@typedstandards/verify-core 0.8.1 → 0.9.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 +26 -0
- package/README.md +11 -3
- package/dist/blob-ref.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lifecycle.js +1 -1
- package/dist/verify.d.ts +17 -2
- package/dist/verify.js +23 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,32 @@ references are to `npstorey/civic-ai-tools-website` (#119 is the offline-crypto
|
|
|
6
6
|
hardening arc; #116 is the standalone-verifier arc this package was extracted
|
|
7
7
|
in).
|
|
8
8
|
|
|
9
|
+
## 0.9.0 — 2026-08-19
|
|
10
|
+
|
|
11
|
+
Vocabulary settlement (spec v0.1.5 Appendix J; registry Q50/Q66, ADR-0025,
|
|
12
|
+
anchored at `civic-ai-tools#160`). "Evidence" is retired from the artifact and
|
|
13
|
+
infrastructure brand role and retained only for the epistemic
|
|
14
|
+
Question/Evidence/Claim role. **A minor bump** — a new export, no removals, no
|
|
15
|
+
behavior change.
|
|
16
|
+
|
|
17
|
+
- **`verifyRecord` is the canonical §9.2 entry point.** `verifyEvidence` remains
|
|
18
|
+
exported as a **deprecated alias**, and it is the same function object
|
|
19
|
+
(`verifyEvidence === verifyRecord`), not a wrapper — every existing caller
|
|
20
|
+
keeps working unchanged and gets byte-identical results. The alias is removed
|
|
21
|
+
no earlier than the next MAJOR version. Migration class `alias-and-deprecate`
|
|
22
|
+
(Appendix J).
|
|
23
|
+
- Package `description` and one `keywords` entry now say "record packages"
|
|
24
|
+
rather than "evidence packages"; the README's usage example imports
|
|
25
|
+
`verifyRecord` and states the alias explicitly. Present-tense references to
|
|
26
|
+
the entry point in published JSDoc (`VerifyInput`, `lifecycle.ts`) name
|
|
27
|
+
`verifyRecord`; past-tense historical narration of what the function did at
|
|
28
|
+
earlier versions is left as written, since it remains accurate.
|
|
29
|
+
- New regression guard in `package-exports.test.ts`: both names must resolve
|
|
30
|
+
and must be the same function object, so the alias cannot silently become a
|
|
31
|
+
second implementation or disappear.
|
|
32
|
+
- No wire, algorithm, check-depth, or result-shape change. Already-signed
|
|
33
|
+
packages are byte-identical and verify exactly as before.
|
|
34
|
+
|
|
9
35
|
## 0.8.1 — 2026-08-17
|
|
10
36
|
|
|
11
37
|
- Removed the `prepare` (install-time build) script (typedstandards#39).
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @typedstandards/verify-core
|
|
2
2
|
|
|
3
|
-
The portable, **browser-safe** verification core for [Typed Standards][ts]
|
|
3
|
+
The portable, **browser-safe** verification core for [Typed Standards][ts] record
|
|
4
4
|
packages — the spec §9.2 check suite, factored so it runs **identically** on a
|
|
5
5
|
server (e.g. civicaitools.org's verify route) and in the browser (the
|
|
6
6
|
typedstandards.org client-side verifier). One implementation, so a tampered
|
|
@@ -45,7 +45,7 @@ edge, and in Node.
|
|
|
45
45
|
## Usage
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
|
-
import {
|
|
48
|
+
import { verifyRecord, type VerifyInput, type TrustRegistry } from '@typedstandards/verify-core';
|
|
49
49
|
|
|
50
50
|
const input: VerifyInput = {
|
|
51
51
|
package: pkg, // the parsed package JSON
|
|
@@ -56,7 +56,7 @@ const input: VerifyInput = {
|
|
|
56
56
|
lifecycle, // optional sidecar lifecycle state
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const result = await
|
|
59
|
+
const result = await verifyRecord(input, {
|
|
60
60
|
registry, // a TrustRegistry (fetched from the package's trustRegistryUrl)
|
|
61
61
|
fetch: globalThis.fetch,
|
|
62
62
|
});
|
|
@@ -64,6 +64,14 @@ const result = await verifyEvidence(input, {
|
|
|
64
64
|
// contentHash, typeResolution, signerIdentity, lifecycle, ...
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
> **`verifyEvidence` is the same function.** The 2026-08-19 vocabulary settlement
|
|
68
|
+
> renamed the entry point to `verifyRecord` (spec Appendix J) — "evidence" is
|
|
69
|
+
> retired from the artifact/infrastructure brand role and kept only for the
|
|
70
|
+
> epistemic Question/Evidence/Claim role. `verifyEvidence` is still exported as a
|
|
71
|
+
> **deprecated alias of this exact function object**, so existing code keeps
|
|
72
|
+
> working unchanged and returns identical results. The alias is removed no
|
|
73
|
+
> earlier than the next MAJOR version; new code should use `verifyRecord`.
|
|
74
|
+
|
|
67
75
|
The barrel (`.`) also exports the individual check functions
|
|
68
76
|
(`recomputePackageHash`, `verifySignature`, `verifyKeyTrust`, `verifyContentHash`,
|
|
69
77
|
…), the canonicalization primitives (`computeEnvelopeHash`,
|
package/dist/blob-ref.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Content-addressable blob references for
|
|
1
|
+
// Content-addressable blob references for record package fields (spec §9.2
|
|
2
2
|
// check #9) — browser-safe.
|
|
3
3
|
//
|
|
4
4
|
// Large fields (full output text, trace JSON, composed skill guidance) can be
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @typedstandards/verify-core (in-repo) — the portable, browser-safe
|
|
1
|
+
// @typedstandards/verify-core (in-repo) — the portable, browser-safe record
|
|
2
2
|
// verification core (civic-ai-tools-website#116 WS2).
|
|
3
3
|
//
|
|
4
4
|
// Pure functions over provided data: no `node:crypto` / `fs` / `path` / `process`
|
package/dist/lifecycle.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// verification logic (factored from the server `verify.ts`). The DB + blob fetch
|
|
12
12
|
// orchestration that assembles the chain stays in the server `lifecycle.ts`,
|
|
13
13
|
// which imports these. WS2's portable orchestrator (`verify.ts` →
|
|
14
|
-
// `
|
|
14
|
+
// `verifyRecord`) consumes lifecycle at STATE depth (the sidecar's
|
|
15
15
|
// status/withdrawnAt/reason) rather than re-running the chain — verifying the
|
|
16
16
|
// signed attestation chain independently in the browser is civic-ai-tools-website#119.
|
|
17
17
|
import { computeEnvelopeHash } from "./canonicalization.js";
|
package/dist/verify.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface CommitmentLifecycleState {
|
|
|
48
48
|
reinstatedReason?: string;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Everything `
|
|
51
|
+
* Everything `verifyRecord` needs, aligned to the WS1 commitment sidecar +
|
|
52
52
|
* the package JSON the sidecar's `packageUrl` resolves to.
|
|
53
53
|
*/
|
|
54
54
|
export interface VerifyInput {
|
|
@@ -150,5 +150,20 @@ export interface VerifyResult {
|
|
|
150
150
|
* Run the §9.2 check suite. The step order mirrors the server route exactly
|
|
151
151
|
* (notably: Rekor before key-trust, because a deprecated-key trust decision is
|
|
152
152
|
* time-bounded by the Rekor `integratedTime`).
|
|
153
|
+
*
|
|
154
|
+
* Named `verifyEvidence` before the 2026-08-19 vocabulary settlement; that
|
|
155
|
+
* name remains exported as a deprecated alias of this exact function.
|
|
153
156
|
*/
|
|
154
|
-
export declare function
|
|
157
|
+
export declare function verifyRecord(input: VerifyInput, deps: VerifyDeps): Promise<VerifyResult>;
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated Renamed to {@link verifyRecord} in the 2026-08-19 vocabulary
|
|
160
|
+
* settlement — "evidence" is retired from the artifact/infrastructure brand
|
|
161
|
+
* role and retained only for the epistemic Question/Evidence/Claim role (spec
|
|
162
|
+
* §6.3, Appendix J; migration class `alias-and-deprecate`).
|
|
163
|
+
*
|
|
164
|
+
* This is the SAME function object, not a wrapper: `verifyEvidence ===
|
|
165
|
+
* verifyRecord`. Existing callers keep working unchanged and get identical
|
|
166
|
+
* results; the alias is removed no earlier than this package's next MAJOR
|
|
167
|
+
* version. New code should import `verifyRecord`.
|
|
168
|
+
*/
|
|
169
|
+
export declare const verifyEvidence: typeof verifyRecord;
|
package/dist/verify.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Portable verification orchestrator (spec §9.2) — browser-safe.
|
|
2
2
|
//
|
|
3
|
-
// `
|
|
3
|
+
// `verifyRecord` runs the §9.2 check suite over an already-resolved package +
|
|
4
4
|
// its proofs, returning one structured verdict. It is the SINGLE orchestration
|
|
5
5
|
// both consumers run: the civicaitools.org server route (which injects its
|
|
6
6
|
// `fetch`, its loaded trust registry, and — to preserve its current output — its
|
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
// test pins this.
|
|
12
12
|
//
|
|
13
13
|
// `VerifyInput` is shaped to align field-for-field with the WS1 commitment
|
|
14
|
-
// sidecar (`buildCommitmentView`) so WS3 can wire sidecar →
|
|
14
|
+
// sidecar (`buildCommitmentView`) so WS3 can wire sidecar → verifyRecord with
|
|
15
15
|
// no glue. The server route adapts its DB row to the same shape.
|
|
16
16
|
//
|
|
17
|
+
// The entry point was named `verifyEvidence` before the 2026-08-19 vocabulary
|
|
18
|
+
// settlement (spec Appendix J, migration class `alias-and-deprecate`). That
|
|
19
|
+
// name is still exported, still the same function object, and still works;
|
|
20
|
+
// see the deprecated alias at the bottom of this file.
|
|
21
|
+
//
|
|
17
22
|
// Check depth: fully client-side for #1/#2/#3/#4/#5/#6/#9/#12/#13/#14/#15; #7 (RFC
|
|
18
23
|
// 3161) is PRESENCE (`hasTimestamp`) AND, when a token is present, cryptographic TSA
|
|
19
24
|
// verification against the pinned FreeTSA anchor (civic-ai-tools-website#119 P2a —
|
|
@@ -35,8 +40,11 @@ import { resolveLifecycleFromLegacyColumns, } from "./lifecycle.js";
|
|
|
35
40
|
* Run the §9.2 check suite. The step order mirrors the server route exactly
|
|
36
41
|
* (notably: Rekor before key-trust, because a deprecated-key trust decision is
|
|
37
42
|
* time-bounded by the Rekor `integratedTime`).
|
|
43
|
+
*
|
|
44
|
+
* Named `verifyEvidence` before the 2026-08-19 vocabulary settlement; that
|
|
45
|
+
* name remains exported as a deprecated alias of this exact function.
|
|
38
46
|
*/
|
|
39
|
-
export async function
|
|
47
|
+
export async function verifyRecord(input, deps) {
|
|
40
48
|
const { package: pkg, packageHash } = input;
|
|
41
49
|
// Step 1 — recompute the envelope hash (checks #1 + #13). Tri-state: a present
|
|
42
50
|
// package recomputes to `verified` / `altered`; a null package is `unavailable`
|
|
@@ -180,3 +188,15 @@ export async function verifyEvidence(input, deps) {
|
|
|
180
188
|
lifecycle,
|
|
181
189
|
};
|
|
182
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated Renamed to {@link verifyRecord} in the 2026-08-19 vocabulary
|
|
193
|
+
* settlement — "evidence" is retired from the artifact/infrastructure brand
|
|
194
|
+
* role and retained only for the epistemic Question/Evidence/Claim role (spec
|
|
195
|
+
* §6.3, Appendix J; migration class `alias-and-deprecate`).
|
|
196
|
+
*
|
|
197
|
+
* This is the SAME function object, not a wrapper: `verifyEvidence ===
|
|
198
|
+
* verifyRecord`. Existing callers keep working unchanged and get identical
|
|
199
|
+
* results; the alias is removed no earlier than this package's next MAJOR
|
|
200
|
+
* version. New code should import `verifyRecord`.
|
|
201
|
+
*/
|
|
202
|
+
export const verifyEvidence = verifyRecord;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typedstandards/verify-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Portable, browser-safe verification core for Typed Standards
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Portable, browser-safe verification core for Typed Standards record packages — the §9.2 check suite, single-sourced so it verifies identically on a server and in the browser.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nathan Storey",
|
|
7
7
|
"type": "module",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"typed-standards",
|
|
58
|
-
"
|
|
58
|
+
"record-package",
|
|
59
59
|
"verification",
|
|
60
60
|
"provenance",
|
|
61
61
|
"ed25519",
|