@colophon-claims/verify 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/admission/application.d.ts +18 -0
- package/dist/admission/application.js +53 -0
- package/dist/admission/contracts.d.ts +506 -0
- package/dist/admission/contracts.js +459 -0
- package/dist/admission/index.d.ts +5 -0
- package/dist/admission/index.js +5 -0
- package/dist/admission/intake.d.ts +75 -0
- package/dist/admission/intake.js +70 -0
- package/dist/admission/result-evaluation.d.ts +18 -0
- package/dist/admission/result-evaluation.js +71 -0
- package/dist/admission/screening-sample.d.ts +56 -0
- package/dist/admission/screening-sample.js +126 -0
- package/dist/admission/verification.d.ts +102 -0
- package/dist/admission/verification.js +844 -0
- package/dist/anchor/check.d.ts +95 -0
- package/dist/anchor/check.js +146 -0
- package/dist/anchor/ports.d.ts +6 -0
- package/dist/anchor/ports.js +354 -0
- package/dist/assets.d.ts +33 -0
- package/dist/assets.js +885 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +20 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.js +205 -0
- package/dist/comparison.d.ts +64 -0
- package/dist/comparison.js +235 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/manifest.d.ts +54 -0
- package/dist/manifest.js +240 -0
- package/dist/materialize.d.ts +4 -0
- package/dist/materialize.js +13 -0
- package/dist/profile/admission-receipts.d.ts +11 -0
- package/dist/profile/admission-receipts.js +24 -0
- package/dist/profile/anchor-claims.d.ts +157 -0
- package/dist/profile/anchor-claims.js +330 -0
- package/dist/profile/artifacts.d.ts +261 -0
- package/dist/profile/artifacts.js +139 -0
- package/dist/profile/assembly-ports.d.ts +19 -0
- package/dist/profile/assembly-ports.js +42 -0
- package/dist/profile/binary-judge-manifest.d.ts +121 -0
- package/dist/profile/binary-judge-manifest.js +106 -0
- package/dist/profile/binary-qualification.d.ts +9 -0
- package/dist/profile/binary-qualification.js +58 -0
- package/dist/profile/branding-assets.d.ts +5 -0
- package/dist/profile/branding-assets.js +5 -0
- package/dist/profile/branding.d.ts +24 -0
- package/dist/profile/branding.js +14 -0
- package/dist/profile/claim-consistency.d.ts +26 -0
- package/dist/profile/claim-consistency.js +91 -0
- package/dist/profile/claim.d.ts +327 -0
- package/dist/profile/claim.js +742 -0
- package/dist/profile/errors.d.ts +49 -0
- package/dist/profile/errors.js +78 -0
- package/dist/profile/inspect-assurance.d.ts +16 -0
- package/dist/profile/inspect-assurance.js +30 -0
- package/dist/profile/inspect-disclosure.d.ts +28 -0
- package/dist/profile/inspect-disclosure.js +54 -0
- package/dist/profile/inspect-manifest.d.ts +706 -0
- package/dist/profile/inspect-manifest.js +397 -0
- package/dist/profile/isolation.d.ts +21 -0
- package/dist/profile/isolation.js +31 -0
- package/dist/profile/pinning-evidence.d.ts +41 -0
- package/dist/profile/pinning-evidence.js +43 -0
- package/dist/profile/ports.d.ts +3 -0
- package/dist/profile/ports.js +11 -0
- package/dist/profile/preview-log.d.ts +4 -0
- package/dist/profile/preview-log.js +3 -0
- package/dist/profile/run-results.d.ts +17 -0
- package/dist/profile/run-results.js +23 -0
- package/dist/profile/signing.d.ts +10 -0
- package/dist/profile/signing.js +46 -0
- package/dist/profile/trust.d.ts +13 -0
- package/dist/profile/trust.js +35 -0
- package/dist/profile/venue.d.ts +2 -0
- package/dist/profile/venue.js +2 -0
- package/dist/profile/verdict.d.ts +28 -0
- package/dist/profile/verdict.js +51 -0
- package/dist/reader-instructions.d.ts +41 -0
- package/dist/reader-instructions.js +52 -0
- package/dist/schema.d.ts +380 -0
- package/dist/schema.js +498 -0
- package/dist/verify.d.ts +72 -0
- package/dist/verify.js +1573 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/package.json +63 -3
- package/schemas/assembly-row.schema.json +194 -0
- package/schemas/bundle-manifest.schema.json +23 -0
- package/schemas/claim-package.schema.json +279 -0
- package/schemas/dsse-envelope.schema.json +25 -0
- package/schemas/evidence-catalog.schema.json +43 -0
- package/schemas/public-trust.schema.json +44 -0
- package/schemas/verdict-catalog.schema.json +27 -0
- package/scripts/external-verify.py +238 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { BENCHMARKING_METHOD_IDS } from "@jinn-network/benchmarking-records";
|
|
2
|
+
import { canonicalJsonBytes } from "@jinn-network/trust-core";
|
|
3
|
+
import { refuse } from "./errors.js";
|
|
4
|
+
import { buildClaimPackage } from "./claim.js";
|
|
5
|
+
import { buildLocalVenueHonesty, localVenueLimitsForRun } from "./run-results.js";
|
|
6
|
+
import { previewDisclosureSummaryLine } from "./preview-log.js";
|
|
7
|
+
import { venueIsolationPostureForPolicy } from "./isolation.js";
|
|
8
|
+
import { binaryInstrumentReportLimitations } from "./binary-qualification.js";
|
|
9
|
+
/** Mirrors `benchmark-product/core/src/verification/claim-consistency.ts`'s own (unexported)
|
|
10
|
+
* copy of this exact string. Not imported from core: this package cannot take a package edge
|
|
11
|
+
* on core, and core already depends on this package. The two copies must stay byte-identical. */
|
|
12
|
+
const PAIRED_ESTIMATE_LIMITATION = "This method estimates an effect; it does not gate one — no verdict, threshold, or selection was registered.";
|
|
13
|
+
const equal = (left, right) => left.length === right.length && left.every((byte, index) => byte === right[index]);
|
|
14
|
+
/** The path of the first field that actually differs, or `undefined` when the two values are
|
|
15
|
+
* equal — equal leaves must report NO difference, or the object branch returns on its first key
|
|
16
|
+
* and every mismatch names the first key in sorted order instead of the edited field. Mirrors
|
|
17
|
+
* `benchmark-product/core`'s own copy (`src/verification/claim-consistency.ts`). */
|
|
18
|
+
function firstDifference(actual, expected, path = "claim") {
|
|
19
|
+
// Never hand `undefined` to canonicalJsonBytes: it is deliberately not a JSON value, and a
|
|
20
|
+
// field carried by one side alone is itself the first difference.
|
|
21
|
+
if (actual === undefined || expected === undefined)
|
|
22
|
+
return actual === expected ? undefined : path;
|
|
23
|
+
if (equal(canonicalJsonBytes(actual), canonicalJsonBytes(expected)))
|
|
24
|
+
return undefined;
|
|
25
|
+
if (actual === null || expected === null || typeof actual !== "object" || typeof expected !== "object" || Array.isArray(actual) !== Array.isArray(expected))
|
|
26
|
+
return path;
|
|
27
|
+
if (Array.isArray(actual) && Array.isArray(expected)) {
|
|
28
|
+
if (actual.length !== expected.length)
|
|
29
|
+
return path;
|
|
30
|
+
for (const [index, value] of actual.entries()) {
|
|
31
|
+
const nested = firstDifference(value, expected[index], `${path}.${index}`);
|
|
32
|
+
if (nested !== undefined)
|
|
33
|
+
return nested;
|
|
34
|
+
}
|
|
35
|
+
return path;
|
|
36
|
+
}
|
|
37
|
+
for (const key of [...new Set([...Object.keys(actual), ...Object.keys(expected)])].sort()) {
|
|
38
|
+
const nested = firstDifference(actual[key], expected[key], path === "claim" ? key : `${path}.${key}`);
|
|
39
|
+
if (nested !== undefined)
|
|
40
|
+
return nested;
|
|
41
|
+
}
|
|
42
|
+
return path;
|
|
43
|
+
}
|
|
44
|
+
export function assertClaimConsistency(input) {
|
|
45
|
+
const { claim, identities, runRecord, matrixRecord, reportRecord } = input;
|
|
46
|
+
if (identities.reportSha256 === undefined)
|
|
47
|
+
refuse("record-integrity", "claim-consistency", "verified Report identity is absent");
|
|
48
|
+
const plan = runRecord.analysisPlan?.find((entry) => entry.method === reportRecord.method.id && entry.version === reportRecord.method.version);
|
|
49
|
+
const verdictRule = plan?.parameters?.verdictRule;
|
|
50
|
+
const minVerdicts = runRecord.policy.evaluation.minVerdicts;
|
|
51
|
+
const distinctEvaluator = runRecord.policy.evaluation.distinctEvaluator;
|
|
52
|
+
if ((verdictRule !== "sole" && verdictRule !== "majority" && verdictRule !== "unanimous") || minVerdicts === undefined || distinctEvaluator === undefined)
|
|
53
|
+
refuse("record-integrity", "claim-consistency", "sealed Run carries no complete supported evaluation assurance primitives");
|
|
54
|
+
// Presence, not emptiness: an empty section belongs to the anchored closure's declared-but-absent
|
|
55
|
+
// bundle, and an omitted one to every unanchored bundle.
|
|
56
|
+
const anchors = input.anchors;
|
|
57
|
+
const expected = buildClaimPackage({ draftId: input.draftId, benchmarkSha256: identities.benchmarkSha256, runRecord, runSha256: identities.runSha256, matrixRecord, matrixSha256: identities.matrixSha256, reportRecord, reportSha256: identities.reportSha256, reportEnvelopeSha256: identities.reportEnvelopeSha256, venueHonesty: buildLocalVenueHonesty(matrixRecord.cells, runRecord, anchors ?? []), verificationCommandVerb: "bundle verify", assurance: { preset: input.assurancePreset, resolved: { independence: runRecord.policy.independence, minVerdicts, distinctEvaluator, verdictRule } }, ...(input.rehearsal === undefined ? {} : { previewDisclosure: input.rehearsal }), ...(anchors === undefined ? {} : { anchors }) });
|
|
58
|
+
if (!equal(canonicalJsonBytes(claim), canonicalJsonBytes(expected)))
|
|
59
|
+
refuse("record-integrity", "claim-consistency", `claim package ${firstDifference(claim, expected) ?? "claim"} is not the exact projection of verified facts`);
|
|
60
|
+
const rehearsalLine = input.rehearsal === undefined ? undefined : previewDisclosureSummaryLine(input.rehearsal);
|
|
61
|
+
const binaryLimitations = reportRecord.method.id === BENCHMARKING_METHOD_IDS.binaryInstrument
|
|
62
|
+
? binaryInstrumentReportLimitations((plan?.parameters ?? {}))
|
|
63
|
+
: [];
|
|
64
|
+
// paired-majority-delta@1 carries the same PAIRED_ESTIMATE_LIMITATION as paired-delta@1
|
|
65
|
+
// (coordinator ruling, packet #2837) -- mirrors core's `verification/claim-consistency.ts`
|
|
66
|
+
// method-conditional exactly, so the portable rebuild agrees with what `report` sealed.
|
|
67
|
+
// Computed from `reportRecord.method.id` directly (like this file's own `binaryLimitations`)
|
|
68
|
+
// rather than threaded through `input.additionalLimitations`.
|
|
69
|
+
const pairedEstimateLimitation = reportRecord.method.id === BENCHMARKING_METHOD_IDS.pairedDelta
|
|
70
|
+
|| reportRecord.method.id === BENCHMARKING_METHOD_IDS.pairedMajorityDelta
|
|
71
|
+
? [PAIRED_ESTIMATE_LIMITATION]
|
|
72
|
+
: [];
|
|
73
|
+
const expectedLimitations = [
|
|
74
|
+
...localVenueLimitsForRun(runRecord),
|
|
75
|
+
...(input.additionalLimitations ?? []),
|
|
76
|
+
...binaryLimitations,
|
|
77
|
+
...pairedEstimateLimitation,
|
|
78
|
+
...(rehearsalLine === undefined ? [] : [rehearsalLine]),
|
|
79
|
+
];
|
|
80
|
+
const posture = venueIsolationPostureForPolicy(runRecord.policy.submissionBaseline?.isolationPolicy);
|
|
81
|
+
// The gate itself is UNCHANGED by the paired-estimate addition (still isolation posture,
|
|
82
|
+
// caller-supplied additionalLimitations, or the existing binary-instrument arm). Deliberately
|
|
83
|
+
// not widened to `|| pairedEstimateLimitation.length > 0` -- core left that gate unchanged so
|
|
84
|
+
// this addition is not responsible for surfacing an unrelated pre-existing gap. For flagship
|
|
85
|
+
// oci-container runs, `posture.inventory.length > 1` already activates the gate; folding the
|
|
86
|
+
// line into `expectedLimitations` is what makes expected match the sealed Report.
|
|
87
|
+
if ((posture.inventory.length > 1 || (input.additionalLimitations?.length ?? 0) > 0 || binaryLimitations.length > 0) && !equal(canonicalJsonBytes(reportRecord.limitations ?? []), canonicalJsonBytes(expectedLimitations)))
|
|
88
|
+
refuse("record-integrity", "claim-consistency", "Report limitations are not the exact disclosure derived from the sealed Run and rehearsal history");
|
|
89
|
+
if (rehearsalLine === undefined ? (reportRecord.limitations ?? []).some((line) => line.includes("disposable preview rehearsal(s)")) : !(reportRecord.limitations ?? []).includes(rehearsalLine))
|
|
90
|
+
refuse("record-integrity", "claim-consistency", "claim rehearsal and verified Report disclosure disagree");
|
|
91
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The claim package (BP-13 deliverable 2, spec §8.2): a pure builder + a zod schema + a writer
|
|
3
|
+
* for the standalone, portable document a skeptic reads to check a benchmark result without
|
|
4
|
+
* re-running anything.
|
|
5
|
+
*
|
|
6
|
+
* `buildClaimPackage` is PURE — no filesystem, no digest recomputation, no re-derivation of the
|
|
7
|
+
* sealed Report's own judgment. Every headline-or-comparison number, disclosure, limitation, and
|
|
8
|
+
* attrition figure is EXTRACTED verbatim from the records the caller already sealed and verified
|
|
9
|
+
* elsewhere (`../operations/report.ts`), never recomputed here — a claim package that silently
|
|
10
|
+
* disagreed with its own cited report would be worse than one that failed to build. Nothing is
|
|
11
|
+
* dropped: `conflicted`, `completeness`, and `attrition` are always present, even when they carry
|
|
12
|
+
* unwelcome numbers (a conflicted cell, an incomplete run) — spec §8.2's whole point is that the
|
|
13
|
+
* claim package cannot be more flattering than the sealed records it cites.
|
|
14
|
+
*
|
|
15
|
+
* P4b Task 5: `buildClaimPackage` DISPATCHES on the produced Report's `method.id` — wilson@1's
|
|
16
|
+
* per-arm `headline` and paired-delta@1's `comparison` are mutually exclusive siblings, exactly
|
|
17
|
+
* one of which is present on any given claim (the schema refuses a claim carrying neither). Same
|
|
18
|
+
* "extracted, never recomputed" posture regardless of which method produced the Report.
|
|
19
|
+
*
|
|
20
|
+
* BP-20 (spec §7.2): the optional `rehearsal` block names any disclosed preview that preceded
|
|
21
|
+
* this run's lock, verbatim from the caller's `previewDisclosure` input — used previews are named
|
|
22
|
+
* in the official record; its absence means no preview preceded lock. Same "extracted, never
|
|
23
|
+
* recomputed" posture as everything else this builder emits.
|
|
24
|
+
*
|
|
25
|
+
* BP-21 (spec §6): the required `assurance` block states the draft's preset (a product-policy
|
|
26
|
+
* label) AND the platform primitives it resolved to, plus the fixed agent-distinctness
|
|
27
|
+
* disclosure. The one deliberate exception to "never cross-check here": `buildClaimPackage`
|
|
28
|
+
* THROWS when the stated primitives disagree with what the sealed Run record's own policy
|
|
29
|
+
* carries — a claim stating primitives the sealed Run does not carry would be dishonest.
|
|
30
|
+
*/
|
|
31
|
+
import { z } from "zod";
|
|
32
|
+
import type { MatrixRecord, ReportRecord, RunRecord } from "@jinn-network/benchmarking-records";
|
|
33
|
+
import { SELF_RUN_TRUST_ROOT } from "./anchor-claims.js";
|
|
34
|
+
import type { ClaimAnchor } from "./anchor-claims.js";
|
|
35
|
+
type VenueHonesty = unknown;
|
|
36
|
+
export declare const CLAIM_PACKAGE_SCHEMA_ID = "benchmark-product.claim-package/1";
|
|
37
|
+
export declare const BINARY_QUALIFICATION_CLAIM_PACKAGE_SCHEMA_ID = "benchmark-product.claim-package/2";
|
|
38
|
+
/**
|
|
39
|
+
* The anchored claim package (anchor-evidence design §7.4): claim-package/1 plus the `anchors`
|
|
40
|
+
* section, carried by `benchmark-product-public-bundle/6`. The allocation is the next free number
|
|
41
|
+
* in the classic path; the evidence-native claim-package/3 adopts the same anchor surface in its
|
|
42
|
+
* own later allocation.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ANCHORED_CLAIM_PACKAGE_SCHEMA_ID = "benchmark-product.claim-package/4";
|
|
45
|
+
export declare const BINARY_QUALIFICATION_VERIFICATION_COMMAND: "npx @colophon-claims/verify@0.1.0 <bundle-dir>";
|
|
46
|
+
export declare const BINARY_QUALIFICATION_COMPATIBLE_VERIFICATION_COMMAND: "npx @colophon-claims/verify@0.1 <bundle-dir>";
|
|
47
|
+
/** Prompted-screening v2 claims require the verifier release that carries that admission surface. */
|
|
48
|
+
export declare const PROMPTED_BINARY_QUALIFICATION_VERIFICATION_COMMAND: "npx @colophon-claims/verify@0.2.0 <bundle-dir>";
|
|
49
|
+
export declare const PROMPTED_BINARY_QUALIFICATION_COMPATIBLE_VERIFICATION_COMMAND: "npx @colophon-claims/verify@0.2 <bundle-dir>";
|
|
50
|
+
/** The fixed sentence every claim package's assurance block carries (BP-21, spec §6/§7.1): what
|
|
51
|
+
* distinct evaluator identities on this venue actually prove. Never softened per-claim. */
|
|
52
|
+
export declare const ASSURANCE_DISCLOSURE: string;
|
|
53
|
+
export declare const ClaimPackageSchema: z.ZodPreprocess<z.ZodObject<{
|
|
54
|
+
claimSchema: z.ZodUnion<readonly [z.ZodLiteral<"benchmark-product.claim-package/1">, z.ZodLiteral<"benchmark-product.claim-package/2">, z.ZodLiteral<"benchmark-product.claim-package/4">]>;
|
|
55
|
+
scope: z.ZodObject<{
|
|
56
|
+
draftId: z.ZodString;
|
|
57
|
+
benchmarkSha256: z.ZodString;
|
|
58
|
+
taskCount: z.ZodNumber;
|
|
59
|
+
arms: z.ZodArray<z.ZodObject<{
|
|
60
|
+
armId: z.ZodString;
|
|
61
|
+
pinning: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
replicates: z.ZodNumber;
|
|
64
|
+
venue: z.ZodLiteral<"self-run">;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
records: z.ZodObject<{
|
|
67
|
+
benchmarkSha256: z.ZodString;
|
|
68
|
+
runSha256: z.ZodString;
|
|
69
|
+
matrixSha256: z.ZodString;
|
|
70
|
+
reportSha256: z.ZodString;
|
|
71
|
+
reportEnvelopeSha256: z.ZodString;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
method: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
version: z.ZodString;
|
|
76
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
77
|
+
preregistered: z.ZodBoolean;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
results: z.ZodUnknown;
|
|
80
|
+
headline: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
81
|
+
n: z.ZodNumber;
|
|
82
|
+
passRate: z.ZodString;
|
|
83
|
+
wilsonInterval: z.ZodObject<{
|
|
84
|
+
low: z.ZodString;
|
|
85
|
+
high: z.ZodString;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
}, z.core.$strip>>>;
|
|
88
|
+
completeness: z.ZodUnknown;
|
|
89
|
+
attrition: z.ZodUnknown;
|
|
90
|
+
conflicted: z.ZodObject<{
|
|
91
|
+
count: z.ZodNumber;
|
|
92
|
+
cellKeys: z.ZodArray<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
assurance: z.ZodObject<{
|
|
95
|
+
preset: z.ZodString;
|
|
96
|
+
resolved: z.ZodObject<{
|
|
97
|
+
independence: z.ZodEnum<{
|
|
98
|
+
gating: "gating";
|
|
99
|
+
disclosed: "disclosed";
|
|
100
|
+
}>;
|
|
101
|
+
minVerdicts: z.ZodNumber;
|
|
102
|
+
distinctEvaluator: z.ZodBoolean;
|
|
103
|
+
verdictRule: z.ZodEnum<{
|
|
104
|
+
sole: "sole";
|
|
105
|
+
majority: "majority";
|
|
106
|
+
unanimous: "unanimous";
|
|
107
|
+
}>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
disclosure: z.ZodString;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
disclosures: z.ZodObject<{
|
|
112
|
+
perSubject: z.ZodArray<z.ZodUnknown>;
|
|
113
|
+
integrityTierCounts: z.ZodObject<{
|
|
114
|
+
"re-derivable": z.ZodNumber;
|
|
115
|
+
"attested-only": z.ZodNumber;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
pinningUnverifiableCounts: z.ZodObject<{
|
|
118
|
+
harness: z.ZodNumber;
|
|
119
|
+
model: z.ZodNumber;
|
|
120
|
+
loadout: z.ZodNumber;
|
|
121
|
+
isolation: z.ZodNumber;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
limitations: z.ZodArray<z.ZodString>;
|
|
125
|
+
venueHonesty: z.ZodUnknown;
|
|
126
|
+
verification: z.ZodObject<{
|
|
127
|
+
command: z.ZodString;
|
|
128
|
+
compatibleCommand: z.ZodString;
|
|
129
|
+
checks: z.ZodArray<z.ZodString>;
|
|
130
|
+
trustRoot: z.ZodString;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
rehearsal: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
previewCount: z.ZodNumber;
|
|
134
|
+
timestamps: z.ZodArray<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
comparison: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
pairs: z.ZodNumber;
|
|
138
|
+
delta: z.ZodNullable<z.ZodString>;
|
|
139
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
140
|
+
alpha: z.ZodString;
|
|
141
|
+
low: z.ZodString;
|
|
142
|
+
high: z.ZodString;
|
|
143
|
+
}, z.core.$strip>>;
|
|
144
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
145
|
+
pairing: z.ZodObject<{
|
|
146
|
+
taskDigests: z.ZodArray<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
clustering: z.ZodObject<{
|
|
149
|
+
basis: z.ZodString;
|
|
150
|
+
clusters: z.ZodNumber;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
excluded: z.ZodObject<{
|
|
153
|
+
count: z.ZodNumber;
|
|
154
|
+
cellKeys: z.ZodArray<z.ZodString>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
conflicted: z.ZodObject<{
|
|
157
|
+
count: z.ZodNumber;
|
|
158
|
+
cellKeys: z.ZodArray<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
bootstrap: z.ZodUnknown;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
pairwiseDisagreement: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
pairs: z.ZodArray<z.ZodObject<{
|
|
164
|
+
n: z.ZodNumber;
|
|
165
|
+
disagreements: z.ZodNumber;
|
|
166
|
+
rate: z.ZodNullable<z.ZodString>;
|
|
167
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
168
|
+
lower: z.ZodString;
|
|
169
|
+
upper: z.ZodString;
|
|
170
|
+
alpha: z.ZodString;
|
|
171
|
+
}, z.core.$strip>>;
|
|
172
|
+
armA: z.ZodString;
|
|
173
|
+
armB: z.ZodString;
|
|
174
|
+
byCandidateClass: z.ZodArray<z.ZodObject<{
|
|
175
|
+
n: z.ZodNumber;
|
|
176
|
+
disagreements: z.ZodNumber;
|
|
177
|
+
rate: z.ZodNullable<z.ZodString>;
|
|
178
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
179
|
+
lower: z.ZodString;
|
|
180
|
+
upper: z.ZodString;
|
|
181
|
+
alpha: z.ZodString;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
candidateClass: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
byStratum: z.ZodArray<z.ZodObject<{
|
|
186
|
+
n: z.ZodNumber;
|
|
187
|
+
disagreements: z.ZodNumber;
|
|
188
|
+
rate: z.ZodNullable<z.ZodString>;
|
|
189
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
190
|
+
lower: z.ZodString;
|
|
191
|
+
upper: z.ZodString;
|
|
192
|
+
alpha: z.ZodString;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
stratum: z.ZodString;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
exclusions: z.ZodArray<z.ZodObject<{
|
|
197
|
+
taskDigest: z.ZodString;
|
|
198
|
+
armId: z.ZodString;
|
|
199
|
+
reason: z.ZodString;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
conflicted: z.ZodObject<{
|
|
203
|
+
count: z.ZodNumber;
|
|
204
|
+
cellKeys: z.ZodArray<z.ZodString>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
pairedMajorityDelta: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
n: z.ZodNumber;
|
|
209
|
+
delta: z.ZodNullable<z.ZodString>;
|
|
210
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
211
|
+
lower: z.ZodString;
|
|
212
|
+
upper: z.ZodString;
|
|
213
|
+
alpha: z.ZodString;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
216
|
+
baseline: z.ZodString;
|
|
217
|
+
candidate: z.ZodString;
|
|
218
|
+
clusters: z.ZodObject<{
|
|
219
|
+
count: z.ZodNumber;
|
|
220
|
+
manifest: z.ZodOptional<z.ZodUnknown>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
byCandidateClass: z.ZodArray<z.ZodObject<{
|
|
223
|
+
n: z.ZodNumber;
|
|
224
|
+
delta: z.ZodNullable<z.ZodString>;
|
|
225
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
226
|
+
lower: z.ZodString;
|
|
227
|
+
upper: z.ZodString;
|
|
228
|
+
alpha: z.ZodString;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
231
|
+
candidateClass: z.ZodString;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
byStratum: z.ZodArray<z.ZodObject<{
|
|
234
|
+
n: z.ZodNumber;
|
|
235
|
+
delta: z.ZodNullable<z.ZodString>;
|
|
236
|
+
interval: z.ZodNullable<z.ZodObject<{
|
|
237
|
+
lower: z.ZodString;
|
|
238
|
+
upper: z.ZodString;
|
|
239
|
+
alpha: z.ZodString;
|
|
240
|
+
}, z.core.$strip>>;
|
|
241
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
242
|
+
stratum: z.ZodString;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
exclusions: z.ZodArray<z.ZodObject<{
|
|
245
|
+
taskDigest: z.ZodString;
|
|
246
|
+
armId: z.ZodString;
|
|
247
|
+
reason: z.ZodString;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
conflicted: z.ZodObject<{
|
|
250
|
+
count: z.ZodNumber;
|
|
251
|
+
cellKeys: z.ZodArray<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
qualification: z.ZodOptional<z.ZodUnknown>;
|
|
255
|
+
anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
256
|
+
subject: z.ZodEnum<{
|
|
257
|
+
lock: "lock";
|
|
258
|
+
matrix: "matrix";
|
|
259
|
+
}>;
|
|
260
|
+
kind: z.ZodString;
|
|
261
|
+
provider: z.ZodString;
|
|
262
|
+
recordSha256: z.ZodString;
|
|
263
|
+
upgradesRecordSha256: z.ZodOptional<z.ZodString>;
|
|
264
|
+
facts: z.ZodUnion<readonly [z.ZodObject<{
|
|
265
|
+
genTime: z.ZodString;
|
|
266
|
+
policyOid: z.ZodString;
|
|
267
|
+
serialNumber: z.ZodString;
|
|
268
|
+
signerCertificateSha256: z.ZodString;
|
|
269
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
|
|
270
|
+
blockHeight: z.ZodNumber;
|
|
271
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
272
|
+
pending: z.ZodLiteral<true>;
|
|
273
|
+
}, z.core.$strict>]>]>;
|
|
274
|
+
}, z.core.$strict>>>;
|
|
275
|
+
}, z.core.$strip>>;
|
|
276
|
+
export type ClaimPackage = z.infer<typeof ClaimPackageSchema>;
|
|
277
|
+
export interface BuildClaimPackageInput {
|
|
278
|
+
readonly draftId: string;
|
|
279
|
+
readonly benchmarkSha256: string;
|
|
280
|
+
readonly runRecord: RunRecord;
|
|
281
|
+
readonly runSha256: string;
|
|
282
|
+
readonly matrixRecord: MatrixRecord;
|
|
283
|
+
readonly matrixSha256: string;
|
|
284
|
+
readonly reportRecord: ReportRecord;
|
|
285
|
+
readonly reportSha256: string;
|
|
286
|
+
readonly reportEnvelopeSha256: string;
|
|
287
|
+
readonly venueHonesty: VenueHonesty;
|
|
288
|
+
/** Retained for structural parity; reader instructions come from the canonical projection. */
|
|
289
|
+
readonly verificationCommandVerb: string;
|
|
290
|
+
/** BP-21 (spec §6): the draft's assurance preset (a product-policy label) and the platform
|
|
291
|
+
* primitives it resolved to. `buildClaimPackage` cross-checks the primitives against what the
|
|
292
|
+
* sealed Run record itself carries and THROWS on any disagreement — a claim that states
|
|
293
|
+
* primitives the sealed Run does not carry would be dishonest. */
|
|
294
|
+
readonly assurance: {
|
|
295
|
+
readonly preset: string;
|
|
296
|
+
readonly resolved: {
|
|
297
|
+
readonly independence: "gating" | "disclosed";
|
|
298
|
+
readonly minVerdicts: number;
|
|
299
|
+
readonly distinctEvaluator: boolean;
|
|
300
|
+
readonly verdictRule: "sole" | "majority" | "unanimous";
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
/** BP-20 (spec §7.2): when present, this draft had at least one disclosed preview before this
|
|
304
|
+
* run's lock — `buildClaimPackage` carries it into the `rehearsal` block verbatim. Absent means
|
|
305
|
+
* the caller found no preview log entry, i.e. no preview preceded lock. */
|
|
306
|
+
readonly previewDisclosure?: {
|
|
307
|
+
readonly previewCount: number;
|
|
308
|
+
readonly timestamps: readonly string[];
|
|
309
|
+
};
|
|
310
|
+
/** anchor-evidence §7.4: the anchors section, already derived from the carried AnchorEvidence
|
|
311
|
+
* bytes by `deriveClaimAnchors`. **Supplying it at all** — even empty — makes this an anchored
|
|
312
|
+
* claim (claim-package/4); omitting it leaves every existing claim byte-identical. Never derived
|
|
313
|
+
* here: this builder is pure, and the derivation needs the record bytes the caller already
|
|
314
|
+
* authenticated. */
|
|
315
|
+
readonly anchors?: readonly ClaimAnchor[];
|
|
316
|
+
}
|
|
317
|
+
export declare const CLAIM_VERIFICATION_CHECKS: readonly string[];
|
|
318
|
+
/** The anchored closure's list: the six frozen checks plus `integrity-anchors` (§8). */
|
|
319
|
+
export declare const ANCHORED_CLAIM_VERIFICATION_CHECKS: readonly string[];
|
|
320
|
+
export declare const PUBLIC_BUNDLE_VERIFICATION_COMMAND: "npx @colophon-claims/verify@0.1.0 <bundle-dir>";
|
|
321
|
+
/** The unconditional trust-root sentence, re-exported unchanged. It is DEFINED once beside its
|
|
322
|
+
* anchored replacement in `anchor-claims.ts`: one sentence written out twice, in two mirrored
|
|
323
|
+
* files, is exactly the drift the conditional copy cannot afford. */
|
|
324
|
+
export { SELF_RUN_TRUST_ROOT };
|
|
325
|
+
/** Builds the claim package document (spec §8.2) from explicit, already-sealed record data. Pure
|
|
326
|
+
* — no filesystem access, no recomputation of anything the cited records already settled. */
|
|
327
|
+
export declare function buildClaimPackage(input: BuildClaimPackageInput): ClaimPackage;
|