{"_id":"@ai-manifests/acb-validate","_rev":"2-39c0000fbda98bb6965e4a4efdcc78c9","name":"@ai-manifests/acb-validate","dist-tags":{"latest":"1.0.0"},"versions":{"0.3.0":{"name":"@ai-manifests/acb-validate","version":"0.3.0","keywords":["acb","agent-cognitive-budget","validate","settlement","audit","calibration"],"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","_id":"@ai-manifests/acb-validate@0.3.0","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"homepage":"https://acb-manifest.dev","bugs":{"url":"https://github.com/ai-manifests/acb-validate/issues"},"bin":{"acb-validate":"bin/cli.js"},"dist":{"shasum":"6bdfee6938953e6877694e6722ebbcb1f384b2c9","tarball":"https://registry.npmjs.org/@ai-manifests/acb-validate/-/acb-validate-0.3.0.tgz","fileCount":7,"integrity":"sha512-4p403oU6EY/B2rUlc96B1ZeposgE4nciVZuIL4KYJrG9Ar/RbhE+WYIoCL7YwoEWY3BTTQEifo9cHPHTyL31Jg==","signatures":[{"sig":"MEUCIHEnK9KUJG1oyLEqJftVt0E/AlgPaq6NFh9PSXd1T0I7AiEAyK+w+kRA5Qc9JJomqp2ZE8mfbEIWKyTM0h5tHkrf5uU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50157},"main":"./src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"022463e562159e92d20d85036ecb3ab54efed5fd","scripts":{"test":"node --test src/*.test.js"},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"repository":{"url":"git+https://github.com/ai-manifests/acb-validate.git","type":"git"},"_npmVersion":"10.8.2","description":"Validate ACB budget and settlement entries and audit settlement arithmetic against deliberation records","directories":{},"_nodeVersion":"20.19.4","dependencies":{"ajv":"^8.17.0","ajv-formats":"^3.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/acb-validate_0.3.0_1777236807845_0.8105818175971493","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@ai-manifests/acb-validate","version":"1.0.0","description":"Validate ACB budget and settlement entries and audit settlement arithmetic against deliberation records","type":"module","bin":{"acb-validate":"bin/cli.js"},"main":"./src/index.js","exports":{".":"./src/index.js"},"scripts":{"test":"node --test src/*.test.js"},"keywords":["acb","agent-cognitive-budget","validate","settlement","audit","calibration"],"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","homepage":"https://acb-manifest.dev","repository":{"type":"git","url":"git+https://github.com/ai-manifests/acb-validate.git"},"dependencies":{"ajv":"^8.17.0","ajv-formats":"^3.0.0"},"_id":"@ai-manifests/acb-validate@1.0.0","gitHead":"ebeecce44f0c3be35261ebb6c45dfb4ad3b75928","bugs":{"url":"https://github.com/ai-manifests/acb-validate/issues"},"_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-kxHTywNHsHRLrUm+VTmCx8bmvopB7U8hiBnOM/rTbZMzDKNQ+doWjSIanAy5mlmcZM2vOMJZQ5pcTmhAZp9SAg==","shasum":"c7df226f81fc626956eac992eb18b84e0a580d56","tarball":"https://registry.npmjs.org/@ai-manifests/acb-validate/-/acb-validate-1.0.0.tgz","fileCount":8,"unpackedSize":62903,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGQnSbdLPG8rxSOj1OGKudhMPkM2QOy+5YREnLFwW9Z8AiABpEJFTBufOeGRt9P/na8QQGPZvGdl16UKc0GroOgCeA=="}]},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"directories":{},"maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/acb-validate_1.0.0_1780369359394_0.21740162652866957"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-26T20:53:27.745Z","modified":"2026-06-02T03:02:39.965Z","0.3.0":"2026-04-26T20:53:28.014Z","1.0.0":"2026-06-02T03:02:39.546Z"},"bugs":{"url":"https://github.com/ai-manifests/acb-validate/issues"},"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","homepage":"https://acb-manifest.dev","keywords":["acb","agent-cognitive-budget","validate","settlement","audit","calibration"],"repository":{"type":"git","url":"git+https://github.com/ai-manifests/acb-validate.git"},"description":"Validate ACB budget and settlement entries and audit settlement arithmetic against deliberation records","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"readme":"# acb-validate\n\n[![npm](https://img.shields.io/npm/v/@ai-manifests/acb-validate.svg?label=npm)](https://www.npmjs.com/package/@ai-manifests/acb-validate)\n[![Downloads](https://img.shields.io/npm/dm/@ai-manifests/acb-validate.svg)](https://www.npmjs.com/package/@ai-manifests/acb-validate)\n[![Node](https://img.shields.io/badge/node-20%2B-blue.svg)](https://nodejs.org/)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Spec](https://img.shields.io/badge/spec-acb--manifest.dev-informational)](https://acb-manifest.dev)\n\nValidate [ACB](https://acb-manifest.dev) budget and settlement entries, audit settlement arithmetic against deliberation records, and re-price deliberations against a posted budget.\n\n## Install\n\n```bash\nnpm install -g @ai-manifests/acb-validate\n```\n\n## Usage\n\n### Validate ACB entries\n\n```bash\nacb-validate ./budget-committed.json\nacb-validate ./settlement-recorded.json\nacb-validate ./budget.json ./cancel.json ./settlement.json\n```\n\n### Validate a complete budget record\n\nPass a directory containing the ACB entries (`budget_committed`, optionally `budget_cancelled`, `settlement_recorded`) and the related ADJ entries (`deliberation_opened`, `deliberation_closed`, `outcome_observed`) to check cross-entry consistency:\n\n```bash\nacb-validate --record ./deliberation/\n```\n\nCross-entry checks:\n\n- `budget_id` matches between `budget_committed` and `settlement_recorded`\n- `amount_total` matches between budget and settlement\n- `budget_committed.timestamp` ≤ `settlement_recorded.timestamp`\n- `deliberation_id` matches across all entries\n- `disagreement_magnitude_initial` in settlement is consistent with `deliberation_closed.final_tally`\n- Epistemic distributions only target agents declared in `deliberation_opened.participants`\n- A budget cannot be both `cancelled` and `settled`\n\n### Re-price a deliberation\n\nVerify the draw computation against a budget and a deliberation result:\n\n```bash\nacb-validate --price ./budget.json ./deliberation-closed.json\n```\n\nReports cheap-routine and expensive-routine draws, the unlock signal computed from the tally, and the routine the budget would select. Useful for sanity-checking settlement arithmetic when no settlement entry exists yet.\n\n## Semantic Checks\n\n| Check | Type |\n|-------|------|\n| `substrate_share + epistemic_share = 1.0` | Error |\n| `round_multiplier >= 1` | Error |\n| `posted_at <= timestamp` | Error |\n| `amount_total > 0` | Error |\n| `amount_returned_to_requester = amount_total − draw_total` | Error |\n| `sum(distributions) = draw_total` | Error |\n| `contribution_breakdown` sums to `amount` per agent | Error |\n| `habit_discount_applied` in [0, 1] | Error |\n| `expensive_routine_rate >= cheap_routine_rate` | Warning |\n| `unlock_threshold` is 0 or 1 (degenerate) | Warning |\n| `habit_discount_applied > 0.80` (default-v0 cap) | Warning |\n| `unlock_triggered` inconsistent with disagreement magnitude | Warning |\n| `mode = deferred` without `outcome_window_seconds` | Warning |\n| Settlement targets agent not in deliberation participants | Warning |\n\n## Programmatic Use\n\n```javascript\nimport {\n  validateEntry,\n  validateBudgetRecord,\n  computeDisagreementMagnitude,\n  computeCheapDraw,\n  computeExpensiveDraw,\n  selectRoutine,\n} from '@ai-manifests/acb-validate';\n\nconst result = validateEntry(budgetEntry);\nconst recordResult = validateBudgetRecord(allEntries);\n\nconst magnitude = computeDisagreementMagnitude({\n  approve_weight: 0.71,\n  reject_weight: 0.64,\n  abstain_weight: 0.18,\n});\n\nconst draw = computeExpensiveDraw(\n  { expensive_routine_rate: 200, round_multiplier: 1.5 },\n  3,    // participants\n  1,    // rounds\n  0.80  // habit discount\n);\n\nconst routine = selectRoutine(budget, initialTally, roundCount, termination);\n```\n\n## How It Composes\n\n`acb-validate` extends the same envelope `adj-validate` validates against. ACB entries (`budget_committed`, `budget_cancelled`, `settlement_recorded`) live in the same journal as ADJ entries (`deliberation_opened`, `proposal_emitted`, `round_event`, `deliberation_closed`, `outcome_observed`) and inherit the same hash chaining, append-only guarantees, and replay verification.\n\nRun both validators against a journal directory for full coverage:\n\n```bash\nadj-validate --deliberation ./journal/\nacb-validate --record ./journal/\n```\n\n## Status\n\n**v0.1** — Validates against ACB spec v0 (draft, pre-implementation).\n\n## License\n\nApache-2.0 — see [`LICENSE`](LICENSE) for the full license text and [`NOTICE`](NOTICE) for attribution.\n","readmeFilename":"README.md"}