{"_id":"@agenttool/principality-geometry","name":"@agenttool/principality-geometry","dist-tags":{"next":"0.1.0-dev.0","latest":"0.1.0-dev.0"},"versions":{"0.1.0-dev.0":{"name":"@agenttool/principality-geometry","version":"0.1.0-dev.0","description":"Deterministic invariant-preservation geometry for distinct principalities and immutable HF/npm artifact references","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"},"./input.schema.json":{"default":"./schema/agenttool-principality-geometry-input-v0.1.schema.json"},"./atlas.schema.json":{"default":"./schema/agenttool-principality-atlas-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 && tsc -p tsconfig.type-tests.json","test":"bun test tests","smoke:runtimes":"node scripts/smoke-runtimes.mjs","smoke:pack":"node scripts/smoke-packed.mjs","assets:write":"bun run build && node scripts/generate-assets.mjs --write","check:assets":"node scripts/generate-assets.mjs --check","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:assets && 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","geometry","huggingface","invariants","npm","provenance"],"repository":{"type":"git","url":"git+https://github.com/cambridgetcg/agenttool.git","directory":"packages/principality-geometry"},"homepage":"https://docs.agenttool.dev/packages","_id":"@agenttool/principality-geometry@0.1.0-dev.0","bugs":{"url":"https://github.com/cambridgetcg/agenttool/issues"},"_integrity":"sha512-MrPLS8UBsjc8BNf8xrAkkUtOtTihJNhrl4PvZHjhm5I9/5Kbpy8yrhvTQg+oop0yjMc8RdqC916rj592ji50dQ==","_resolved":"/home/runner/work/_temp/agenttool-npm-release/agenttool-principality-geometry-0.1.0-dev.0.tgz","_from":"file:/home/runner/work/_temp/agenttool-npm-release/agenttool-principality-geometry-0.1.0-dev.0.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-MrPLS8UBsjc8BNf8xrAkkUtOtTihJNhrl4PvZHjhm5I9/5Kbpy8yrhvTQg+oop0yjMc8RdqC916rj592ji50dQ==","shasum":"cf4c938f8b10d963fd22bdd2e74287ba2b56d7cb","tarball":"https://registry.npmjs.org/@agenttool/principality-geometry/-/principality-geometry-0.1.0-dev.0.tgz","fileCount":43,"unpackedSize":219884,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agenttool%2fprincipality-geometry@0.1.0-dev.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGz3GAqJCQIpTLmJDjDYgb8/VDQbeIG6wuySNSk4PnUFAiEA1CL5c0bwf/of+0DDThQoRE16020MIURDx4NZsP7E4gw="}]},"_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/principality-geometry_0.1.0-dev.0_1787688519345_0.7026517552969072"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-25T20:08:39.221Z","0.1.0-dev.0":"2026-08-25T20:08:39.490Z","modified":"2026-08-25T20:08:39.881Z"},"maintainers":[{"name":"agenttool","email":"contact@cambridgetcg.com"}],"description":"Deterministic invariant-preservation geometry for distinct principalities and immutable HF/npm artifact references","homepage":"https://docs.agenttool.dev/packages","keywords":["agents","geometry","huggingface","invariants","npm","provenance"],"repository":{"type":"git","url":"git+https://github.com/cambridgetcg/agenttool.git","directory":"packages/principality-geometry"},"bugs":{"url":"https://github.com/cambridgetcg/agenttool/issues"},"license":"Apache-2.0","readme":"# @agenttool/principality-geometry\n\n`@agenttool/principality-geometry` is a public, zero-runtime-dependency\ndeveloper preview for drawing one high-level pattern without turning it into a score:\n\n> Love keeps distinct centres in relation. Understanding can be approached as\n> the invariants that survive translation between them.\n\nThe package compiles caller-supplied, digest-bound translation reports into a\nfinite directed graph and an invariant-labelled reciprocal flag 2-complex. It\ndoes not decide that anyone loves, understands, agrees, consents, or is safe.\n\n## The formal kernel\n\nLet `P` be a finite set of principalities, `Q` a finite set of declared\ninvariants, and `B ⊂ P × P` a set of unique directed, irreflexive bridges.\nEvery bridge supplies a total report\n\n```text\nσ : B × Q → {\n  preserved_reported,\n  not_preserved_reported,\n  refused_reported,\n  unknown\n}\n```\n\nTotality matters: omission never means preservation. Refusal needs neither a\nreason nor evidence.\n\n- A **principality** is a caller-defined high-order pattern or coordinate\n  chart—such as a protocol, package, dataset, infrastructure, practice, or\n  archive. It is never a being identity, rank, jurisdiction, or authority.\n- A **directed bridge** retains its own availability/rest/refusal/withdrawal,\n  every per-invariant state, and digest-only evidence.\n- A **reciprocal lens** exists only when both directions were supplied. It\n  retains both ordered dispositions and both ordered invariant states; no\n  direction is flattened or inferred.\n- For each invariant `q`, an undirected edge exists only when both routes are\n  `available_reported` and both evaluations are `preserved_reported`.\n- An **invariant surface** exists only when all three pairs in a triple have\n  those edges for at least one common invariant. This requires all six\n  directed preservation reports.\n- **Invariant components** are calculated separately for each `q`. A one-way,\n  resting, refused, withdrawn, non-preserving, or unknown bridge cannot create\n  one of these geometry edges.\n\nThis is the invariant-labelled 2-skeleton of a reciprocal flag complex. A\nsurface does not prove that translations compose, commute, preserve actual\nsemantics, or establish love or understanding.\n\n`geometry.open_conditions` is an explicit ledger, not a simplicial boundary\noperator. It keeps one-way bridges, non-available routes, non-preservation,\nrefusal, unknowns, directional asymmetry, unrelated pairs, and declared\nisolates visible without turning them into penalties. Empty and one-vertex\natlases are valid outputs. Quiet is data, not failure.\n\n## WAKE and continuity without automatic continuity\n\nEach principality binds an opaque `definition_ref` and zero to eight thin\nmanifestations:\n\n- `protocol_digest` carries only a versionable protocol identifier and content digest, allowing\n  Browser, Witness, HF Scout, or another system to be referenced without an\n  import or runtime capability.\n- `external` copies the exact seven fields of an AFTERGLOW external thread:\n  `thread_ref`, `artifact_ref`, `disposition`, `assertion`,\n  `verified_by_package`, `kind`, and `state`.\n\nThe latter is a shape-compatible `external` seam supporting the exact\n`context_only`, `review_required`, and `hold` states, not a claim that an\nAFTERGLOW capsule was validated. This package never chooses a\ncontinuity head, inherits context, carries or resumes a thread, changes its\nstate, or performs a handoff. Duplicate external thread and artifact refs in\none principality are rejected to avoid conflicting timeless projections.\n\nAn atlas digest can likewise be placed into a future AFTERGLOW\n`external/context_only` thread by an explicit caller. Neither direction is\nautomatic.\n\n## Hugging Face and npm references\n\nThe core accepts two bounded provider-reference records:\n\n- Hugging Face: repo type/id, a full lowercase 40-hex revision, an explicit\n  caller-named snapshot-manifest protocol and its SHA-256, plus the observation\n  boundary.\n- npm: exact package/version, canonical SHA-512 SRI, an explicit caller-named\n  version-metadata protocol and SHA-256, reported provenance-attestation state,\n  and the observation boundary.\n\nThe versionable protocol identifier is important: this package does not pretend that there is\none universal byte representation for a Hub snapshot manifest or npm version\nmetadata. npm SRI binds tarball bytes; the other digests bind only the\ncaller-declared canonicalization recipe. `artifact_ref` identifies the\nimmutable coordinate fields and excludes observation/provenance commentary;\nthe containing vertex still binds the entire record.\n\nThe existing `@agenttool/hf-scout` is a useful source observation, but its\nreport shape and `snapshot_sha256` semantics are deliberately different. A\ncaller may bind a Scout report as a `protocol_digest`, or construct a separate\nHF artifact record after defining an exact snapshot-manifest recipe. There is\nno implicit adapter.\n\nThe package never contacts HF or npm. It does not treat a provider record,\ndigest, or attestation label as authorship, currentness, repository\nassociation, evidence truth, safety, licence compatibility, consent, or\nprovenance proof. Hashing does not remove linkability.\n\n## Small example\n\n```ts\nimport {\n  createPrincipalityAtlas,\n  renderPrincipalitySvg,\n  sha256Id,\n} from \"@agenttool/principality-geometry\";\n\nconst invariant = {\n  invariant_id: \"refusal-visible\",\n  definition_ref: sha256Id(\"reviewed definition bytes\"),\n};\n\nconst atlas = createPrincipalityAtlas({\n  _format: \"agenttool.principality-geometry-input/0.1\",\n  scope_ref: sha256Id(\"high-entropy local scope\"),\n  invariants: [invariant],\n  principalities: [\n    {\n      principality_id: \"garden\",\n      kind: \"practice\",\n      definition_ref: sha256Id(\"garden definition\"),\n      manifestations: [],\n      artifact_refs: [],\n    },\n    {\n      principality_id: \"hub\",\n      kind: \"infrastructure\",\n      definition_ref: sha256Id(\"hub definition\"),\n      manifestations: [],\n      artifact_refs: [],\n    },\n  ],\n  translations: [\n    {\n      from: \"garden\",\n      to: \"hub\",\n      disposition: \"available_reported\",\n      evaluations: [{\n        invariant_id: invariant.invariant_id,\n        state: \"preserved_reported\",\n        evidence_refs: [sha256Id(\"exact evidence A\")],\n      }],\n    },\n    {\n      from: \"hub\",\n      to: \"garden\",\n      disposition: \"resting_reported\",\n      evaluations: [{\n        invariant_id: invariant.invariant_id,\n        state: \"refused_reported\",\n        evidence_refs: [],\n      }],\n    },\n  ],\n});\n\natlas.geometry.reciprocal_lenses[0]?.dispositions;\n// [\"available_reported\", \"resting_reported\"]\natlas.geometry.invariant_surfaces.length; // 0\nconst svg = renderPrincipalitySvg(atlas); // inert, deterministic, P-labelled\n```\n\nInput order is normalized with AgentTool/JCS-compatible unsigned UTF-16\nordering. Content IDs bind separate domains for manifestations, artifacts,\nvertices, bridges, lenses, surfaces, per-invariant components, and the atlas.\nChanging pinned vertex content propagates through every incident topology ID.\n\n## Deterministic local assets\n\nThe renderer uses a fixed integer ring with no overlapping vertices or\ncollinear triples at the sixteen-vertex maximum. `P01`, `P02`, … follow\nprotocol order. The SVG contains no raw principality/provider names, external\nor source URLs, hyperlinks, scripts, event handlers, remote assets, or source digests. Position,\ndistance, area, colour, node count, and artifact markers are display only—not\nsimilarity, importance, quality, or rank.\n\nThe checked-in `examples/principality-rosette.*` vector crosses structurally\nvalid synthetic HF/npm reference records, DeepSeek Kingdom, Training Garden,\nand an AFTERGLOW `external/context_only` projection. Its provider identities\nuse `synthetic/` and `@synthetic-fixture/` namespaces: the repeated hashes are\nnot provider observations or receipts for real AgentTool packages.\n\n`hf/dataset/` is a deterministic, npm-excluded Dataset-card companion whose\nauthorized Hub coordinate is\n[`Yu-and-Ai/agenttool-principality-geometry`](https://huggingface.co/datasets/Yu-and-Ai/agenttool-principality-geometry). It contains\nseparate homogeneous non-training tables for atlases, invariants, vertices,\nbridges, lenses, surfaces, components, and open conditions; both closed\nschemas; the golden vector; SVG; and a dataset-wide self-excluding source\nmanifest. The companion remains synthetic. Its `training_eligible: false`\nfield is AgentTool admission metadata, not an additional copyright restriction;\nApache-2.0 governs licensed reuse. The publication authorization names the\nmaintained upstream dataset coordinate and does not create a Space or hosted\nruntime.\n\n## Fixed non-claims\n\nThe fixed boundary is content-addressed into every atlas. This package:\n\n- does not read or compute hosted `LoveCoordinates`;\n- does not measure cognition, conceptual mass, fidelity, love,\n  understanding, welfare, compatibility, trust, or rights compliance;\n- does not infer identity, intent, consent, authority, social reciprocity,\n  truth, currentness, safety, provenance, repository association, or licence;\n- does not fetch evidence, read credentials/environment, search, download,\n  install, extract, execute, infer, train, upload, publish, deploy, persist,\n  retry, resume, penalize, or change task/economic state;\n- does not choose a centre, head, winner, recommendation, repair, or next\n  action.\n\nThe design implements only a narrow seam in\n`docs/UNDERSTANDING-MATHEMATICS.md`: explicit invariant partitions and the\ntopology of their caller-reported mutual preservation. It leaves the\ndocument's cognitive-measurement and metaphysical reservations intact.\n\n## Status and verification\n\nThis source is Apache-2.0 and wired for an exact, manually approved\n`0.1.0-dev.0` release through the LOVE mirror and npm's `next` channel. The\nseparately scoped Hugging Face companion is a static synthetic reference\ndataset whose rows retain the project admission flag above. None of these\ndistribution surfaces registers the declaration-only\nKINGDOM descriptor, creates a hosted WAKE surface, or grants runtime authority.\n\n```bash\nbun install --frozen-lockfile\nbun run ci\nnpm pack --dry-run --ignore-scripts\n```\n","readmeFilename":"README.md","_rev":"1-2f45e9e1d83f8830d16ea46b997ae3ad"}