agent-passport-system 2.3.0-alpha → 2.5.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 +22 -4
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/v2/accountability/__tests__/action.test.d.ts +2 -0
- package/dist/src/v2/accountability/__tests__/action.test.d.ts.map +1 -0
- package/dist/src/v2/accountability/__tests__/action.test.js +101 -0
- package/dist/src/v2/accountability/__tests__/action.test.js.map +1 -0
- package/dist/src/v2/accountability/__tests__/authority-boundary.test.d.ts +2 -0
- package/dist/src/v2/accountability/__tests__/authority-boundary.test.d.ts.map +1 -0
- package/dist/src/v2/accountability/__tests__/authority-boundary.test.js +79 -0
- package/dist/src/v2/accountability/__tests__/authority-boundary.test.js.map +1 -0
- package/dist/src/v2/accountability/__tests__/bundle.test.d.ts +2 -0
- package/dist/src/v2/accountability/__tests__/bundle.test.d.ts.map +1 -0
- package/dist/src/v2/accountability/__tests__/bundle.test.js +122 -0
- package/dist/src/v2/accountability/__tests__/bundle.test.js.map +1 -0
- package/dist/src/v2/accountability/__tests__/contestability.test.d.ts +2 -0
- package/dist/src/v2/accountability/__tests__/contestability.test.d.ts.map +1 -0
- package/dist/src/v2/accountability/__tests__/contestability.test.js +205 -0
- package/dist/src/v2/accountability/__tests__/contestability.test.js.map +1 -0
- package/dist/src/v2/accountability/__tests__/custody.test.d.ts +2 -0
- package/dist/src/v2/accountability/__tests__/custody.test.d.ts.map +1 -0
- package/dist/src/v2/accountability/__tests__/custody.test.js +155 -0
- package/dist/src/v2/accountability/__tests__/custody.test.js.map +1 -0
- package/dist/src/v2/accountability/__tests__/fixtures.test.d.ts +2 -0
- package/dist/src/v2/accountability/__tests__/fixtures.test.d.ts.map +1 -0
- package/dist/src/v2/accountability/__tests__/fixtures.test.js +48 -0
- package/dist/src/v2/accountability/__tests__/fixtures.test.js.map +1 -0
- package/dist/src/v2/accountability/construct/action.d.ts +7 -0
- package/dist/src/v2/accountability/construct/action.d.ts.map +1 -0
- package/dist/src/v2/accountability/construct/action.js +46 -0
- package/dist/src/v2/accountability/construct/action.js.map +1 -0
- package/dist/src/v2/accountability/construct/authority-boundary.d.ts +7 -0
- package/dist/src/v2/accountability/construct/authority-boundary.d.ts.map +1 -0
- package/dist/src/v2/accountability/construct/authority-boundary.js +34 -0
- package/dist/src/v2/accountability/construct/authority-boundary.js.map +1 -0
- package/dist/src/v2/accountability/construct/bundle.d.ts +19 -0
- package/dist/src/v2/accountability/construct/bundle.d.ts.map +1 -0
- package/dist/src/v2/accountability/construct/bundle.js +63 -0
- package/dist/src/v2/accountability/construct/bundle.js.map +1 -0
- package/dist/src/v2/accountability/construct/contestability.d.ts +9 -0
- package/dist/src/v2/accountability/construct/contestability.d.ts.map +1 -0
- package/dist/src/v2/accountability/construct/contestability.js +62 -0
- package/dist/src/v2/accountability/construct/contestability.js.map +1 -0
- package/dist/src/v2/accountability/construct/custody.d.ts +7 -0
- package/dist/src/v2/accountability/construct/custody.d.ts.map +1 -0
- package/dist/src/v2/accountability/construct/custody.js +41 -0
- package/dist/src/v2/accountability/construct/custody.js.map +1 -0
- package/dist/src/v2/accountability/index.d.ts +12 -0
- package/dist/src/v2/accountability/index.d.ts.map +1 -0
- package/dist/src/v2/accountability/index.js +37 -0
- package/dist/src/v2/accountability/index.js.map +1 -0
- package/dist/src/v2/accountability/types/action.d.ts +24 -0
- package/dist/src/v2/accountability/types/action.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/action.js +11 -0
- package/dist/src/v2/accountability/types/action.js.map +1 -0
- package/dist/src/v2/accountability/types/authority-boundary.d.ts +16 -0
- package/dist/src/v2/accountability/types/authority-boundary.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/authority-boundary.js +12 -0
- package/dist/src/v2/accountability/types/authority-boundary.js.map +1 -0
- package/dist/src/v2/accountability/types/base.d.ts +35 -0
- package/dist/src/v2/accountability/types/base.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/base.js +10 -0
- package/dist/src/v2/accountability/types/base.js.map +1 -0
- package/dist/src/v2/accountability/types/bundle.d.ts +23 -0
- package/dist/src/v2/accountability/types/bundle.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/bundle.js +12 -0
- package/dist/src/v2/accountability/types/bundle.js.map +1 -0
- package/dist/src/v2/accountability/types/contestability.d.ts +31 -0
- package/dist/src/v2/accountability/types/contestability.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/contestability.js +18 -0
- package/dist/src/v2/accountability/types/contestability.js.map +1 -0
- package/dist/src/v2/accountability/types/custody.d.ts +18 -0
- package/dist/src/v2/accountability/types/custody.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/custody.js +14 -0
- package/dist/src/v2/accountability/types/custody.js.map +1 -0
- package/dist/src/v2/accountability/types/index.d.ts +7 -0
- package/dist/src/v2/accountability/types/index.d.ts.map +1 -0
- package/dist/src/v2/accountability/types/index.js +7 -0
- package/dist/src/v2/accountability/types/index.js.map +1 -0
- package/dist/src/v2/accountability/verify/action.d.ts +8 -0
- package/dist/src/v2/accountability/verify/action.d.ts.map +1 -0
- package/dist/src/v2/accountability/verify/action.js +33 -0
- package/dist/src/v2/accountability/verify/action.js.map +1 -0
- package/dist/src/v2/accountability/verify/authority-boundary.d.ts +8 -0
- package/dist/src/v2/accountability/verify/authority-boundary.d.ts.map +1 -0
- package/dist/src/v2/accountability/verify/authority-boundary.js +26 -0
- package/dist/src/v2/accountability/verify/authority-boundary.js.map +1 -0
- package/dist/src/v2/accountability/verify/bundle.d.ts +8 -0
- package/dist/src/v2/accountability/verify/bundle.d.ts.map +1 -0
- package/dist/src/v2/accountability/verify/bundle.js +31 -0
- package/dist/src/v2/accountability/verify/bundle.js.map +1 -0
- package/dist/src/v2/accountability/verify/contestability.d.ts +8 -0
- package/dist/src/v2/accountability/verify/contestability.d.ts.map +1 -0
- package/dist/src/v2/accountability/verify/contestability.js +107 -0
- package/dist/src/v2/accountability/verify/contestability.js.map +1 -0
- package/dist/src/v2/accountability/verify/custody.d.ts +8 -0
- package/dist/src/v2/accountability/verify/custody.d.ts.map +1 -0
- package/dist/src/v2/accountability/verify/custody.js +58 -0
- package/dist/src/v2/accountability/verify/custody.js.map +1 -0
- package/dist/src/v2/index.d.ts +2 -0
- package/dist/src/v2/index.d.ts.map +1 -1
- package/dist/src/v2/index.js +4 -0
- package/dist/src/v2/index.js.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 +3 -3
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// APSBundle — construction
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// merkle_root is computed over receipt_ids sorted lexicographically,
|
|
6
|
+
// hashed leaf-wise, then folded pairwise. Odd-length layers duplicate
|
|
7
|
+
// the trailing leaf. Empty bundles use sha256('') as the sentinel.
|
|
8
|
+
// ══════════════════════════════════════════════════════════════════
|
|
9
|
+
import { createHash } from 'node:crypto';
|
|
10
|
+
import { canonicalizeJCS } from '../../../core/canonical-jcs.js';
|
|
11
|
+
import { sign, publicKeyFromPrivate } from '../../../crypto/keys.js';
|
|
12
|
+
function sha256Hex(input) {
|
|
13
|
+
return createHash('sha256').update(input, 'utf-8').digest('hex');
|
|
14
|
+
}
|
|
15
|
+
/** Balanced binary Merkle tree over sorted receipt ids.
|
|
16
|
+
* Empty input returns sha256('') as the canonical sentinel.
|
|
17
|
+
* Odd-length layers duplicate the trailing element. */
|
|
18
|
+
export function computeMerkleRoot(receiptIds) {
|
|
19
|
+
if (receiptIds.length === 0) {
|
|
20
|
+
return sha256Hex('');
|
|
21
|
+
}
|
|
22
|
+
const sorted = [...receiptIds].sort();
|
|
23
|
+
let layer = sorted.map(id => sha256Hex(id));
|
|
24
|
+
while (layer.length > 1) {
|
|
25
|
+
const next = [];
|
|
26
|
+
for (let i = 0; i < layer.length; i += 2) {
|
|
27
|
+
const left = layer[i];
|
|
28
|
+
const right = i + 1 < layer.length ? layer[i + 1] : layer[i];
|
|
29
|
+
next.push(sha256Hex(left + right));
|
|
30
|
+
}
|
|
31
|
+
layer = next;
|
|
32
|
+
}
|
|
33
|
+
return layer[0];
|
|
34
|
+
}
|
|
35
|
+
export function createAPSBundle(input, bundlerPrivateKey) {
|
|
36
|
+
const timestamp = input.timestamp ?? new Date().toISOString();
|
|
37
|
+
const signer_did = publicKeyFromPrivate(bundlerPrivateKey);
|
|
38
|
+
const merkle_root = computeMerkleRoot(input.receipts.map(r => r.receipt_id));
|
|
39
|
+
const receipt_count = input.receipts.length;
|
|
40
|
+
// Skeleton: receipt_id and signature both empty placeholders. Optional
|
|
41
|
+
// fields (subject_scope) are conditionally spread so the canonical bytes
|
|
42
|
+
// match what JSON.stringify will produce when the fixture is reloaded.
|
|
43
|
+
const skeleton = {
|
|
44
|
+
claim_type: 'aps:bundle:v1',
|
|
45
|
+
receipt_id: '',
|
|
46
|
+
timestamp,
|
|
47
|
+
signer_did,
|
|
48
|
+
scope_of_claim: input.scope_of_claim,
|
|
49
|
+
bundler_did: input.bundler_did,
|
|
50
|
+
period_start: input.period_start,
|
|
51
|
+
period_end: input.period_end,
|
|
52
|
+
...(input.subject_scope !== undefined ? { subject_scope: input.subject_scope } : {}),
|
|
53
|
+
merkle_root,
|
|
54
|
+
receipt_count,
|
|
55
|
+
profile_conformance: input.profile_conformance,
|
|
56
|
+
signature: '',
|
|
57
|
+
};
|
|
58
|
+
const receipt_id = sha256Hex(canonicalizeJCS({ ...skeleton, signature: undefined }));
|
|
59
|
+
const withId = { ...skeleton, receipt_id };
|
|
60
|
+
const signature = sign(canonicalizeJCS({ ...withId, signature: undefined }), bundlerPrivateKey);
|
|
61
|
+
return { ...withId, signature };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/construct/bundle.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContestabilityReceipt, ContestabilityControllerResponse } from '../types/contestability.js';
|
|
2
|
+
export type CreateContestabilityReceiptInput = Omit<ContestabilityReceipt, 'receipt_id' | 'signature' | 'signer_did' | 'timestamp' | 'claim_type' | 'controller_response'> & {
|
|
3
|
+
/** Optional override; defaults to new Date().toISOString(). */
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function createContestabilityReceipt(input: CreateContestabilityReceiptInput, contestantPrivateKey: string): ContestabilityReceipt;
|
|
7
|
+
export type ControllerResponseInput = Omit<ContestabilityControllerResponse, 'response_signature'>;
|
|
8
|
+
export declare function attachControllerResponse(receipt: ContestabilityReceipt, response: ControllerResponseInput, controllerPrivateKey: string): ContestabilityReceipt;
|
|
9
|
+
//# sourceMappingURL=contestability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contestability.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/construct/contestability.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,qBAAqB,EACrB,gCAAgC,EACjC,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,qBAAqB,EACnB,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,qBAAqB,CACxB,GAAG;IACF,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,EACvC,oBAAoB,EAAE,MAAM,GAC3B,qBAAqB,CAkCvB;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,gCAAgC,EAChC,oBAAoB,CACrB,CAAA;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,uBAAuB,EACjC,oBAAoB,EAAE,MAAM,GAC3B,qBAAqB,CAiBvB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// ContestabilityReceipt — construction
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// At filing time: receipt_id and outer signature are computed over the
|
|
6
|
+
// receipt with NO controller_response present. This locks the
|
|
7
|
+
// contestants claim independently of any later controller response.
|
|
8
|
+
//
|
|
9
|
+
// attachControllerResponse re-issues the receipt by adding an
|
|
10
|
+
// independently-signed controller_response. The outer (contestant)
|
|
11
|
+
// signature is unchanged; the response_signature is computed over
|
|
12
|
+
// JCS(receipt with controller_response present and response_signature
|
|
13
|
+
// emptied), so anyone with both DIDs can verify the two assertions
|
|
14
|
+
// separately.
|
|
15
|
+
// ══════════════════════════════════════════════════════════════════
|
|
16
|
+
import { createHash } from 'node:crypto';
|
|
17
|
+
import { canonicalizeJCS } from '../../../core/canonical-jcs.js';
|
|
18
|
+
import { sign, publicKeyFromPrivate } from '../../../crypto/keys.js';
|
|
19
|
+
export function createContestabilityReceipt(input, contestantPrivateKey) {
|
|
20
|
+
if ((input.contestant.did === undefined || input.contestant.did === '') &&
|
|
21
|
+
(input.contestant.pseudonym_hash === undefined || input.contestant.pseudonym_hash === '')) {
|
|
22
|
+
throw new Error('createContestabilityReceipt: contestant must have at least one of did or pseudonym_hash');
|
|
23
|
+
}
|
|
24
|
+
const signer_did = publicKeyFromPrivate(contestantPrivateKey);
|
|
25
|
+
const timestamp = input.timestamp ?? new Date().toISOString();
|
|
26
|
+
const draft = {
|
|
27
|
+
claim_type: 'aps:contestability:v1',
|
|
28
|
+
receipt_id: '',
|
|
29
|
+
timestamp,
|
|
30
|
+
signer_did,
|
|
31
|
+
scope_of_claim: input.scope_of_claim,
|
|
32
|
+
contestant: input.contestant,
|
|
33
|
+
action_id: input.action_id,
|
|
34
|
+
grounds: input.grounds,
|
|
35
|
+
requested_remedy: input.requested_remedy,
|
|
36
|
+
signature: '',
|
|
37
|
+
};
|
|
38
|
+
const receipt_id = createHash('sha256')
|
|
39
|
+
.update(canonicalizeJCS(draft), 'utf8')
|
|
40
|
+
.digest('hex');
|
|
41
|
+
const signed = { ...draft, receipt_id };
|
|
42
|
+
const signature = sign(canonicalizeJCS(signed), contestantPrivateKey);
|
|
43
|
+
return { ...signed, signature };
|
|
44
|
+
}
|
|
45
|
+
export function attachControllerResponse(receipt, response, controllerPrivateKey) {
|
|
46
|
+
// Build the receipt as it will exist post-attach but with the
|
|
47
|
+
// response_signature placeholder, then sign that canonical form.
|
|
48
|
+
const responseDraft = {
|
|
49
|
+
...response,
|
|
50
|
+
response_signature: '',
|
|
51
|
+
};
|
|
52
|
+
const receiptDraft = {
|
|
53
|
+
...receipt,
|
|
54
|
+
controller_response: responseDraft,
|
|
55
|
+
};
|
|
56
|
+
const response_signature = sign(canonicalizeJCS(receiptDraft), controllerPrivateKey);
|
|
57
|
+
return {
|
|
58
|
+
...receipt,
|
|
59
|
+
controller_response: { ...response, response_signature },
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=contestability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contestability.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/construct/contestability.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,uCAAuC;AACvC,qEAAqE;AACrE,uEAAuE;AACvE,8DAA8D;AAC9D,oEAAoE;AACpE,EAAE;AACF,8DAA8D;AAC9D,mEAAmE;AACnE,kEAAkE;AAClE,sEAAsE;AACtE,mEAAmE;AACnE,cAAc;AACd,qEAAqE;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAmBpE,MAAM,UAAU,2BAA2B,CACzC,KAAuC,EACvC,oBAA4B;IAE5B,IACE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC;QACnE,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,cAAc,KAAK,EAAE,CAAC,EACzF,CAAC;QACD,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAA;IACH,CAAC;IAED,MAAM,UAAU,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;IAC7D,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAE7D,MAAM,KAAK,GAA0B;QACnC,UAAU,EAAE,uBAAuB;QACnC,UAAU,EAAE,EAAE;QACd,SAAS;QACT,UAAU;QACV,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,SAAS,EAAE,EAAE;KACd,CAAA;IAED,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC;SACpC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;SACtC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEhB,MAAM,MAAM,GAA0B,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,CAAA;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC,CAAA;IAErE,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC;AAOD,MAAM,UAAU,wBAAwB,CACtC,OAA8B,EAC9B,QAAiC,EACjC,oBAA4B;IAE5B,8DAA8D;IAC9D,iEAAiE;IACjE,MAAM,aAAa,GAAqC;QACtD,GAAG,QAAQ;QACX,kBAAkB,EAAE,EAAE;KACvB,CAAA;IACD,MAAM,YAAY,GAA0B;QAC1C,GAAG,OAAO;QACV,mBAAmB,EAAE,aAAa;KACnC,CAAA;IACD,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,CAAA;IAEpF,OAAO;QACL,GAAG,OAAO;QACV,mBAAmB,EAAE,EAAE,GAAG,QAAQ,EAAE,kBAAkB,EAAE;KACzD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CustodyReceipt } from '../types/custody.js';
|
|
2
|
+
export type CreateCustodyReceiptInput = Omit<CustodyReceipt, 'receipt_id' | 'signature' | 'signer_did' | 'timestamp' | 'claim_type'> & {
|
|
3
|
+
/** Optional override; defaults to new Date().toISOString(). */
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function createCustodyReceipt(input: CreateCustodyReceiptInput, custodianPrivateKey: string): CustodyReceipt;
|
|
7
|
+
//# sourceMappingURL=custody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custody.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/construct/custody.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,cAAc,EACd,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,CACvE,GAAG;IACF,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,EAChC,mBAAmB,EAAE,MAAM,GAC1B,cAAc,CA+BhB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// CustodyReceipt — construction
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// receipt_id is sha256 hex of JCS(receipt with empty receipt_id and
|
|
6
|
+
// empty signature). signature is Ed25519 over JCS(receipt with computed
|
|
7
|
+
// receipt_id and empty signature) — i.e. the signature covers the
|
|
8
|
+
// receipt_id, so any post-signing receipt_id tampering breaks the sig.
|
|
9
|
+
// ══════════════════════════════════════════════════════════════════
|
|
10
|
+
import { createHash } from 'node:crypto';
|
|
11
|
+
import { canonicalizeJCS } from '../../../core/canonical-jcs.js';
|
|
12
|
+
import { sign, publicKeyFromPrivate } from '../../../crypto/keys.js';
|
|
13
|
+
export function createCustodyReceipt(input, custodianPrivateKey) {
|
|
14
|
+
const signer_did = publicKeyFromPrivate(custodianPrivateKey);
|
|
15
|
+
const timestamp = input.timestamp ?? new Date().toISOString();
|
|
16
|
+
const draft = {
|
|
17
|
+
claim_type: 'aps:custody:v1',
|
|
18
|
+
receipt_id: '',
|
|
19
|
+
timestamp,
|
|
20
|
+
signer_did,
|
|
21
|
+
scope_of_claim: input.scope_of_claim,
|
|
22
|
+
custodian_did: input.custodian_did,
|
|
23
|
+
event_type: input.event_type,
|
|
24
|
+
subject_receipt_batch: input.subject_receipt_batch,
|
|
25
|
+
...(input.previous_custody_id !== undefined
|
|
26
|
+
? { previous_custody_id: input.previous_custody_id }
|
|
27
|
+
: {}),
|
|
28
|
+
...(input.next_custodian_did !== undefined
|
|
29
|
+
? { next_custodian_did: input.next_custodian_did }
|
|
30
|
+
: {}),
|
|
31
|
+
purpose: input.purpose,
|
|
32
|
+
signature: '',
|
|
33
|
+
};
|
|
34
|
+
const receipt_id = createHash('sha256')
|
|
35
|
+
.update(canonicalizeJCS(draft), 'utf8')
|
|
36
|
+
.digest('hex');
|
|
37
|
+
const signed = { ...draft, receipt_id };
|
|
38
|
+
const signature = sign(canonicalizeJCS(signed), custodianPrivateKey);
|
|
39
|
+
return { ...signed, signature };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=custody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custody.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/construct/custody.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,gCAAgC;AAChC,qEAAqE;AACrE,oEAAoE;AACpE,wEAAwE;AACxE,kEAAkE;AAClE,uEAAuE;AACvE,qEAAqE;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAWpE,MAAM,UAAU,oBAAoB,CAClC,KAAgC,EAChC,mBAA2B;IAE3B,MAAM,UAAU,GAAG,oBAAoB,CAAC,mBAAmB,CAAC,CAAA;IAC5D,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAE7D,MAAM,KAAK,GAAmB;QAC5B,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,EAAE;QACd,SAAS;QACT,UAAU;QACV,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;QAClD,GAAG,CAAC,KAAK,CAAC,mBAAmB,KAAK,SAAS;YACzC,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE;YACpD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,KAAK,CAAC,kBAAkB,KAAK,SAAS;YACxC,CAAC,CAAC,EAAE,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAAE;YAClD,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,EAAE;KACd,CAAA;IAED,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC;SACpC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;SACtC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEhB,MAAM,MAAM,GAAmB,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,CAAA;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,CAAA;IAEpE,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './types/index.js';
|
|
2
|
+
export { createActionReceipt } from './construct/action.js';
|
|
3
|
+
export { createAuthorityBoundaryReceipt } from './construct/authority-boundary.js';
|
|
4
|
+
export { createCustodyReceipt } from './construct/custody.js';
|
|
5
|
+
export { createContestabilityReceipt, attachControllerResponse } from './construct/contestability.js';
|
|
6
|
+
export { createAPSBundle, computeMerkleRoot } from './construct/bundle.js';
|
|
7
|
+
export { verifyActionReceipt } from './verify/action.js';
|
|
8
|
+
export { verifyAuthorityBoundaryReceipt } from './verify/authority-boundary.js';
|
|
9
|
+
export { verifyCustodyReceipt } from './verify/custody.js';
|
|
10
|
+
export { verifyContestabilityReceipt } from './verify/contestability.js';
|
|
11
|
+
export { verifyAPSBundle } from './verify/bundle.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/accountability/index.ts"],"names":[],"mappings":"AAwBA,cAAc,kBAAkB,CAAA;AAGhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACrG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAG1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// Accountability MVP — Wave 1 attribution-grade receipt surface
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: specs/full-accountability-mvp.md
|
|
6
|
+
//
|
|
7
|
+
// Five primitives:
|
|
8
|
+
// ActionReceipt — what was emitted, by whom, under what authority
|
|
9
|
+
// AuthorityBoundaryReceipt — was the action inside or outside delegation
|
|
10
|
+
// CustodyReceipt — provenance trail of receipt-handling events
|
|
11
|
+
// ContestabilityReceipt — affected-party challenge with controller response
|
|
12
|
+
// APSBundle — signed aggregation envelope with Merkle commitment
|
|
13
|
+
//
|
|
14
|
+
// Every receipt extends AccountabilityReceiptBase and MUST declare its
|
|
15
|
+
// scope_of_claim. Verbal confessions, not brain scans.
|
|
16
|
+
//
|
|
17
|
+
// SDK scope: receipt construction, JCS canonicalization, Ed25519 signing,
|
|
18
|
+
// cryptographic verification, Merkle aggregation.
|
|
19
|
+
//
|
|
20
|
+
// Out of scope (private gateway): replay engines, drift detection, compliance
|
|
21
|
+
// dashboards, cross-tenant correlation, decision-equivalence reports.
|
|
22
|
+
// ══════════════════════════════════════════════════════════════════
|
|
23
|
+
// Types
|
|
24
|
+
export * from './types/index.js';
|
|
25
|
+
// Constructors
|
|
26
|
+
export { createActionReceipt } from './construct/action.js';
|
|
27
|
+
export { createAuthorityBoundaryReceipt } from './construct/authority-boundary.js';
|
|
28
|
+
export { createCustodyReceipt } from './construct/custody.js';
|
|
29
|
+
export { createContestabilityReceipt, attachControllerResponse } from './construct/contestability.js';
|
|
30
|
+
export { createAPSBundle, computeMerkleRoot } from './construct/bundle.js';
|
|
31
|
+
// Verifiers
|
|
32
|
+
export { verifyActionReceipt } from './verify/action.js';
|
|
33
|
+
export { verifyAuthorityBoundaryReceipt } from './verify/authority-boundary.js';
|
|
34
|
+
export { verifyCustodyReceipt } from './verify/custody.js';
|
|
35
|
+
export { verifyContestabilityReceipt } from './verify/contestability.js';
|
|
36
|
+
export { verifyAPSBundle } from './verify/bundle.js';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v2/accountability/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,gEAAgE;AAChE,qEAAqE;AACrE,yCAAyC;AACzC,EAAE;AACF,mBAAmB;AACnB,iFAAiF;AACjF,6EAA6E;AAC7E,6EAA6E;AAC7E,mFAAmF;AACnF,oFAAoF;AACpF,EAAE;AACF,uEAAuE;AACvE,uDAAuD;AACvD,EAAE;AACF,0EAA0E;AAC1E,6DAA6D;AAC7D,EAAE;AACF,8EAA8E;AAC9E,sEAAsE;AACtE,qEAAqE;AAErE,QAAQ;AACR,cAAc,kBAAkB,CAAA;AAEhC,eAAe;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACrG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE1E,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AccountabilityReceiptBase } from './base.js';
|
|
2
|
+
export type SideEffectClass = 'financial' | 'data_modification' | 'external_message' | 'irreversible' | 'subject_affecting' | 'internal_only';
|
|
3
|
+
export interface ActionReceipt extends AccountabilityReceiptBase {
|
|
4
|
+
claim_type: 'aps:action:v1';
|
|
5
|
+
agent_did: string;
|
|
6
|
+
/** sha256 hex of the canonical delegation chain that authorized the agent. */
|
|
7
|
+
delegation_chain_root: string;
|
|
8
|
+
intent_ref?: string;
|
|
9
|
+
policy_ref?: string;
|
|
10
|
+
action: {
|
|
11
|
+
kind: string;
|
|
12
|
+
target: string;
|
|
13
|
+
parameters?: Record<string, unknown>;
|
|
14
|
+
resource_version?: string;
|
|
15
|
+
};
|
|
16
|
+
side_effect_classes: SideEffectClass[];
|
|
17
|
+
transparency_log_inclusion?: {
|
|
18
|
+
log_url: string;
|
|
19
|
+
leaf_hash: string;
|
|
20
|
+
};
|
|
21
|
+
/** RFC 3161 timestamp token, base64-encoded. Optional. */
|
|
22
|
+
rfc3161_timestamp?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/action.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAE1D,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,eAAe,CAAA;AAEnB,MAAM,WAAW,aAAc,SAAQ,yBAAyB;IAC9D,UAAU,EAAE,eAAe,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,8EAA8E;IAC9E,qBAAqB,EAAE,MAAM,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACpC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAC1B,CAAA;IACD,mBAAmB,EAAE,eAAe,EAAE,CAAA;IACtC,0BAA0B,CAAC,EAAE;QAC3B,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// ActionReceipt — declares an action the system observed an agent take
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: specs/full-accountability-mvp.md
|
|
6
|
+
// Verbal confession: this receipt asserts WHAT happened (kind, target,
|
|
7
|
+
// parameters, side-effect classes). It does not claim the agent
|
|
8
|
+
// understood why; that is a separate primitive.
|
|
9
|
+
// ══════════════════════════════════════════════════════════════════
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/action.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,qEAAqE;AACrE,yCAAyC;AACzC,uEAAuE;AACvE,gEAAgE;AAChE,gDAAgD;AAChD,qEAAqE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AccountabilityReceiptBase } from './base.js';
|
|
2
|
+
export type BoundaryResult = 'inside' | 'outside' | 'indeterminate';
|
|
3
|
+
export interface AuthorityBoundaryReceipt extends AccountabilityReceiptBase {
|
|
4
|
+
claim_type: 'aps:authority_boundary:v1';
|
|
5
|
+
/** receipt_id of the ActionReceipt this ruling is about. */
|
|
6
|
+
action_id: string;
|
|
7
|
+
/** DID of the entity that ran the boundary check (typically the gateway). */
|
|
8
|
+
evaluator_did: string;
|
|
9
|
+
/** sha256 hex of the canonical delegation chain evaluated against. */
|
|
10
|
+
delegation_chain_root: string;
|
|
11
|
+
result: BoundaryResult;
|
|
12
|
+
/** Optional human-readable explanation. e.g. "scope 'commerce.purchase'
|
|
13
|
+
* not in delegation" when result='outside'. */
|
|
14
|
+
result_detail?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=authority-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-boundary.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/authority-boundary.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAE1D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAA;AAEnE,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,UAAU,EAAE,2BAA2B,CAAA;IACvC,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,aAAa,EAAE,MAAM,CAAA;IACrB,sEAAsE;IACtE,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB;oDACgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// AuthorityBoundaryReceipt — gateway-side ruling on whether an action
|
|
4
|
+
// fell inside, outside, or at the edge of the agent's delegated scope
|
|
5
|
+
// ══════════════════════════════════════════════════════════════════
|
|
6
|
+
// Spec: specs/full-accountability-mvp.md
|
|
7
|
+
// Pairs with ActionReceipt: the action is what the agent did; the
|
|
8
|
+
// authority-boundary receipt is the evaluator's call on whether that
|
|
9
|
+
// action was authorized. Different signers, distinct trust roles.
|
|
10
|
+
// ══════════════════════════════════════════════════════════════════
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=authority-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority-boundary.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/authority-boundary.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,sEAAsE;AACtE,sEAAsE;AACtE,qEAAqE;AACrE,yCAAyC;AACzC,kEAAkE;AAClE,qEAAqE;AACrE,kEAAkE;AAClE,qEAAqE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Accountability primitive foundation.
|
|
3
|
+
*
|
|
4
|
+
* Verbal confessions, not brain scans. APS receipts are signed declarations
|
|
5
|
+
* about what the system observed, not causal proofs of agent cognition.
|
|
6
|
+
* Every accountability receipt MUST declare its scope_of_claim explicitly.
|
|
7
|
+
*/
|
|
8
|
+
export type CaptureMode = 'gateway_observed' | 'runtime_attested' | 'self_attested' | 'partial' | 'unknown';
|
|
9
|
+
export type Completeness = 'complete' | 'partial' | 'best_effort';
|
|
10
|
+
export interface ScopeOfClaim {
|
|
11
|
+
/** 1-2 sentences: what this receipt claims cryptographically. */
|
|
12
|
+
asserts: string;
|
|
13
|
+
/** Explicit list of what this receipt does NOT prove. */
|
|
14
|
+
does_not_assert: string[];
|
|
15
|
+
capture_mode: CaptureMode;
|
|
16
|
+
completeness: Completeness;
|
|
17
|
+
/** True when the agent itself signed without independent attestation.
|
|
18
|
+
* Self-attested receipts have lower evidentiary weight. */
|
|
19
|
+
self_attested: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AccountabilityReceiptBase {
|
|
22
|
+
/** e.g. 'aps:action:v1', 'aps:authority_boundary:v1' */
|
|
23
|
+
claim_type: string;
|
|
24
|
+
/** sha256(jcs(this excluding signature)) — content-addressed identity */
|
|
25
|
+
receipt_id: string;
|
|
26
|
+
/** ISO 8601 UTC with milliseconds, ending Z */
|
|
27
|
+
timestamp: string;
|
|
28
|
+
/** Ed25519 hex pubkey of signer */
|
|
29
|
+
signer_did: string;
|
|
30
|
+
/** Required honest scope declaration */
|
|
31
|
+
scope_of_claim: ScopeOfClaim;
|
|
32
|
+
/** Ed25519 signature over JCS(this excluding signature), hex */
|
|
33
|
+
signature: string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/base.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAA;AAEjE,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,YAAY,EAAE,WAAW,CAAA;IACzB,YAAY,EAAE,YAAY,CAAA;IAC1B;gEAC4D;IAC5D,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAA;IAClB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,cAAc,EAAE,YAAY,CAAA;IAC5B,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Accountability primitive foundation.
|
|
4
|
+
*
|
|
5
|
+
* Verbal confessions, not brain scans. APS receipts are signed declarations
|
|
6
|
+
* about what the system observed, not causal proofs of agent cognition.
|
|
7
|
+
* Every accountability receipt MUST declare its scope_of_claim explicitly.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/base.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E;;;;;;GAMG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AccountabilityReceiptBase } from './base.js';
|
|
2
|
+
export interface APSBundle extends AccountabilityReceiptBase {
|
|
3
|
+
claim_type: 'aps:bundle:v1';
|
|
4
|
+
bundler_did: string;
|
|
5
|
+
/** ISO 8601 UTC ms + Z, inclusive. */
|
|
6
|
+
period_start: string;
|
|
7
|
+
/** ISO 8601 UTC ms + Z, exclusive. */
|
|
8
|
+
period_end: string;
|
|
9
|
+
/** Optional list of subject DIDs covered. */
|
|
10
|
+
subject_scope?: string[];
|
|
11
|
+
/** sha256 hex of balanced binary tree over sorted receipt_ids. */
|
|
12
|
+
merkle_root: string;
|
|
13
|
+
/** Exact count of bundled receipts. */
|
|
14
|
+
receipt_count: number;
|
|
15
|
+
/** e.g. ['aps:profile/mva-v1']. */
|
|
16
|
+
profile_conformance: string[];
|
|
17
|
+
}
|
|
18
|
+
/** Lightweight reference for tree construction. */
|
|
19
|
+
export interface BundledReceiptRef {
|
|
20
|
+
receipt_id: string;
|
|
21
|
+
claim_type: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/bundle.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAE1D,MAAM,WAAW,SAAU,SAAQ,yBAAyB;IAC1D,UAAU,EAAE,eAAe,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAA;IACrB,mCAAmC;IACnC,mBAAmB,EAAE,MAAM,EAAE,CAAA;CAC9B;AAED,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// APSBundle — signed aggregation envelope over a set of receipts
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: specs/full-accountability-mvp.md
|
|
6
|
+
// A bundler signs a Merkle-rooted commitment over a batch of receipt
|
|
7
|
+
// ids in a closed time window. Survives cryptographic erasure of the
|
|
8
|
+
// underlying content: merkle_root and receipt_count remain verifiable
|
|
9
|
+
// even when the leaves are destroyed.
|
|
10
|
+
// ══════════════════════════════════════════════════════════════════
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/bundle.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,iEAAiE;AACjE,qEAAqE;AACrE,yCAAyC;AACzC,qEAAqE;AACrE,qEAAqE;AACrE,sEAAsE;AACtE,sCAAsC;AACtC,qEAAqE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AccountabilityReceiptBase } from './base.js';
|
|
2
|
+
export type StandingBasis = 'data_subject' | 'third_party' | 'regulator' | 'court' | 'internal_audit' | 'insurer' | 'principal';
|
|
3
|
+
export type RequestedRemedy = 'rollback' | 'review' | 'explanation' | 'compensation' | 'erasure' | 'modification';
|
|
4
|
+
export type ContestStatus = 'filed' | 'under_review' | 'upheld' | 'rejected' | 'remedied' | 'expired' | 'abandoned';
|
|
5
|
+
export interface ContestabilityControllerResponse {
|
|
6
|
+
status: ContestStatus;
|
|
7
|
+
/** ISO 8601 UTC with milliseconds, ending Z. */
|
|
8
|
+
responded_at: string;
|
|
9
|
+
responder_did: string;
|
|
10
|
+
/** Ed25519 hex over canonicalizeJCS(receipt with response_signature emptied). */
|
|
11
|
+
response_signature: string;
|
|
12
|
+
response_detail?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ContestabilityContestant {
|
|
15
|
+
/** Optional — pseudonymous filings are allowed. At least one of did
|
|
16
|
+
* or pseudonym_hash MUST be present. */
|
|
17
|
+
did?: string;
|
|
18
|
+
/** sha256 hex when the contestant prefers a pseudonym. */
|
|
19
|
+
pseudonym_hash?: string;
|
|
20
|
+
standing_basis: StandingBasis;
|
|
21
|
+
}
|
|
22
|
+
export interface ContestabilityReceipt extends AccountabilityReceiptBase {
|
|
23
|
+
claim_type: 'aps:contestability:v1';
|
|
24
|
+
contestant: ContestabilityContestant;
|
|
25
|
+
/** References the contested ActionReceipt.receipt_id. */
|
|
26
|
+
action_id: string;
|
|
27
|
+
grounds: string;
|
|
28
|
+
requested_remedy: RequestedRemedy;
|
|
29
|
+
controller_response?: ContestabilityControllerResponse;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=contestability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contestability.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/contestability.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAE1D,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,aAAa,GACb,WAAW,GACX,OAAO,GACP,gBAAgB,GAChB,SAAS,GACT,WAAW,CAAA;AAEf,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,QAAQ,GACR,aAAa,GACb,cAAc,GACd,SAAS,GACT,cAAc,CAAA;AAElB,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,cAAc,GACd,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CAAA;AAEf,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,aAAa,CAAA;IACrB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC;6CACyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,aAAa,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAsB,SAAQ,yBAAyB;IACtE,UAAU,EAAE,uBAAuB,CAAA;IACnC,UAAU,EAAE,wBAAwB,CAAA;IACpC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,eAAe,CAAA;IACjC,mBAAmB,CAAC,EAAE,gCAAgC,CAAA;CACvD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// ContestabilityReceipt — declares a challenge filed against an action
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: specs/full-accountability-mvp.md
|
|
6
|
+
// The wedge primitive: every observability surface in the market today
|
|
7
|
+
// is operator-facing. ContestabilityReceipt is the first cryptographic
|
|
8
|
+
// format designed for STANDING — the right of an affected party to
|
|
9
|
+
// challenge an automated decision and force a tracked response.
|
|
10
|
+
//
|
|
11
|
+
// The contestant signs a receipt about the FILING. If a controller
|
|
12
|
+
// later responds, the response is appended with an INDEPENDENT
|
|
13
|
+
// signature inside controller_response — the contestants outer
|
|
14
|
+
// signature does not cover that response, so the response cannot
|
|
15
|
+
// retroactively rewrite the original claim.
|
|
16
|
+
// ══════════════════════════════════════════════════════════════════
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=contestability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contestability.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/contestability.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,qEAAqE;AACrE,yCAAyC;AACzC,uEAAuE;AACvE,uEAAuE;AACvE,mEAAmE;AACnE,gEAAgE;AAChE,EAAE;AACF,mEAAmE;AACnE,+DAA+D;AAC/D,+DAA+D;AAC/D,iEAAiE;AACjE,4CAA4C;AAC5C,qEAAqE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AccountabilityReceiptBase } from './base.js';
|
|
2
|
+
export type CustodyEventType = 'created' | 'sealed' | 'transferred' | 'disclosed' | 'redacted' | 'erased' | 'expired' | 'verified';
|
|
3
|
+
export type CustodyPurpose = 'internal_audit' | 'regulator_disclosure' | 'subject_access' | 'litigation_discovery' | 'vendor_handoff' | 'archival' | 'incident_response';
|
|
4
|
+
export interface CustodyReceipt extends AccountabilityReceiptBase {
|
|
5
|
+
claim_type: 'aps:custody:v1';
|
|
6
|
+
custodian_did: string;
|
|
7
|
+
event_type: CustodyEventType;
|
|
8
|
+
subject_receipt_batch: {
|
|
9
|
+
merkle_root: string;
|
|
10
|
+
count: number;
|
|
11
|
+
};
|
|
12
|
+
/** Chains custody events. Set to the previous CustodyReceipt.receipt_id. */
|
|
13
|
+
previous_custody_id?: string;
|
|
14
|
+
/** Receiving custodian DID. Required when event_type === 'transferred'. */
|
|
15
|
+
next_custodian_did?: string;
|
|
16
|
+
purpose: CustodyPurpose;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=custody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custody.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/custody.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAE1D,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,QAAQ,GACR,aAAa,GACb,WAAW,GACX,UAAU,GACV,QAAQ,GACR,SAAS,GACT,UAAU,CAAA;AAEd,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,sBAAsB,GACtB,gBAAgB,GAChB,sBAAsB,GACtB,gBAAgB,GAChB,UAAU,GACV,mBAAmB,CAAA;AAEvB,MAAM,WAAW,cAAe,SAAQ,yBAAyB;IAC/D,UAAU,EAAE,gBAAgB,CAAA;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,gBAAgB,CAAA;IAC5B,qBAAqB,EAAE;QACrB,WAAW,EAAE,MAAM,CAAA;QACnB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;CACxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
|
|
2
|
+
// ══════════════════════════════════════════════════════════════════
|
|
3
|
+
// CustodyReceipt — declares a custody event over a batch of receipts
|
|
4
|
+
// ══════════════════════════════════════════════════════════════════
|
|
5
|
+
// Spec: specs/full-accountability-mvp.md
|
|
6
|
+
// Verbal confession: this receipt asserts WHO held WHAT receipts at
|
|
7
|
+
// WHAT moment, for WHAT purpose. It does not assert the custodians
|
|
8
|
+
// claim is factually accurate; the protocol records the claim, truth
|
|
9
|
+
// is rebuttable. The chain remains verifiable across erasure events
|
|
10
|
+
// (cryptographic-erasure pattern: merkle_root and count are preserved
|
|
11
|
+
// even when the underlying content is destroyed).
|
|
12
|
+
// ══════════════════════════════════════════════════════════════════
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=custody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custody.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/custody.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,qEAAqE;AACrE,qEAAqE;AACrE,yCAAyC;AACzC,oEAAoE;AACpE,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,sEAAsE;AACtE,kDAAkD;AAClD,qEAAqE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/v2/accountability/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ActionReceipt } from '../types/action.js';
|
|
2
|
+
export type ActionReceiptVerifyReason = 'INVALID_CLAIM_TYPE' | 'RECEIPT_ID_MISMATCH' | 'SIGNATURE_INVALID';
|
|
3
|
+
export interface ActionReceiptVerifyResult {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
reason?: ActionReceiptVerifyReason;
|
|
6
|
+
}
|
|
7
|
+
export declare function verifyActionReceipt(receipt: ActionReceipt): ActionReceiptVerifyResult;
|
|
8
|
+
//# sourceMappingURL=action.d.ts.map
|