@typedstandards/verify-core 0.8.0 → 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 CHANGED
@@ -6,6 +6,76 @@ 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
+
35
+ ## 0.8.1 — 2026-08-17
36
+
37
+ - Removed the `prepare` (install-time build) script (typedstandards#39).
38
+ A fresh `npm ci` at the monorepo root previously failed in workspace
39
+ `prepare` ordering (produce-core's tsc ran before this package's dist
40
+ existed), and npm 10.x runs workspace `prepare` even under
41
+ `--ignore-scripts`. Builds are now explicit (`npm run build:verify-core`,
42
+ then `npm run build`; CI does the same). Published tarballs are unchanged —
43
+ `prepublishOnly` still builds at publish — but installing this package from
44
+ git no longer auto-builds `dist`.
45
+ - Docs only, no behavior change: removed reference-deployment framing from
46
+ published JSDoc/README (typedstandards#44 P3, findings B10/B11). Four
47
+ sites — `verifyBlobRef`'s JSDoc, the exported `FetchLike` type's JSDoc, the
48
+ README's Fetch note, and `trust-registry.ts` — no longer treat
49
+ civicaitools.org as the rule's rationale or "the platform" as the sole
50
+ publisher. The plain-GET/no-custom-headers requirement now derives from
51
+ CORS behavior itself (a custom header triggers a preflight, rejectable at
52
+ a redirecting host), with the reference redirect kept as a named example;
53
+ `trust-registry.ts`'s header states its actual contract (pure, registry
54
+ passed in, loading is the caller's job) instead of pointing at an unshipped
55
+ server file; each publisher is understood to have its own registry, named
56
+ by `trustRegistryUrl`. No exported type, signature, or runtime behavior
57
+ changed — most consumer-visible via `FetchLike`'s JSDoc in the published
58
+ `.d.ts`.
59
+ - Docs correction, no behavior change: scopes the plain-GET/CORS claim above
60
+ by execution environment (typedstandards#44 P4). The unscoped version was
61
+ disproved during a live browser session: a cross-origin redirect response
62
+ must itself carry CORS headers, or a browser's fetch fails regardless of
63
+ how simple the triggering request was — a plain GET only avoids the
64
+ *preflight* rejection, it does not make a redirect chain transparent in a
65
+ browser. The claim had been verified only from Node/curl, where that
66
+ constraint does not exist, then stated unconditionally. Now scoped: a
67
+ plain GET avoids the preflight failure mode (kept, unchanged); a browser
68
+ additionally needs the redirect response itself to carry CORS headers
69
+ (the missing half, now stated); server-side/Node fetches follow redirects
70
+ without that constraint (why the unscoped claim read true when written).
71
+ Same three verify-core sites P3 touched for this class — `verifyBlobRef`'s
72
+ JSDoc (`blob-ref.ts`), the exported `FetchLike` type's JSDoc (`types.ts`),
73
+ and the README's Fetch note — plus the equivalent explanation and its
74
+ cross-reference in typedstandards.org's client-side verify flow
75
+ (`apps/web`, outside this published package). No exported type, signature,
76
+ or runtime behavior changed — consumer-visible via `FetchLike`'s JSDoc in
77
+ the published `.d.ts` and the README.
78
+
9
79
  ## 0.8.0 — 2026-08-01
10
80
 
11
81
  - New export: `ED25519_SPKI_PREFIX` (`signature.ts`) — the fixed 12-byte
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] evidence
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
@@ -34,14 +34,18 @@ edge, and in Node.
34
34
  injects its `fetch`, the browser injects `window.fetch`, tests inject a stub.
35
35
 
36
36
  > **Fetch note.** A `FetchLike` should issue **plain GETs with no custom request
37
- > headers**. A custom header triggers a CORS preflight, and a preflight `OPTIONS`
38
- > hitting civicaitools.org's site-wide 307 to its canonical host can be rejected.
39
- > A simple GET follows the 307 transparently.
37
+ > headers**. A custom header makes the request non-simple and triggers a CORS
38
+ > preflight; a preflight `OPTIONS` against a host that redirects can be rejected
39
+ > there, so a plain GET avoids that failure mode — e.g. civicaitools.org's
40
+ > site-wide 307 to its canonical host. That's necessary but not sufficient in a
41
+ > browser, though: a cross-origin redirect response must itself carry CORS
42
+ > headers, or the fetch fails regardless of the request's simplicity.
43
+ > Server-side/Node fetches follow redirects without that constraint.
40
44
 
41
45
  ## Usage
42
46
 
43
47
  ```ts
44
- import { verifyEvidence, type VerifyInput, type TrustRegistry } from '@typedstandards/verify-core';
48
+ import { verifyRecord, type VerifyInput, type TrustRegistry } from '@typedstandards/verify-core';
45
49
 
46
50
  const input: VerifyInput = {
47
51
  package: pkg, // the parsed package JSON
@@ -52,7 +56,7 @@ const input: VerifyInput = {
52
56
  lifecycle, // optional sidecar lifecycle state
53
57
  };
54
58
 
55
- const result = await verifyEvidence(input, {
59
+ const result = await verifyRecord(input, {
56
60
  registry, // a TrustRegistry (fetched from the package's trustRegistryUrl)
57
61
  fetch: globalThis.fetch,
58
62
  });
@@ -60,6 +64,14 @@ const result = await verifyEvidence(input, {
60
64
  // contentHash, typeResolution, signerIdentity, lifecycle, ...
61
65
  ```
62
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
+
63
75
  The barrel (`.`) also exports the individual check functions
64
76
  (`recomputePackageHash`, `verifySignature`, `verifyKeyTrust`, `verifyContentHash`,
65
77
  …), the canonicalization primitives (`computeEnvelopeHash`,
@@ -43,9 +43,15 @@ export interface BlobFetchOptions {
43
43
  * Fetch a blob and verify that its SHA-256 matches the reference hash and that
44
44
  * its byte size matches the metadata. Returns a structured result; never throws.
45
45
  *
46
- * Fetches over HTTPS without auth (Vercel Blob public access is the storage
47
- * default for evidence content). A plain GET with no custom headers, so it
48
- * follows civicaitools.org's canonical-host 307 without a CORS preflight.
46
+ * Fetches over HTTPS with no auth and no custom request headers — evidence
47
+ * content is expected to be publicly readable, and a custom header would make
48
+ * the request non-simple, triggering a CORS preflight. A preflight `OPTIONS`
49
+ * against a host that redirects can be rejected there, so a plain GET avoids
50
+ * that failure mode — e.g. civicaitools.org's canonical-host 307. That's
51
+ * necessary but not sufficient in a browser, though: a cross-origin redirect
52
+ * response must itself carry CORS headers, or the fetch fails regardless of
53
+ * the request's simplicity. Server-side/Node fetches follow redirects
54
+ * without that constraint.
49
55
  */
50
56
  export declare function verifyBlobRef(ref: BlobRef, options?: BlobFetchOptions): Promise<BlobRefVerifyResult>;
51
57
  /**
package/dist/blob-ref.js CHANGED
@@ -1,4 +1,4 @@
1
- // Content-addressable blob references for evidence package fields (spec §9.2
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
@@ -56,9 +56,15 @@ function resolveFetch(options) {
56
56
  * Fetch a blob and verify that its SHA-256 matches the reference hash and that
57
57
  * its byte size matches the metadata. Returns a structured result; never throws.
58
58
  *
59
- * Fetches over HTTPS without auth (Vercel Blob public access is the storage
60
- * default for evidence content). A plain GET with no custom headers, so it
61
- * follows civicaitools.org's canonical-host 307 without a CORS preflight.
59
+ * Fetches over HTTPS with no auth and no custom request headers — evidence
60
+ * content is expected to be publicly readable, and a custom header would make
61
+ * the request non-simple, triggering a CORS preflight. A preflight `OPTIONS`
62
+ * against a host that redirects can be rejected there, so a plain GET avoids
63
+ * that failure mode — e.g. civicaitools.org's canonical-host 307. That's
64
+ * necessary but not sufficient in a browser, though: a cross-origin redirect
65
+ * response must itself carry CORS headers, or the fetch fails regardless of
66
+ * the request's simplicity. Server-side/Node fetches follow redirects
67
+ * without that constraint.
62
68
  */
63
69
  export async function verifyBlobRef(ref, options = {}) {
64
70
  let parsed;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // @typedstandards/verify-core (in-repo) — the portable, browser-safe evidence
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
- // `verifyEvidence`) consumes lifecycle at STATE depth (the sidecar's
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";
@@ -40,8 +40,8 @@ export interface KeyTrustResult {
40
40
  */
41
41
  export declare function legacyEmbeddedKeyTrust(): KeyTrustResult;
42
42
  /**
43
- * Verify that a `(kid, publicKey)` pair is trusted by the platform registry,
44
- * applying the rotation semantics documented in the P5 plan:
43
+ * Verify that a `(kid, publicKey)` pair is trusted by the registry, applying
44
+ * the rotation semantics documented in the P5 plan:
45
45
  * - `active` → trusted.
46
46
  * - `deprecated` → trusted only when `packageIntegratedTime` precedes
47
47
  * `deprecatedAt` (preventive rotation — pre-deprecation signatures remain
@@ -1,16 +1,19 @@
1
1
  // Trust registry types + key-trust evaluation (spec §8.3.3, §9.2 check #5) —
2
2
  // browser-safe.
3
3
  //
4
- // The platform publishes its authorized signing keys at a `/.well-known/*`
5
- // registry. Verification treats it as the source of truth for which
6
- // `(kid, publicKey)` pairs are allowed and their rotation state: keys absent or
7
- // revoked fail verification regardless of cryptographic correctness — a locally
8
- // valid signature from an unrecognised key is still not "trusted evidence".
4
+ // Each publisher publishes its own authorized signing keys at a
5
+ // `/.well-known/*` registry, named by the package's declared
6
+ // `trustRegistryUrl`. Verification treats the resolved registry as the source
7
+ // of truth for which `(kid, publicKey)` pairs are allowed and their rotation
8
+ // state: keys absent or revoked fail verification regardless of cryptographic
9
+ // correctness — a locally valid signature from an unrecognised key is still
10
+ // not "trusted evidence".
9
11
  //
10
- // These functions are pure (registry passed IN as data). The server `verify.ts`
11
- // keeps the registry LOADER (build-time embedded import + fs + fetch fallback,
12
- // all server-only); WS3's browser client fetches the registry from the sidecar's
13
- // `trustRegistryUrl`. Both then hand the parsed registry to `verifyKeyTrust`.
12
+ // These functions are pure: the registry is passed IN as already-parsed data.
13
+ // Loading it — however a caller chooses to (a build-time embed, a filesystem
14
+ // read, a network fetch, or some mix) — is entirely the caller's job; this
15
+ // module has no opinion on how a registry was obtained, only on what it means
16
+ // once handed to `verifyKeyTrust`.
14
17
  export const KEY_TRUST_STATUSES = [
15
18
  'active', // active key — package is trusted
16
19
  'deprecated_valid', // deprecated key, but package was signed before deprecation
@@ -30,8 +33,8 @@ export function legacyEmbeddedKeyTrust() {
30
33
  return { status: 'legacy_embedded', verified: false };
31
34
  }
32
35
  /**
33
- * Verify that a `(kid, publicKey)` pair is trusted by the platform registry,
34
- * applying the rotation semantics documented in the P5 plan:
36
+ * Verify that a `(kid, publicKey)` pair is trusted by the registry, applying
37
+ * the rotation semantics documented in the P5 plan:
35
38
  * - `active` → trusted.
36
39
  * - `deprecated` → trusted only when `packageIntegratedTime` precedes
37
40
  * `deprecatedAt` (preventive rotation — pre-deprecation signatures remain
package/dist/types.d.ts CHANGED
@@ -24,10 +24,15 @@ export type CaptureMethod = 'chat-flow-stream' | 'claude-code-jsonl-readback' |
24
24
  * never reaches for `node:*` or a hardcoded global — see the ESLint
25
25
  * `no-restricted-imports` guard scoped to this directory.
26
26
  *
27
- * Per the WS1 prod smoke test: the injected fetcher should issue plain GETs with
28
- * NO custom request headers (a custom header triggers a CORS preflight, and a
29
- * preflight OPTIONS hitting civicaitools.org's site-wide 307 to its canonical
30
- * host can be rejected). A simple GET follows the 307 transparently.
27
+ * Per the WS1 prod smoke test: the injected fetcher should issue plain GETs
28
+ * with NO custom request headers — a custom header makes the request
29
+ * non-simple and triggers a CORS preflight; a preflight `OPTIONS` against a
30
+ * host that redirects can be rejected there, so a plain GET avoids that
31
+ * failure mode — e.g. civicaitools.org's site-wide 307 to its canonical
32
+ * host. That's necessary but not sufficient in a browser, though: per the
33
+ * Fetch spec, a cross-origin redirect response must itself carry CORS
34
+ * headers, or the fetch fails regardless of the request's simplicity.
35
+ * Server-side/Node fetches follow redirects without that constraint.
31
36
  */
32
37
  export type FetchLike = (input: string, init?: {
33
38
  signal?: AbortSignal;
package/dist/verify.d.ts CHANGED
@@ -48,7 +48,7 @@ export interface CommitmentLifecycleState {
48
48
  reinstatedReason?: string;
49
49
  }
50
50
  /**
51
- * Everything `verifyEvidence` needs, aligned to the WS1 commitment sidecar +
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 verifyEvidence(input: VerifyInput, deps: VerifyDeps): Promise<VerifyResult>;
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
- // `verifyEvidence` runs the §9.2 check suite over an already-resolved package +
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 → verifyEvidence with
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 verifyEvidence(input, deps) {
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.8.0",
4
- "description": "Portable, browser-safe verification core for Typed Standards evidence packages — the §9.2 check suite, single-sourced so it verifies identically on a server and in the browser.",
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",
@@ -28,7 +28,6 @@
28
28
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
29
29
  "typecheck": "tsc -p tsconfig.json --noEmit",
30
30
  "test": "node --test --experimental-strip-types \"src/**/*.test.ts\"",
31
- "prepare": "npm run build",
32
31
  "prepublishOnly": "npm run clean && npm run build"
33
32
  },
34
33
  "dependencies": {
@@ -56,7 +55,7 @@
56
55
  },
57
56
  "keywords": [
58
57
  "typed-standards",
59
- "evidence",
58
+ "record-package",
60
59
  "verification",
61
60
  "provenance",
62
61
  "ed25519",