@charter-agreement-protocol/verifier 0.6.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,123 @@
3
3
  All notable public changes to `@charter-agreement-protocol/verifier` are
4
4
  documented here.
5
5
 
6
- ## [Unreleased]
6
+ ## [1.0.0] — 2026-11-09
7
+
8
+ - Lets the quickstart flush its complete canonical report before process exit.
9
+ - Updates the browser workshop to pass the current direct chain context to
10
+ the signer, fixing its stale wrapped acceptance context.
11
+ - Stabilizes the public API under Semantic Versioning; wire revisions 1–3 and
12
+ the certified corpus stay unchanged.
13
+ - Pins and checks the published Elixir 1.0 conformance reference. The release
14
+ gate verifies packed contents, reproducible bytes, installed README examples
15
+ and generated declarations.
16
+ - Refreshes documentation, security support, Node requirements and workshop
17
+ version labels. Updates development tools and adds the Node 24.8 CI floor.
18
+ - Stages verified archives with provenance through the existing npm trusted
19
+ publisher. Owner approval with 2FA is required to make them public.
20
+
21
+ ## [0.7.0] — 2026-10-14
22
+
23
+ ### Added
24
+
25
+ - `prepareSigning`, `finishSigning`, `SigningPlan`, `SigningKind`, and
26
+ `SigningOptions` support checks before signing and retain the artifact's
27
+ verification context, limits, and profile
28
+ for completion. The plan exposes the signing input and whether its key is
29
+ `matched` or `unnamed` (a receipt against a bare revision).
30
+ Acceptance and termination profiles cover the revision, the signing party's
31
+ descriptor history, and the new artifact. The full profile checks the rest of
32
+ the set; caller limits cover every artifact read. Receipt profiles cover the
33
+ whole retained set; descriptor profiles cover predecessor history.
34
+ Plans can only be constructed through preparation. Context arrays are copied
35
+ before use, and completion accepts `Uint8Array` signatures from any realm.
36
+ Malformed contexts return `invalid_type`; cyclic signing claims return
37
+ `signing_input_invalid`.
38
+ - `signing_key_invalid` reports an invalid snapshot key encoding or shape.
39
+ `signing_key_mismatch` reports a snapshot that does not match an active candidate
40
+ in the holder's own view.
41
+ - The certified corpus now contains 541 cases in 16 case files, including
42
+ `signing.prepare`. Its runner calls public `prepareSigning`; tests cover
43
+ its 107 preparation cases, closed runner options, and both compiled class floors.
44
+ - `SECURITY.md` ships in the npm package with supported versions, scope,
45
+ reproduction commands and private reporting through GitHub's Security tab.
46
+
47
+ ### Changed
48
+
49
+ - `capabilities().verifiable` requires a declared key type, a passing known-answer
50
+ vector, and rejection of a tampered vector. Verification and preparation cache
51
+ that result once per key algorithm.
52
+ - `verifyDescriptor` returns `invalid_type` for a predecessor with missing, null,
53
+ empty, or non-string lineage, matching the reference.
54
+ - `verifyReceipt` returns `invalid_type` for a context such as `null`, `42`, `[]`,
55
+ or `["x"]`, instead of `chain_invalid`.
56
+ - `acceptanceSigningInput`, `terminationSigningInput`, `acceptanceRefusal`, and
57
+ `terminationRefusal` preserve `verifyChain`'s error for a bad set. For example, a
58
+ malformed descriptor now returns `compact_invalid` instead of `chain_invalid`.
59
+
60
+ ### Fixed
61
+
62
+ - Ed25519 public keys and signature `R` use the same point rule: canonical
63
+ `y`, a curve point, and not small order. Mixed order is accepted. Decoding
64
+ uses one modular exponentiation per point, with a faster fixed addition chain.
65
+ - The corpus runner checks limits first, then the profile, then operation inputs.
66
+ Malformed limits return `invalid_limits`; malformed profiles and revision bounds
67
+ return `invalid_profile`. A missing profile or axis uses the full profile or axis;
68
+ an empty profile uses both full axes. An explicit null profile or axis returns
69
+ `invalid_profile` on every surface. Malformed runner inputs return typed errors.
70
+ - JSON decoding checks limits validity, input type, byte size, then streaming
71
+ syntax and limits. It reads the syntax needed to start a container before
72
+ checking depth: `{` is `invalid_syntax` at depth zero, while `[bad` is
73
+ `limit_exceeded`. The runner rejects malformed base64url input before JSON decoding.
74
+ Byte input follows parser order too: `[` followed by an invalid UTF-8 byte
75
+ hits depth zero first, and an invalid byte after `[1]` is `trailing_bytes`.
76
+ - Revision projections return a null binding when the binding list is empty.
77
+ Governing queries and predecessor histories retain errors from context reads.
78
+ - Receipt verification and signing preparation apply the caller's limits to
79
+ the retained chain context. The receipt corpus runner passes these limits through.
80
+ - The source CLI finds its bundled corpus without an explicit path, as the
81
+ built CLI does.
82
+ - The public verdict functions return typed results for malformed inputs,
83
+ throwing getters, and Proxies: `verifyDescriptor`, `verifyDescriptorChain`,
84
+ `verifyAcceptance`, `verifyTermination`, `verifyChain`, `verifyReceipt`,
85
+ `prepareSigning`, `finishSigning`, `governingRevision`, `decodeArtifact`,
86
+ `decodeCharterRevision`, `revisionDigest`, `decodePartyDescriptor`,
87
+ `descriptorDigest`, `checkSigningClaims`, `acceptanceRefusal`,
88
+ `terminationRefusal`, all four signing-input producers, `assembleCompact`, and
89
+ `decodeJsonText`. `verifySignature` returns `false` for malformed inputs.
90
+ `canonical`, `jsonProjection`, `encodeBase64url`, `taggedDigest`, `loadCorpus`,
91
+ and `reportFor` retain their existing return shapes and can throw on invalid
92
+ caller input, corpus failures, or unavailable corpus verification.
93
+ - Options use ordinary property reads, including inherited and getter values,
94
+ once at entry. Claims use own enumerable JSON members. Context copies read
95
+ only the members the entry point uses and check all chain list types before
96
+ bounds. Array lengths and typed byte lengths are checked before allocating
97
+ their copies. Other typed arrays are rejected before enumeration. JSON copies
98
+ retain at most the selected member count, count expanded bytes and depth,
99
+ and stop at the selected limits. Deep and shared signing claims return
100
+ `signing_input_invalid` without overflowing the stack or expanding unboundedly.
101
+ Reported array lengths must fit the unsigned 32-bit array range; all malformed
102
+ lengths return `invalid_type` before reading any items.
103
+ - Empty revision lists read descriptors before topology checks. The runner
104
+ handles null and incomplete sets, nontext predecessors, and null receipt
105
+ chains with typed errors. Case JSON preserves float lexemes during integrity
106
+ checks and execution: `protocol_revision: 2.0` returns `signing_input_invalid`
107
+ during signing preparation, and float profile bounds return `invalid_profile`.
108
+ - The corpus runner validates codepoints, integer text, tagged integer members,
109
+ digest domains and byte encodings, and schema member shapes. Case JSON retains
110
+ large integer tokens without rounding. Kind and value types must match.
111
+ Case chain views contain exactly the four artifact lists; limits come from
112
+ the case's top level.
113
+ - Integer claims reject float tokens before canonical encoding, including
114
+ integral floats such as `1.0`. Signing returns `signing_input_invalid`;
115
+ artifact verification and revision decoding return `invalid_type`.
116
+ - The signature guard requires canonical base64url public keys and accepts plain
117
+ and cross-realm `Uint8Array` messages and signatures.
118
+ - The workshop passes only the signing party's descriptor history to acceptance
119
+ verification. The extracted flow is tested with the site's browser shims and
120
+ real WebCrypto and noble keys, and the bundle uses this repository's verifier
121
+ throughout. Evidence checks reject unknown kinds. CI also checks the site's
122
+ types and build.
7
123
 
