@charter-agreement-protocol/verifier 1.0.0 → 2.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,6 +3,56 @@
3
3
  All notable public changes to `@charter-agreement-protocol/verifier` are
4
4
  documented here.
5
5
 
6
+ ## [Unreleased]
7
+
8
+ ## [2.0.0] — 2026-11-27
9
+
10
+ - Inspect receipts against retained chain artifacts in Node and the browser.
11
+ Export the original signed segments, verified provenance, grant digest
12
+ equality, and governing agreement as JSON.
13
+
14
+ - Breaking TypeScript change: `SigningKind` and `SigningPlan.kind` include
15
+ `"party_replacement"`. Exhaustive switches over either type need a branch
16
+ for the new operation.
17
+
18
+ - Verify revision-8 party quorums, declared assignments, and receipt ownership.
19
+ Prepare assignor acceptances through the same checked signing path.
20
+
21
+ - Verify per-party signer scopes on revision-8 descriptors. Retain scope
22
+ facts on signed artifacts, exclude outside-scope votes from quorum and
23
+ assignment assent, and refuse outside-scope signing preparation.
24
+
25
+ - Require an accepted predecessor for every charter successor. A signed legacy
26
+ successor of an unsigned genesis remains proposed and cannot govern.
27
+
28
+ - Retain bounded signing contexts across key callbacks while preserving
29
+ preparation error order. Bound algorithm profiles before reading entries
30
+ and copy byte views without invoking caller conversion methods.
31
+
32
+ - Verify revision-8 descriptor commitments and unsigned current/next
33
+ publications in Node and browser builds.
34
+
35
+ - Check the canonical limited-substrate outcomes for receipt preparation
36
+ when the browser cannot verify the supplied ML-DSA chain.
37
+
38
+ - Expose the receipt deployment match and retained optional extension names
39
+ through `verifyReceipt`. The browser corpus uses the public verifier and
40
+ governing revision APIs.
41
+
42
+ - Pin the canonical CAP corpus by source commit and index SHA-256. Run
43
+ all 931 cases through the browser bundle, including the declared
44
+ limited-substrate outcomes and new receipt and lifecycle verdicts.
45
+
46
+ - Read CI runtime defaults and compatibility lanes only through the shared
47
+ toolchain reader, with exact installed-version checks.
48
+
49
+ - Resumes approved npm releases on the same commit, refusing missing package
50
+ names, retired versions and differing archive bytes. Preserves verified
51
+ consumer files for the maintainers' GitHub release and reads npm integrity back.
52
+ - Qualifies commits only through landing CI, with exact runtime checks and a
53
+ required site job. The maintainers' release process dispatches protected npm
54
+ and Pages publication from the default branch after qualification.
55
+
6
56
  ## [1.0.0] — 2026-11-09
7
57
 
8
58
  - Lets the quickstart flush its complete canonical report before process exit.
