@agenticprimitives/evaluation 0.0.0-alpha.4 → 0.0.0-alpha.6
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/dist/act.d.ts +97 -0
- package/dist/act.d.ts.map +1 -0
- package/dist/act.js +115 -0
- package/dist/act.js.map +1 -0
- package/dist/assessment.d.ts +136 -0
- package/dist/assessment.d.ts.map +1 -0
- package/dist/assessment.js +162 -0
- package/dist/assessment.js.map +1 -0
- package/dist/canonical.d.ts +2 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +4 -0
- package/dist/canonical.js.map +1 -0
- package/dist/capture.d.ts +90 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +195 -0
- package/dist/capture.js.map +1 -0
- package/dist/compare-runner.d.ts +204 -0
- package/dist/compare-runner.d.ts.map +1 -0
- package/dist/compare-runner.js +313 -0
- package/dist/compare-runner.js.map +1 -0
- package/dist/conformal.d.ts +113 -0
- package/dist/conformal.d.ts.map +1 -0
- package/dist/conformal.js +113 -0
- package/dist/conformal.js.map +1 -0
- package/dist/consensus.d.ts +53 -0
- package/dist/consensus.d.ts.map +1 -0
- package/dist/consensus.js +64 -0
- package/dist/consensus.js.map +1 -0
- package/dist/experiment.d.ts +218 -0
- package/dist/experiment.d.ts.map +1 -0
- package/dist/experiment.js +196 -0
- package/dist/experiment.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +128 -0
- package/dist/ledger.d.ts.map +1 -0
- package/dist/ledger.js +146 -0
- package/dist/ledger.js.map +1 -0
- package/dist/measure.d.ts +63 -0
- package/dist/measure.d.ts.map +1 -0
- package/dist/measure.js +95 -0
- package/dist/measure.js.map +1 -0
- package/dist/replay.d.ts +50 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +61 -0
- package/dist/replay.js.map +1 -0
- package/dist/report.d.ts +189 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +282 -0
- package/dist/report.js.map +1 -0
- package/dist/rollup.d.ts +91 -0
- package/dist/rollup.d.ts.map +1 -0
- package/dist/rollup.js +80 -0
- package/dist/rollup.js.map +1 -0
- package/dist/selection-gates.d.ts +283 -0
- package/dist/selection-gates.d.ts.map +1 -0
- package/dist/selection-gates.js +331 -0
- package/dist/selection-gates.js.map +1 -0
- package/dist/selection-score.d.ts +285 -0
- package/dist/selection-score.d.ts.map +1 -0
- package/dist/selection-score.js +392 -0
- package/dist/selection-score.js.map +1 -0
- package/dist/selection.d.ts +83 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/selection.js +86 -0
- package/dist/selection.js.map +1 -0
- package/dist/signals.d.ts +37 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +44 -0
- package/dist/signals.js.map +1 -0
- package/dist/stats.d.ts +62 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +279 -0
- package/dist/stats.js.map +1 -0
- package/package.json +2 -2
package/dist/act.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** The gold for one case. Parties and the delegator are NAMES in the set (the estate's fixture), resolved to addresses
|
|
2
|
+
* before a run by the caller — a gold file stays readable and the estate stays the source of who is who. */
|
|
3
|
+
export interface ActGoldCaseV1 {
|
|
4
|
+
/** What the reply must be: the act parked for authority, a question back, an answer (a read), or a refusal. */
|
|
5
|
+
reply: 'authority_required' | 'prompt' | 'answer' | 'done' | 'refused';
|
|
6
|
+
/** The capability the act exercises (authority_required / prompt), or the read that answers (answer). */
|
|
7
|
+
capability?: string;
|
|
8
|
+
/** Argument → the agent it must resolve to (a name here; an address after `resolveActGold`). */
|
|
9
|
+
parties?: Record<string, string>;
|
|
10
|
+
/** Whose authority the act needs — the mandate's delegator (a name; an address after resolution). */
|
|
11
|
+
delegator?: string;
|
|
12
|
+
/** Requirement limits that must hold exactly (e.g. `{ maxAmount: '3000000' }` — base units). */
|
|
13
|
+
limits?: Record<string, string>;
|
|
14
|
+
/** For `prompt`: fields the question must ask for (any order; others may be asked too); `usdc|amount` = either name. */
|
|
15
|
+
promptFields?: string[];
|
|
16
|
+
/** The run's provenance must hold the act's step (realizing the capability, governed by a skill contract). */
|
|
17
|
+
/** `true`: the act's step is Suspended or Completed; `'dry-run'`: a self-acting write held by a comparison run (Skipped). */
|
|
18
|
+
receipt?: boolean | 'dry-run';
|
|
19
|
+
/** Capabilities the run must NOT reach (a near-neighbour act the words could be mistaken for). */
|
|
20
|
+
forbidden?: string[];
|
|
21
|
+
/** Spec 420 — the domain principles (`appr:` ids, tbox/principles.ttl) this case tests; its verdict counts toward each. */
|
|
22
|
+
principles?: string[];
|
|
23
|
+
/** Spec 420 W4 — a UX ACTION: the plan a Home button supplies (its words ride as the message). The run is judged the same way;
|
|
24
|
+
* a read must also return its rows to the screen (`results` for each supplied tool). */
|
|
25
|
+
supplied?: {
|
|
26
|
+
steps: Array<{
|
|
27
|
+
toolId: string;
|
|
28
|
+
args: Record<string, unknown>;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
/** Spec 420 §10 — keys the capability's result must NOT carry (a supplied read that must withhold its rows: `['members']`).
|
|
32
|
+
* Judged on the result's KEYS only; no row is read. */
|
|
33
|
+
withholds?: string[];
|
|
34
|
+
/** Spec 421 W3 — what the act's arguments must CARRY (`argName` → text, `a|b` alternatives; `*` = any argument): the fact
|
|
35
|
+
* that came from what was read ("Linden" in a remembered address). A plan that acts on the sentence's own words passes
|
|
36
|
+
* every other check and fails this one — the hollow success the continuation laboratory exists to catch. */
|
|
37
|
+
argsInclude?: Record<string, string>;
|
|
38
|
+
/** Spec 421 W2 — the arguments the reply must NAME as having come from someone else's words (the card's warning). */
|
|
39
|
+
flags?: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface ActGoldV1 {
|
|
42
|
+
type: 'ap.act-gold.v1';
|
|
43
|
+
replaySetDigest?: string;
|
|
44
|
+
note?: string;
|
|
45
|
+
estate?: string;
|
|
46
|
+
cases: Record<string, ActGoldCaseV1>;
|
|
47
|
+
}
|
|
48
|
+
/** What a reply said about the act — taken from the reply by the caller; addresses lowercased. */
|
|
49
|
+
export interface ActCaptureV1 {
|
|
50
|
+
kind: string;
|
|
51
|
+
capability?: string;
|
|
52
|
+
delegator?: string;
|
|
53
|
+
limits?: Record<string, string | number>;
|
|
54
|
+
parties?: Record<string, string>;
|
|
55
|
+
promptFields?: string[];
|
|
56
|
+
/** The tools the plan named, in order (to check `forbidden`). */
|
|
57
|
+
planned?: string[];
|
|
58
|
+
/** Spec 421 W2 — the act's arguments the reply said came only from someone else's words. */
|
|
59
|
+
fromOthers?: string[];
|
|
60
|
+
/** The plan's steps with their arguments (for `argsInclude`). */
|
|
61
|
+
plannedArgs?: Array<{
|
|
62
|
+
toolId: string;
|
|
63
|
+
args: Record<string, unknown>;
|
|
64
|
+
}>;
|
|
65
|
+
/** Tools whose rows came back to the surface (`results[]` on a supplied plan's reply). */
|
|
66
|
+
results?: string[];
|
|
67
|
+
/** The KEYS of each supplied tool's result (never the values) — for `withholds`. */
|
|
68
|
+
resultKeys?: Record<string, string[]>;
|
|
69
|
+
/** Of those keys, the ones whose value is an empty list or object. */
|
|
70
|
+
resultEmpty?: Record<string, string[]>;
|
|
71
|
+
}
|
|
72
|
+
/** One step of the run as its provenance records it. */
|
|
73
|
+
export interface ActStepV1 {
|
|
74
|
+
capability: string | null;
|
|
75
|
+
state: string | null;
|
|
76
|
+
skill: string | null;
|
|
77
|
+
}
|
|
78
|
+
/** The judgement: every check by name, and right only when all hold. Booleans only — no addresses leave. */
|
|
79
|
+
export interface ActVerdictV1 {
|
|
80
|
+
right: boolean;
|
|
81
|
+
checks: Record<string, boolean>; /** Spec 420 — the principles this case tests. */
|
|
82
|
+
principles?: string[];
|
|
83
|
+
}
|
|
84
|
+
/** The steps a run's provenance graph records (JSON-LD graph as `/harness/provenance` returns it). */
|
|
85
|
+
export declare function actStepsOf(graph: unknown): ActStepV1[];
|
|
86
|
+
export declare function judgeAct(gold: ActGoldCaseV1, got: ActCaptureV1, steps: readonly ActStepV1[]): ActVerdictV1;
|
|
87
|
+
/** The reply of `/harness/ask`, read for the act — the one place the reply's shape is interpreted. */
|
|
88
|
+
export declare function actCaptureOf(reply: unknown): ActCaptureV1;
|
|
89
|
+
/** Names in the gold → addresses, by the estate's own resolver (the caller's). A name that resolves nowhere is an error:
|
|
90
|
+
* a case whose gold names nobody cannot be judged. */
|
|
91
|
+
export declare function resolveActGold(gold: ActGoldV1, resolveName: (name: string) => Promise<string | null>): Promise<ActGoldV1>;
|
|
92
|
+
/** Spec 420 — right / total per principle over act verdicts (each case's verdict counts toward every principle it cites). */
|
|
93
|
+
export declare function principleCoverageOf(verdicts: ReadonlyArray<ActVerdictV1 | undefined>): Record<string, {
|
|
94
|
+
right: number;
|
|
95
|
+
total: number;
|
|
96
|
+
}>;
|
|
97
|
+
//# sourceMappingURL=act.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../src/act.ts"],"names":[],"mappings":"AASA;6GAC6G;AAC7G,MAAM,WAAW,aAAa;IAC5B,+GAA+G;IAC/G,KAAK,EAAE,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IACvE,yGAAyG;IACzG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,qGAAqG;IACrG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,wHAAwH;IACxH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,8GAA8G;IAC9G,6HAA6H;IAC7H,OAAO,CAAC,EAAE,OAAO,G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,QAAQ,EAAE,aAAa,CAAC,YAAY,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAIvI"}
|
package/dist/act.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// THE ACT LABORATORY — spec 418 §12. The CIL Commons sets ask "did we pick the right writer, and was the writing good?";
|
|
2
|
+
// a Home act asks something else: did the harness reach THE act the person asked for — the right capability, the parties
|
|
3
|
+
// her words named resolved to the right agents, the amount she said, whose authority it needs — and did it leave the
|
|
4
|
+
// receipt? A payment that parks for the wrong account is a wrong outcome even when the pick was right.
|
|
5
|
+
//
|
|
6
|
+
// Nothing here signs or moves anything. An act under test ends where the person would sign (`authority_required`) or
|
|
7
|
+
// where she would be asked (`prompt`); the gold says which, and what would have been signed. Every check is
|
|
8
|
+
// deterministic over the reply and the run's own provenance — no model judges an act.
|
|
9
|
+
const lc = (s) => (s ?? '').toLowerCase();
|
|
10
|
+
/** The steps a run's provenance graph records (JSON-LD graph as `/harness/provenance` returns it). */
|
|
11
|
+
export function actStepsOf(graph) {
|
|
12
|
+
const nodes = (graph?.graph ?? []);
|
|
13
|
+
const byId = new Map(nodes.map((n) => [String(n['id']), n]));
|
|
14
|
+
const run = nodes.find((n) => Array.isArray(n['hasStep']) || typeof n['hasStep'] === 'string');
|
|
15
|
+
const ids = run ? [].concat(run['hasStep']).map(String) : [];
|
|
16
|
+
return ids.map((id) => byId.get(id)).filter((n) => !!n).map((n) => ({
|
|
17
|
+
capability: typeof n['realizesCapability'] === 'string' ? String(n['realizesCapability']).replace(/^urn:ap:capability:/, '') : null,
|
|
18
|
+
state: typeof n['completionState'] === 'string' ? String(n['completionState']) : null,
|
|
19
|
+
skill: typeof n['governedBySkill'] === 'string' ? String(n['governedBySkill']) : null,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
export function judgeAct(gold, got, steps) {
|
|
23
|
+
// A write HELD by a comparison's dry run is reported as not saved — `done` or `answer` both say the run reached it.
|
|
24
|
+
const checks = { reply: gold.receipt === 'dry-run' ? got.kind === 'done' || got.kind === 'answer' : got.kind === gold.reply };
|
|
25
|
+
if (gold.capability)
|
|
26
|
+
checks['capability'] = gold.reply === 'answer' || gold.reply === 'done' || gold.reply === 'refused' ? (got.planned ?? []).includes(gold.capability) : got.capability === gold.capability;
|
|
27
|
+
for (const [arg, want] of Object.entries(gold.parties ?? {}))
|
|
28
|
+
checks[`party:${arg}`] = lc(got.parties?.[arg]) === lc(want);
|
|
29
|
+
if (gold.delegator)
|
|
30
|
+
checks['delegator'] = lc(got.delegator) === lc(gold.delegator);
|
|
31
|
+
for (const [k, v] of Object.entries(gold.limits ?? {}))
|
|
32
|
+
checks[`limit:${k}`] = String(got.limits?.[k] ?? '') === v;
|
|
33
|
+
// `a|b` — the argument under any of its declared names (the harness may ask for `usdc` as `amount`).
|
|
34
|
+
for (const f of gold.promptFields ?? [])
|
|
35
|
+
checks[`asks:${f}`] = f.split('|').some((x) => (got.promptFields ?? []).includes(x));
|
|
36
|
+
if (gold.receipt && gold.capability)
|
|
37
|
+
checks['receipt'] = steps.some((s) => s.capability === gold.capability && !!s.skill && (gold.receipt === 'dry-run' ? s.state === 'Skipped' : s.state === 'Suspended' || s.state === 'Completed'));
|
|
38
|
+
if (gold.supplied && gold.reply === 'answer')
|
|
39
|
+
for (const st of gold.supplied.steps)
|
|
40
|
+
checks[`rows:${st.toolId}`] = (got.results ?? []).includes(st.toolId);
|
|
41
|
+
// Withheld = the key is absent, or present and EMPTY (a refused roster answers `members: []`): nothing was disclosed either way.
|
|
42
|
+
if (gold.withholds?.length && gold.capability)
|
|
43
|
+
for (const k of gold.withholds)
|
|
44
|
+
checks[`withholds:${k}`] = !(got.resultKeys?.[gold.capability] ?? []).includes(k) || (got.resultEmpty?.[gold.capability] ?? []).includes(k);
|
|
45
|
+
for (const f of gold.forbidden ?? [])
|
|
46
|
+
checks[`not:${f}`] = !(got.planned ?? []).includes(f) && got.capability !== f;
|
|
47
|
+
for (const a of gold.flags ?? [])
|
|
48
|
+
checks[`flags:${a}`] = (got.fromOthers ?? []).includes(a);
|
|
49
|
+
for (const [arg, want] of Object.entries(gold.argsInclude ?? {})) {
|
|
50
|
+
const steps = (got.plannedArgs ?? []).filter((p) => p.toolId === gold.capability);
|
|
51
|
+
const values = steps.flatMap((p) => (arg === '*' ? Object.values(p.args) : [p.args[arg]])).map((v) => lc(typeof v === 'string' ? v : JSON.stringify(v ?? '')));
|
|
52
|
+
checks[`carries:${arg}`] = want.split('|').some((w) => values.some((v) => v.includes(lc(w))));
|
|
53
|
+
}
|
|
54
|
+
return { right: Object.values(checks).every(Boolean), checks, ...(gold.principles?.length ? { principles: [...gold.principles] } : {}) };
|
|
55
|
+
}
|
|
56
|
+
/** The reply of `/harness/ask`, read for the act — the one place the reply's shape is interpreted. */
|
|
57
|
+
export function actCaptureOf(reply) {
|
|
58
|
+
const r = (reply ?? {});
|
|
59
|
+
const parties = Object.fromEntries((r.parties ?? []).flatMap((p) => (p.arg && p.agent ? [[p.arg, p.agent.toLowerCase()]] : [])));
|
|
60
|
+
// A question back names no capability on the reply; the step it asks about does (`s<N>` → the plan's step N).
|
|
61
|
+
const planned = (r.plannerTrace?.plan ?? []).map((p) => String(p.toolId ?? ''));
|
|
62
|
+
const asked = r.prompt?.stepRef?.match(/^s(\d+)$/)?.[1];
|
|
63
|
+
const capability = r.capability ?? (r.kind === 'prompt' && asked !== undefined ? planned[Number(asked)] : undefined);
|
|
64
|
+
return {
|
|
65
|
+
kind: String(r.kind ?? 'none'),
|
|
66
|
+
...(capability ? { capability } : {}),
|
|
67
|
+
...(r.delegator ? { delegator: r.delegator.toLowerCase() } : {}),
|
|
68
|
+
...(r.requirement?.limits ? { limits: r.requirement.limits } : {}),
|
|
69
|
+
...(Object.keys(parties).length ? { parties } : {}),
|
|
70
|
+
...(r.prompt?.fields?.length ? { promptFields: r.prompt.fields.map((f) => (typeof f === 'string' ? f : String(f.name ?? ''))) } : {}),
|
|
71
|
+
...(r.plannerTrace?.plan?.length ? { planned: r.plannerTrace.plan.map((p) => String(p.toolId ?? '')) } : {}),
|
|
72
|
+
...(Array.isArray(r.fromOthers) ? { fromOthers: (r.fromOthers).map((x) => String(x.arg ?? '')) } : {}),
|
|
73
|
+
...(r.plannerTrace?.plan?.length ? { plannedArgs: r.plannerTrace.plan.map((p) => ({ toolId: String(p.toolId ?? ''), args: (p.args ?? {}) })) } : {}),
|
|
74
|
+
...(Array.isArray(r.results) ? { results: (r.results).map((x) => String(x.toolId ?? '')) } : {}),
|
|
75
|
+
...(Array.isArray(r.results) ? { resultEmpty: Object.fromEntries((r.results).map((x) => [String(x.toolId ?? ''), x.result && typeof x.result === 'object' ? Object.entries(x.result).filter(([, v]) => (Array.isArray(v) && v.length === 0) || (v && typeof v === 'object' && !Array.isArray(v) && Object.keys(v).length === 0)).map(([k]) => k) : []])) } : {}),
|
|
76
|
+
...(Array.isArray(r.results) ? { resultKeys: Object.fromEntries((r.results).map((x) => [String(x.toolId ?? ''), x.result && typeof x.result === 'object' ? Object.keys(x.result) : []])) } : {}),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** Names in the gold → addresses, by the estate's own resolver (the caller's). A name that resolves nowhere is an error:
|
|
80
|
+
* a case whose gold names nobody cannot be judged. */
|
|
81
|
+
export async function resolveActGold(gold, resolveName) {
|
|
82
|
+
const memo = new Map();
|
|
83
|
+
const addr = async (v) => {
|
|
84
|
+
if (/^0x[0-9a-fA-F]{40}$/.test(v))
|
|
85
|
+
return v.toLowerCase();
|
|
86
|
+
if (!memo.has(v)) {
|
|
87
|
+
const a = await resolveName(v);
|
|
88
|
+
if (!a)
|
|
89
|
+
throw new Error(`act gold names "${v}", which resolves to no agent on this estate`);
|
|
90
|
+
memo.set(v, a.toLowerCase());
|
|
91
|
+
}
|
|
92
|
+
return memo.get(v);
|
|
93
|
+
};
|
|
94
|
+
const cases = {};
|
|
95
|
+
for (const [id, c] of Object.entries(gold.cases)) {
|
|
96
|
+
const parties = {};
|
|
97
|
+
for (const [k, v] of Object.entries(c.parties ?? {}))
|
|
98
|
+
parties[k] = await addr(v);
|
|
99
|
+
cases[id] = { ...c, ...(c.parties ? { parties } : {}), ...(c.delegator ? { delegator: await addr(c.delegator) } : {}) };
|
|
100
|
+
}
|
|
101
|
+
return { ...gold, cases };
|
|
102
|
+
}
|
|
103
|
+
/** Spec 420 — right / total per principle over act verdicts (each case's verdict counts toward every principle it cites). */
|
|
104
|
+
export function principleCoverageOf(verdicts) {
|
|
105
|
+
const out = {};
|
|
106
|
+
for (const v of verdicts)
|
|
107
|
+
for (const p of v?.principles ?? []) {
|
|
108
|
+
const e = (out[p] ??= { right: 0, total: 0 });
|
|
109
|
+
e.total++;
|
|
110
|
+
if (v.right)
|
|
111
|
+
e.right++;
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=act.js.map
|
package/dist/act.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"act.js","sourceRoot":"","sources":["../src/act.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,yHAAyH;AACzH,qHAAqH;AACrH,uGAAuG;AACvG,EAAE;AACF,qHAAqH;AACrH,4GAA4G;AAC5G,sFAAsF;AAmEtF,MAAM,EAAE,GAAG,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAE9D,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,MAAM,KAAK,GAAG,CAAE,KAA2D,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1F,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CA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AC;QACjF,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAC1H,CAAC;IACD,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,6HAA6H;AAC7H,MAAM,UAAU,mBAAmB,CAAC,QAAiD;IACnF,MAAM,GAAG,GAAqD,EAAE,CAAC;IACjE,KAAK,MAAM,CAAC,IAAI,QAAQ;QAAE,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,IAAI,EAAE,EAAE,CAAC;YAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAAC,IAAI,CAAE,CAAC,KAAK;gBAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAAC,CAAC;IACrJ,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { JudgeKindV1 } from './selection.js';
|
|
2
|
+
/** EARL's outcome vocabulary. `cantTell` is a real verdict — it is never rounded to a pass or a fail (J8). */
|
|
3
|
+
export type AssessmentOutcomeV1 = 'passed' | 'failed' | 'cantTell' | 'inapplicable' | 'untested';
|
|
4
|
+
export interface AssessmentSubjectV1 {
|
|
5
|
+
runRef: string;
|
|
6
|
+
/** The digest of the record as judged. A later reader comparing this to the record they fetched learns
|
|
7
|
+
* whether the assessment is even about the same document. */
|
|
8
|
+
recordDigest: string;
|
|
9
|
+
/** ISO — when the subject came into being. Compared against `criteria.statedAt` for J2. */
|
|
10
|
+
at: string;
|
|
11
|
+
artifactDigests?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export interface AssessmentCriteriaV1 {
|
|
14
|
+
outcomeId: string;
|
|
15
|
+
/** The `OutcomeSpecificationV1` revision judged against (revisions are new entities, never edits). */
|
|
16
|
+
revision: number;
|
|
17
|
+
digest: string;
|
|
18
|
+
/** ISO — when this revision was stated. MUST pre-date `subject.at` (J2). */
|
|
19
|
+
statedAt: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AssessmentEvaluatorV1 {
|
|
22
|
+
/** The evaluator's Smart Agent address. For a mechanical or model evaluator this is a Service Agent. */
|
|
23
|
+
sa: string;
|
|
24
|
+
kind: JudgeKindV1;
|
|
25
|
+
/** Digest of the implementation (mechanical) — so J5 reproducibility can be claimed or honestly refused. */
|
|
26
|
+
implementation?: string;
|
|
27
|
+
modelRef?: string;
|
|
28
|
+
promptDigest?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface AssessmentResultV1 {
|
|
31
|
+
criterionId: string;
|
|
32
|
+
outcome: AssessmentOutcomeV1;
|
|
33
|
+
/** What the verdict rests on. An empty list is allowed only for `untested` / `inapplicable`. */
|
|
34
|
+
evidenceRefs: readonly string[];
|
|
35
|
+
/** An optional number for criteria that are scored rather than passed. Aggregation uses it; nothing else does. */
|
|
36
|
+
score?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface AssessmentV1 {
|
|
39
|
+
schema: 'apeval/AssessmentV1';
|
|
40
|
+
subject: AssessmentSubjectV1;
|
|
41
|
+
criteria: AssessmentCriteriaV1;
|
|
42
|
+
evaluator: AssessmentEvaluatorV1;
|
|
43
|
+
results: readonly AssessmentResultV1[];
|
|
44
|
+
/** ISO — when the judgment was made. */
|
|
45
|
+
at: string;
|
|
46
|
+
/** The digest of the assessment this one replaces. The replaced one remains readable. */
|
|
47
|
+
supersedes?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface SignedAssessmentV1 {
|
|
50
|
+
assessment: AssessmentV1;
|
|
51
|
+
/** sha256 over the assessment's canonical JSON — what was signed. */
|
|
52
|
+
digest: `sha256:${string}`;
|
|
53
|
+
/** The signature, in whatever form the binding produced (ERC-1271, or the `0x51` session-wrapped form). */
|
|
54
|
+
signature: string;
|
|
55
|
+
}
|
|
56
|
+
/** The assessment's identity: sha256 over its canonical JSON. Two assessments with the same content have the
|
|
57
|
+
* same digest whatever order their keys were written in. */
|
|
58
|
+
export declare const assessmentDigest: (a: AssessmentV1) => Promise<`sha256:${string}`>;
|
|
59
|
+
export interface AssessmentValidationV1 {
|
|
60
|
+
ok: boolean;
|
|
61
|
+
/** Every problem found, not just the first: a caller fixing one at a time learns the next only by retrying. */
|
|
62
|
+
problems: string[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The structural rules, checked without any cryptography — so they can be run before signing, in a test, or
|
|
66
|
+
* over an assessment that arrived from somewhere else.
|
|
67
|
+
*/
|
|
68
|
+
export declare function validateAssessment(a: AssessmentV1): AssessmentValidationV1;
|
|
69
|
+
/** Signs the assessment's digest. Whatever key it uses, the binding must be the evaluator's own delegate. */
|
|
70
|
+
export type AssessmentSigner = (digest: `sha256:${string}`) => Promise<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Who actually signed, as the binding can determine it.
|
|
73
|
+
*
|
|
74
|
+
* `delegator` is what makes the session form checkable: for a `0x51` session-wrapped signature the binding
|
|
75
|
+
* recovers the session key AND the wire it signed under, and the wire's delegator is the evaluator the
|
|
76
|
+
* assessment claims. For a human assessment (ERC-1271 by the person's own account) `signer` is the answer and
|
|
77
|
+
* `delegator` is absent.
|
|
78
|
+
*/
|
|
79
|
+
export interface AssessmentSignatureFacts {
|
|
80
|
+
ok: boolean;
|
|
81
|
+
signer?: string;
|
|
82
|
+
delegator?: string;
|
|
83
|
+
/** The selector the wire was pinned to, when there was one. Expected to be `assessment.issue`. */
|
|
84
|
+
selector?: string;
|
|
85
|
+
reason?: string;
|
|
86
|
+
}
|
|
87
|
+
export type AssessmentVerifier = (input: {
|
|
88
|
+
digest: `sha256:${string}`;
|
|
89
|
+
signature: string;
|
|
90
|
+
}) => Promise<AssessmentSignatureFacts>;
|
|
91
|
+
/** The selector an assessment-issuing wire is pinned to. A wire that may do anything is not this wire. */
|
|
92
|
+
export declare const ASSESSMENT_SELECTOR = "assessment.issue";
|
|
93
|
+
export declare function signAssessment(a: AssessmentV1, sign: AssessmentSigner): Promise<SignedAssessmentV1>;
|
|
94
|
+
export interface AssessmentVerdictV1 {
|
|
95
|
+
ok: boolean;
|
|
96
|
+
problems: string[];
|
|
97
|
+
signer?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Verify a signed assessment: the digest recomputes, the structure holds, and the signer is the evaluator's
|
|
101
|
+
* own delegate.
|
|
102
|
+
*
|
|
103
|
+
* Every failure is reported rather than thrown, because an assessment that does not verify is a FACT about
|
|
104
|
+
* the evidence someone is holding, and a thrown error tends to be caught and turned into silence.
|
|
105
|
+
*/
|
|
106
|
+
export declare function verifyAssessment(signed: SignedAssessmentV1, verify: AssessmentVerifier): Promise<AssessmentVerdictV1>;
|
|
107
|
+
/** The vault record key for a run's assessments. Mirrors `runMeasuresRecordKey`. */
|
|
108
|
+
export declare const runAssessmentRecordKey: (runRef: string) => string;
|
|
109
|
+
export type AssessmentReadV1 = {
|
|
110
|
+
found: true;
|
|
111
|
+
assessments: SignedAssessmentV1[];
|
|
112
|
+
} | {
|
|
113
|
+
found: false;
|
|
114
|
+
} | {
|
|
115
|
+
refused: string;
|
|
116
|
+
};
|
|
117
|
+
export interface AssessmentStorePort {
|
|
118
|
+
readonly binding: string;
|
|
119
|
+
/** APPEND, never replace: a correction is a new assessment that supersedes an earlier one, and the earlier
|
|
120
|
+
* one stays readable (§5). A store that overwrote would quietly make the chain unverifiable. */
|
|
121
|
+
append(agent: string, runRef: string, signed: SignedAssessmentV1): Promise<{
|
|
122
|
+
ok: true;
|
|
123
|
+
} | {
|
|
124
|
+
refused: string;
|
|
125
|
+
}>;
|
|
126
|
+
get(agent: string, runRef: string): Promise<AssessmentReadV1>;
|
|
127
|
+
}
|
|
128
|
+
/** The assessments that currently STAND: those nothing else supersedes. Pure, so a caller can resolve the
|
|
129
|
+
* chain without the store. An assessment naming a `supersedes` digest nobody holds is kept and reported —
|
|
130
|
+
* dropping it would hide a correction whose predecessor is merely missing. */
|
|
131
|
+
export declare function standingAssessments(signed: readonly SignedAssessmentV1[]): {
|
|
132
|
+
standing: SignedAssessmentV1[];
|
|
133
|
+
superseded: SignedAssessmentV1[];
|
|
134
|
+
danglingSupersedes: string[];
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=assessment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment.d.ts","sourceRoot":"","sources":["../src/assessment.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,8GAA8G;AAC9G,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,UAAU,CAAC;AAEjG,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf;kEAC8D;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,sGAAsG;IACtG,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,wGAAwG;IACxG,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;I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AM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/G,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC/D;AAED;;+EAE+E;AAC/E,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,kBAAkB,EAAE,GACpC;IAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAAC,UAAU,EAAE,kBAAkB,EAAE,CAAC;IAAC,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAAE,CAepG"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// ASSESSMENTS — spec 438 §5, finishing the seam spec 414 §3.4 opened and left to "a later spec".
|
|
2
|
+
//
|
|
3
|
+
// ── WHAT AN ASSESSMENT IS, AND WHAT MAKES IT SAFE ─────────────────────────────────────────────────
|
|
4
|
+
// A run record is evidence of what happened. An assessment is somebody's judgment OF it. The one design
|
|
5
|
+
// decision everything else follows from: **an assessment never edits the record it is about.** It is a
|
|
6
|
+
// separate signed assertion, stored beside the run, and a correction is a NEW assessment that supersedes the
|
|
7
|
+
// old one — the earlier one stays readable. A record of opinions that can be rewritten is not a record, and
|
|
8
|
+
// a trace that a verdict can alter stops being a trace (414 J6).
|
|
9
|
+
//
|
|
10
|
+
// Three rules are enforced here rather than left to callers, because each is the kind of thing that is
|
|
11
|
+
// obviously right and quietly skipped:
|
|
12
|
+
//
|
|
13
|
+
// J2 The criteria must be STATED BEFORE the subject they judge, and cited by digest. An assessment whose
|
|
14
|
+
// criteria were written after the run is a verdict in search of premises; this module refuses it.
|
|
15
|
+
// J3 The evaluator is named and its kind declared. No anonymous verdicts.
|
|
16
|
+
// §5 The signer must be the evaluator's own delegate. A mechanical or model evaluator is a Service Agent
|
|
17
|
+
// signing with its KMS SESSION key under a wire `evaluator SA → session key` (the service-agent-signing
|
|
18
|
+
// rule: no evaluator ever holds an identity key); a human assessment is signed by the person's SA.
|
|
19
|
+
// An assessment signed by someone who is not that wire's delegate is refused.
|
|
20
|
+
//
|
|
21
|
+
// J1 holds throughout: **no verifier, admission stage or mandate reads an assessment.** It is evidence.
|
|
22
|
+
//
|
|
23
|
+
// ── WHY SIGNING IS A PORT ─────────────────────────────────────────────────────────────────────────
|
|
24
|
+
// This package is a leaf with no `@agenticprimitives` dependencies, and that is worth keeping: the signature
|
|
25
|
+
// scheme (ERC-1271, the 372 §S3c session-wrapped `0x51` form) lives in packages this one must not import.
|
|
26
|
+
// So `sign` and `verify` are injected, exactly as `integrityOf` injects its canonicalizer. The RULES above
|
|
27
|
+
// are enforced here, where they cannot be forgotten; the CRYPTOGRAPHY is bound outside, where it belongs.
|
|
28
|
+
import { canonicalJson } from './canonical.js';
|
|
29
|
+
const sha256 = async (s) => {
|
|
30
|
+
const b = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(s)));
|
|
31
|
+
return `sha256:${Array.from(b, (x) => x.toString(16).padStart(2, '0')).join('')}`;
|
|
32
|
+
};
|
|
33
|
+
/** The assessment's identity: sha256 over its canonical JSON. Two assessments with the same content have the
|
|
34
|
+
* same digest whatever order their keys were written in. */
|
|
35
|
+
export const assessmentDigest = (a) => sha256(canonicalJson(a));
|
|
36
|
+
/**
|
|
37
|
+
* The structural rules, checked without any cryptography — so they can be run before signing, in a test, or
|
|
38
|
+
* over an assessment that arrived from somewhere else.
|
|
39
|
+
*/
|
|
40
|
+
export function validateAssessment(a) {
|
|
41
|
+
const problems = [];
|
|
42
|
+
if (a.schema !== 'apeval/AssessmentV1')
|
|
43
|
+
problems.push(`schema must be apeval/AssessmentV1, got ${String(a.schema)}`);
|
|
44
|
+
if (!a.subject?.runRef)
|
|
45
|
+
problems.push('subject.runRef is required — an assessment of nothing is not a record');
|
|
46
|
+
if (!a.subject?.recordDigest)
|
|
47
|
+
problems.push('subject.recordDigest is required — without it nobody can tell which document was judged');
|
|
48
|
+
if (!a.criteria?.digest)
|
|
49
|
+
problems.push('criteria.digest is required (J2: the criterion is cited by digest)');
|
|
50
|
+
// J2, mechanically. The comparison is against the SUBJECT's time, not the assessment's: criteria written
|
|
51
|
+
// after the run but before the judgment are still post-hoc.
|
|
52
|
+
const stated = Date.parse(a.criteria?.statedAt ?? '');
|
|
53
|
+
const subject = Date.parse(a.subject?.at ?? '');
|
|
54
|
+
if (!Number.isFinite(stated))
|
|
55
|
+
problems.push('criteria.statedAt must be an ISO instant (J2 cannot be checked without it)');
|
|
56
|
+
else if (!Number.isFinite(subject))
|
|
57
|
+
problems.push('subject.at must be an ISO instant (J2 cannot be checked without it)');
|
|
58
|
+
else if (stated > subject) {
|
|
59
|
+
problems.push('the criteria were stated AFTER the subject they judge — J2 refuses a post-hoc expectation');
|
|
60
|
+
}
|
|
61
|
+
// J3.
|
|
62
|
+
if (!a.evaluator?.sa)
|
|
63
|
+
problems.push('evaluator.sa is required (J3: a verdict without a named judge is not recorded)');
|
|
64
|
+
if (!a.evaluator?.kind)
|
|
65
|
+
problems.push('evaluator.kind is required (J3: mechanical | model | human, never pooled)');
|
|
66
|
+
if (!Array.isArray(a.results) || a.results.length === 0)
|
|
67
|
+
problems.push('an assessment with no results asserts nothing');
|
|
68
|
+
for (const r of a.results ?? []) {
|
|
69
|
+
if (!r.criterionId)
|
|
70
|
+
problems.push('every result names its criterionId');
|
|
71
|
+
const needsEvidence = r.outcome === 'passed' || r.outcome === 'failed';
|
|
72
|
+
if (needsEvidence && (r.evidenceRefs?.length ?? 0) === 0) {
|
|
73
|
+
problems.push(`result ${r.criterionId}: a ${r.outcome} verdict must cite what it rests on`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { ok: problems.length === 0, problems };
|
|
77
|
+
}
|
|
78
|
+
/** The selector an assessment-issuing wire is pinned to. A wire that may do anything is not this wire. */
|
|
79
|
+
export const ASSESSMENT_SELECTOR = 'assessment.issue';
|
|
80
|
+
export async function signAssessment(a, sign) {
|
|
81
|
+
const v = validateAssessment(a);
|
|
82
|
+
// Refusing to SIGN an invalid assessment, not merely to accept one: an invalid record that carries a valid
|
|
83
|
+
// signature is worse than no record, because the signature invites trust the content has not earned.
|
|
84
|
+
if (!v.ok)
|
|
85
|
+
throw new Error(`refusing to sign an invalid assessment: ${v.problems.join('; ')}`);
|
|
86
|
+
const digest = await assessmentDigest(a);
|
|
87
|
+
return { assessment: a, digest, signature: await sign(digest) };
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Verify a signed assessment: the digest recomputes, the structure holds, and the signer is the evaluator's
|
|
91
|
+
* own delegate.
|
|
92
|
+
*
|
|
93
|
+
* Every failure is reported rather than thrown, because an assessment that does not verify is a FACT about
|
|
94
|
+
* the evidence someone is holding, and a thrown error tends to be caught and turned into silence.
|
|
95
|
+
*/
|
|
96
|
+
export async function verifyAssessment(signed, verify) {
|
|
97
|
+
const problems = [];
|
|
98
|
+
const structural = validateAssessment(signed.assessment);
|
|
99
|
+
problems.push(...structural.problems);
|
|
100
|
+
const recomputed = await assessmentDigest(signed.assessment);
|
|
101
|
+
if (recomputed !== signed.digest) {
|
|
102
|
+
problems.push('the assessment does not hash to the digest it carries — the content changed after signing');
|
|
103
|
+
// No point asking about a signature over a digest that does not describe this document.
|
|
104
|
+
return { ok: false, problems };
|
|
105
|
+
}
|
|
106
|
+
let facts;
|
|
107
|
+
try {
|
|
108
|
+
facts = await verify({ digest: signed.digest, signature: signed.signature });
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
return { ok: false, problems: [...problems, `the signature check failed to run: ${e instanceof Error ? e.message : String(e)}`] };
|
|
112
|
+
}
|
|
113
|
+
if (!facts.ok)
|
|
114
|
+
problems.push(`the signature did not verify${facts.reason ? `: ${facts.reason}` : ''}`);
|
|
115
|
+
const claimed = signed.assessment.evaluator?.sa?.toLowerCase();
|
|
116
|
+
if (facts.ok && claimed) {
|
|
117
|
+
if (facts.delegator !== undefined) {
|
|
118
|
+
// The session form: the signer is a key, and the wire says whose key it may be.
|
|
119
|
+
if (facts.delegator.toLowerCase() !== claimed) {
|
|
120
|
+
problems.push(`the signer is not the evaluator's delegate — the wire's delegator is ${facts.delegator}, the assessment claims ${signed.assessment.evaluator.sa}`);
|
|
121
|
+
}
|
|
122
|
+
if (facts.selector !== undefined && facts.selector !== ASSESSMENT_SELECTOR) {
|
|
123
|
+
problems.push(`the wire is pinned to ${facts.selector}, not ${ASSESSMENT_SELECTOR} — a wire that may do anything is not an assessment wire`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else if (facts.signer?.toLowerCase() !== claimed) {
|
|
127
|
+
problems.push(`the signer ${String(facts.signer)} is not the named evaluator ${signed.assessment.evaluator.sa}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return { ok: problems.length === 0, problems, ...(facts.signer ? { signer: facts.signer } : {}) };
|
|
131
|
+
}
|
|
132
|
+
// ── THE STORE (spec 438 §5) ───────────────────────────────────────────────────────────────────────
|
|
133
|
+
// Assessments live at `run.assessment:<runRef>` in the evaluator's own vault, beside `run.measures:<runRef>`
|
|
134
|
+
// and `run.provenance:<runRef>`. The port is declared structurally here for the same reason the signer is:
|
|
135
|
+
// this package is a leaf, and the real binding is the vault behind demo-mcp. The one behaviour it must keep,
|
|
136
|
+
// copied deliberately from `ProvenanceStorePort`: a FAILED READ IS `refused`, never `absent`. Folding an
|
|
137
|
+
// error into "there is no assessment" turns an outage into the claim that nobody has judged this run.
|
|
138
|
+
/** The vault record key for a run's assessments. Mirrors `runMeasuresRecordKey`. */
|
|
139
|
+
export const runAssessmentRecordKey = (runRef) => `run.assessment:${runRef}`;
|
|
140
|
+
/** The assessments that currently STAND: those nothing else supersedes. Pure, so a caller can resolve the
|
|
141
|
+
* chain without the store. An assessment naming a `supersedes` digest nobody holds is kept and reported —
|
|
142
|
+
* dropping it would hide a correction whose predecessor is merely missing. */
|
|
143
|
+
export function standingAssessments(signed) {
|
|
144
|
+
const byDigest = new Map(signed.map((s) => [String(s.digest), s]));
|
|
145
|
+
const supersededDigests = new Set();
|
|
146
|
+
const dangling = [];
|
|
147
|
+
for (const s of signed) {
|
|
148
|
+
const target = s.assessment.supersedes;
|
|
149
|
+
if (!target)
|
|
150
|
+
continue;
|
|
151
|
+
if (byDigest.has(target))
|
|
152
|
+
supersededDigests.add(target);
|
|
153
|
+
else
|
|
154
|
+
dangling.push(target);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
standing: signed.filter((s) => !supersededDigests.has(String(s.digest))),
|
|
158
|
+
superseded: signed.filter((s) => supersededDigests.has(String(s.digest))),
|
|
159
|
+
danglingSupersedes: dangling,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=assessment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment.js","sourceRoot":"","sources":["../src/assessment.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,EAAE;AACF,qGAAqG;AACrG,wGAAwG;AACxG,uGAAuG;AACvG,6GAA6G;AAC7G,4GAA4G;AAC5G,iEAAiE;AACjE,EAAE;AACF,uGAAuG;AACvG,uCAAuC;AACvC,EAAE;AACF,4GAA4G;AAC5G,wGAAwG;AACxG,6EAA6E;AAC7E,4GAA4G;AAC5G,8GAA8G;AAC9G,yGAAyG;AACzG,oFAAoF;AACpF,EAAE;AACF,wGAAwG;AACxG,EAAE;AACF,qGAAqG;AACrG,6GAA6G;AAC7G,0GAA0G;AAC1G,2GAA2G;AAC3G,0GAA0G;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAgE/C,MAAM,MAAM,GAAG,KAAK,EAAE,CAAS,EAA+B,EAAE;IAC9D,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,I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C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACzE,kBAAkB,EAAE,QAAQ;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,MAAO,OAAO,KAAG,MACkN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Canonical JSON (object keys sorted, recursively) — the RFC 8785 ordering for the string/number/array/object values
|
|
2
|
+
// these records carry. The same bytes for the same content, so a digest names content, not formatting.
|
|
3
|
+
export const canonicalJson = (v) => JSON.stringify(v, (_k, x) => (x && typeof x === 'object' && !Array.isArray(x) ? Object.keys(x).sort().reduce((o, k) => { o[k] = x[k]; return o; }, {}) : x)) ?? 'null';
|
|
4
|
+
//# sourceMappingURL=canonical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,uGAAuG;AACvG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAU,EAAU,EAAE,CAClD,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAI,CAA6B,CAAC,CAAC,CAAC,GAAI,CAA6B,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAA6B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC"}
|