8
124
  ## [0.6.0] — 2026-10-13
9
125
 
package/README.md CHANGED
@@ -15,9 +15,14 @@ satisfaction, and more. Hosts read the evidence and decide.
15
15
  ## Install
16
16
 
17
17
  ```console
18
- npm install @charter-agreement-protocol/verifier
18
+ npm install @charter-agreement-protocol/verifier@^1.0.0
19
19
  ```
20
20
 
21
+
22
+ Release submissions use npm's staged publishing workflow. A staged version
23
+ becomes publicly installable only after owner approval. During release review,
24
+ maintainers can use `npm stage download <stage-id>` and install that tarball.
25
+
21
26
  Requires Node >= 24.8 (ML-DSA landed in the Node builtins across the
22
27
  24.6–24.8 minors). Zero runtime dependencies — Node builtins only.
23
28
 
@@ -35,14 +40,14 @@ const require = createRequire(import.meta.url);
35
40
  const corpusRoot = join(dirname(require.resolve("@charter-agreement-protocol/verifier/package.json")), "conformance");
36
41
  const report = reportFor(corpusRoot);
37
42
  console.log(report.bytes); // canonical JSON report
38
- process.exit(report.exitStatus); // 0 = all certified cases recomputed and agreed
43
+ process.exitCode = report.exitStatus; // 0 = all certified cases recomputed and agreed
39
44
  ```
40
45
 
41
46
  Or from the shell:
42
47
 
43
48
  ```console
