@charter-agreement-protocol/signer 0.2.1 → 0.2.2
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 +16 -0
- package/README.md +52 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable public changes to `@charter-agreement-protocol/signer` are
|
|
4
4
|
documented here.
|
|
5
5
|
|
|
6
|
+
## [0.2.2] — October 6, 2026
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- Update the build compiler from TypeScript 5.9.3 to 7.0.2 (`^7.0.2`),
|
|
11
|
+
removing the `~5.9.0` pin; update `@types/node` to 26.6.4 (`^26.6.4`).
|
|
12
|
+
- Reconcile README and workshop documentation with verifier 0.5.0 and signer
|
|
13
|
+
0.2.2. Make the Node quickstart executable, document development and trusted
|
|
14
|
+
publisher staging, and clarify the workshop's chain/receipt verification,
|
|
15
|
+
artifact kinds, refusal ordering, and Node-only ML-DSA support.
|
|
16
|
+
- Observed on October 6, 2026: `npm ci`, `typecheck`, all 18 tests, `build`,
|
|
17
|
+
`typecheck:web`, `build:site`, and `npm pack --dry-run` pass.
|
|
18
|
+
`diff -ru` against the TypeScript 5.9.3 baseline reports no differences:
|
|
19
|
+
all four emitted JavaScript and declaration files are byte-identical.
|
|
20
|
+
`npm outdated --json` returns `{}`.
|
|
21
|
+
|
|
6
22
|
## [0.2.1] — 2026-09-24
|
|
7
23
|
|
|
8
24
|
Dependency-line release: this package now tracks the published verify
|
package/README.md
CHANGED
|
@@ -23,13 +23,18 @@ verification of the assembled artifact through the
|
|
|
23
23
|
npm install @charter-agreement-protocol/signer
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Release **0.2.2** requires Node >= 24.8.0 (ML-DSA support in the Node builtins)
|
|
27
|
+
and depends on `@charter-agreement-protocol/verifier` `^0.5.0`.
|
|
27
28
|
|
|
28
29
|
## Quickstart
|
|
29
30
|
|
|
31
|
+
This runnable Ed25519 example keeps the private key in a Node `KeyObject`.
|
|
32
|
+
For an HSM, OS keychain, or remote key server, replace the handle's callbacks
|
|
33
|
+
with your custodian's key identity and signing operations.
|
|
34
|
+
|
|
30
35
|
```js
|
|
31
36
|
import { signDescriptor } from "@charter-agreement-protocol/signer";
|
|
32
|
-
import { generateKeyPairSync } from "node:crypto";
|
|
37
|
+
import { generateKeyPairSync, sign as nodeSign } from "node:crypto";
|
|
33
38
|
|
|
34
39
|
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
|
|
35
40
|
const publicKeyBase64url = publicKey.export({ type: "spki", format: "der" }).subarray(-32).toString("base64url");
|
|
@@ -41,7 +46,7 @@ const handle = {
|
|
|
41
46
|
},
|
|
42
47
|
// The holder's job: sign the exact message bytes with the held key.
|
|
43
48
|
sign(message) {
|
|
44
|
-
return
|
|
49
|
+
return nodeSign(null, message, privateKey); // Buffer is a Uint8Array
|
|
45
50
|
},
|
|
46
51
|
};
|
|
47
52
|
|
|
@@ -54,12 +59,13 @@ const result = await signDescriptor(
|
|
|
54
59
|
],
|
|
55
60
|
attestation_hints: [],
|
|
56
61
|
extensions: { critical: {}, optional: {} },
|
|
57
|
-
effective_from:
|
|
62
|
+
effective_from: new Date().toISOString(),
|
|
58
63
|
},
|
|
59
64
|
handle,
|
|
60
65
|
);
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
if (!result.ok) throw new Error(JSON.stringify(result));
|
|
68
|
+
console.log(result.result.descriptor); // Post-verified compact JWS
|
|
63
69
|
```
|
|
64
70
|
|
|
65
71
|
For ML-DSA-65 artifacts pass `{ algorithm: "ML-DSA-65" }` as the options
|
|
@@ -109,16 +115,18 @@ TypeScript-signed artifacts from raw bytes).
|
|
|
109
115
|
— verification and the pure producer surface (signing inputs, claims
|
|
110
116
|
gate, refusal guards, assembly) that this package signs through.
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
against the published version
|
|
118
|
+
This signer depends on the verifier (`^0.5.0`, locked to 0.5.0). When changing
|
|
119
|
+
that dependency, publish the verifier version first, then lock and release
|
|
120
|
+
the signer against the published version. The packages have independent
|
|
121
|
+
SemVer versions; signer documentation and build-tool updates can release
|
|
122
|
+
without a verifier version change.
|
|
115
123
|
|
|
116
124
|
## Evidence
|
|
117
125
|
|
|
118
126
|
- The Elixir reference repository's gate verifies TypeScript-signed
|
|
119
127
|
artifacts from raw bytes (cross-implementation agreement, enforced in CI).
|
|
120
128
|
- Framing, the producer claims gate, refusal guards, and assembly are the
|
|
121
|
-
verifier package's producer surface (0.
|
|
129
|
+
verifier package's producer surface (0.5.0) — the same single
|
|
122
130
|
implementation the independent verifier certifies. What remains here is
|
|
123
131
|
custody plus input policing: the issuing-view discipline composes the
|
|
124
132
|
verifier's own `verifyChain`, never a local reimplementation.
|
|
@@ -145,6 +153,41 @@ requires `chain`, `signAcceptance` now enforces the refusal guards over the
|
|
|
145
153
|
at or above 1.0 a package major is owed when a shipped public API is removed
|
|
146
154
|
or changes behavior.
|
|
147
155
|
|
|
156
|
+
## Development
|
|
157
|
+
|
|
158
|
+
Use Node 24 (at least 24.8.0) and npm. The lockfile selects TypeScript 7.0.2
|
|
159
|
+
and `@types/node` 26.6.4. CI runs on Linux with Node 24 and a frozen install;
|
|
160
|
+
the same npm commands are used for local development on macOS and Linux.
|
|
161
|
+
|
|
162
|
+
```console
|
|
163
|
+
npm ci
|
|
164
|
+
npm run typecheck
|
|
165
|
+
npm test
|
|
166
|
+
npm run build
|
|
167
|
+
npm run typecheck:web
|
|
168
|
+
npm run build:site
|
|
169
|
+
npm pack --dry-run
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
`build` emits JavaScript and declarations into `dist/`; `build:site` writes
|
|
173
|
+
the browser workshop to `site-dist/`. `prepack` runs the library build.
|
|
174
|
+
For the TypeScript 7 upgrade, the four library output files were byte-identical
|
|
175
|
+
to the TypeScript 5.9.3 build (observed October 6, 2026 with `diff -ru`).
|
|
176
|
+
|
|
177
|
+
## Release staging
|
|
178
|
+
|
|
179
|
+
The [Release workflow](https://github.com/baselabs/charter_agreement_signer_typescript/blob/main/.github/workflows/release.yml) is the npm trusted
|
|
180
|
+
publisher for this repository. Prepare a release by updating `package.json`,
|
|
181
|
+
`package-lock.json`, this README's release version, the CHANGELOG, and the
|
|
182
|
+
workshop's version badge. Run the development checks above, commit and push
|
|
183
|
+
main, and wait for CI to pass. Then tag that same commit `v<package-version>`
|
|
184
|
+
and push that specific tag.
|
|
185
|
+
|
|
186
|
+
The tag triggers verification and `npm stage publish --provenance` through
|
|
187
|
+
GitHub Actions OIDC. A successful staging step prints the package version and
|
|
188
|
+
stage ID. The package becomes public only after the owner approves the staged
|
|
189
|
+
release on npmjs.com with 2FA. Keep npm staging in this workflow.
|
|
190
|
+
|
|
148
191
|
## License
|
|
149
192
|
|
|
150
193
|
Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charter-agreement-protocol/signer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Holder-side companion signer for the Charter Agreement Protocol (CAP) in TypeScript - key custody only: an atomic key snapshot, the sign callback, the wrong-key guard, and post-sign verification, with framing, the claims gate, the R1-R3 honest-signer refusals, and assembly all delegated to the @charter-agreement-protocol/verifier producer surface. CAP verifies; it never authorizes; this signer signs, it never verifies third-party artifacts or takes custody.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@noble/ed25519": "^3.2.0",
|
|
39
39
|
"@noble/hashes": "^2.4.0",
|
|
40
|
-
"@types/node": "^26.
|
|
40
|
+
"@types/node": "^26.6.4",
|
|
41
41
|
"buffer": "^6.0.3",
|
|
42
42
|
"esbuild": "^0.28.2",
|
|
43
|
-
"typescript": "
|
|
43
|
+
"typescript": "^7.0.2"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|