@agledger/verify-core 0.1.0 → 0.1.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/README.md CHANGED
@@ -22,13 +22,15 @@ CBOR decoding.
22
22
  import { verifyAuditExport } from '@agledger/verify-core';
23
23
 
24
24
  const result = verifyAuditExport(exportDocument, {
25
- publicKeys, // optional out-of-band keys, keyed by kid
25
+ publicKeys, // optional out-of-band keys, keyed by kid
26
+ requireOutOfBandKeys: true, // optional: refuse the export's embedded keys
26
27
  });
27
28
 
28
- if (!result.ok) {
29
- console.error(JSON.stringify(result, null, 2));
29
+ if (!result.valid) {
30
+ console.error(`Broken at position ${result.brokenAt?.position}: ${result.brokenAt?.code}`);
30
31
  process.exit(1);
31
32
  }
33
+ // { valid: true, verifiedEntries, totalEntries, keyProvenance: { outOfBand, embedded }, ... }
32
34
  ```
33
35
 
34
36
  ## What it verifies
@@ -3,11 +3,19 @@
3
3
  *
4
4
  * This is the customer/developer path — `client.records.getAuditExport(id)`
5
5
  * then `verifyAuditExport(...)`. It maps the export wire shape onto the shared
6
- * normalized entry and runs `verifyChain`. The export wire carries only the
7
- * inputs for the always-run checks; the binding-integrity, OIDC-actor, and
8
- * temporal-key checks are reported as `skipped_no_input` (the dump path runs
9
- * them). That applicability is surfaced in the result, never hidden behind a
10
- * green verdict.
6
+ * normalized entry and runs `verifyChain`.
7
+ *
8
+ * Two of the three input-gated checks now run on the export path when the wire
9
+ * carries their inputs (engine ≥ v0.26.x, agledger-api commit a7eec8e4): the
10
+ * `actorOidcSynthesized` flag + `actorOidcIss/Sub` enable the OIDC-actor
11
+ * cross-check, and `exportMetadata.signingKeyWindows` + per-entry `createdAt`
12
+ * enable temporal key-validity. The binding-integrity check stays
13
+ * `skipped_no_input` here by design — the export deliberately re-projects
14
+ * `payload` from the signed bytes (anti-DBA-injection), so comparing signed-vs-
15
+ * row on the export path would compare signed bytes to a derivative of
16
+ * themselves; that check stays dump-only. Older exports without the new fields
17
+ * stay `skipped_no_input` for all three, surfaced in the result so a caller
18
+ * never mistakes "not checked here" for "checked and passed".
11
19
  */
12
20
  import { type CheckApplicability, type OptionalCheck } from './chain.js';
13
21
  import type { FailureCode } from './failures.js';
@@ -17,6 +25,14 @@ export interface AuditExportEntryInput {
17
25
  chainPosition?: number;
18
26
  /** Legacy alias for `chainPosition`. */
19
27
  position?: number;
28
+ /** ISO-8601 write time. Engine ≥ v0.26.x — gates the temporal key-validity check. */
29
+ createdAt?: string;
30
+ /** OIDC issuer the actor was synthesized from (engine ≥ v0.26.x). */
31
+ actorOidcIss?: string | null;
32
+ /** OIDC subject the actor was synthesized from (engine ≥ v0.26.x). */
33
+ actorOidcSub?: string | null;
34
+ /** Tri-state from `audit_vault.actor_oidc_synthesized` (engine ≥ v0.26.x). Marker for the OIDC-actor check. */
35
+ actorOidcSynthesized?: boolean | null;
20
36
  integrity: {
21
37
  payloadHash: string;
22
38
  previousHash: string | null;
@@ -25,6 +41,11 @@ export interface AuditExportEntryInput {
25
41
  signingKeyId: string | null;
26
42
  };
27
43
  }
44
+ /** Per-key activation/retirement window — drives temporal key-validity (engine ≥ v0.26.x). */
45
+ export interface SigningKeyWindow {
46
+ activatedAt: string;
47
+ retiredAt: string | null;
48
+ }
28
49
  /** A `/audit-export` document (only the fields the verifier reads). */
29
50
  export interface RecordAuditExportInput {
30
51
  exportMetadata: {
@@ -32,17 +53,42 @@ export interface RecordAuditExportInput {
32
53
  exportFormatVersion?: string;
33
54
  canonicalization?: string;
34
55
  signingPublicKeys?: Record<string, string>;
56
+ /** keyId → activation/retirement window (engine ≥ v0.26.x). */
57
+ signingKeyWindows?: Record<string, SigningKeyWindow>;
35
58
  };
36
59
  entries: AuditExportEntryInput[];
37
60
  }
61
+ /**
62
+ * Structural shape for a single out-of-band key in array form. Matches the SDK's
63
+ * `VerificationKey` (the `.data[]` from `client.verificationKeys.list()`) plus
64
+ * the SCITT COSE_KeySet (`/.well-known/scitt-keys`) entry shape — extra fields
65
+ * are ignored. `publicKey` must be SPKI DER base64.
66
+ */
67
+ export interface OutOfBandKeyEntry {
68
+ keyId: string;
69
+ publicKey: string;
70
+ /** Optional activation timestamp — feeds temporal key-validity when present. */
71
+ activatedAt?: string;
72
+ /** Optional retirement timestamp; `null` means "active, no scheduled retirement". */
73
+ retiredAt?: string | null;
74
+ }
38
75
  export interface VerifyExportOptions {
39
76
  /**
40
- * Public keys (keyId -> SPKI DER base64) supplied OUT OF BAND from a trusted
41
- * source (GET /v1/verification-keys, /.well-known/scitt-keys). These override
42
- * any key embedded in the export. For a real independent audit, supply keys
43
- * here rather than trusting the export's own `signingPublicKeys`.
77
+ * Public keys supplied OUT OF BAND from a trusted source (GET
78
+ * /v1/verification-keys, /.well-known/scitt-keys). These override any key
79
+ * embedded in the export. For a real independent audit, supply keys here
80
+ * rather than trusting the export's own `signingPublicKeys`.
81
+ *
82
+ * Accepts either form:
83
+ * - `Record<keyId, base64SpkiDer>` — the compact map shape
84
+ * - `OutOfBandKeyEntry[]` — the natural shape returned by
85
+ * `client.verificationKeys.list().data` and SCITT COSE_KeySet listings
86
+ *
87
+ * Anything else throws `TypeError` at the boundary. Fail-closed: the verifier
88
+ * never silently falls back to embedded keys when the caller meant to defeat
89
+ * trust in them. See agledger-agents#77 (F-698).
44
90
  */
45
- publicKeys?: Record<string, string>;
91
+ publicKeys?: Record<string, string> | ReadonlyArray<OutOfBandKeyEntry>;
46
92
  /** Require every entry to reference this keyId (else CHAIN_KEY_POLICY_VIOLATION). */
47
93
  requireKeyId?: string;
48
94
  /**
@@ -77,10 +123,18 @@ export interface VerifyExportResult {
77
123
  total: number;
78
124
  };
79
125
  /**
80
- * Which input-gated checks ran. On the export path these are all
81
- * `skipped_no_input` — surfaced so a caller never mistakes "not checked here"
82
- * for "checked and passed". Run @agledger/verify over a full vault dump to
83
- * exercise them.
126
+ * Which input-gated checks ran on this export.
127
+ *
128
+ * - `oidc_actor` and `key_temporal` flip to `applied` when the export wire
129
+ * carries their inputs (engine ≥ v0.26.x: `actorOidcSynthesized` per
130
+ * entry, `signingKeyWindows` in exportMetadata, `createdAt` per entry).
131
+ * - `payload_binding` stays `skipped_no_input` here by design — the export
132
+ * re-projects payload from the signed bytes, so this check is dump-only
133
+ * (run `@agledger/verify` over a full vault dump to exercise it).
134
+ *
135
+ * Older exports without the new fields stay `skipped_no_input` for all three.
136
+ * The applicability is surfaced so a caller never mistakes "not checked
137
+ * here" for "checked and passed".
84
138
  */
85
139
  optionalChecks: Record<OptionalCheck, CheckApplicability>;
86
140
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"audit-export.d.ts","sourceRoot":"","sources":["../src/audit-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAEnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,+FAA+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,+DAA+D;QAC/D,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B,CAAC;CACH;AAED,uEAAuE;AACvE,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5C,CAAC;IACF,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW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;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxF;;;;;;;;;;;;;OAaG;IACH,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;IAC1D;;;;OAIG;IACH,aAAa,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD;AAKD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,sBAAsB,EAClC,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAsEpB"}
@@ -3,11 +3,19 @@
3
3
  *
4
4
  * This is the customer/developer path — `client.records.getAuditExport(id)`
5
5
  * then `verifyAuditExport(...)`. It maps the export wire shape onto the shared
6
- * normalized entry and runs `verifyChain`. The export wire carries only the
7
- * inputs for the always-run checks; the binding-integrity, OIDC-actor, and
8
- * temporal-key checks are reported as `skipped_no_input` (the dump path runs
9
- * them). That applicability is surfaced in the result, never hidden behind a
10
- * green verdict.
6
+ * normalized entry and runs `verifyChain`.
7
+ *
8
+ * Two of the three input-gated checks now run on the export path when the wire
9
+ * carries their inputs (engine ≥ v0.26.x, agledger-api commit a7eec8e4): the
10
+ * `actorOidcSynthesized` flag + `actorOidcIss/Sub` enable the OIDC-actor
11
+ * cross-check, and `exportMetadata.signingKeyWindows` + per-entry `createdAt`
12
+ * enable temporal key-validity. The binding-integrity check stays
13
+ * `skipped_no_input` here by design — the export deliberately re-projects
14
+ * `payload` from the signed bytes (anti-DBA-injection), so comparing signed-vs-
15
+ * row on the export path would compare signed bytes to a derivative of
16
+ * themselves; that check stays dump-only. Older exports without the new fields
17
+ * stay `skipped_no_input` for all three, surfaced in the result so a caller
18
+ * never mistakes "not checked here" for "checked and passed".
11
19
  */
12
20
  import { buildKeyRegistry, verifyChain, } from './chain.js';
13
21
  const SUPPORTED_FORMAT_VERSION = '2.0';
@@ -22,15 +30,32 @@ export function verifyAuditExport(exportData, options = {}) {
22
30
  return earlyFailure(meta.recordId, entries.length, `Unsupported canonicalization ${meta.canonicalization} (only ${SUPPORTED_CANONICALIZATION} supported).`);
23
31
  }
24
32
  const keys = buildKeyRegistry(resolveKeys(exportData, options));
25
- const normalized = entries.map((e) => ({
26
- scopeId: meta.recordId,
27
- chainPosition: e.chainPosition ?? e.position ?? -1,
28
- payloadHash: e.integrity.payloadHash,
29
- previousHash: e.integrity.previousHash,
30
- coseSign1: e.integrity.coseSign1,
31
- signingKeyId: e.integrity.signingKeyId,
32
- // No binding / oidcActor / createdAt — the export wire does not carry them.
33
- }));
33
+ const normalized = entries.map((e) => {
34
+ const base = {
35
+ scopeId: meta.recordId,
36
+ chainPosition: e.chainPosition ?? e.position ?? -1,
37
+ payloadHash: e.integrity.payloadHash,
38
+ previousHash: e.integrity.previousHash,
39
+ coseSign1: e.integrity.coseSign1,
40
+ signingKeyId: e.integrity.signingKeyId,
41
+ };
42
+ // Binding-integrity stays dump-only: the export re-projects payload from
43
+ // the signed bytes (anti-DBA-injection), so this check is not run here.
44
+ if (e.createdAt)
45
+ base.createdAt = e.createdAt;
46
+ // The synthesized flag is the marker that the export carries the OIDC
47
+ // wire shape at all. Older exports omit it entirely; new exports always
48
+ // include it (false/null/true). Setting `oidcActor` flips `oidc_actor`
49
+ // to `applied` in the chain result — never `applied` for old exports.
50
+ if (e.actorOidcSynthesized !== undefined) {
51
+ base.oidcActor = {
52
+ iss: e.actorOidcIss ?? null,
53
+ sub: e.actorOidcSub ?? null,
54
+ synthesized: e.actorOidcSynthesized ?? undefined,
55
+ };
56
+ }
57
+ return base;
58
+ });
34
59
  const chain = verifyChain(normalized, keys, {
35
60
  requireKeyId: options.requireKeyId,
36
61
  requireOutOfBandKeys: options.requireOutOfBandKeys,
@@ -80,12 +105,108 @@ function resolveKeys(exportData, options) {
80
105
  byId.set(keyId, { keyId, spkiBase64, source: 'embedded' });
81
106
  }
82
107
  }
83
- // Out-of-band keys override embedded keys of the same id.
84
- if (options.publicKeys) {
85
- for (const [keyId, spkiBase64] of Object.entries(options.publicKeys)) {
86
- byId.set(keyId, { keyId, spkiBase64, source: 'out-of-band' });
108
+ // Out-of-band keys override embedded keys of the same id, but inherit the
109
+ // previously-seen activation/retirement window if the OOB entry didn't carry
110
+ // its own.
111
+ const oob = normalizeOutOfBandKeys(options.publicKeys);
112
+ if (oob) {
113
+ for (const entry of oob) {
114
+ const existing = byId.get(entry.keyId);
115
+ const activatedAt = entry.activatedAt ?? existing?.activatedAt;
116
+ const retiredAt = entry.retiredAt !== undefined ? entry.retiredAt : existing?.retiredAt;
117
+ byId.set(entry.keyId, {
118
+ keyId: entry.keyId,
119
+ spkiBase64: entry.spkiBase64,
120
+ source: 'out-of-band',
121
+ ...(activatedAt !== undefined ? { activatedAt } : {}),
122
+ ...(retiredAt !== undefined ? { retiredAt } : {}),
123
+ });
124
+ }
125
+ }
126
+ // Attach activation/retirement windows from exportMetadata (engine ≥ v0.26.x).
127
+ // Older exports omit signingKeyWindows; keys stay without a window and
128
+ // verifyChain reports `key_temporal` as `skipped_no_input`.
129
+ const windows = meta.signingKeyWindows;
130
+ if (windows) {
131
+ for (const [keyId, window] of Object.entries(windows)) {
132
+ const existing = byId.get(keyId);
133
+ if (!existing)
134
+ continue;
135
+ // Trust hierarchy on the temporal axis: when the caller supplied this
136
+ // key out-of-band AND brought their own activation/retirement window,
137
+ // the export's (untrusted) signingKeyWindows MUST NOT overwrite it.
138
+ // A compromised export could otherwise hide a retirement by setting
139
+ // retiredAt:null, reopening F-698 on the temporal axis. When the OOB
140
+ // caller did not carry a window, we still fall through to the export's
141
+ // window — most auditors trust the engine's published key-rotation log
142
+ // even when they bring their own key catalogue.
143
+ const oobCarriesWindow = existing.source === 'out-of-band' &&
144
+ (existing.activatedAt !== undefined || existing.retiredAt !== undefined);
145
+ if (oobCarriesWindow)
146
+ continue;
147
+ byId.set(keyId, {
148
+ ...existing,
149
+ activatedAt: window.activatedAt,
150
+ retiredAt: window.retiredAt,
151
+ });
87
152
  }
88
153
  }
89
154
  return [...byId.values()];
90
155
  }
156
+ /**
157
+ * Normalize `options.publicKeys` into a uniform array of entries, or throw
158
+ * `TypeError` at the boundary if the shape is wrong. Fail-closed by design:
159
+ * an OOB-key argument that silently falls back to embedded keys would lie
160
+ * about the audit-independence claim (see agledger-agents#77 / F-698).
161
+ *
162
+ * Accepts:
163
+ * - `Record<keyId, base64SpkiDer>` — compact map (string-keyed object whose
164
+ * values are all strings)
165
+ * - `OutOfBandKeyEntry[]` — natural SDK shape from `verificationKeys.list()`,
166
+ * or COSE_KeySet shape from `/.well-known/scitt-keys`
167
+ *
168
+ * Returns `null` when no keys were supplied; otherwise an array of normalized
169
+ * entries ready to merge into the registry.
170
+ */
171
+ function normalizeOutOfBandKeys(publicKeys) {
172
+ if (publicKeys === undefined || publicKeys === null)
173
+ return null;
174
+ if (Array.isArray(publicKeys)) {
175
+ return publicKeys.map((entry, i) => {
176
+ if (entry === null || typeof entry !== 'object') {
177
+ throw new TypeError(`verifyAuditExport: publicKeys[${i}] is not an object (got ${typeof entry}). ` +
178
+ `Expected { keyId, publicKey } entries — e.g. the .data[] from client.verificationKeys.list().`);
179
+ }
180
+ const keyId = entry.keyId;
181
+ const publicKey = entry.publicKey;
182
+ if (typeof keyId !== 'string' || typeof publicKey !== 'string') {
183
+ throw new TypeError(`verifyAuditExport: publicKeys[${i}] is missing required string fields { keyId, publicKey } ` +
184
+ `(got keyId=${typeof keyId}, publicKey=${typeof publicKey}). ` +
185
+ `Expected the SDK VerificationKey shape — publicKey must be SPKI DER base64.`);
186
+ }
187
+ const out = { keyId, spkiBase64: publicKey };
188
+ const activatedAt = entry.activatedAt;
189
+ const retiredAt = entry.retiredAt;
190
+ if (typeof activatedAt === 'string')
191
+ out.activatedAt = activatedAt;
192
+ if (retiredAt === null || typeof retiredAt === 'string')
193
+ out.retiredAt = retiredAt;
194
+ return out;
195
+ });
196
+ }
197
+ if (typeof publicKeys !== 'object') {
198
+ throw new TypeError(`verifyAuditExport: publicKeys must be a Record<keyId, base64SpkiDer> or an array of ` +
199
+ `{ keyId, publicKey } entries (got ${typeof publicKeys}).`);
200
+ }
201
+ const entries = [];
202
+ for (const [keyId, value] of Object.entries(publicKeys)) {
203
+ if (typeof value !== 'string') {
204
+ throw new TypeError(`verifyAuditExport: publicKeys["${keyId}"] is not a base64 string (got ${typeof value}). ` +
205
+ `If you passed the .data[] from client.verificationKeys.list(), pass it as an array, ` +
206
+ `not via Object.fromEntries on the raw list.`);
207
+ }
208
+ entries.push({ keyId, spkiBase64: value });
209
+ }
210
+ return entries;
211
+ }
91
212
  //# sourceMappingURL=audit-export.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-export.js","sourceRoot":"","sources":["../src/audit-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,WAAW,GAKZ,MAAM,YAAY,CAAC;AA8EpB,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,0BAA0B,GAAG,aAAa,CAAC;AAEjD,MAAM,UAAU,iBAAiB,CAC/B,UAAkC,EAClC,UAA+B,EAAE;IAEjC,MAAM,IAAI,GAAG,UAAU,CAAC,cAAc,CAAC;IACvC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC;IAEzC,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,mBAAmB,KAAK,wBAAwB,EAAE,CAAC;QACtF,OAAO,YAAY,CACjB,IAAI,CAAC,QAAQ,EACb,OAAO,CAAC,MAAM,EACd,mCAAmC,IAAI,CAAC,mBAAmB,yBAAyB,wBAAwB,IAAI,CACjH,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB,KAAK,0BAA0B,EAAE,CAAC;QAClF,OAAO,YAAY,CACjB,IAAI,CAAC,QAAQ,EACb,OAAO,CAAC,MAAM,EACd,gCAAgC,IAAI,CAAC,gBAAgB,UAAU,0BAA0B,cAAc,CACxG,CAAC;I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KAAK,QAAQ;gBAAE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;YACnF,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,IAAI,SAAS,CACjB,sFAAsF;YACpF,qCAAqC,OAAO,UAAU,IAAI,CAC7D,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAyB,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CACjB,kCAAkC,KAAK,kCAAkC,OAAO,KAAK,KAAK;gBACxF,sFAAsF;gBACtF,6CAA6C,CAChD,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export type { FailureCode } from './failures.js';
8
8
  export { buildKeyRegistry, verifyChain, } from './chain.js';
9
9
  export type { KeySource, VerificationKey, KeyRegistry, NormalizedEntry, OptionalCheck, CheckApplicability, SignatureOutcome, ChainEntryResult, ChainResult, VerifyChainOptions, } from './chain.js';
10
10
  export { verifyAuditExport } from './audit-export.js';
11
- export type { AuditExportEntryInput, RecordAuditExportInput, VerifyExportOptions, EntryVerificationResult, VerifyExportResult, } from './audit-export.js';
11
+ export type { AuditExportEntryInput, RecordAuditExportInput, SigningKeyWindow, VerifyExportOptions, OutOfBandKeyEntry, EntryVerificationResult, VerifyExportResult, } from './audit-export.js';
12
12
  export { sha256Hex, sha256HexString, verifyEd25519Bytes, decodeCoseSign1, verifyCoseSign1, extractChainClaim, extractOnBehalfOfClaim, extractTraceparentClaim, decodePredicate, buildPredicateForRow, stripEnvelopeExtensions, deepEqual, merkleRoot, verifyInclusion, rfc9162LeafHash, rfc9162NodeHash, verifyRfc9162Inclusion, extractReceiptInclusionProof, verifyReceipt, } from './primitives.js';
13
13
  export type { CoseSign1Parts, CoseVerifyOutcome, ChainClaim, ReceiptInclusionProof, ReceiptVerifyOutcome, } from './primitives.js';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAStD,OAAO,EACL,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,GACd,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EACL,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAWtD,OAAO,EACL,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,GACd,MAAM,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agledger/verify-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Shared offline verification core for AGLedger audit chains — COSE_Sign1 (RFC 9052) decode/verify, Ed25519, hash-chain walk, Merkle proofs, and the canonical failure taxonomy. One dependency (cborg); no network. The single source of truth the SDK, CLI, MCP server, and @agledger/verify all build on.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",