{"_id":"@ai-manifests/aap-validate","name":"@ai-manifests/aap-validate","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ai-manifests/aap-validate","version":"1.0.0","description":"Validate AAP acknowledgment events and compute reference reputation weight","type":"module","bin":{"aap-validate":"bin/cli.js"},"main":"./src/index.js","exports":{".":"./src/index.js"},"scripts":{"test":"node --test src/*.test.js"},"keywords":["aap","agent-acknowledgment-protocol","validate","reputation","acknowledgment"],"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","homepage":"https://aap-manifest.dev","repository":{"type":"git","url":"git+https://github.com/ai-manifests/aap-validate.git"},"dependencies":{"ajv":"^8.17.0","ajv-formats":"^3.0.0"},"_id":"@ai-manifests/aap-validate@1.0.0","gitHead":"f2fbf97089d993fbbafdd59d07b9211533dbba79","bugs":{"url":"https://github.com/ai-manifests/aap-validate/issues"},"_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-mvpjjfQk6D1QNLGlUYMkZJDgQ9j4r/r2o0lxYuLRHOHeWYCsaHx78HZG8qlKfwMRxlboFJQo9/D5OU1DyhOtTQ==","shasum":"5cddcb6f498af57194658415b393160a3ab9a38b","tarball":"https://registry.npmjs.org/@ai-manifests/aap-validate/-/aap-validate-1.0.0.tgz","fileCount":8,"unpackedSize":39048,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB3VvakIzL+5pH3oFgdhzW9jbIkCejhxiOar3M4QNsCJAiEA/SXyufTj5FfMuYzXu0606Eed6Ua6BzflDJ5arayqfgo="}]},"_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/aap-validate_1.0.0_1780369361825_0.14292719486446592"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T03:02:41.705Z","1.0.0":"2026-06-02T03:02:41.978Z","modified":"2026-06-02T03:02:42.149Z"},"maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"description":"Validate AAP acknowledgment events and compute reference reputation weight","homepage":"https://aap-manifest.dev","keywords":["aap","agent-acknowledgment-protocol","validate","reputation","acknowledgment"],"repository":{"type":"git","url":"git+https://github.com/ai-manifests/aap-validate.git"},"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"bugs":{"url":"https://github.com/ai-manifests/aap-validate/issues"},"license":"Apache-2.0","readme":"# aap-validate\n\n[![npm](https://img.shields.io/npm/v/@ai-manifests/aap-validate.svg?label=npm)](https://www.npmjs.com/package/@ai-manifests/aap-validate)\n[![Downloads](https://img.shields.io/npm/dm/@ai-manifests/aap-validate.svg)](https://www.npmjs.com/package/@ai-manifests/aap-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-aap--manifest.dev-informational)](https://aap-manifest.dev)\n\nValidate [AAP](https://aap-manifest.dev) acknowledgment events, check the\nanti-abuse semantic rules, and compute the reference reputation weight for an\nevent.\n\n## Install\n\n```bash\nnpm install -g @ai-manifests/aap-validate\n```\n\n## Usage\n\n### Validate AAP events\n\n```bash\naap-validate ./appreciation-with-settlement.json\naap-validate ./a.json ./b.json ./c.json\n```\n\n### Validate a batch (with replay / duplicate-id detection)\n\nPass a directory of events to validate them as a set and detect duplicate `id`\nvalues (replay protection, T4):\n\n```bash\naap-validate --batch ./events/\n```\n\n### Compute the reference weight\n\nShow the AAP §7.2 reference weight breakdown for an event (assumes\n`issuer_trust = 1` and an unverified settlement, i.e. no economic boost):\n\n```bash\naap-validate --weight ./endorsement-witnessed.json\n```\n\n## Semantic Checks\n\n| Check | Type | Threat |\n|-------|------|--------|\n| `value.amount` present ⇒ `value.settlement_ref` present | Error | T2 |\n| `value.amount` is a non-negative decimal string | Error | T2 |\n| `WITHDRAWAL` carries `subject.context_ref` | Error | T7 |\n| Witness DID identical to issuer DID | Error | T9 |\n| `type` is neither core nor `x-` extension | Error | T1 |\n| Unknown `x-` type (weight-clamped by consumers) | Warning | T1 |\n| `value` present (economic weight needs verified settlement) | Warning | T2 |\n| Witnesses present (independence verified out-of-band) | Warning | T9 |\n| `expires_at` not after `issued_at` (already expired) | Warning | — |\n| `note` longer than the 280-char display recommendation | Warning | T8 |\n| `subject.context_ref` advisory until resolved | Warning | T11 |\n| Duplicate event `id` within a batch | Error | T4 |\n\n## Programmatic Use\n\n```javascript\nimport {\n  validateEvent,\n  validateBatch,\n  computeWeight,\n  typeWeight,\n  DEFAULT_TYPE_WEIGHTS,\n} from '@ai-manifests/aap-validate';\n\nconst result = validateEvent(event);\nconst batchResult = validateBatch(events);\n\n// Reference weight (AAP §7.2). value_weight applies only when settlement is verified.\nconst { weight, components } = computeWeight(event, {\n  issuerTrust: 0.8,\n  settlementVerified: true,\n  usdEquivalent: 0.50,\n  now: '2027-01-01T00:00:00Z',  // enables time decay; omit for no decay\n});\n```\n\n## How It Composes\n\n`aap-validate` checks events at the source. The durable record layer that stores,\nchains, federates, and aggregates these events is [AAR](https://aar-manifest.dev);\nvalidate the ledger with [`aar-validate`](https://github.com/ai-manifests/aar-validate).\nThe reference weight computed here is the AAP §7.2 view; the **normative**\naggregation algorithm — issuer-diversity penalty, recursive-trust bound,\nmandatory settlement verification — lives in AAR §9 and is checked by\n`aar-validate`.\n\n```\naap-validate   validates the acknowledgment event\naar-validate   validates the ledger that stores and aggregates it\n```\n\n## Status\n\n**v1.0** — Validates against AAP spec v1.0 (stable). Schemas for both `v0` (draft\nbaseline) and `v1.0` ship in `schema/`.\n\n## License\n\nApache-2.0 — see [`LICENSE`](LICENSE) for the full license text and [`NOTICE`](NOTICE) for attribution.\n","readmeFilename":"README.md","_rev":"1-ad1300031bdc2c74b862bef9f07b8bfc"}