44
- npx @charter-agreement-protocol/verifier # the vendored certified corpus
45
- npx @charter-agreement-protocol/verifier --corpus DIR # any corpus directory
49
+ npx @charter-agreement-protocol/verifier@^1.0.0 # the vendored certified corpus
50
+ npx @charter-agreement-protocol/verifier@^1.0.0 --corpus DIR # any corpus directory
46
51
  ```
47
52
 
48
53
  Exit `0` means every case recomputed and agreed with the certified
@@ -61,7 +66,11 @@ cannot verify green.
61
66
  | `decodeJsonText(text, limits?)` | Strict I-JSON decode (duplicates, noncharacters, lone surrogates, number round-tripping rejected) |
62
67
  | `jsonProjection(value)` | The tagged projection used by reports; object members retain text order |
63
68
  | `Limits`, `DEFAULT_LIMITS`, `MAXIMUM_LIMITS` | Closed limits type, reference defaults and compiled maximum values; overrides must be nonnegative integers within the maximums |
64
- | `VerificationOptions` | Optional `{ limits?: Partial<Limits>, profile?: { algorithms: string[]; revisions: { min: number; max: number } } }` for public verification |
69
+ | `ChainInput` | A chain view with `revisions`, `acceptances`, `descriptors`, and `terminations` string arrays |
70
+ | `VerificationOptions` | Optional `{ limits?: Partial<Limits>, profile?: { algorithms?: string[]; revisions?: { min: number; max: number } } }` for public verification |
71
+ | `SigningOptions` | Verification options plus an optional `algorithm` for `prepareSigning` |
72
+ | `algorithmRegistry()` / `emissions()` / `defaultEmissionName()` | Signature registry rows, producer algorithm/revision pairs and the default emission name |
73
+ | `Profile` / `DescriptorPredecessor` | Optional capability axes and retained descriptor identity/lineage types |
65
74
  | `capabilities()` / `algorithmRegistryDigest()` | Runtime known-answer results per signature registry row, and the signature registry digest |
66
75
  | `CERTIFIED_INDEX_SHA256_BASE64URL`, `CERTIFIED_REGISTRY_DIGEST` | The certified identity pins this build carries |
67
76
  | `verifyDescriptor(compact, predecessor?, options?)` / `verifyDescriptorChain(compacts, options?)` | Artifact-level verification: one party descriptor (with optional predecessor facts), or a full descriptor chain |
@@ -71,18 +80,68 @@ cannot verify green.
71
80
  | `decodeArtifact(compact)` / `verifySignature(message, signature, publicKey, alg, options?)` | Framing decode and the strict signature primitive; the latter retains its boolean result with optional limits and algorithm filtering |
72
81
  | `descriptorSigningInput(kid, claims, alg?)` / `receiptSigningInput(kid, claims, alg?)` | The build-only producers: the exact RFC 7515 signing input per kind (emission pair gated, claims schema gated, provisional decode) — no key, no signature |
73
82
  | `acceptanceSigningInput(kid, claims, chainInput, alg?)` / `terminationSigningInput(kid, claims, chainInput, alg?)` | The set-aware producers: build first, then the R1–R3 refusal checks at the reference ordering |
83
+ | `prepareSigning(kind, kid, claims, publicKey, context, options?)` | Check framing, claims, context, profile, limits, and the holder's own signing key before signing; return a `SigningPlan` |
84
+ | `finishSigning(plan, signature)` | Assemble under the plan's limits and run public verification with its retained context |
85
+ | `SigningPlan` / `SigningKind` | The plan class exposes `kind`, `input`, and `key` (`matched` or `unnamed`); kinds are `descriptor`, `acceptance`, `termination`, and `receipt` |
74
86
  | `assembleCompact(signingInput, signature)` | Assemble a validated signing input and its exact raw signature (registry-row length, framing re-decode, size gate) |
75
87
  | `governingRevision(chainInput, at, options?)` | The unique governing revision at one UTC instant — a digest, or `contested`/`none`, including verified termination closing |
76
88
  | `decodeCharterRevision(text, options?)` / `revisionDigest(text, options?)` | Decode one canonical unsigned Charter Revision (claims + content digest over the exact text bytes) |
77
89
  | `decodePartyDescriptor(compact)` / `descriptorDigest(compact)` | Decode one Party Descriptor's claims and digest without verifying its signature |
78
- | `acceptanceRefusal(claims, chainInput)` / `terminationRefusal(claims, chainInput)` | The honest-signer refusal checks (R1–R3: claims-truth, no-equivocation, ancestry/governing coverage) over the caller's own view — `{ok: true}`, or `signing_refused` / `chain_invalid` / `signing_input_invalid`. Holder-side signers run these before any key is used; the rule that fired is deliberately not surfaced |
90
+ | `acceptanceRefusal(claims, chainInput)` / `terminationRefusal(claims, chainInput)` | The honest-signer refusal checks (R1–R3: claims-truth, no-equivocation, ancestry/governing coverage) over the caller's own view return `{ok: true}`, `signing_refused`, `signing_input_invalid`, or the set verification error. Holder-side signers run these before any key is used; the rule that fired is deliberately not surfaced |
91
+
92
+ Additional exported structural types are `CanonicalValue`, `Projection`,
93
+ `DecodeResult`, `CaseResult`, `CorpusFile`, `CorpusIndex`, `ConformanceCase`,
94
+ `LoadedCorpus`, `CaseOutcome`, `ConformanceReport`, `ReportOutput`,
95
+ `SigningInput`, `ProducerResult`, `AlgRow`, `VerifyResult`, and `RefusalResult`.
96
+ The installed declarations contain their complete shapes.
97
+
98
+ `prepareSigning` accepts a predecessor or `null` for a descriptor, a chain view
99
+ (`revisions`, `acceptances`, `descriptors`, `terminations` arrays) for acceptance
100
+ and termination, and a chain view or bare revision text for a receipt. Pass a
101
+ canonical base64url public key. Its options are `algorithm`, `limits`, and
102
+ `profile`. Limits cover every artifact read, including the entire set. For
103
+ acceptance and termination, the profile covers the revision, the signing party's
104
+ descriptor history, and the new artifact; the full profile checks the rest of
105
+ the set. A receipt's profile covers the whole retained set and the new artifact.
106
+ A descriptor's profile includes its predecessor history.
107
+
108
+ Sign `plan.input.message`, then pass the raw `Uint8Array` signature to
109
+ `finishSigning`. Both signature functions accept plain and cross-realm
110
+ `Uint8Array` bytes, including Node Buffers. `verifySignature` returns `false` for
111
+ `ArrayBuffer` and `DataView` inputs; `finishSigning` returns `invalid_type` for
112
+ them. A bare-revision receipt has `key: "unnamed"`; public receipt
113
+ verification leaves its signature unchecked. `signing_key_invalid` means the
114
+ snapshot key fails the encoding or shape check; `signing_key_mismatch` means it
115
+ matches no active candidate in the holder's own view. The plan retains private
116
+ copies of its input, context arrays, limits, and profile. The existing producers
117
+ and `assembleCompact` continue to use default limits; use the plan API for caller
118
+ limits and the check before signing. A non-set passed to the existing set-aware
119
+ producers still returns `signing_input_invalid`.
120
+
121
+ The following public functions return typed results for malformed input and
122
+ unreadable getters or Proxies: `verifyDescriptor`, `verifyDescriptorChain`,
123
+ `verifyAcceptance`, `verifyTermination`, `verifyChain`, `verifyReceipt`,
124
+ `prepareSigning`, `finishSigning`, `governingRevision`, `decodeArtifact`,
125
+ `decodeCharterRevision`, `revisionDigest`, `decodePartyDescriptor`,
126
+ `descriptorDigest`, `checkSigningClaims`, `acceptanceRefusal`,
127
+ `terminationRefusal`, `descriptorSigningInput`, `receiptSigningInput`,
128
+ `acceptanceSigningInput`, `terminationSigningInput`, `assembleCompact`, and
129
+ `decodeJsonText`. `verifySignature` returns `false` for malformed input.
130
+ `canonical`, `jsonProjection`, `encodeBase64url`, `taggedDigest`, `loadCorpus`,
131
+ and `reportFor` retain their existing return shapes and can throw on invalid
132
+ caller input, corpus failures, or unavailable corpus verification.
133
+
134
+ Known option members are read once at entry with ordinary property reads;
135
+ inherited values and getters count. Claims use own enumerable JSON members.
136
+ Copies check array lengths and byte sizes before allocation and bound expanded
137
+ bytes and depth. Deep or excessively shared signing claims return
138
+ `signing_input_invalid`.
79
139
 
80
140
  Verification options default to the full algorithm registry, revisions 1..3,
81
141
  and `DEFAULT_LIMITS`. Profiles apply to each signed artifact after its local
82
142
  checks and before crypto; unsigned charter revisions use only the revision
83
- axis. Public acceptance, termination and receipt calls re-verify their
84
- supplied context with the full profile, then apply the requested profile to
85
- the artifact, matching the reference. `verifyChain` applies it throughout
143
+ axis. Public acceptance, termination, and receipt calls re-verify their
144
+ supplied context and check the artifact under the requested profile. `verifyChain` applies it throughout
86
145
  the view. Malformed options return `invalid_limits` or `invalid_profile`;
87
146
  excluded artifacts return `algorithm_outside_profile` or
88
147
  `revision_outside_profile`.
@@ -116,9 +175,16 @@ substrate cannot verify, keeping that local result outside verdict reports.
116
175
  canonical reports must be byte-identical over the certified corpus — in
117
176
  this repository and over the unpacked published package — enforced by the
118
177
  reference repository's gates, together with a randomized differential
119
- harness and a 25-mutation red-required battery.
178
+ harness and its red-required mutation battery.
120
179
  - **The certified corpus** ships in this package (`conformance/`), pinned by
121
180
  a raw index SHA-256 asserted at load.
181
+ - **Ed25519 key and R admission.** After `npm run build`, run
182
+ `npm run check:ed25519 -- /path/to/elixir/repository` to compare the source
183
+ and built predicates with Elixir at `911d84b` on 10,000 seeded inputs and
184
+ 51 named edges for each role. The check compiles Elixir in a temporary copy
185
+ of that commit, exposing its private R check by changing only its visibility.
186
+ Run `npm run bench:ed25519` for admission and native signature costs, plus
187
+ a valid chain with 80 descriptors, 200 revisions, and 400 acceptances.
122
188
  - **This package never publishes verdict claims that were not recomputed
123
189
  from raw bytes.**
124
190
 
@@ -133,19 +199,61 @@ cross-verifies TypeScript-signed artifacts from raw bytes):
133
199
  - **This package** — `@charter-agreement-protocol/verifier`: verification
134
200
  and the pure producer surface (signing inputs, refusal guards, assembly).
135
201
  - [`@charter-agreement-protocol/signer`](https://www.npmjs.com/package/@charter-agreement-protocol/signer)
136
- — the holder-side companion: key custody, the wrong-key guard, and
137
- post-sign verification, delegating all protocol logic here.
202
+ — the holder-side companion: key custody and the wrong-key guard. It
203
+ calls `prepareSigning` before the key is used and `finishSigning` after,
204
+ so every protocol check stays in this package.
138
205
 
139
- The pair releases together: the signer depends on this package, so a
140
- verifier release stages first and the signer locks and releases against
141
- the published version immediately after.
206
+ The 1.0 signer supports both the certified verifier 0.7 line and 1.x.
207
+ Its registry lock pins published 0.7.0 for the baseline compatibility check.
208
+ Its other check binds verifier 1.0 to the commit and exact archive integrity
209
+ recorded from staging. When promoting a paired release, approve the verifier
210
+ stage first, then the signer stage.
142
211
 
143
212
  ## SemVer
144
213
 
145
- Package SemVer is decoupled from the protocol's `protocol_revision`: new
146
- wire revisions land additively (minor releases; old revisions keep
147
- verifying side by side); a package major is owed only when a shipped public
148
- API is removed or verdicts change.
214
+ The 1.x public JavaScript exports, TypeScript contracts and documented option
215
+ and error shapes follow Semantic Versioning. Removing or renaming a public
216
+ surface, or making an incompatible change to valid-input behavior, requires a
217
+ major release. New exports and optional options or fields are minor additions. An incompatible
218
+ change to a closed TypeScript union requires a major release. Compatible bug and
219
+ security fixes can tighten malformed-input handling; they are recorded in the
220
+ changelog. Package versions do not change an artifact's `protocol_revision`.
221
+
222
+ ## Conformance reference and development
223
+
224
+ `reference.json` pins the published Elixir CAP 1.0.0 archive and its checksum.
225
+ The unchanged corpus contains 541 cases in 16 case files. `npm run check:reference`
226
+ compares every corpus file with that archive. `npm run check:reference -- --report`
227
+ also runs the published Elixir package and requires byte-identical reports;
228
+ this needs Elixir 1.19/1.20 on OTP 28/29 linked to OpenSSL 3.5 or newer.
229
+ The Elixir release's historical TypeScript source pin remains immutable.
230
+
231
+ Use Node >= 24.8.0 and npm; `.tool-versions` pins the development Node.
232
+ The lockfile records TypeScript 7 and the current Node declarations. Run:
233
+
234
+ ```console
235
+ npm ci
236
+ npm run check
237
+ ```
238
+
239
+ `check` runs strict library and browser typechecks, the full native/browser and
240
+ resource-boundary suites, self-checks, both builds, corpus agreement, the
241
+ reference-byte check, and the packed-consumer documentation/declaration checks.
242
+ CI covers Node 24.8.0 and current Node 24; both lanes also require Bun
243
+ 1.3.14 for its real substrate behavior. `npm run check:package` proves package
244
+ contents and reproducible bytes, executes this quickstart and the installed CLI,
245
+ and writes the verified tarball to `artifacts/package.tgz`.
246
+
247
+ ## Release staging
248
+
249
+ Run the checks before pushing main and wait for CI. Tag that same commit
250
+ `v<package-version>` after confirming package and tag versions agree. The
251
+ [Release workflow](https://github.com/baselabs/charter_agreement_protocol_typescript/blob/main/.github/workflows/release.yml)
252
+ checks the source without publishing permissions, then stages the verified
253
+ archive using `npm stage publish --provenance --ignore-scripts` in a separate job.
254
+ Staging requires npm >= 11.15.0; the workflow pins its publishing CLI.
255
+ Only the owner can approve the staged package with npm 2FA. Record the stage ID
256
+ and archive integrity, and approve the verifier before the signer.
149
257
 
150
258
  ## License
151
259
 
package/SECURITY.md ADDED
@@ -0,0 +1,90 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ | Version | Security fixes |
6
+ | --- | --- |
7
+ | 1.x | supported after staged 1.0.0 is approved |
8
+ | 0.7.x | supported until 1.0.0 is approved |
9
+ | 0.6.x and earlier | no; upgrade to 0.7.x or approved 1.x |
10
+
11
+ The [changelog](CHANGELOG.md) describes verification changes between releases.
12
+ Keep the package version with stored verification results so you can check
13
+ them again when upgrading.
14
+
15
+ ## Reporting a vulnerability
16
+
17
+ Report it privately through the repository's Security tab, then
18
+ "Report a vulnerability", for
19
+ [`baselabs/charter_agreement_protocol_typescript`](https://github.com/baselabs/charter_agreement_protocol_typescript/security/advisories/new).
20
+
21
+ Never put an exploit, credential, private key, production data or an
22
+ unfixed vulnerability's details in a public issue, pull request or discussion.
23
+
24
+ A useful report names:
25
+
26
+ - the package version or commit and the Node version;
27
+ - the property that fails, such as a modified artifact verifying or a limit
28
+ not being enforced;
29
+ - the smallest reproduction, using test keys and synthetic data;
30
+ - the result you expected, usually a typed `{ ok: false, code: "..." }`.
31
+
32
+ ## What happens after you report
33
+
34
+ | Step | Target |
35
+ | --- | --- |
36
+ | We confirm we received the report | within 3 business days |
37
+ | We tell you whether we can reproduce it and how serious it is | within 10 business days |
38
+ | We ship a fix in a patch release | as soon as it is ready, within 90 days of the report |
39
+ | We publish an advisory crediting you, unless you ask us not to | when the fix is on npm |
40
+
41
+ If a fix needs longer than 90 days, we agree on a new date with you before
42
+ the 90 days run out. Please keep the details private until the advisory is
43
+ published.
44
+
45
+ ## Scope
46
+
47
+ In scope: everything shipped in the npm package
48
+ `@charter-agreement-protocol/verifier`.
49
+
50
+ - Decoding, canonicalization, digests, signature checks, descriptor, chain,
51
+ acceptance, termination and receipt verification, and the facts they return.
52
+ - Signing input helpers, compact assembly, `prepareSigning` and `finishSigning`.
53
+ The caller supplies the context, time, limits, public key and signature.
54
+ - The corpus loader and CLI, including filesystem checks. They cap a corpus
55
+ at 64 files and 32 MiB and reject symlinks and other entries that are neither
56
+ regular files nor directories.
57
+ - The shipped conformance corpus and package documentation.
58
+
59
+ Out of scope here:
60
+
61
+ - What your application does with the facts. CAP verifies and never
62
+ authorizes; the [README](README.md) describes the `not_verified` fields.
63
+ - Key custody and signing callbacks. Report companion signer issues to
64
+ [charter_agreement_signer_typescript](https://github.com/baselabs/charter_agreement_signer_typescript).
65
+ - The Elixir reference. Report its issues to
66
+ [charter_agreement_protocol](https://github.com/baselabs/charter_agreement_protocol).
67
+
68
+ The workshop is maintained in this repository but is outside the npm package.
69
+ Report a flaw in its signing or verification flow through the same private
70
+ reporting form.
71
+
72
+ ## Reproducing a report
73
+
74
+ Use Node 24.8.0 or later. From a source checkout:
75
+
76
+ ```sh
77
+ npm ci
78
+ npm test
79
+ npm run typecheck
80
+ npm run typecheck:web
81
+ npm run self-checks
82
+ npm run build
83
+ npm run build:site
84
+ node cli.ts --corpus conformance
85
+ node dist/cli.js --corpus conformance
86
+ ```
87
+
88
+ For an installed package, run `cap-verifier --corpus DIRECTORY` to check a
89
+ corpus directory. Include the command, its output and the synthetic input
90
+ that reproduces the problem in your private report.