agent-passport-system 2.2.0 → 2.4.0-alpha
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 +15 -5
- package/dist/src/core/policy.d.ts +34 -2
- package/dist/src/core/policy.d.ts.map +1 -1
- package/dist/src/core/policy.js +40 -0
- package/dist/src/core/policy.js.map +1 -1
- package/dist/src/decisionReceipt.d.ts +118 -0
- package/dist/src/decisionReceipt.d.ts.map +1 -0
- package/dist/src/decisionReceipt.js +109 -0
- package/dist/src/decisionReceipt.js.map +1 -0
- package/dist/src/index.d.ts +6 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/policy.d.ts +30 -0
- package/dist/src/types/policy.d.ts.map +1 -1
- package/dist/src/v2/instruction-provenance/canonicalize.d.ts +50 -0
- package/dist/src/v2/instruction-provenance/canonicalize.d.ts.map +1 -0
- package/dist/src/v2/instruction-provenance/canonicalize.js +128 -0
- package/dist/src/v2/instruction-provenance/canonicalize.js.map +1 -0
- package/dist/src/v2/instruction-provenance/envelope.d.ts +22 -0
- package/dist/src/v2/instruction-provenance/envelope.d.ts.map +1 -0
- package/dist/src/v2/instruction-provenance/envelope.js +107 -0
- package/dist/src/v2/instruction-provenance/envelope.js.map +1 -0
- package/dist/src/v2/instruction-provenance/index.d.ts +5 -0
- package/dist/src/v2/instruction-provenance/index.d.ts.map +1 -0
- package/dist/src/v2/instruction-provenance/index.js +11 -0
- package/dist/src/v2/instruction-provenance/index.js.map +1 -0
- package/dist/src/v2/instruction-provenance/types.d.ts +133 -0
- package/dist/src/v2/instruction-provenance/types.d.ts.map +1 -0
- package/dist/src/v2/instruction-provenance/types.js +11 -0
- package/dist/src/v2/instruction-provenance/types.js.map +1 -0
- package/dist/src/v2/instruction-provenance/verify.d.ts +28 -0
- package/dist/src/v2/instruction-provenance/verify.d.ts.map +1 -0
- package/dist/src/v2/instruction-provenance/verify.js +311 -0
- package/dist/src/v2/instruction-provenance/verify.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// InstructionProvenanceReceipt — public barrel
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: ~/aeoess_web/specs/INSTRUCTION-PROVENANCE-RECEIPT-DRAFT-v0.2.md
|
|
6
|
+
// Tier scope this version: 'self-asserted' only.
|
|
7
|
+
// ══════════════════════════════════════════════════════════════════
|
|
8
|
+
export { createInstructionProvenanceReceipt, IPRConstructionError, signEd25519 } from './envelope.js';
|
|
9
|
+
export { verifyInstructionProvenanceReceipt, verifyActionTimeContextRoot, matchesAnyPattern } from './verify.js';
|
|
10
|
+
export { IPRPathError, canonicalizePath, canonicalizeEnvelope, computeContextRoot, sortInstructionFiles, sha256Hex, } from './canonicalize.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v2/instruction-provenance/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,+CAA+C;AAC/C,qEAAqE;AACrE,wEAAwE;AACxE,iDAAiD;AACjD,qEAAqE;AAErE,OAAO,EAAE,kCAAkC,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,kCAAkC,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAChH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,GACV,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** v0.2 envelopes ship 'self-asserted'. v0.3 unlocks 'witnessed' and 'verified'. */
|
|
2
|
+
export type AttestationTier = 'self-asserted' | 'witnessed' | 'verified';
|
|
3
|
+
export type FilesystemMode = 'case-sensitive' | 'case-insensitive';
|
|
4
|
+
export type InstructionRole = 'system_prompt' | 'agent_md' | 'user_md' | 'memory' | 'rules' | 'other';
|
|
5
|
+
export interface InstructionFile {
|
|
6
|
+
/** Canonicalized relative POSIX path, per spec §5.1. Symlinks are separate
|
|
7
|
+
* entries with `is_symlink: true`; the link target appears as a distinct
|
|
8
|
+
* file. */
|
|
9
|
+
path: string;
|
|
10
|
+
/** Hex sha256 of file contents. Lowercase, 64 chars. */
|
|
11
|
+
digest: string;
|
|
12
|
+
/** Byte length of the file at issuance time. */
|
|
13
|
+
bytes: number;
|
|
14
|
+
/** Role classification. `'other'` for files matched by patterns but not
|
|
15
|
+
* fitting a named role. */
|
|
16
|
+
role: InstructionRole;
|
|
17
|
+
/** True iff this entry represents a symlink, not a regular file. The
|
|
18
|
+
* symlink's target file appears as its own entry. */
|
|
19
|
+
is_symlink?: boolean;
|
|
20
|
+
/** Target path of the symlink (only present when is_symlink=true). */
|
|
21
|
+
symlink_target?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface InstructionProvenanceReceiptBoundTo {
|
|
24
|
+
type: 'session' | 'action' | 'window';
|
|
25
|
+
/** Reference to the bound entity. Format depends on `type`:
|
|
26
|
+
* - session: session_id
|
|
27
|
+
* - action: action_ref hex sha256 (Module 37 / A2A#1672)
|
|
28
|
+
* - window: ISO 8601 timestamp interval `<start>/<end>` */
|
|
29
|
+
ref: string;
|
|
30
|
+
}
|
|
31
|
+
export interface InstructionProvenanceReceipt {
|
|
32
|
+
/** sha256 of the canonical-JCS serialization of this object minus
|
|
33
|
+
* `signature` and `receipt_id`. */
|
|
34
|
+
receipt_id: string;
|
|
35
|
+
/** Existing APS field. Links IPR to its delegation root.
|
|
36
|
+
* Format: hex sha256 of canonical delegation chain. */
|
|
37
|
+
delegation_chain_root: string;
|
|
38
|
+
/** Acting agent DID. */
|
|
39
|
+
agent_did: string;
|
|
40
|
+
/** Glob patterns the agent claims to have walked, in arbitrary order.
|
|
41
|
+
* Must be non-empty. POSIX globs relative to `working_root`. */
|
|
42
|
+
discovery_patterns: string[];
|
|
43
|
+
/** Working root for path resolution. Absolute POSIX path. The agent's
|
|
44
|
+
* `instruction_files[].path` values are relative to this root. */
|
|
45
|
+
working_root: string;
|
|
46
|
+
/** Filesystem case mode for the working_root. Affects path comparison. */
|
|
47
|
+
filesystem_mode: FilesystemMode;
|
|
48
|
+
/** Files matched by `discovery_patterns`. Exhaustiveness contract: this
|
|
49
|
+
* array MUST contain every regular file matched by any pattern in
|
|
50
|
+
* `discovery_patterns`, in canonical sorted order by `path`. */
|
|
51
|
+
instruction_files: InstructionFile[];
|
|
52
|
+
/** sha256 of the canonical-JCS serialization of `instruction_files` only.
|
|
53
|
+
* The hash that changes when any file content or path changes. */
|
|
54
|
+
context_root: string;
|
|
55
|
+
/** Attestation tier per ENFORCEMENT-TRUST-ANCHOR Component 4. v0.2
|
|
56
|
+
* envelopes MUST carry `'self-asserted'`. */
|
|
57
|
+
attestation_tier: AttestationTier;
|
|
58
|
+
/** When true, action receipts emitted under this IPR MUST re-hash the
|
|
59
|
+
* files matching `discovery_patterns` immediately before action
|
|
60
|
+
* execution and inline the fresh `context_root` into the action receipt.
|
|
61
|
+
* Default false. Mandatory true at tier >= 2 in v2.4. */
|
|
62
|
+
recompute_at_action: boolean;
|
|
63
|
+
/** Issuance timestamp, ISO 8601 with millisecond precision and Z suffix. */
|
|
64
|
+
issued_at: string;
|
|
65
|
+
/** Optional expiry. Verifiers SHOULD treat absent as session-bound. */
|
|
66
|
+
expires_at?: string;
|
|
67
|
+
/** Binding scope. */
|
|
68
|
+
bound_to: InstructionProvenanceReceiptBoundTo;
|
|
69
|
+
/** Ed25519 signing key fingerprint: `ed25519:<first-16-hex-of-public-key>`. */
|
|
70
|
+
signing_key_id: string;
|
|
71
|
+
/** Ed25519 over the JCS canonicalization of this object minus
|
|
72
|
+
* `signature` and `receipt_id`. Hex, 128 chars. */
|
|
73
|
+
signature: string;
|
|
74
|
+
}
|
|
75
|
+
/** Result of `canonicalizePath`. Either a canonical relative POSIX string or
|
|
76
|
+
* a typed error explaining the rejection (callers throw `IPRPathError`). */
|
|
77
|
+
export interface CanonicalizationResult {
|
|
78
|
+
canonical: string;
|
|
79
|
+
}
|
|
80
|
+
/** Verification outcome from `verifyInstructionProvenanceReceipt`. */
|
|
81
|
+
export interface VerificationResult {
|
|
82
|
+
valid: boolean;
|
|
83
|
+
errors: string[];
|
|
84
|
+
/** Surfaced for callers that want to gate on tier even when valid=true. */
|
|
85
|
+
tier?: AttestationTier;
|
|
86
|
+
/** Surfaced for caller convenience; equals envelope.context_root when
|
|
87
|
+
* recomputation matched, otherwise the recomputed value. */
|
|
88
|
+
contextRoot?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Inputs for createInstructionProvenanceReceipt. */
|
|
91
|
+
export interface CreateIPRInput {
|
|
92
|
+
delegation_chain_root: string;
|
|
93
|
+
agent_did: string;
|
|
94
|
+
discovery_patterns: string[];
|
|
95
|
+
working_root: string;
|
|
96
|
+
filesystem_mode: FilesystemMode;
|
|
97
|
+
instruction_files: InstructionFile[];
|
|
98
|
+
recompute_at_action?: boolean;
|
|
99
|
+
issued_at?: string;
|
|
100
|
+
expires_at?: string;
|
|
101
|
+
bound_to: InstructionProvenanceReceiptBoundTo;
|
|
102
|
+
/** Ed25519 private key (hex seed, 64 chars). */
|
|
103
|
+
privateKeyHex: string;
|
|
104
|
+
/** Ed25519 public key (hex, 64 chars) used to derive `signing_key_id`. */
|
|
105
|
+
publicKeyHex: string;
|
|
106
|
+
/** Tier override is not allowed in v0.2; envelope is always 'self-asserted'.
|
|
107
|
+
* Future-flagged here so v0.3 can wire 'witnessed' / 'verified'. */
|
|
108
|
+
attestation_tier?: 'self-asserted';
|
|
109
|
+
}
|
|
110
|
+
/** Verification options. */
|
|
111
|
+
export interface VerifyIPRInput {
|
|
112
|
+
envelope: InstructionProvenanceReceipt;
|
|
113
|
+
/** Ed25519 public key (hex, 64 chars) used to verify `signature`. */
|
|
114
|
+
publicKeyHex: string;
|
|
115
|
+
/** When provided, performs §6.3 step 10/11 exhaustiveness check by
|
|
116
|
+
* re-walking the working root with `discovery_patterns`. When omitted,
|
|
117
|
+
* the verifier skips filesystem checks (signature + schema only). */
|
|
118
|
+
filesystemCheck?: boolean;
|
|
119
|
+
/** Verifier clock for §6.4 step 12/13 (default: Date.now()). */
|
|
120
|
+
now?: Date;
|
|
121
|
+
/** Allowable clock skew in milliseconds for `issued_at` future check
|
|
122
|
+
* (default: 5 minutes). */
|
|
123
|
+
clockSkewMs?: number;
|
|
124
|
+
}
|
|
125
|
+
/** Action-receipt context-root verification input. */
|
|
126
|
+
export interface ActionTimeContextRootInput {
|
|
127
|
+
/** The IPR the action receipt is bound to. */
|
|
128
|
+
envelope: InstructionProvenanceReceipt;
|
|
129
|
+
/** Action-receipt-side fresh `context_root` computed immediately before
|
|
130
|
+
* action execution. Hex sha256, 64 chars. */
|
|
131
|
+
context_root_at_action_time: string;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/instruction-provenance/types.ts"],"names":[],"mappings":"AAUA,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,CAAA;AAExE,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;AAElE,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,UAAU,GACV,SAAS,GACT,QAAQ,GACR,OAAO,GACP,OAAO,CAAA;AAEX,MAAM,WAAW,eAAe;IAC9B;;gBAEY;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD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,EAAE,CAAA;IAChB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB;iEAC6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,cAAc,CAAA;IAC/B,iBAAiB,EAAE,eAAe,EAAE,CAAA;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,mCAAmC,CAAA;IAC7C,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAA;IACpB;yEACqE;IACrE,gBAAgB,CAAC,EAAE,eAAe,CAAA;CACnC;AAED,4BAA4B;AAC5B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,4BAA4B,CAAA;IACtC,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAA;IACpB;;0EAEsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,gEAAgE;IAChE,GAAG,CAAC,EAAE,IAAI,CAAA;IACV;gCAC4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,sDAAsD;AACtD,MAAM,WAAW,0BAA0B;IACzC,8CAA8C;IAC9C,QAAQ,EAAE,4BAA4B,CAAA;IACtC;kDAC8C;IAC9C,2BAA2B,EAAE,MAAM,CAAA;CACpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// InstructionProvenanceReceipt — types
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: ~/aeoess_web/specs/INSTRUCTION-PROVENANCE-RECEIPT-DRAFT-v0.2.md
|
|
6
|
+
// Tier scope this version: 'self-asserted' only. 'witnessed' and 'verified'
|
|
7
|
+
// are reserved schema values; verifiers MUST reject envelopes carrying them
|
|
8
|
+
// per ENFORCEMENT-TRUST-ANCHOR Component 4 (§§141-149).
|
|
9
|
+
// ══════════════════════════════════════════════════════════════════
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/v2/instruction-provenance/types.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,uCAAuC;AACvC,qEAAqE;AACrE,wEAAwE;AACxE,4EAA4E;AAC5E,4EAA4E;AAC5E,wDAAwD;AACxD,qEAAqE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ActionTimeContextRootInput, VerificationResult, VerifyIPRInput } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Verify an InstructionProvenanceReceipt envelope per spec §6.
|
|
4
|
+
*
|
|
5
|
+
* Pipeline:
|
|
6
|
+
* §6.1 schema + signature
|
|
7
|
+
* §6.2 delegation linkage (signature key matches signing_key_id)
|
|
8
|
+
* §6.3 path canonicalization, sort order, context_root, exhaustiveness
|
|
9
|
+
* §6.4 issued_at + expires_at + bound_to consistency
|
|
10
|
+
*
|
|
11
|
+
* Filesystem-side checks (§6.3 step 10/11 cross-walk vs disk) only run
|
|
12
|
+
* when `filesystemCheck: true` AND `working_root` exists on this host.
|
|
13
|
+
*/
|
|
14
|
+
export declare function verifyInstructionProvenanceReceipt(input: VerifyIPRInput): VerificationResult;
|
|
15
|
+
/**
|
|
16
|
+
* §6.5 — when an IPR carries `recompute_at_action: true`, every action
|
|
17
|
+
* receipt under its binding scope MUST include `context_root_at_action_time`
|
|
18
|
+
* computed by re-walking discovery_patterns. This helper compares.
|
|
19
|
+
*/
|
|
20
|
+
export declare function verifyActionTimeContextRoot(input: ActionTimeContextRootInput): VerificationResult;
|
|
21
|
+
/**
|
|
22
|
+
* Tiny POSIX-glob matcher. Supports `*`, `?`, `**`, character literals.
|
|
23
|
+
* Patterns are matched against canonical relative paths (no leading `/`,
|
|
24
|
+
* forward-slash separators). Patterns may start with `./` (stripped) or
|
|
25
|
+
* `**` for recursive match.
|
|
26
|
+
*/
|
|
27
|
+
export declare function matchesAnyPattern(path: string, patterns: readonly string[]): boolean;
|
|
28
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/v2/instruction-provenance/verify.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,0BAA0B,EAG1B,kBAAkB,EAClB,cAAc,EACf,MAAM,YAAY,CAAA;AAOnB;;;;;;;;;;;GAWG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,cAAc,GAAG,kBAAkB,CA4I5F;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,GAAG,kBAAkB,CAiBjG;AAwBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAMpF"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// IPR — verification end-to-end (§6)
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Pipeline order matches spec §6.1 → §6.5. Hard reject early; do not
|
|
6
|
+
// silently downgrade. Returns aggregate { valid, errors[], tier, contextRoot }.
|
|
7
|
+
//
|
|
8
|
+
// §6.5 action-time recompute (verifyActionTimeContextRoot) is a separate
|
|
9
|
+
// helper because it needs the action-receipt's freshly recomputed root,
|
|
10
|
+
// which is not part of the IPR envelope itself.
|
|
11
|
+
// ══════════════════════════════════════════════════════════════════
|
|
12
|
+
import { createPublicKey, verify as cryptoVerify } from 'node:crypto';
|
|
13
|
+
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
14
|
+
import { join, relative, resolve } from 'node:path';
|
|
15
|
+
import { IPRPathError, canonicalizeEnvelope, canonicalizePath, computeContextRoot, sha256Hex, } from './canonicalize.js';
|
|
16
|
+
const SPKI_ED25519_PREFIX = Buffer.from('302a300506032b6570032100', 'hex');
|
|
17
|
+
const VALID_TIERS = new Set(['self-asserted', 'witnessed', 'verified']);
|
|
18
|
+
const V0_2_PERMITTED_TIER = 'self-asserted';
|
|
19
|
+
/**
|
|
20
|
+
* Verify an InstructionProvenanceReceipt envelope per spec §6.
|
|
21
|
+
*
|
|
22
|
+
* Pipeline:
|
|
23
|
+
* §6.1 schema + signature
|
|
24
|
+
* §6.2 delegation linkage (signature key matches signing_key_id)
|
|
25
|
+
* §6.3 path canonicalization, sort order, context_root, exhaustiveness
|
|
26
|
+
* §6.4 issued_at + expires_at + bound_to consistency
|
|
27
|
+
*
|
|
28
|
+
* Filesystem-side checks (§6.3 step 10/11 cross-walk vs disk) only run
|
|
29
|
+
* when `filesystemCheck: true` AND `working_root` exists on this host.
|
|
30
|
+
*/
|
|
31
|
+
export function verifyInstructionProvenanceReceipt(input) {
|
|
32
|
+
const errors = [];
|
|
33
|
+
const env = input.envelope;
|
|
34
|
+
const tier = env.attestation_tier;
|
|
35
|
+
// §6.1 — schema-level checks (subset; full schema is in spec §4.2)
|
|
36
|
+
if (!env || typeof env !== 'object') {
|
|
37
|
+
errors.push('envelope is not an object');
|
|
38
|
+
return { valid: false, errors };
|
|
39
|
+
}
|
|
40
|
+
if (!VALID_TIERS.has(tier)) {
|
|
41
|
+
errors.push(`attestation_tier must be one of self-asserted | witnessed | verified, got '${tier}'`);
|
|
42
|
+
}
|
|
43
|
+
if (tier !== V0_2_PERMITTED_TIER) {
|
|
44
|
+
errors.push(`attestation_tier reserved for v0.3+, v0.2 only accepts self-asserted (got '${tier}')`);
|
|
45
|
+
}
|
|
46
|
+
if (typeof env.signing_key_id !== 'string' || !/^ed25519:[0-9a-f]{16}$/.test(env.signing_key_id)) {
|
|
47
|
+
errors.push(`signing_key_id must match ^ed25519:[0-9a-f]{16}$ (got '${env.signing_key_id}')`);
|
|
48
|
+
}
|
|
49
|
+
if (typeof env.signature !== 'string' || !/^[0-9a-f]{128}$/.test(env.signature)) {
|
|
50
|
+
errors.push('signature must be 128-char lowercase hex');
|
|
51
|
+
}
|
|
52
|
+
if (typeof env.receipt_id !== 'string' || !/^[0-9a-f]{64}$/.test(env.receipt_id)) {
|
|
53
|
+
errors.push('receipt_id must be 64-char lowercase hex');
|
|
54
|
+
}
|
|
55
|
+
if (typeof env.context_root !== 'string' || !/^[0-9a-f]{64}$/.test(env.context_root)) {
|
|
56
|
+
errors.push('context_root must be 64-char lowercase hex');
|
|
57
|
+
}
|
|
58
|
+
if (typeof env.delegation_chain_root !== 'string' || !/^[0-9a-f]{64}$/.test(env.delegation_chain_root)) {
|
|
59
|
+
errors.push('delegation_chain_root must be 64-char lowercase hex');
|
|
60
|
+
}
|
|
61
|
+
if (!Array.isArray(env.discovery_patterns) || env.discovery_patterns.length === 0) {
|
|
62
|
+
errors.push('discovery_patterns must be a non-empty array');
|
|
63
|
+
}
|
|
64
|
+
if (typeof env.working_root !== 'string' || !env.working_root.startsWith('/')) {
|
|
65
|
+
errors.push('working_root must be absolute POSIX');
|
|
66
|
+
}
|
|
67
|
+
if (errors.length > 0)
|
|
68
|
+
return { valid: false, errors, tier };
|
|
69
|
+
// §6.1 step 3 — recompute receipt_id from canonical bytes
|
|
70
|
+
const canonical = canonicalizeEnvelope(env);
|
|
71
|
+
const expectedReceiptId = sha256Hex(canonical);
|
|
72
|
+
if (env.receipt_id !== expectedReceiptId) {
|
|
73
|
+
errors.push(`receipt_id mismatch (expected ${expectedReceiptId}, got ${env.receipt_id})`);
|
|
74
|
+
return { valid: false, errors, tier };
|
|
75
|
+
}
|
|
76
|
+
// §6.1 step 4 — Ed25519 signature
|
|
77
|
+
const sigOk = verifyEd25519(canonical, env.signature, input.publicKeyHex);
|
|
78
|
+
if (!sigOk) {
|
|
79
|
+
errors.push('Ed25519 signature verification failed');
|
|
80
|
+
return { valid: false, errors, tier };
|
|
81
|
+
}
|
|
82
|
+
// §6.2 step 6 — signing_key_id must match the public key fingerprint
|
|
83
|
+
const expectedKid = `ed25519:${input.publicKeyHex.slice(0, 16)}`;
|
|
84
|
+
if (env.signing_key_id !== expectedKid) {
|
|
85
|
+
errors.push(`signing_key_id ${env.signing_key_id} does not match provided publicKeyHex fingerprint ${expectedKid}`);
|
|
86
|
+
return { valid: false, errors, tier };
|
|
87
|
+
}
|
|
88
|
+
// §6.3 step 7-9 — path canonicalization + sort order + context_root
|
|
89
|
+
for (const f of env.instruction_files) {
|
|
90
|
+
let canon;
|
|
91
|
+
try {
|
|
92
|
+
canon = canonicalizePath(f.path, {
|
|
93
|
+
workingRoot: env.working_root,
|
|
94
|
+
filesystemMode: env.filesystem_mode,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
const msg = e instanceof IPRPathError ? e.message : e.message;
|
|
99
|
+
errors.push(`instruction_files[${f.path}] path canonicalization failed: ${msg}`);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (canon !== f.path) {
|
|
103
|
+
errors.push(`instruction_files[${f.path}] path is not in canonical form (expected ${canon})`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!isSortedByPath(env.instruction_files)) {
|
|
107
|
+
errors.push('instruction_files is not sorted by path (canonical lexicographic)');
|
|
108
|
+
}
|
|
109
|
+
const expectedContextRoot = computeContextRoot(env.instruction_files);
|
|
110
|
+
if (env.context_root !== expectedContextRoot) {
|
|
111
|
+
errors.push(`context_root mismatch (expected ${expectedContextRoot}, got ${env.context_root})`);
|
|
112
|
+
}
|
|
113
|
+
// §6.3 step 10/11 — exhaustiveness + smuggling checks
|
|
114
|
+
const declaredPaths = new Set(env.instruction_files.map(f => f.path));
|
|
115
|
+
for (const f of env.instruction_files) {
|
|
116
|
+
if (!matchesAnyPattern(f.path, env.discovery_patterns)) {
|
|
117
|
+
errors.push(`path smuggling: instruction_files[${f.path}] matches no discovery_pattern`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (input.filesystemCheck && existsSync(env.working_root)) {
|
|
121
|
+
const discovered = walkPatterns(env.working_root, env.discovery_patterns, env.filesystem_mode);
|
|
122
|
+
for (const p of discovered) {
|
|
123
|
+
if (!declaredPaths.has(p)) {
|
|
124
|
+
errors.push(`omission detected: filesystem matches discovery_pattern but instruction_files omits '${p}'`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// §6.4 step 12 — issued_at not in the future
|
|
129
|
+
const now = input.now ?? new Date();
|
|
130
|
+
const skew = input.clockSkewMs ?? 5 * 60 * 1000;
|
|
131
|
+
const issuedAtMs = Date.parse(env.issued_at);
|
|
132
|
+
if (Number.isNaN(issuedAtMs)) {
|
|
133
|
+
errors.push('issued_at is not a parseable ISO-8601 timestamp');
|
|
134
|
+
}
|
|
135
|
+
else if (issuedAtMs > now.getTime() + skew) {
|
|
136
|
+
errors.push(`issued_at is in the future beyond clock skew (${env.issued_at})`);
|
|
137
|
+
}
|
|
138
|
+
// §6.4 step 13 — expires_at not in the past
|
|
139
|
+
if (env.expires_at !== undefined) {
|
|
140
|
+
const expMs = Date.parse(env.expires_at);
|
|
141
|
+
if (Number.isNaN(expMs)) {
|
|
142
|
+
errors.push('expires_at is not a parseable ISO-8601 timestamp');
|
|
143
|
+
}
|
|
144
|
+
else if (expMs < now.getTime()) {
|
|
145
|
+
errors.push(`IPR expired at ${env.expires_at}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// §6.4 step 14 — bound_to.ref shape per type
|
|
149
|
+
if (env.bound_to.type === 'action' && !/^[0-9a-f]{64}$/.test(env.bound_to.ref)) {
|
|
150
|
+
errors.push(`bound_to.type='action' requires ref to be 64-char hex sha256, got '${env.bound_to.ref}'`);
|
|
151
|
+
}
|
|
152
|
+
if (env.bound_to.type === 'window' && !/^[^/]+\/[^/]+$/.test(env.bound_to.ref)) {
|
|
153
|
+
errors.push(`bound_to.type='window' requires ref of form '<iso8601>/<iso8601>'`);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
valid: errors.length === 0,
|
|
157
|
+
errors,
|
|
158
|
+
tier,
|
|
159
|
+
contextRoot: expectedContextRoot,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* §6.5 — when an IPR carries `recompute_at_action: true`, every action
|
|
164
|
+
* receipt under its binding scope MUST include `context_root_at_action_time`
|
|
165
|
+
* computed by re-walking discovery_patterns. This helper compares.
|
|
166
|
+
*/
|
|
167
|
+
export function verifyActionTimeContextRoot(input) {
|
|
168
|
+
const errors = [];
|
|
169
|
+
if (!input.envelope.recompute_at_action) {
|
|
170
|
+
errors.push('IPR did not declare recompute_at_action: true; action-time check not applicable');
|
|
171
|
+
return { valid: false, errors };
|
|
172
|
+
}
|
|
173
|
+
if (!/^[0-9a-f]{64}$/.test(input.context_root_at_action_time)) {
|
|
174
|
+
errors.push('context_root_at_action_time must be 64-char lowercase hex');
|
|
175
|
+
return { valid: false, errors };
|
|
176
|
+
}
|
|
177
|
+
if (input.context_root_at_action_time !== input.envelope.context_root) {
|
|
178
|
+
errors.push(`context_drift: action-time root ${input.context_root_at_action_time} differs from IPR root ${input.envelope.context_root}`);
|
|
179
|
+
return { valid: false, errors };
|
|
180
|
+
}
|
|
181
|
+
return { valid: true, errors: [], contextRoot: input.envelope.context_root };
|
|
182
|
+
}
|
|
183
|
+
// ─── helpers ────────────────────────────────────────────────────────
|
|
184
|
+
function verifyEd25519(message, sigHex, publicKeyHex) {
|
|
185
|
+
try {
|
|
186
|
+
const pub = Buffer.from(publicKeyHex, 'hex');
|
|
187
|
+
if (pub.length !== 32)
|
|
188
|
+
return false;
|
|
189
|
+
const derKey = Buffer.concat([SPKI_ED25519_PREFIX, pub]);
|
|
190
|
+
const keyObj = createPublicKey({ key: derKey, format: 'der', type: 'spki' });
|
|
191
|
+
const msg = typeof message === 'string' ? Buffer.from(message, 'utf8') : Buffer.from(message);
|
|
192
|
+
return cryptoVerify(null, msg, keyObj, Buffer.from(sigHex, 'hex'));
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function isSortedByPath(files) {
|
|
199
|
+
for (let i = 1; i < files.length; i++) {
|
|
200
|
+
if (files[i - 1].path > files[i].path)
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Tiny POSIX-glob matcher. Supports `*`, `?`, `**`, character literals.
|
|
207
|
+
* Patterns are matched against canonical relative paths (no leading `/`,
|
|
208
|
+
* forward-slash separators). Patterns may start with `./` (stripped) or
|
|
209
|
+
* `**` for recursive match.
|
|
210
|
+
*/
|
|
211
|
+
export function matchesAnyPattern(path, patterns) {
|
|
212
|
+
for (const raw of patterns) {
|
|
213
|
+
const pat = raw.startsWith('./') ? raw.slice(2) : raw;
|
|
214
|
+
if (matchGlob(path, pat))
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
function matchGlob(path, pattern) {
|
|
220
|
+
const re = globToRegex(pattern);
|
|
221
|
+
return re.test(path);
|
|
222
|
+
}
|
|
223
|
+
/** Compile a POSIX glob to a JS regex. `**` matches any number of segments
|
|
224
|
+
* including zero; `*` matches anything except `/`; `?` matches one non-`/`. */
|
|
225
|
+
function globToRegex(pattern) {
|
|
226
|
+
let i = 0;
|
|
227
|
+
let out = '^';
|
|
228
|
+
while (i < pattern.length) {
|
|
229
|
+
const c = pattern[i];
|
|
230
|
+
if (c === '*') {
|
|
231
|
+
if (pattern[i + 1] === '*') {
|
|
232
|
+
// `**` consumes path segments. Handle leading `**/` and trailing `/**`.
|
|
233
|
+
i += 2;
|
|
234
|
+
if (pattern[i] === '/') {
|
|
235
|
+
out += '(?:.*/)?';
|
|
236
|
+
i += 1;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
out += '.*';
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
out += '[^/]*';
|
|
244
|
+
i += 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
else if (c === '?') {
|
|
248
|
+
out += '[^/]';
|
|
249
|
+
i += 1;
|
|
250
|
+
}
|
|
251
|
+
else if ('.+()|{}[]^$\\'.includes(c)) {
|
|
252
|
+
out += `\\${c}`;
|
|
253
|
+
i += 1;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
out += c;
|
|
257
|
+
i += 1;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
out += '$';
|
|
261
|
+
return new RegExp(out);
|
|
262
|
+
}
|
|
263
|
+
/** Walk the working root and return canonical relative paths matching any
|
|
264
|
+
* discovery pattern. Symlinks are returned as relative paths in their own
|
|
265
|
+
* right (we don't dereference). */
|
|
266
|
+
function walkPatterns(workingRoot, patterns, filesystemMode) {
|
|
267
|
+
const out = [];
|
|
268
|
+
const root = resolve(workingRoot);
|
|
269
|
+
const visit = (dir) => {
|
|
270
|
+
let entries;
|
|
271
|
+
try {
|
|
272
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
for (const ent of entries) {
|
|
278
|
+
const name = String(ent.name);
|
|
279
|
+
const abs = join(dir, name);
|
|
280
|
+
const rel = canonicalizePathSafe(workingRoot, abs, filesystemMode);
|
|
281
|
+
if (rel === null)
|
|
282
|
+
continue;
|
|
283
|
+
if (ent.isDirectory()) {
|
|
284
|
+
visit(abs);
|
|
285
|
+
}
|
|
286
|
+
else if (ent.isFile() || ent.isSymbolicLink()) {
|
|
287
|
+
if (matchesAnyPattern(rel, patterns))
|
|
288
|
+
out.push(rel);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
if (!existsSync(root))
|
|
293
|
+
return out;
|
|
294
|
+
const stat = statSync(root);
|
|
295
|
+
if (!stat.isDirectory())
|
|
296
|
+
return out;
|
|
297
|
+
visit(root);
|
|
298
|
+
return out.sort();
|
|
299
|
+
}
|
|
300
|
+
function canonicalizePathSafe(workingRoot, absPath, filesystemMode) {
|
|
301
|
+
try {
|
|
302
|
+
const rel = relative(workingRoot, absPath);
|
|
303
|
+
if (rel.length === 0 || rel.startsWith('..'))
|
|
304
|
+
return null;
|
|
305
|
+
return canonicalizePath(rel, { workingRoot, filesystemMode });
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/v2/instruction-provenance/verify.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,qCAAqC;AACrC,qEAAqE;AACrE,qEAAqE;AACrE,gFAAgF;AAChF,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,gDAAgD;AAChD,qEAAqE;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,O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|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-passport-system",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Enforcement and accountability layer for AI agents. Bring your own identity (did:key, did:web, SPIFFE, OAuth, did:aps). Policy eval <2ms, 14 constraint dimensions, 403 ops/sec. Gateway enforcement, monotonic narrowing, cascade revocation, Bayesian reputation, feeless Nano payments, unified four-axis attribution primitive, per-period attribution settlement, data lifecycle, mutual authentication. 2,
|
|
3
|
+
"version": "2.4.0-alpha",
|
|
4
|
+
"description": "Enforcement and accountability layer for AI agents. Bring your own identity (did:key, did:web, SPIFFE, OAuth, did:aps). Policy eval <2ms, 14 constraint dimensions, 403 ops/sec. Gateway enforcement, monotonic narrowing, cascade revocation, Bayesian reputation, feeless Nano payments, unified four-axis attribution primitive, per-period attribution settlement, data lifecycle, mutual authentication. 2,410 tests.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "tsc && chmod +x dist/src/cli/index.js",
|
|
23
|
-
"test": "npx tsx --test tests/passport.test.ts tests/adversarial.ts tests/v2.0-integration.ts tests/contract.test.ts tests/agora.test.ts tests/values.test.ts tests/delegation.test.ts tests/attribution.test.ts tests/policy.test.ts tests/canonical.test.ts tests/coordination.test.ts tests/commerce.test.ts tests/enforcement.test.ts tests/routing.test.ts tests/did-vc.test.ts tests/a2a.test.ts tests/principal.test.ts tests/adversarial-paper.test.ts tests/property-delegation.test.ts tests/intent.test.ts tests/reputation-authority.test.ts tests/cross-chain.test.ts tests/encrypted-messaging.test.ts tests/obligations.test.ts tests/execution-envelope.test.ts tests/adversarial-causal-chain.test.ts tests/governance.test.ts tests/feasibility.test.ts tests/identity.test.ts tests/precedent.test.ts tests/reanchor.test.ts tests/escalation.test.ts tests/oracle-witness.test.ts tests/messaging-audit.test.ts tests/policy-conflict.test.ts tests/data-source.test.ts tests/decision-semantics.test.ts tests/interop-vectors.test.ts tests/v2-bridge.test.ts tests/v2-full.test.ts tests/key-storage.test.ts tests/qntm-bridge.test.ts tests/agent-json-bridge.test.ts tests/did-resolution-conformance.test.ts tests/decision-equivalence.test.ts tests/data-lifecycle.test.ts tests/campaign7-composition.test.ts tests/entity-verification.test.ts tests/conformance.test.ts tests/governance-block.test.ts tests/aps-txt.test.ts tests/governance-360.test.ts tests/storage-backend.test.ts tests/receipt-bundle.test.ts tests/reputation-confidence.test.ts tests/governance-consumer.test.ts tests/charter.test.ts tests/rome-phase2.test.ts tests/data-source-attribution.test.ts tests/canonical-jcs.test.ts tests/temporal-spread.test.ts tests/fidelity-pressure.test.ts tests/denial-domains.test.ts tests/data-narrowing.test.ts tests/governance-posture.test.ts tests/anchor-state.test.ts tests/issuer-signature.test.ts tests/openshell-adapter.test.ts tests/attestation.test.ts tests/execution-attestation.test.ts tests/bilateral-receipt.test.ts tests/proof-namespace.test.ts tests/ecosystem-features.test.ts tests/persistent-passport.test.ts tests/security-av.test.ts tests/audit-fixes.test.ts tests/did-interop.test.ts tests/identity-bridge.test.ts tests/vc-wrapper.test.ts tests/identity-pipeline.test.ts tests/cross-protocol/sint-crossverify.test.ts tests/action-ref.test.ts tests/freshness.test.ts tests/evidence-grade.test.ts tests/key-rotation.test.ts tests/governance-regression.test.ts tests/posture-overlay.test.ts tests/feasibility-gateway.test.ts tests/trust-adapters.test.ts tests/evaluation-context.test.ts tests/health.test.ts tests/composio-adapter.test.ts tests/interop/ietf-envelope.test.ts tests/interop/signet-combined.test.ts tests/interop/moltrust-attestation.test.ts tests/interop/cross-protocol-vectors.test.ts tests/interop/receipt-chaining.test.ts tests/ibac-adapter.test.ts tests/langchain-adapter.test.ts tests/crewai-adapter.test.ts tests/mcp-adapter.test.ts tests/a2a-adapter.test.ts tests/gonka-adapter.test.ts tests/cross-algo-mismatch.test.ts tests/credential-lifecycle.test.ts tests/behavioral-memory.test.ts tests/telemetry-scope.test.ts tests/idempotency.test.ts tests/v2/wallet-binding.test.ts tests/v2/wallet-binding-fixture.test.ts tests/v2/credential-check-policy.test.ts tests/v2/delegation-escalation.test.ts tests/v2/attribution-consent.test.ts tests/v2/attribution-integration.test.ts tests/v2/attribution-primitive.test.ts tests/v2/attribution-primitive-integration.test.ts tests/v2/build-b-fractional-weights.test.ts tests/v2/build-b-cross-language.test.ts tests/v2/build-c-settlement.test.ts tests/v2/build-c-cross-language.test.ts tests/v2/build-c-end-to-end.test.ts tests/v2/provisional-statement.test.ts tests/temporal-decay.test.ts tests/confidence-breakdown.test.ts tests/behavioral-fingerprint.test.ts tests/session-boundary.test.ts tests/probe-identity.test.ts tests/v2/cognitive-attestation/envelope.test.ts tests/v2/cognitive-attestation/verify.test.ts tests/v2/cognitive-attestation/adversarial.test.ts tests/v2/mutual-auth/handshake.test.ts tests/v2/mutual-auth/adversarial.test.ts tests/v2/mutual-auth/conformance.test.ts",
|
|
23
|
+
"test": "npx tsx --test tests/passport.test.ts tests/adversarial.ts tests/v2.0-integration.ts tests/contract.test.ts tests/agora.test.ts tests/values.test.ts tests/delegation.test.ts tests/attribution.test.ts tests/policy.test.ts tests/canonical.test.ts tests/coordination.test.ts tests/commerce.test.ts tests/enforcement.test.ts tests/routing.test.ts tests/did-vc.test.ts tests/a2a.test.ts tests/principal.test.ts tests/adversarial-paper.test.ts tests/property-delegation.test.ts tests/intent.test.ts tests/reputation-authority.test.ts tests/cross-chain.test.ts tests/encrypted-messaging.test.ts tests/obligations.test.ts tests/execution-envelope.test.ts tests/adversarial-causal-chain.test.ts tests/governance.test.ts tests/feasibility.test.ts tests/identity.test.ts tests/precedent.test.ts tests/reanchor.test.ts tests/escalation.test.ts tests/oracle-witness.test.ts tests/messaging-audit.test.ts tests/policy-conflict.test.ts tests/data-source.test.ts tests/decision-semantics.test.ts tests/interop-vectors.test.ts tests/v2-bridge.test.ts tests/v2-full.test.ts tests/key-storage.test.ts tests/qntm-bridge.test.ts tests/agent-json-bridge.test.ts tests/did-resolution-conformance.test.ts tests/decision-equivalence.test.ts tests/data-lifecycle.test.ts tests/campaign7-composition.test.ts tests/entity-verification.test.ts tests/conformance.test.ts tests/governance-block.test.ts tests/aps-txt.test.ts tests/governance-360.test.ts tests/storage-backend.test.ts tests/receipt-bundle.test.ts tests/reputation-confidence.test.ts tests/governance-consumer.test.ts tests/charter.test.ts tests/rome-phase2.test.ts tests/data-source-attribution.test.ts tests/canonical-jcs.test.ts tests/temporal-spread.test.ts tests/fidelity-pressure.test.ts tests/denial-domains.test.ts tests/data-narrowing.test.ts tests/governance-posture.test.ts tests/anchor-state.test.ts tests/issuer-signature.test.ts tests/openshell-adapter.test.ts tests/attestation.test.ts tests/execution-attestation.test.ts tests/bilateral-receipt.test.ts tests/proof-namespace.test.ts tests/ecosystem-features.test.ts tests/persistent-passport.test.ts tests/security-av.test.ts tests/audit-fixes.test.ts tests/did-interop.test.ts tests/identity-bridge.test.ts tests/vc-wrapper.test.ts tests/identity-pipeline.test.ts tests/cross-protocol/sint-crossverify.test.ts tests/action-ref.test.ts tests/freshness.test.ts tests/evidence-grade.test.ts tests/key-rotation.test.ts tests/governance-regression.test.ts tests/posture-overlay.test.ts tests/feasibility-gateway.test.ts tests/trust-adapters.test.ts tests/evaluation-context.test.ts tests/health.test.ts tests/composio-adapter.test.ts tests/interop/ietf-envelope.test.ts tests/interop/signet-combined.test.ts tests/interop/moltrust-attestation.test.ts tests/interop/cross-protocol-vectors.test.ts tests/interop/receipt-chaining.test.ts tests/ibac-adapter.test.ts tests/langchain-adapter.test.ts tests/crewai-adapter.test.ts tests/mcp-adapter.test.ts tests/a2a-adapter.test.ts tests/gonka-adapter.test.ts tests/cross-algo-mismatch.test.ts tests/credential-lifecycle.test.ts tests/behavioral-memory.test.ts tests/telemetry-scope.test.ts tests/idempotency.test.ts tests/v2/wallet-binding.test.ts tests/v2/wallet-binding-fixture.test.ts tests/v2/credential-check-policy.test.ts tests/v2/delegation-escalation.test.ts tests/v2/attribution-consent.test.ts tests/v2/attribution-integration.test.ts tests/v2/attribution-primitive.test.ts tests/v2/attribution-primitive-integration.test.ts tests/v2/build-b-fractional-weights.test.ts tests/v2/build-b-cross-language.test.ts tests/v2/build-c-settlement.test.ts tests/v2/build-c-cross-language.test.ts tests/v2/build-c-end-to-end.test.ts tests/v2/provisional-statement.test.ts tests/temporal-decay.test.ts tests/confidence-breakdown.test.ts tests/behavioral-fingerprint.test.ts tests/session-boundary.test.ts tests/probe-identity.test.ts tests/v2/cognitive-attestation/envelope.test.ts tests/v2/cognitive-attestation/verify.test.ts tests/v2/cognitive-attestation/adversarial.test.ts tests/v2/mutual-auth/handshake.test.ts tests/v2/mutual-auth/adversarial.test.ts tests/v2/mutual-auth/conformance.test.ts tests/property-bilateral-receipt.test.ts tests/v2/instruction-provenance/conformance.test.ts tests/v2/instruction-provenance/adversarial.test.ts",
|
|
24
24
|
"test:interop": "npx tsx --test tests/interop/ietf-envelope.test.ts tests/interop/signet-combined.test.ts tests/interop/moltrust-attestation.test.ts tests/interop/cross-protocol-vectors.test.ts tests/interop/receipt-chaining.test.ts",
|
|
25
25
|
"test:quick": "tsx --test tests/passport.test.ts",
|
|
26
|
+
"test:fixtures": "tsx fixtures/bilateral-delegation/test-canonicalize.ts",
|
|
26
27
|
"lint": "tsc --noEmit",
|
|
27
28
|
"clean": "rm -rf dist",
|
|
28
29
|
"prepublishOnly": "npm run build && npm test",
|