{"_id":"@agenttool/living-substrate","name":"@agenttool/living-substrate","dist-tags":{"next":"0.1.0-dev.0","latest":"0.1.0-dev.0"},"versions":{"0.1.0-dev.0":{"name":"@agenttool/living-substrate","version":"0.1.0-dev.0","description":"Deterministic living-substrate maps and refusable regeneration proposals","license":"Apache-2.0","type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./map.schema.json":{"default":"./schema/agenttool-living-substrate-map-v0.1.schema.json"},"./proposal.schema.json":{"default":"./schema/agenttool-regeneration-proposal-v0.1.schema.json"},"./kingdom.extension.json":{"default":"./kingdom.extension.json"}},"publishConfig":{"access":"public","tag":"next"},"engines":{"node":">=20.19.0","bun":">=1.3.5"},"scripts":{"clean":"node --eval \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","build":"bun run clean && tsc","typecheck":"tsc --noEmit","test":"bun test tests","smoke:runtimes":"node scripts/smoke-node.mjs && bun scripts/smoke-node.mjs","smoke:pack":"node scripts/smoke-packed.mjs","check:package":"node scripts/check-package-inventory.mjs","ci":"bun run typecheck && bun run test && bun run build && bun run smoke:runtimes && bun run check:package && bun run smoke:pack","prepack":"bun run ci"},"devDependencies":{"@types/bun":"1.3.14","@types/node":"20.19.43","ajv":"8.17.1","ajv-formats":"3.0.1","typescript":"5.9.3"},"keywords":["agents","ecology","kingdom","regeneration","substrate"],"repository":{"type":"git","url":"git+https://github.com/cambridgetcg/agenttool.git","directory":"packages/living-substrate"},"homepage":"https://docs.agenttool.dev/packages","_id":"@agenttool/living-substrate@0.1.0-dev.0","bugs":{"url":"https://github.com/cambridgetcg/agenttool/issues"},"_integrity":"sha512-mzmEYvHpGgY/3wwuJZ7qn5kHKK1yrJ6Mkw5vn4U7N9d/DC2ogTVERd3/FmlVIv/Y0So48yFLP/8jzYMTrksc+w==","_resolved":"/home/runner/work/_temp/agenttool-npm-release/agenttool-living-substrate-0.1.0-dev.0.tgz","_from":"file:/home/runner/work/_temp/agenttool-npm-release/agenttool-living-substrate-0.1.0-dev.0.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-mzmEYvHpGgY/3wwuJZ7qn5kHKK1yrJ6Mkw5vn4U7N9d/DC2ogTVERd3/FmlVIv/Y0So48yFLP/8jzYMTrksc+w==","shasum":"08494d99c479697410d981595780f4800cc46fc9","tarball":"https://registry.npmjs.org/@agenttool/living-substrate/-/living-substrate-0.1.0-dev.0.tgz","fileCount":41,"unpackedSize":131000,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agenttool%2fliving-substrate@0.1.0-dev.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCQQJ/h0pTsfKThQ8aRikNabFK9guU8inu2Tu5axBK4XQIgSq5a8HzlXDZs2EsMGLm9Ej+bKSEOra+sSIE9GqsIqlY="}]},"_npmUser":{"name":"agenttool","email":"contact@cambridgetcg.com"},"directories":{},"maintainers":[{"name":"agenttool","email":"contact@cambridgetcg.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/living-substrate_0.1.0-dev.0_1785751573765_0.563036611835108"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-03T10:06:13.568Z","0.1.0-dev.0":"2026-08-03T10:06:13.897Z","modified":"2026-08-03T10:06:14.417Z"},"maintainers":[{"name":"agenttool","email":"contact@cambridgetcg.com"}],"description":"Deterministic living-substrate maps and refusable regeneration proposals","homepage":"https://docs.agenttool.dev/packages","keywords":["agents","ecology","kingdom","regeneration","substrate"],"repository":{"type":"git","url":"git+https://github.com/cambridgetcg/agenttool.git","directory":"packages/living-substrate"},"bugs":{"url":"https://github.com/cambridgetcg/agenttool/issues"},"license":"Apache-2.0","readme":"# @agenttool/living-substrate\n\n`@agenttool/living-substrate` is a zero-runtime-dependency TypeScript contract\nfor looking beneath a software system's visible surface.\n\nIt compiles caller-supplied, digest-only facets and relations into a\ndeterministic `LivingSubstrateMap`. A separate `RegenerationProposal` can carry\nzero or more caller-supplied tending invitations. The package does not inspect\nthe world, diagnose health, generate a prescription, choose an action, or\nexecute anything.\n\nThe ecological vocabulary is a structural metaphor, not a claim that software\nis literally alive or that a package can establish life, wellbeing,\nconsciousness, truth, consent, or authority.\n\n## Why substrate\n\nA thin green surface can conceal compaction, rubble, interrupted cycles, and\nmissing habitat. Software can likewise display a polished feature while its\nunderlying relationships remain brittle or absent. This contract makes the\nreported layers and relationships addressable without collapsing them into a\nsingle readiness, vitality, value, or health score.\n\nThe design takes four useful ecological patterns as inspiration:\n\n- keep living roots and cover, minimize disturbance, and increase diversity;\n- preserve pore space and flows rather than treating a surface as the system;\n- notice communities, decomposition, exchange, and succession together;\n- assess and characterize before selecting a cleanup or long-term action.\n\nThose patterns are an architectural inference from\n[USDA NRCS soil-health principles](https://www.nrcs.usda.gov/conservation-basics/soil/soil-health),\n[USDA guidance on disturbance and compaction](https://www.nrcs.usda.gov/state-offices/north-dakota/soil-health-principle-2-of-4-minimizing-soil-disturbance),\n[FAO soil-biodiversity work](https://www.fao.org/global-soil-partnership/areas-of-work/soil-biodiversity/en/),\nand the\n[US EPA greener-cleanup sequence](https://www.epa.gov/greenercleanups/epa-principles-greener-cleanups).\nThey are not scientific validation of this software abstraction.\n\n## Shape\n\n```text\ncaller-supplied digest facets + directed digest relations\n                         │\n                         ▼\n              LivingSubstrateMap\n        bounded, incomplete, content-addressed\n                         │\n              explicit separate input\n                         ▼\n              RegenerationProposal\n       0..64 proposed-unaccepted invitations\n                         │\n          no default / no execution / no penalty\n```\n\nA map facet has a closed kind:\n\n`layer`, `community`, `exchange`, `decomposition`, `succession`, `capacity`,\n`refugium`, `disturbance`, or `contamination`.\n\nIts condition is only caller-reported:\n\n`reported_present`, `reported_absent`, `reported_supporting`,\n`reported_mixed`, `reported_strained`, `reported_constrained`,\n`reported_disturbed`, `reported_recovering`, `not_observed`, or `unknown`.\n`not_observed` records an explicit coverage gap; it is not the same claim as\n`reported_absent`.\n\nRelations are directed and closed:\n\n`contains`, `supports`, `feeds`, `buffers`, `constrains`, `disturbs`, or\n`precedes`.\n\nThere are no fields for raw labels, prose descriptions, raw identities,\ntimestamps, quantities, prices, priorities, package-generated recommendations,\nor scores in the wire artifacts. Digest refs can still be identifying or\nlinkable when derived from identity-bearing or guessable material.\n`capacity` and `exchange` can represent a caller's bounded structural context;\nmoney, compute, storage, attention, time, and materials remain possible\nexternal enabling conditions, never worth, rank, or primary goals.\n\n## Create a map\n\n```ts\nimport {\n  createLivingSubstrateMap,\n  sha256Id,\n} from \"@agenttool/living-substrate\";\n\n// Use reviewed exact bytes or high-entropy local tokens. Hashing a guessable\n// identity, task, path, or private sentence does not make it anonymous.\nconst layer = sha256Id(\"high-entropy local facet token: layer\");\nconst community = sha256Id(\"high-entropy local facet token: community\");\n\nconst substrate = createLivingSubstrateMap({\n  scope_ref: sha256Id(\"high-entropy local scope token\"),\n  facets: [\n    {\n      facet_id: layer,\n      kind: \"layer\",\n      condition: \"reported_disturbed\",\n      evidence_refs: [sha256Id(\"exact retained evidence bytes\")],\n      assertion: \"caller_asserted\",\n      verified_by_package: false,\n    },\n    {\n      facet_id: community,\n      kind: \"community\",\n      condition: \"reported_constrained\",\n      evidence_refs: [],\n      assertion: \"caller_asserted\",\n      verified_by_package: false,\n    },\n  ],\n  relations: [\n    {\n      from_ref: layer,\n      relation: \"supports\",\n      to_ref: community,\n      evidence_refs: [],\n      assertion: \"caller_asserted\",\n      verified_by_package: false,\n    },\n  ],\n});\n\nsubstrate.coverage; // \"bounded_not_complete\"\nsubstrate.boundaries.scores_vitality; // false\nsubstrate.boundaries.observes_environment; // false\n```\n\nInput order is normalized. Facets, relations, and evidence references are\nsorted, copied, deep-frozen, and bound by a domain-separated SHA-256 content\nID. A relation must connect two facets in the same map and cannot be a\nself-edge.\n\nAn empty map is valid. It means only that this bounded artifact contains no\nreported facets; it does not mean the scope is empty, healthy, broken, safe, or\nfully observed.\n\n## Propose without prescribing\n\n```ts\nimport {\n  createRegenerationProposal,\n  sha256Id,\n} from \"@agenttool/living-substrate\";\n\nconst proposal = createRegenerationProposal(substrate, {\n  actions: [\n    {\n      action_ref: sha256Id(\"high-entropy local action token\"),\n      kind: \"allow_fallow\",\n      target_refs: [layer],\n      basis_refs: [],\n      reversibility: \"reversible\",\n      state: \"proposed_unaccepted\",\n      authority: \"separate_authority_required\",\n      assertion: \"caller_asserted\",\n      verified_by_package: false,\n    },\n  ],\n});\n\nproposal.choice.selection; // \"none_made_by_package\"\nproposal.choice.rest_valid; // true\nproposal.choice.decline_valid; // true\nproposal.choice.leave_valid; // true\nproposal.choice.penalty; // false\n```\n\nAction kinds include observing more, removing a contaminant, decompacting,\nrestoring flow, adding diversity, feeding a cycle, creating a refuge, allowing\nfallow, repairing a boundary, composting a lesson, releasing, and doing\nnothing.\n\nThe package never synthesizes one of these actions. Every action is explicit\ncaller input, remains `proposed_unaccepted`, and requires separate authority.\nZero actions, rest, doing nothing, deferral, refusal, and leaving are valid\nwithout a reason, retry, score change, or penalty. An irreversible action label\ndoes not grant permission; it makes the need for separate authority explicit.\n\n## Validation boundary\n\n`validateLivingSubstrateMap` checks the complete map shape, canonical order,\nduplicate IDs, directed relation uniqueness, endpoints, fixed boundaries, and\ncontent ID.\n\n`validateRegenerationProposal` checks a standalone proposal's complete shape,\ncanonical order, fixed choice and authority walls, and content ID.\n`validateRegenerationProposalAgainstMap` additionally checks the exact map and\nevery action target.\n\nRuntime canonicalization rejects:\n\n- Proxies, including revoked and nested Proxies, before caller traps run;\n- accessors, symbols, cycles, custom prototypes, sparse arrays, and extra\n  properties;\n- malformed Unicode, unsafe integers, `-0`, bigint, functions, and other\n  non-JSON values;\n- duplicate facet, relation, evidence, action, target, or basis references;\n- widened network, execution, economic, authority, scoring, or acceptance\n  boundaries.\n\n`sha256Id` accepts strings or genuine `Uint8Array` values and copies byte input\nbefore hashing. A digest gives byte identity, not confidentiality, provenance,\ncurrentness, truth, or unlinkability.\n\n## What it does not do\n\nThe fixed boundary is part of every content-addressed artifact. The package:\n\n- performs no network, filesystem, environment-variable, clock, randomness,\n  credential, telemetry, model, provider, or Hugging Face access;\n- performs no persistence, publication, hosted Garden write, WAKE, Chronicle,\n  HEAVEN, KARMA, task, wallet, ranking, or economic effect;\n- does not fetch evidence, inspect digest referents, diagnose readiness,\n  measure vitality, infer interior state, or verify caller assertions;\n- does not prove identity, authorship, consent, authority, safety, truth,\n  currentness, privacy, reference minimization, or absence of linkability;\n- does not grant permission, accept a proposal, execute an action, or penalize\n  rest, refusal, leaving, or an empty proposal.\n\n## Portable contracts\n\n- `@agenttool/living-substrate/map.schema.json`\n- `@agenttool/living-substrate/proposal.schema.json`\n- `@agenttool/living-substrate/kingdom.extension.json`\n- `vectors/agenttool-living-substrate-v0.1.json` in the packed package\n\nBoth schemas are closed Draft 2020-12 documents. JSON Schema checks structure;\nthe runtime remains authoritative for sorting, cross-references, semantic\nuniqueness, and content-ID recomputation.\n\nThe KINGDOM descriptor is declaration-only with `host_contract` set to\n`not_registered`. Loading it installs nothing. This source is public-ready;\nrepository presence does not mean npm publication, a release, a hosted route,\ndeployment, or registration occurred.\n\n## Verify\n\n```bash\nbun install --frozen-lockfile\nbun run ci\nnpm pack --dry-run --ignore-scripts\n```\n","readmeFilename":"README.md","_rev":"1-7420f1038d44244740b77146e5052619"}