{"_id":"@axtary/ledger","_rev":"8-fef3d04c924122a9424a582cd310040b","name":"@axtary/ledger","dist-tags":{"latest":"0.6.1"},"versions":{"0.0.1":{"name":"@axtary/ledger","version":"0.0.1","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"UNLICENSED","_id":"@axtary/ledger@0.0.1","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/axtary/axtary#readme","bugs":{"url":"https://github.com/axtary/axtary/issues"},"dist":{"shasum":"03a994f37fe7504b0569126c795ca7fe72eace20","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.0.1.tgz","fileCount":6,"integrity":"sha512-gTVguJ7gSmnDNhGxyPNEL7CgBWlNGFGKeysMfbshOX095zQasVrJ+2HBZ6TuZqnjV10y40wz92nJPbbCsNSvxA==","signatures":[{"sig":"MEYCIQCmlELrpUIEJ4pw+eAMPhRemECRUczVoa9cDiUKNHyxXwIhAKF0XRdqy+Jxb00mBe1OwCW/cNvctdJmQWQnvZpHBfEc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49690},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d4ba1d3959b2f7ad34d7f30da7632f3cd652ede3","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"axtary-user","email":"major.snack5x@icloud.com"},"repository":{"url":"git+https://github.com/axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"10.9.2","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"22.13.0","dependencies":{"zod":"^4.4.3","@axtary/actionpass":"0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.0.1_1780706451853_0.27684768889143196","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@axtary/ledger","version":"0.1.0","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"Apache-2.0","_id":"@axtary/ledger@0.1.0","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/axtary/axtary#readme","bugs":{"url":"https://github.com/axtary/axtary/issues"},"dist":{"shasum":"8128fb72746eca747b26cd8e79f639f0b5908359","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.1.0.tgz","fileCount":7,"integrity":"sha512-84HlKscc/yGNOzfuScxNfIzO03wv6JFlvGIvcGv9g82TBZ+LKYHWixyRQbyyHHDqDnnCWyrpnc6RZOvE4Atr0Q==","signatures":[{"sig":"MEYCIQCGirs5wUQuKO7jr0i5tFkx7BGQYgPXDm2ld4yiHu2gKgIhAPLiqmi4PHC9SoL0itYm8rSD3HcWi+TE2Y2GzdLagBd1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67183},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fb000224f8a36b7d5558164705780172ea2f4b89","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"axtary-user","email":"major.snack5x@icloud.com"},"repository":{"url":"git+https://github.com/axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"10.9.2","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"22.13.0","dependencies":{"zod":"^4.4.3","@axtary/actionpass":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.1.0_1781151120167_0.49175428363764273","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@axtary/ledger","version":"0.2.0","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"Apache-2.0","_id":"@axtary/ledger@0.2.0","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/axtary/axtary#readme","bugs":{"url":"https://github.com/axtary/axtary/issues"},"dist":{"shasum":"917c7e8a0ae2faf9196c29bea9894a2a558491e1","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.2.0.tgz","fileCount":19,"integrity":"sha512-eVhTyQTaWzJainu1eQk7nozNpf6FruOKWJ7H5unsqvWOlomdldB2zyL/5R1vP6HOgfedyChbmQLW2g93cCFXPw==","signatures":[{"sig":"MEYCIQClhGbn6+2DLUH4ds3tmK+Mch33FcO30sUZgEDt0TLe9QIhALKI0CbRS+hJuPtDk4FJxEgfrZc9UvCOAPRiGeBFM3CH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":223673},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fe535422b37b24d80e2f4b6e511f327f656c56d5","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"axtary-user","email":"major.snack5x@icloud.com"},"repository":{"url":"git+https://github.com/axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"10.9.2","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"22.13.0","dependencies":{"zod":"^4.4.3","jose":"^6.2.3","proper-lockfile":"^4.1.2","@axtary/actionpass":"^0.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.2.0_1783367124787_0.2618816961144079","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@axtary/ledger","version":"0.3.0","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"Apache-2.0","_id":"@axtary/ledger@0.3.0","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/axtary/axtary#readme","bugs":{"url":"https://github.com/axtary/axtary/issues"},"dist":{"shasum":"4ebd7d1dc194a3c4bd9bd1c616c04a2ddb33832f","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.3.0.tgz","fileCount":23,"integrity":"sha512-TFiZBYgSA35a5KEdID0zCZR6TN4Xyq/qLcPkwJsg2S+7rDjoWZWXp6pc5gTpnPflgWmzzUPDJpP2lFKriF62kQ==","signatures":[{"sig":"MEUCIQDDVCFXjT+9ep/DUROt7F2EwcNsQyxWXO8bdKIT+VPIhQIgQZryqqZ36nMFQORuDx/s4uYz/Kb6esVc8cBXhLpDJ6I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246078},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5530b13c9606ead4376d05a969f5bc938205468b","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"axtary-user","email":"major.snack5x@icloud.com"},"repository":{"url":"git+https://github.com/axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"10.9.2","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"22.13.0","dependencies":{"zod":"^4.4.3","jose":"^6.2.3","proper-lockfile":"^4.1.2","@axtary/actionpass":"^0.3.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.3.0_1783550455146_0.6269492163077972","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@axtary/ledger","version":"0.4.0","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"Apache-2.0","_id":"@axtary/ledger@0.4.0","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/Axtary/axtary#readme","bugs":{"url":"https://github.com/Axtary/axtary/issues"},"dist":{"shasum":"5fead598bc8e44b596ddbafd99215e561cfcebee","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.4.0.tgz","fileCount":23,"integrity":"sha512-pA2O0XrgmpK7ZKt+A5ytcUF+4BIWDmoUUceGGRy9FUzfOJJhh5QsWOVFlRd6qFLIeq4udM60C0YSqVicaZRFpw==","signatures":[{"sig":"MEYCIQCtOT680gZTrAygETH4QAYJywicWtu0sLvooYsIh1SH1gIhAJn0o17TvyTvtQHtGEWnajBxRLMTJWW96nlecRiFb1Ay","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246227},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"850624faf0c7f79f0cc1446bc3eded5a3e34e105","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9787917-e6c7-41b3-8014-e45f4c56ca82"}},"repository":{"url":"git+https://github.com/Axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"11.18.0","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"zod":"^4.4.3","jose":"^6.2.3","proper-lockfile":"^4.1.2","@axtary/actionpass":"^0.4.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.4.0_1783985845894_0.16116608197805737","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@axtary/ledger","version":"0.5.0","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"Apache-2.0","_id":"@axtary/ledger@0.5.0","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/Axtary/axtary#readme","bugs":{"url":"https://github.com/Axtary/axtary/issues"},"dist":{"shasum":"6b45d08c6b91c1b2509a885985ceefce9ef972d3","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.5.0.tgz","fileCount":23,"integrity":"sha512-Fg1RFWF5QpiX4ZHeAdC+k3xH+7jPoFih1nQ9HkjI6Bw1MIiNcGzvt9aauQjhZ9gbbUH9WWIU7qCJ+Y1oIOL8qQ==","signatures":[{"sig":"MEUCICRlH6eKuhJ1vumy7W0QOgqYgp0pQ8RBc9A5TlBQVFT0AiEAtHD8MHvkvctepUPFhwTDqPB8xvSqv6JYheHqQF+j/S8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":252701},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f0bce01c4543e5c0f1685ebbb5087a2ac653b9df","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9787917-e6c7-41b3-8014-e45f4c56ca82"}},"repository":{"url":"git+https://github.com/Axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"11.18.0","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"zod":"^4.4.3","jose":"^6.2.3","proper-lockfile":"^4.1.2","@axtary/actionpass":"^0.5.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.5.0_1785026670764_0.24251607484006854","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@axtary/ledger","version":"0.6.0","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"license":"Apache-2.0","_id":"@axtary/ledger@0.6.0","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"homepage":"https://github.com/Axtary/axtary#readme","bugs":{"url":"https://github.com/Axtary/axtary/issues"},"dist":{"shasum":"2f2bfd8d511f53487cb543232fad29e5e68d6777","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.6.0.tgz","fileCount":23,"integrity":"sha512-ra6EoJj1PZIogGxWpgXoPI4tdKQ1qVN1aJVil4JVWxG7sLcecPo3GRTrISphZu3ToKt/q1WW8joGwXY0GomupQ==","signatures":[{"sig":"MEYCIQCJF+r3Ben2hW5bBobKVuq+CuXz1aLPFtuMhHFzzwqsIQIhAPfvDUw8eEC9szLvblMp7+pVt5H5oAme9wFPkFZz6DIM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":252701},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fbd46405637d3765f8d316009e640bdf0cb275dc","private":false,"scripts":{"build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build","prebuild":"npm run build -w @axtary/actionpass"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9787917-e6c7-41b3-8014-e45f4c56ca82"}},"repository":{"url":"git+https://github.com/Axtary/axtary.git","type":"git","directory":"packages/ledger"},"_npmVersion":"11.18.0","description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"zod":"^4.4.3","jose":"^6.2.3","proper-lockfile":"^4.1.2","@axtary/actionpass":"^0.6.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ledger_0.6.0_1785707344018_0.8962833168646172","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@axtary/ledger","version":"0.6.1","private":false,"description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","type":"module","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/Axtary/axtary.git","directory":"packages/ledger"},"keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"scripts":{"prebuild":"npm run build -w @axtary/actionpass","build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","prepack":"npm run build"},"main":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"types":"./dist/index.d.ts","dependencies":{"@axtary/actionpass":"^0.6.1","jose":"^6.2.3","proper-lockfile":"^4.1.2","zod":"^4.4.3"},"gitHead":"d1621a5d0eb7ae06e674c24119fb096d8a0c1ad8","_id":"@axtary/ledger@0.6.1","bugs":{"url":"https://github.com/Axtary/axtary/issues"},"homepage":"https://github.com/Axtary/axtary#readme","_nodeVersion":"24.18.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-0oS4PCiT/XReLIEY+tWsHJsuBFiZxt2AVwTFywIcphfJVwj8jUN0X3LPh+vAWry88k4jeMEBtAEDHgOBpHMxPg==","shasum":"12adac2264c2a653f67a64f82b9f602ec23de87a","tarball":"https://registry.npmjs.org/@axtary/ledger/-/ledger-0.6.1.tgz","fileCount":23,"unpackedSize":252701,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChxeEbnHWGjdXXixsU5BJ+hLBKw2SpbM3H5N7RAkR0DwIgNxxeCT6gEFTib895Q064fUBi4gJ9ila7eM/OWRPecDY="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9787917-e6c7-41b3-8014-e45f4c56ca82"}},"directories":{},"maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ledger_0.6.1_1785711540708_0.8231878401405126"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-06T00:40:51.638Z","modified":"2026-08-02T22:59:01.017Z","0.0.1":"2026-06-06T00:40:52.020Z","0.1.0":"2026-06-11T04:12:00.300Z","0.2.0":"2026-07-06T19:45:24.928Z","0.3.0":"2026-07-08T22:40:55.277Z","0.4.0":"2026-07-13T23:37:26.031Z","0.5.0":"2026-07-26T00:44:30.916Z","0.6.0":"2026-08-02T21:49:04.164Z","0.6.1":"2026-08-02T22:59:00.845Z"},"bugs":{"url":"https://github.com/Axtary/axtary/issues"},"license":"Apache-2.0","homepage":"https://github.com/Axtary/axtary#readme","keywords":["ai-agents","audit-log","jsonl","hash-chain","authorization"],"repository":{"type":"git","url":"git+https://github.com/Axtary/axtary.git","directory":"packages/ledger"},"description":"Append-only JSONL action ledger with hash-chain verification for Axtary.","maintainers":[{"name":"axtary-user","email":"major.snack5x@icloud.com"}],"readme":"# @axtary/ledger\n\nAppend-only JSONL action ledger with hash-chain verification for Axtary.\n\nEarly `0.x` release: the runtime path is real and tested, but the API is not stable yet and may change between minor versions.\n\nThe source repository is currently private. Public product documentation and runnable guides are at [axtary.com/docs](https://www.axtary.com/docs).\n\n```bash\nnpm install @axtary/ledger\n```\n\n## What It Does\n\n- Appends Axtary ledger records to local JSONL.\n- Serializes concurrent processes with an inter-process lease lock.\n- Appends in place and synchronizes the file plus directory metadata before\n  returning success; prior ledger bytes are never rewritten.\n- Maintains a private O(1) head checkpoint and reconstructs it from the\n  verified JSONL chain after a crash or legacy-file migration.\n- Maintains a `previousLedgerHash -> ledgerHash` chain.\n- Reads ledger records back in order.\n- Verifies hash-chain continuity and record integrity.\n- Exports verified records by inclusive date range and decision type.\n- Emits a detached signed attestation over an export, and an RFC 6962\n  transparency-log signed tree head (`merkleRoot`/`treeSize`) with inclusion and\n  consistency proofs (`proveLedgerInclusion`/`proveLedgerConsistency` +\n  `verifyLedgerInclusionProof`/`verifyLedgerConsistencyProof`). Inclusion proves\n  one record is committed by a signed head; consistency proves a later head\n  append-only-extends an earlier one. Both fail closed unless bound to a signed\n  head.\n- Verifies cross-issuer evidence with `verifyCrossIssuerActionPass`: a pinned\n  public trust root, ActionPass token, ledger attestation bundle, inclusion\n  proof, and fresh status-list response must all agree before the report is\n  valid. This is verify-only and does not authorize execution.\n- Reconstructs a delegation+execution incident offline from ledger records alone\n  (`analyzeForensics`/`reconstructIncident`) and asserts attenuation structure,\n  exact authorization→execution correlation, and cascade containment — a\n  read-only auditor primitive, not anomaly detection.\n- Formats verified exports as JSON, raw ledger JSONL, or SIEM-friendly JSONL events.\n- Syncs a verified export plus an optional detached attestation bundle to an\n  optional hosted endpoint.\n- Exposes `verifyLedgerExportIntegrity` so receivers can re-check record hashes,\n  chain/head/count/filter consistency, and approval↔execution equivalence before\n  trusting an export.\n- Exports opt-in OTLP/HTTP GenAI `execute_tool` spans from ledger records,\n  carrying decisions, reasons, hashes, and audit dimensions without payload\n  bodies or secrets.\n- Keeps OTLP export and hosted sync network access explicit: both require the\n  caller to inject a transport and fail closed without one, so\n  the package does not use ambient global network access on its own.\n- Fails closed on malformed JSONL records.\n- Records parent-to-child ActionPass delegation edges inside the hash chain.\n- Records denied, pending, committed, and rolled-back budget events with\n  configured cost/limit and usage before/after.\n- Carries a payload-free, hash-bound audit context on new records (tenant,\n  agent, human owner, task, tool, and resource) so operator search does not\n  infer identity from hashes or provider summaries.\n- Carries trace IDs and sanitized provider evidence for GitHub, Slack, and Linear records when that evidence was present at decision time.\n\n## Quickstart\n\nThis example runs as-is with Node 20+:\n\n```ts\nimport { evaluatePolicy } from \"@axtary/policy\";\nimport { parseNormalizedAction, demoAction } from \"@axtary/actionpass\";\nimport { LocalJsonlLedger, verifyLedgerFile } from \"@axtary/ledger\";\n\nconst ledger = new LocalJsonlLedger(\".axtary/ledger.jsonl\");\n\n// Every decision appends a record chained to the previous record's hash.\nconst action = parseNormalizedAction(demoAction);\nawait ledger.appendDecision({ action, decision: evaluatePolicy(action) });\n\n// Verification fails closed on any edited, reordered, or deleted line.\nconst verification = await verifyLedgerFile(\".axtary/ledger.jsonl\");\nconsole.log(verification.valid, verification.records.length);\n```\n\n## Design Notes\n\nThe ledger is local-first. It is not a database, SIEM, or remote audit service. It gives the proxy and adapters a durable local trail that can later be uploaded, exported, or re-verified. Export and sync both verify the full hash chain before returning or sending filtered records. SIEM JSONL events include timestamps, trace IDs, outcomes, provider/resource summaries, policy metadata, reasons, and hashes without expanding protected action payloads or credential-bearing provider responses.\n\nOpenTelemetry export is an operational projection, not the audit proof.\n`exportLedgerRecordsToOtlp` posts verified records to an OTLP/HTTP traces\nendpoint, and `LocalJsonlLedger` can be constructed with `OtlpHttpTraceExporter`\nto stream spans after durable append. The span shape uses standard GenAI tool\nattributes (`gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.tool.type`)\nplus Axtary namespaced attributes for decision, reason, payload hash, ledger\nhash, policy, pass id, trace/correlation id, and audit context. It never emits\nnormalized payload bodies, provider tokens, auth headers, result rows, file\ncontents, or raw shell commands.\n\n`LocalJsonlLedger` uses a filesystem lease lock (`<ledger>.lock`) so separate\nprocesses resolve and append against one chain head. The JSONL file is opened\nin append mode, one line is written, and the file is synchronized. A private\n`<ledger>.head.json` checkpoint (mode `0600`) stores byte length, line number,\nand the last hash for steady-state O(1) appends; it is never treated as audit\nevidence. The checkpoint is atomically replaced and the containing directory\nis synchronized. If a process dies after the durable JSONL append but before\ncheckpoint replacement or lock release, the lease becomes stale and the next\nwriter verifies the JSONL chain, reconstructs the head, and continues.\n\nHosted sync should use signed ledger sync tokens rather than dashboard user sessions. Sync tokens carry a signed `kid` so hosted verification can rotate keys with `AXTARY_LEDGER_SYNC_TOKEN_KID` and a JSON `AXTARY_LEDGER_SYNC_TOKEN_SECRETS` keyring. The hosted Axtary profile also caps token lifetime at one hour and pins the runtime's P-256 attestation-key thumbprint and issuer. A sync request therefore needs both the bearer and a detached signature over the exact export from the pinned private key; possession of the bearer alone is insufficient. Hosted retention can be bounded with `AXTARY_LEDGER_SYNC_MAX_BATCHES`, `AXTARY_LEDGER_SYNC_MAX_AGE_DAYS`, or stricter limits embedded in the signed sync token.\n\nThe hosted sync store now sits behind a persistence adapter. The default adapter is owner-only local JSON at `.axtary/hosted-ledger-sync.json`; set `AXTARY_LEDGER_SYNC_STORE=neon` plus `AXTARY_LEDGER_SYNC_DATABASE_URL` to use the Neon/Postgres adapter. Apply `migrations/neon/001_hosted_ledger_sync_batches.sql` for deployed environments; `docs/neon-hosted-sync-runbook.md` covers the hosted setup and verification flow. Source file paths default to `basename` reduction and can be fully redacted. The hosted receiver verifies the runtime attestation before redaction, then HMAC-receipts the stored projection so a modified receipt-bearing row cannot be shown as trusted evidence. Receiptless pre-hardening rows are preserved but excluded from trusted reads until a fresh attested sync. A database-side deletion can still hide evidence; the runtime's portable attestation remains the independent proof.\n\nUnified audit search is available through `/api/ledger/search` with optional\n`q`, `decision`, `from`, `to`, and `limit` query parameters. In local dashboard\nmode it searches the verified local JSONL chain plus tenant-scoped synced\nbatches; hosted mode searches only tenant-scoped synced evidence. The broad\nquery covers agent, human owner, task, tool, resource, hashes, policy, reasons,\ntraces, and provider evidence. Historical records without `auditContext`\nremain valid but those identity dimensions are labeled unavailable. The older\n`/api/ledger/sync?view=records` endpoint remains a synced-only view, and SIEM\nexports remain available through `/api/ledger/sync?format=siem-jsonl`.\n\nFail-closed and secret boundaries:\n\n- Ledger export fails if any source record breaks JSON parsing, previous-hash continuity, or record-hash integrity.\n- Hosted sync accepts only structurally verified, token-key-bound attested exports\n  through the sync route and keeps provider credentials, sync tokens, dashboard\n  sessions, cookies, and auth headers out of stored batches and browser payloads.\n- Provider evidence is extracted from normalized actions, not raw provider HTTP responses. GitHub content payloads record paths and lengths rather than file bodies unless an explicit sanitized diff is supplied.\n\nConcurrent cooperating writers are serialized by the package lock. Direct\nwrites that bypass `LocalJsonlLedger` are unsupported; size drift is detected\nbefore and after append and fails closed as `ledger_concurrent_write_detected`.\n","readmeFilename":"README.md"}