package/IPR.md ADDED
@@ -0,0 +1,14 @@
1
+ # Intellectual property
2
+
3
+ **Steward.** BaseLabs Holdings LLC is the steward of the Charter Agreement Protocol
4
+ specification and holds the copyright in the work it contributes. Contributors keep the
5
+ copyright in their contributions.
6
+
7
+ **License.** Everything in this repository, specification text, schemas, conformance
8
+ corpora and code alike, is licensed under the Apache License, Version 2.0, unless a
9
+ file or NOTICE says otherwise. See LICENSE and NOTICE.
10
+
11
+ **Contributions.** Contributions are accepted under the Apache License, Version 2.0, as
12
+ its section 5 describes, with a Developer Certificate of Origin 1.1 sign-off
13
+ (https://developercertificate.org) on every commit: `git commit -s`. No contributor
14
+ license agreement is required.
package/LICENSE CHANGED
@@ -175,7 +175,7 @@
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
177
 
178
- Copyright 2026 BaseLabs
178
+ Copyright 2026 BaseLabs Holdings LLC
179
179
 
180
180
  Licensed under the Apache License, Version 2.0 (the "License");
181
181
  you may not use this file except in compliance with the License.
package/NOTICE CHANGED
@@ -1,7 +1,7 @@
1
1
  Charter Agreement Protocol Verifier (TypeScript)
2
- Copyright 2026 BaseLabs
2
+ Copyright 2026 BaseLabs Holdings LLC
3
3
 
4
- This product includes software developed by BaseLabs
4
+ This product includes software developed by BaseLabs Holdings LLC
5
5
  (https://github.com/baselabs).
6
6
 
7
7
  The certified conformance corpus vendored in this package is certified
package/README.md CHANGED
@@ -4,24 +4,68 @@ Independent TypeScript verifier for the
4
4
  [Charter Agreement Protocol](https://hex.pm/packages/charter_agreement_protocol) (CAP).
5
5
 
6
6
  **CAP verifies. It never authorizes.** This package re-verifies signed,
7
- byte-exact evidence of what two parties agreed — party descriptor key
7
+ byte-exact evidence of what charter parties agreed — party descriptor key
8
8
  histories (Ed25519 and, from `protocol_revision` 3, ML-DSA per RFC 9964),
9
- charter revisions, bilateral acceptances, termination notices, and action
9
+ charter revisions, acceptances, termination notices, and action
10
10
  receipts — completely offline, with no network, no clock, and no central
11
11
  authority. Every verification result carries a closed floor of what was
12
12
  *not* verified: authority, execution, billing, legal validity, term
13
13
  satisfaction, and more. Hosts read the evidence and decide.
14
14
 
15
+ ## Descriptor rotation
16
+
17
+ Use `descriptorNextKeyCommitment` to commit to a successor’s active keys. Create
18
+ revision-8 descriptors with the existing signing-input API. Pass the signed
19
+ history to `encodeDescriptorPublication` and `verifyDescriptorPublication` to
20
+ check the current and next pair and its opening status.
21
+
22
+ ## Signer scopes
23
+
24
+ A revision-8 descriptor may declare `signing_scopes`, an array of up to 64
25
+ role entries. Each entry has a `role` and up to 32 `signers`. A signer
26
+ entry has a `key_thumbprint` from an active verification key and an
27
+ `artifact_kinds` array drawn from `acceptance`, `descriptor`, `receipt`,
28
+ and `termination`. Roles, thumbprints within each role, and kinds within
29
+ each signer entry are sorted and unique. Omission leaves the descriptor
30
+ unrestricted. An empty scope array permits no match.
31
+
32
+ `signerThumbprint` identifies a descriptor key by its algorithm and public
33
+ key bytes. Renaming its key id preserves that identity. The predecessor must
34
+ match `descriptor` under some role for its signing key to sign a successor.
35
+
36
+ Acceptances and terminations use the descriptor digest in the signed claims.
37
+ Receipts look up the issuing role in the named accepted revision. Those
38
+ verifiers report `scope_status` (`not_required`, `matched`, `outside`,
39
+ or `not_verified`) and `signer_thumbprint`. Bare-revision receipts and
40
+ receipts whose named revision is unrecognized have `not_verified` scope
41
+ and a null thumbprint.
42
+
43
+ Chain verification keeps every verified acceptance. It records the first
44
+ applicable `credit_reason` in order: `arbiter_not_counted`,
45
+ `role_outside_quorum`, and `signer_outside_scope`. A replacement vote uses
46
+ the predecessor's acceptance rule. An ordinary vote can still count under
47
+ the predecessor's rule when a successor narrows its quorum. A vote with a
48
+ reason has `credit: "uncredited"` and contributes no quorum vote.
49
+ Every candidate party supplies ordinary assignment assent even if its role
50
+ is outside the quorum. An outside signer cannot supply that assent.
51
+ Eligible votes have `credit: "not_required"` and a null reason.
52
+ Single-artifact acceptance verification returns
53
+ `credit: "not_evaluated"` and a null reason.
54
+
55
+ Outside termination notices remain visible and contribute no termination
56
+ votes. Receipt scope is descriptive. Checked signing refuses outside scope
57
+ with `signing_refused`. An outside descriptor successor returns
58
+ `descriptor_chain_invalid` in verification and checked preparation.
59
+
15
60
  ## Install
16
61
 
17
62
  ```console
18
- npm install @charter-agreement-protocol/verifier@^1.0.0
63
+ npm install @charter-agreement-protocol/verifier@^2.0.0
19
64
  ```
20
65
 
21
66
 
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.
67
+ The maintainers' release process publishes inspected archives to npm with
68
+ provenance through GitHub Actions trusted publishing after owner approval.
25
69
 
26
70
  Requires Node >= 24.8 (ML-DSA landed in the Node builtins across the
27
71
  24.6–24.8 minors). Zero runtime dependencies — Node builtins only.
@@ -46,8 +90,8 @@ process.exitCode = report.exitStatus; // 0 = all certified cases recomputed and
46
90
  Or from the shell:
47
91
 
48
92
  ```console
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
93
+ npx @charter-agreement-protocol/verifier@^2.0.0 # the vendored certified corpus
94
+ npx @charter-agreement-protocol/verifier@^2.0.0 --corpus DIR # any corpus directory
51
95
  ```
52
96
 
53
97
  Exit `0` means every case recomputed and agreed with the certified
@@ -60,6 +104,7 @@ cannot verify green.
60
104
  | Export | What it does |
61
105
  |---|---|
62
106
  | `reportFor(root)` | Load + integrity-check + recompute a corpus directory; returns the canonical report bytes and exit status |
107
+ | `runConformanceCase(case)` | Run one decoded corpus case through the public verifier and project its verdict |
63
108
  | `loadCorpus(root)` | Integrity-checked corpus load (canonical index, digests, file set, applicability floor, certified index pin) |
64
109
  | `selfChecks()` | The self-check battery: SHA-256 known answers, canonical ordering, strict base64url, timestamp and limit invariants |
65
110
  | `canonical(value)` | RFC 8785 canonical JSON serialization |
@@ -73,16 +118,19 @@ cannot verify green.
73
118
  | `Profile` / `DescriptorPredecessor` | Optional capability axes and retained descriptor identity/lineage types |
74
119
  | `capabilities()` / `algorithmRegistryDigest()` | Runtime known-answer results per signature registry row, and the signature registry digest |
75
120
  | `CERTIFIED_INDEX_SHA256_BASE64URL`, `CERTIFIED_REGISTRY_DIGEST` | The certified identity pins this build carries |
121
+ | `inspectReceipt(compact, chain, grantReference?, options?)` | Receipt bytes, verified provenance, grant digest equality, and governing agreement |
76
122
  | `verifyDescriptor(compact, predecessor?, options?)` / `verifyDescriptorChain(compacts, options?)` | Artifact-level verification: one party descriptor (with optional predecessor facts), or a full descriptor chain |
123
+ | `signerThumbprint(key)` | Validate a descriptor verification-key declaration and return its tagged algorithm-and-public-key identity |
77
124
  | `verifyAcceptance(compact, revisionText, descriptorCompacts, options?)` / `verifyTermination(compact, revisionText, descriptorCompacts, options?)` | Artifact-level verification of an acceptance / termination notice against the named revision and the signing party's descriptor chain |
78
- | `verifyChain(chainInput, options?)` / `verifyReceipt(compact, chainInput, options?)` | Full chain-view verification (facts include topology, verified acceptances and termination notices); receipt verification against the verified chain |
79
- | `checkSigningClaims(kind, claims)` | The producer build gate's claims half (the reference `decode_for_signing`): the claims-only schema checks per kind — `descriptor \| acceptance \| termination \| receipt` — shared with the verify paths; holder-side signers run it before any key is used |
125
+ | `verifyChain(chainInput, options?)` / `verifyReceipt(compact, chainInput, options?)` | Full chain-view verification (facts include topology, verified acceptances and termination notices); receipt verification against the verified chain, with `deployment_digest_matched` and `optional_extensions_retained` in its facts |
126
+ | `checkSigningClaims(kind, claims)` | The producer build gate's claims half (the reference `decode_for_signing`): the claims-only schema checks for the four wire artifact kinds — `descriptor \| acceptance \| termination \| receipt` — shared with the verify paths; holder-side signers run it before any key is used |
80
127
  | `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 |
81
128
  | `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 |
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` |
129
+ | `acceptanceSigningInput(kid, claims, chainInput, alg?)` / `partyReplacementSigningInput(kid, claims, chainInput, alg?)` / `terminationSigningInput(kid, claims, chainInput, alg?)` | Set-aware producers. The replacement producer frames the departing party's marked acceptance. |
130
+ | `prepareSigning(kind, kid, claims, publicKey, context, options?)` | Check framing, claims, context, profile, limits, key membership, and signer scope before signing; return a `SigningPlan` |
131
+ | `retainSigningContext(kind, context, options?)` | Validate options and context shape, then capture a bounded context before awaiting custody. On success, `value(kid, claims, publicKey)` prepares with the same result and error order as `prepareSigning`. |
84
132
  | `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` |
133
+ | `SigningPlan` / `SigningKind` | The plan class exposes `kind`, `input`, and `key` (`matched` or `unnamed`); kinds are `descriptor`, `acceptance`, `party_replacement`, `termination`, and `receipt` |
86
134
  | `assembleCompact(signingInput, signature)` | Assemble a validated signing input and its exact raw signature (registry-row length, framing re-decode, size gate) |
87
135
  | `governingRevision(chainInput, at, options?)` | The unique governing revision at one UTC instant — a digest, or `contested`/`none`, including verified termination closing |
88
136
  | `decodeCharterRevision(text, options?)` / `revisionDigest(text, options?)` | Decode one canonical unsigned Charter Revision (claims + content digest over the exact text bytes) |
@@ -95,9 +143,15 @@ Additional exported structural types are `CanonicalValue`, `Projection`,
95
143
  `SigningInput`, `ProducerResult`, `AlgRow`, `VerifyResult`, and `RefusalResult`.
96
144
  The installed declarations contain their complete shapes.
97
145
 
146
+ Legacy artifacts, including receipts, use `Ed25519` at protocol revision 2
147
+ or `ML-DSA-65` at revision 3. Revision-8 party descriptors, acceptances
148
+ (including marked assignor acceptances), and termination notices can use
149
+ either algorithm.
150
+
98
151
  `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
152
+ (`revisions`, `acceptances`, `descriptors`, `terminations` arrays) for acceptance,
153
+ party replacement, and termination. It accepts a chain view for a receipt,
154
+ or bare revision text for a legacy charter. Pass a
101
155
  canonical base64url public key. Its options are `algorithm`, `limits`, and
102
156
  `profile`. Limits cover every artifact read, including the entire set. For
103
157
  acceptance and termination, the profile covers the revision, the signing party's
@@ -109,8 +163,10 @@ Sign `plan.input.message`, then pass the raw `Uint8Array` signature to
109
163
  `finishSigning`. Both signature functions accept plain and cross-realm
110
164
  `Uint8Array` bytes, including Node Buffers. `verifySignature` returns `false` for
111
165
  `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
166
+ them. A receipt prepared against a bare legacy revision has `key: "unnamed"`.
167
+ Preparing against a bare revision-8 charter returns `signing_refused`.
168
+ Public receipt verification against a bare revision lists `signature` in
169
+ `not_verified` and adds `ownership` for revision 8. `signing_key_invalid` means the
114
170
  snapshot key fails the encoding or shape check; `signing_key_mismatch` means it
115
171
  matches no active candidate in the holder's own view. The plan retains private
116
172
  copies of its input, context arrays, limits, and profile. The existing producers
@@ -121,11 +177,11 @@ producers still returns `signing_input_invalid`.
121
177
  The following public functions return typed results for malformed input and
122
178
  unreadable getters or Proxies: `verifyDescriptor`, `verifyDescriptorChain`,
123
179
  `verifyAcceptance`, `verifyTermination`, `verifyChain`, `verifyReceipt`,
124
- `prepareSigning`, `finishSigning`, `governingRevision`, `decodeArtifact`,
180
+ `prepareSigning`, `retainSigningContext`, `finishSigning`, `governingRevision`, `decodeArtifact`,
125
181
  `decodeCharterRevision`, `revisionDigest`, `decodePartyDescriptor`,
126
182
  `descriptorDigest`, `checkSigningClaims`, `acceptanceRefusal`,
127
183
  `terminationRefusal`, `descriptorSigningInput`, `receiptSigningInput`,
128
- `acceptanceSigningInput`, `terminationSigningInput`, `assembleCompact`, and
184
+ `acceptanceSigningInput`, `partyReplacementSigningInput`, `terminationSigningInput`, `assembleCompact`, and
129
185
  `decodeJsonText`. `verifySignature` returns `false` for malformed input.
130
186
  `canonical`, `jsonProjection`, `encodeBase64url`, `taggedDigest`, `loadCorpus`,
131
187
  and `reportFor` retain their existing return shapes and can throw on invalid
@@ -137,7 +193,7 @@ Copies check array lengths and byte sizes before allocation and bound expanded
137
193
  bytes and depth. Deep or excessively shared signing claims return
138
194
  `signing_input_invalid`.
139
195
 
140
- Verification options default to the full algorithm registry, revisions 1..3,
196
+ Verification options default to the full algorithm registry, revisions 1, 2, 3, and 8,
141
197
  and `DEFAULT_LIMITS`. Profiles apply to each signed artifact after its local
142
198
  checks and before crypto; unsigned charter revisions use only the revision
143
199
  axis. Public acceptance, termination, and receipt calls re-verify their
@@ -177,7 +233,7 @@ substrate cannot verify, keeping that local result outside verdict reports.
177
233
  reference repository's gates, together with a randomized differential
178
234
  harness and its red-required mutation battery.
179
235
  - **The certified corpus** ships in this package (`conformance/`), pinned by
180
- a raw index SHA-256 asserted at load.
236
+ an Elixir source commit and raw index SHA-256 checked at load.
181
237
  - **Ed25519 key and R admission.** After `npm run build`, run
182
238
  `npm run check:ed25519 -- /path/to/elixir/repository` to compare the source
183
239
  and built predicates with Elixir at `911d84b` on 10,000 seeded inputs and
@@ -203,15 +259,19 @@ cross-verifies TypeScript-signed artifacts from raw bytes):
203
259
  calls `prepareSigning` before the key is used and `finishSigning` after,
204
260
  so every protocol check stays in this package.
205
261
 
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.
262
+ The published signer's dependency range stops before verifier 2.0.0. Check the
263
+ signer's verifier dependency when upgrading both packages. For a paired release,
264
+ the maintainers publish and verify the verifier before publishing the signer.
265
+
266
+ ## Upgrade to 2.0
267
+
268
+ Add a `"party_replacement"` branch to exhaustive switches on `SigningKind`
269
+ and `SigningPlan.kind`. This kind prepares a marked acceptance from the
270
+ departing party for a declared assignment.
211
271
 
212
272
  ## SemVer
213
273
 
214
- The 1.x public JavaScript exports, TypeScript contracts and documented option
274
+ The public JavaScript exports, TypeScript contracts and documented option
215
275
  and error shapes follow Semantic Versioning. Removing or renaming a public
216
276
  surface, or making an incompatible change to valid-input behavior, requires a
217
277
  major release. New exports and optional options or fields are minor additions. An incompatible
@@ -221,15 +281,33 @@ changelog. Package versions do not change an artifact's `protocol_revision`.
221
281
 
222
282
  ## Conformance reference and development
223
283
 
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.
284
+ `reference.json` pins CAP 1.0.0 as the published archive for compatibility
285
+ checks. Verifier 2.0.0 implements CAP 1.1.0. Its corpus has 931 cases in 18 files
286
+ copied from the [canonical Elixir commit](https://github.com/baselabs/charter_agreement_protocol/tree/55cd0662d7fa5d3a4cf7633180ea1fdd08409e28/priv/conformance).
287
+ The verifier checks the SHA-256 of the index and every listed case file.
288
+ Legacy revisions require assent from both parties. One qualifying notice
289
+ can close a legacy charter. Every charter successor needs an accepted predecessor.
290
+ A signed legacy successor of an unsigned genesis can lose governing status
291
+ on replay. Revision 8 requires the revision's acceptance
292
+ quorum, the applicable predecessor quorum, and any required assignment
293
+ assent. Closure requires a termination quorum for the same governing
294
+ revision, reason, and effective instant. See the [core specification](https://github.com/baselabs/charter_agreement_protocol/blob/55cd0662d7fa5d3a4cf7633180ea1fdd08409e28/spec/core.md).
295
+ The browser bench can inspect a receipt with its retained artifact set and
296
+ optional grant digest. Its download contains the same JSON evidence that
297
+ `inspectReceipt` returns. The signed segments reconstruct the receipt
298
+ exactly when joined with periods.
299
+
300
+ Node and the browser bundle run all 931 cases. The browser uses the corpus's
301
+ explicit capability-limited outcomes for ML-DSA verification.
302
+ `npm run check:reference` fetches the exact Elixir source commit from
303
+ `reference.json`, compares all vendored files to its Git blobs, and checks
304
+ that the released cases are retained.
305
+ `npm run check:reference -- --report` compares their exact report rows;
306
+ it requires Elixir 1.19/1.20 on OTP 28/29 linked to OpenSSL 3.5 or newer.
230
307
 
231
308
  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:
309
+ The lockfile records TypeScript 7 and the current Node declarations. Qualification
310
+ runs these commands on GitHub-hosted runners:
233
311
 
234
312
  ```console
235
313
  npm ci
@@ -238,24 +316,92 @@ npm run check
238
316
 
239
317
  `check` runs strict library and browser typechecks, the full native/browser and
240
318
  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
319
+ released-corpus check, and the packed-consumer documentation/declaration checks.
320
+ CI covers the exact Node in `.tool-versions` and the Node 24.8.0 compatibility
321
+ floor; both lanes require the exact Bun pin for its real substrate behavior.
322
+ The reference job also installs the exact Erlang/OTP and Elixir pins from that
323
+ file. Every runtime is checked after installation. `npm run check:package` proves package
244
324
  contents and reproducible bytes, executes this quickstart and the installed CLI,
245
325
  and writes the verified tarball to `artifacts/package.tgz`.
246
326
 
247
- ## Release staging
327
+ ## Releases
328
+
329
+ The maintainers' release process runs covering checks on the build box where
330
+ configured, never on a workstation. This public repository has no build-box
331
+ checkout: its qualification runs on pinned GitHub-hosted runners at landing.
332
+ Prepare the version commit with matching `package.json` and `package-lock.json`
333
+ versions, stamp the changelog, and update the documented release and site badge.
334
+ Land the full commit through the maintainers' landing tool; it qualifies the commit
335
+ on `kci/**` before moving the default branch. Do not push the default branch or
336
+ version tags directly.
337
+
338
+ Send the release operator one message with the repository, full commit, version, what goes out,
339
+ and the green `qualified` run. The release operator obtains owner approval and dispatches
340
+ [publish.yml](https://github.com/baselabs/charter_agreement_protocol_typescript/blob/main/.github/workflows/publish.yml)
341
+ from the default branch with the full qualified SHA as `release_commit`.
342
+ The first job checks default-branch history, the successful `qualified` check and
343
+ the absence of a version tag before checkout. The build uses that commit and the
344
+ registry script comes from the workflow revision. The build refuses a package
345
+ name the registry lacks, a deprecated or unpublished version, and served bytes
346
+ that differ from the inspected archive. A first publication is the owner's
347
+ decision. The build produces the library and documentation site and inspects
348
+ the archive. The protected upload job verifies the archive checksum and stages
349
+ missing bytes with
350
+ `npm stage publish --provenance` through OIDC. No stored npm token is used.
351
+ The package becomes public only after the owner approves the staged release
352
+ on npmjs.com with 2FA.
353
+
354
+ A held release is finished by dispatching `publish.yml` again with the same
355
+ `release_commit` after approval. It stages only what is missing, skips an identical
356
+ served version, and refuses differing bytes or a retired version. npm's OIDC
357
+ credentials cannot read pending staged versions: a dispatch while approval
358
+ is still pending may attempt to stage again, which npm refuses without
359
+ replacing the staged version. Approve the pending stage before dispatching
360
+ again.
361
+
362
+ Read-back downloads the npm tarball and compares its bytes with the inspected
363
+ archive. After it verifies the signed release commit, the workflow exports
364
+ `charter-agreement-protocol-verifier-<version>.tgz`, the site docs archive and `SHA256SUMS`. The docs archive
365
+ contains root `index.html` and `release.json`. The release operator compares the
366
+ tarball with npm's bytes and tags the commit named by `release.json`.
367
+ For a paired release, publish and verify the verifier first.
368
+
369
+ ### Release source attestation
370
+
371
+ npm provenance identifies the default-branch workflow revision. The release
372
+ workflow also signs a predicate containing the qualified `release_commit` over
373
+ the checked tarball's digest. Read-back checks that predicate against the
374
+ tarball downloaded from npm.
375
+
376
+ To verify a release, download the archives and `SHA256SUMS` from the matching
377
+ [`v<version>` GitHub release](https://github.com/baselabs/charter_agreement_protocol_typescript/releases) and run
378
+ `sha256sum --check SHA256SUMS` in their directory. Compare the tarball's SHA-512
379
+ with npm's `dist.integrity`, then verify its release source against the tag.
380
+
381
+ ```sh
382
+ published_commit=$(gh api "repos/baselabs/charter_agreement_protocol_typescript/commits/v<version>" -q .sha)
383
+ gh attestation verify "charter-agreement-protocol-verifier-<version>.tgz" \
384
+ --repo baselabs/charter_agreement_protocol_typescript \
385
+ --signer-workflow baselabs/charter_agreement_protocol_typescript/.github/workflows/publish.yml \
386
+ --source-ref refs/heads/main \
387
+ --predicate-type 'https://github.com/baselabs/charter_agreement_protocol_typescript/blob/main/README.md#release-source-attestation' \
388
+ --format json |
389
+ jq -e --arg commit "$published_commit" \
390
+ 'any(.[]; .verificationResult.statement.predicate.release_commit == $commit)'
391
+ ```
392
+
393
+ Site typechecking and building are required by `qualified`. The release operator dispatches
394
+ [pages.yml](https://github.com/baselabs/charter_agreement_protocol_typescript/blob/main/.github/workflows/pages.yml)
395
+ from the default branch to build and deploy the static site through GitHub's
396
+ `github-pages` environment. A default-branch push or version tag starts neither workflow.
397
+
398
+ ## Contributing
248
399
 
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.
400
+ Contributions are licensed under Apache-2.0, as section 5 of the license describes, and
401
+ every commit carries a Developer Certificate of Origin sign-off (`git commit -s`). See
402
+ IPR.md.
257
403
 
258
404
  ## License
259
405
 
260
- Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE). © The Charter
261
- Agreement Protocol authors.
406
+ Apache-2.0, maintained by BaseLabs Holdings LLC. See LICENSE and NOTICE, and
407
+ IPR.md for contributions.
package/SECURITY.md CHANGED
@@ -4,9 +4,8 @@
4
4
 
5
5
  | Version | Security fixes |
6
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 |
7
+ | 2.x | supported |
8
+ | Earlier releases | upgrade to 2.x |
10
9
 
11
10
  The [changelog](CHANGELOG.md) describes verification changes between releases.
12
11
  Keep the package version with stored verification results so you can check
@@ -49,6 +48,8 @@ In scope: everything shipped in the npm package
49
48
 
50
49
  - Decoding, canonicalization, digests, signature checks, descriptor, chain,
51
50
  acceptance, termination and receipt verification, and the facts they return.
51
+ - Descriptor signer-scope matching, including predecessor continuity and
52
+ whether verified votes count toward an assignment or quorum.
52
53
  - Signing input helpers, compact assembly, `prepareSigning` and `finishSigning`.
53
54
  The caller supplies the context, time, limits, public key and signature.
54
55
  - The corpus loader and CLI, including filesystem checks. They cap a corpus