@sanning/proof 0.19.1 → 0.20.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 +30 -29
- package/dist/agent-record.d.ts +62 -0
- package/dist/agent-record.js +527 -0
- package/dist/agent-schemas.generated.d.ts +15 -0
- package/dist/agent-schemas.generated.js +5759 -0
- package/dist/case-file.d.ts +32 -89
- package/dist/case-file.js +41 -93
- package/dist/case.d.ts +339 -822
- package/dist/case.js +667 -1160
- package/dist/chain.d.ts +19 -47
- package/dist/chain.js +78 -205
- package/dist/claims.d.ts +211 -0
- package/dist/claims.js +1081 -0
- package/dist/cli.d.ts +45 -68
- package/dist/cli.js +618 -1022
- package/dist/compose.js +23 -65
- package/dist/crypto.d.ts +7 -8
- package/dist/crypto.js +60 -147
- package/dist/declaration.d.ts +68 -194
- package/dist/declaration.js +175 -518
- package/dist/environment.d.ts +9 -30
- package/dist/environment.js +17 -66
- package/dist/evidence.d.ts +119 -160
- package/dist/evidence.js +744 -1103
- package/dist/exit-codes.d.ts +11 -27
- package/dist/exit-codes.js +24 -59
- package/dist/file-match.d.ts +33 -79
- package/dist/file-match.js +33 -69
- package/dist/grading.d.ts +98 -135
- package/dist/grading.js +224 -380
- package/dist/handoff.d.ts +62 -160
- package/dist/handoff.js +153 -393
- package/dist/index.d.ts +14 -10
- package/dist/index.js +60 -167
- package/dist/json-schema.d.ts +29 -0
- package/dist/json-schema.js +298 -0
- package/dist/merkle.js +16 -28
- package/dist/message-parts.d.ts +56 -212
- package/dist/message-parts.js +142 -502
- package/dist/side-content.d.ts +11 -22
- package/dist/side-content.js +22 -65
- package/dist/types.d.ts +17 -0
- package/dist/types.js +19 -5
- package/dist/verifier.d.ts +40 -114
- package/dist/verifier.js +196 -535
- package/dist/witness-cache.d.ts +24 -45
- package/dist/witness-cache.js +38 -81
- package/dist/witness-lookup.d.ts +36 -57
- package/dist/witness-lookup.js +89 -139
- package/dist/zip-reader.d.ts +18 -33
- package/dist/zip-reader.js +19 -34
- package/package.json +11 -3
- package/src/agent-record.ts +608 -0
- package/src/agent-schemas.generated.ts +5764 -0
- package/src/case-file.ts +45 -109
- package/src/case.ts +814 -1328
- package/src/chain.ts +85 -224
- package/src/claims.ts +1253 -0
- package/src/cli.ts +714 -1176
- package/src/compose.ts +33 -79
- package/src/crypto.ts +60 -147
- package/src/declaration.ts +219 -656
- package/src/environment.ts +17 -65
- package/src/evidence.ts +958 -1381
- package/src/exit-codes.ts +24 -63
- package/src/file-match.ts +40 -89
- package/src/grading.ts +287 -421
- package/src/handoff.ts +175 -427
- package/src/index.ts +131 -177
- package/src/json-schema.ts +295 -0
- package/src/merkle.ts +16 -28
- package/src/message-parts.ts +155 -533
- package/src/side-content.ts +25 -68
- package/src/types.ts +55 -36
- package/src/verifier.ts +202 -526
- package/src/witness-cache.ts +45 -94
- package/src/witness-lookup.ts +107 -177
- package/src/zip-reader.ts +20 -38
- package/vectors/README.md +52 -34
- package/vectors/agent-record.json +2175 -0
- package/vectors/case-file-index.json +1 -1
- package/vectors/case-split.json +2 -2
- package/vectors/chain-reading.json +3 -3
- package/vectors/file-match.json +285 -148
- package/vectors/jcs-reader.json +6 -6
- package/vectors/pack-grading.json +102 -25
- package/vectors/sandbox-evidence.json +573 -581
- package/vectors/stamp-on-chain.json +18 -18
- package/vectors/witness-cache.json +49 -49
- package/dist/agent-proof.d.ts +0 -28
- package/dist/agent-proof.js +0 -226
- package/dist/run-adapters.d.ts +0 -10
- package/dist/run-adapters.js +0 -35
- package/dist/run.d.ts +0 -209
- package/dist/run.js +0 -1405
- package/src/agent-proof.ts +0 -264
- package/src/run-adapters.ts +0 -44
- package/src/run.ts +0 -1598
package/dist/declaration.d.ts
CHANGED
|
@@ -1,82 +1,46 @@
|
|
|
1
1
|
import type { ChainLink } from "./chain.js";
|
|
2
2
|
import { type HandoffRecord } from "./handoff.js";
|
|
3
3
|
import { type SideContentMap } from "./side-content.js";
|
|
4
|
-
/** The first declaration schema
|
|
4
|
+
/** The first declaration schema. */
|
|
5
5
|
export declare const DECLARATION_VERSION = "sanning.declaration/v1";
|
|
6
|
-
/**
|
|
7
|
-
* v1 plus a signed `records[].role` on every record (evidence-bundle.md
|
|
8
|
-
* 5.4.1 v1.20, A21). A reader that knows only v1 reads a v2 declaration as one
|
|
9
|
-
* it cannot read, which is the safe direction.
|
|
10
|
-
*/
|
|
6
|
+
/** v1 plus a signed `records[].role` on every record (§5.4.1). */
|
|
11
7
|
export declare const DECLARATION_VERSION_V2 = "sanning.declaration/v2";
|
|
12
8
|
/**
|
|
13
9
|
* v2 plus a signed `chains[]`: the `chain_key`s the holder claims are complete
|
|
14
|
-
* and in order (
|
|
15
|
-
* v1 and v2 reads a v3 declaration as one it cannot read, which is the safe
|
|
10
|
+
* and in order (§5.4.1). An older reader cannot read it, which is the safe
|
|
16
11
|
* direction.
|
|
17
12
|
*/
|
|
18
13
|
export declare const DECLARATION_VERSION_V3 = "sanning.declaration/v3";
|
|
19
|
-
/** Every declaration schema this reader knows,
|
|
14
|
+
/** Every declaration schema this reader knows, oldest first. */
|
|
20
15
|
export declare const DECLARATION_VERSIONS: readonly ["sanning.declaration/v1", "sanning.declaration/v2", "sanning.declaration/v3"];
|
|
21
16
|
/**
|
|
22
|
-
*
|
|
23
|
-
* record 4.1 governs that the pack claims
|
|
24
|
-
* `step`, any other record.
|
|
17
|
+
* The roles a v2 declaration can sign, compared exactly: `handoff` for a
|
|
18
|
+
* record §4.1 governs that the pack claims in `handoffs[]`, `step` otherwise.
|
|
25
19
|
*/
|
|
26
20
|
export declare const DECLARATION_ROLES: readonly ["handoff", "step"];
|
|
27
21
|
export type DeclarationRole = (typeof DECLARATION_ROLES)[number];
|
|
28
|
-
|
|
29
|
-
export declare const DECLARATION_VERDICTS: readonly ["verified", "failed", "partial"];
|
|
22
|
+
export declare const DECLARATION_VERDICTS: readonly ["verified", "failed", "incomplete"];
|
|
30
23
|
export type DeclarationVerdict = (typeof DECLARATION_VERDICTS)[number];
|
|
31
24
|
export declare const DECLARATION_DEVIATION_KINDS: readonly ["declaration_malformed", "declared_absent", "undeclared_present", "withheld_but_disclosed", "duplicate_event_id", "pair_record_undeclared", "pair_record_not_a_handoff", "role_handoff_unclaimed", "role_step_claimed", "role_step_governed", "role_step_unreadable", "chain_second_root", "chain_fork", "chain_link_dangling", "chain_claimed_absent"];
|
|
32
25
|
export type DeclarationDeviationKind = (typeof DECLARATION_DEVIATION_KINDS)[number];
|
|
33
26
|
/**
|
|
34
|
-
* Every way a pack and the
|
|
35
|
-
* up
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* WHY THEY ARE NOT DEVIATIONS. 5.4 grades a pack's declaration partly against
|
|
39
|
-
* content the reader was HANDED, and that content is not signed by anybody.
|
|
40
|
-
* `events[].content` rides inside `body`, so the wrapper signature and
|
|
41
|
-
* `body_hash` cover it and what it says about the holder is the holder's own
|
|
42
|
-
* word. The side-content map is the other channel, and whoever assembles a
|
|
43
|
-
* case fills it in: an accuser could put an intact pack into
|
|
44
|
-
* `pack_declaration_deviates`, which contributed `failed`, WITH NO KEY AT
|
|
45
|
-
* ALL, by dropping the bytes of a record the pack declared `disclosed` or by
|
|
46
|
-
* adding bytes for one it declared `content_withheld`. The pack was intact,
|
|
47
|
-
* its wrapper verified, and its holder had done nothing.
|
|
48
|
-
*
|
|
49
|
-
* This is the mirror of proof#143. There a counterparty makes itself look
|
|
50
|
-
* better by choosing what it hands over; here an accuser makes a counterparty
|
|
51
|
-
* look worse the same way. Both now read as what the READER established, so
|
|
52
|
-
* `failed` stays for what a signature covers.
|
|
53
|
-
*
|
|
54
|
-
* WHAT A HOSTILE HOLDER GAINS FROM THE WEAKER WORD: nothing, because a
|
|
55
|
-
* cheaper move already dominates it. Declaring a record `content_withheld` is
|
|
56
|
-
* legal and grades `verified`, which is strictly better than the `incomplete`
|
|
57
|
-
* these carry.
|
|
27
|
+
* Every way a pack and the unsigned content handed in beside it fail to line
|
|
28
|
+
* up. Not deviations, and never `failed`: whoever assembles a case fills the
|
|
29
|
+
* side-content map, so an accuser could otherwise fail an intact pack with no
|
|
30
|
+
* key at all. `failed` stays for what a signature covers.
|
|
58
31
|
*/
|
|
59
32
|
export declare const DECLARATION_CONTENT_KINDS: readonly ["content_dependent_withholding", "content_dependent_disclosure"];
|
|
60
33
|
export type DeclarationContentKind = (typeof DECLARATION_CONTENT_KINDS)[number];
|
|
61
|
-
/**
|
|
62
|
-
* One way the pack and the unsigned content beside it do not line up. Named
|
|
63
|
-
* like a deviation and weighed like an absence.
|
|
64
|
-
*/
|
|
34
|
+
/** One content finding: named like a deviation, weighed like an absence. */
|
|
65
35
|
export interface DeclarationContentFinding {
|
|
66
36
|
kind: DeclarationContentKind;
|
|
67
|
-
/** The record this is about.
|
|
37
|
+
/** The record this is about. */
|
|
68
38
|
eventId?: string;
|
|
69
39
|
}
|
|
70
|
-
/** Everything this check reports that is
|
|
40
|
+
/** Everything this check reports that is not a deviation. */
|
|
71
41
|
export declare const DECLARATION_NOTE_KINDS: readonly ["disclosure_did_not_travel", "pair_record_withheld", "role_step_withheld", "other_declaration_held", "other_declaration_withheld", "chain_claim_withheld"];
|
|
72
42
|
export type DeclarationNoteKind = (typeof DECLARATION_NOTE_KINDS)[number];
|
|
73
|
-
/**
|
|
74
|
-
* One named non-deviation finding, as data.
|
|
75
|
-
*
|
|
76
|
-
* A note never moves the declaration verdict. It exists so the one shape rule
|
|
77
|
-
* 3 deliberately does not fail is still SAID, rather than leaving a reader to
|
|
78
|
-
* notice nothing was reported.
|
|
79
|
-
*/
|
|
43
|
+
/** One named finding that is not a deviation. A note never moves the verdict. */
|
|
80
44
|
export interface DeclarationNote {
|
|
81
45
|
kind: DeclarationNoteKind;
|
|
82
46
|
/** How many records the note is about, where it is about a count. */
|
|
@@ -90,43 +54,37 @@ export interface DeclarationNote {
|
|
|
90
54
|
/** The claimed chain, for `chain_claim_withheld`. */
|
|
91
55
|
chainKey?: string;
|
|
92
56
|
}
|
|
93
|
-
/** One deviation, as data.
|
|
57
|
+
/** One deviation, as data. */
|
|
94
58
|
export interface DeclarationDeviation {
|
|
95
59
|
kind: DeclarationDeviationKind;
|
|
96
60
|
/** The record this is about, where it is about one. */
|
|
97
61
|
eventId?: string;
|
|
98
|
-
/** Which side of a claimed hand-off
|
|
62
|
+
/** Which side of a claimed hand-off, for the `pair_record_` deviations. */
|
|
99
63
|
side?: "sent" | "received";
|
|
100
|
-
/** Which claimed hand-off, by position, for the
|
|
64
|
+
/** Which claimed hand-off, by position, for the `pair_record_` deviations. */
|
|
101
65
|
pairIndex?: number;
|
|
102
66
|
/** What is wrong with the declaration itself, for `declaration_malformed`. */
|
|
103
67
|
reason?: string;
|
|
104
|
-
/**
|
|
105
|
-
* The `declaration_version` the object claimed, for `declaration_malformed`,
|
|
106
|
-
* so the rendered sentence names the version the holder wrote to rather than
|
|
107
|
-
* the first one this reader learned.
|
|
108
|
-
*/
|
|
68
|
+
/** The `declaration_version` the object claimed, for `declaration_malformed`. */
|
|
109
69
|
version?: string;
|
|
110
|
-
/** The claimed chain, for the
|
|
70
|
+
/** The claimed chain, for the `chain_` deviations. */
|
|
111
71
|
chainKey?: string;
|
|
112
72
|
}
|
|
113
73
|
export interface DeclarationCheck {
|
|
114
74
|
verdict: DeclarationVerdict;
|
|
115
|
-
/** Every deviation, in a fixed order.
|
|
75
|
+
/** Every deviation, in a fixed order. */
|
|
116
76
|
deviations: DeclarationDeviation[];
|
|
117
77
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* `partial` and the pack to `incomplete`, never to `failed`.
|
|
78
|
+
* Mismatches with unsigned content, in a fixed order. They carry the check to
|
|
79
|
+
* `incomplete` and the pack to `incomplete`, never to `failed`.
|
|
121
80
|
*/
|
|
122
81
|
contentFindings: DeclarationContentFinding[];
|
|
123
|
-
/** Named findings that are
|
|
82
|
+
/** Named findings that are not deviations, in a fixed order. */
|
|
124
83
|
notes: DeclarationNote[];
|
|
125
84
|
/**
|
|
126
|
-
* Whether the body carried a `declaration` member at all,
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* that claimed nothing: `gradePack` grades the two differently.
|
|
85
|
+
* Whether the body carried a `declaration` member at all, whatever its shape.
|
|
86
|
+
* An unreadable claim is not the same as no claim: `gradePack` grades them
|
|
87
|
+
* differently.
|
|
130
88
|
*/
|
|
131
89
|
present: boolean;
|
|
132
90
|
/** `event_id`s the declaration expects, in declaration order. */
|
|
@@ -134,140 +92,70 @@ export interface DeclarationCheck {
|
|
|
134
92
|
/** Of those, the ones declared withheld on purpose. */
|
|
135
93
|
declaredWithheld: string[];
|
|
136
94
|
/**
|
|
137
|
-
* The
|
|
138
|
-
*
|
|
139
|
-
* one whose version this reader does not know. Set for a malformed object
|
|
140
|
-
* too: the version was read, the rest was not. Optional so a check a caller
|
|
141
|
-
* builds by hand, as rule version 5 adapters do, still type-checks.
|
|
95
|
+
* The version the object was read as, or `null` where there is no
|
|
96
|
+
* declaration or its version is unknown. Set for a malformed object too.
|
|
142
97
|
*/
|
|
143
98
|
version?: string | null;
|
|
144
|
-
/**
|
|
145
|
-
* Every record a v2 declaration signs a role for, in declaration order.
|
|
146
|
-
* Empty for v1, and for anything this reader could not read.
|
|
147
|
-
*/
|
|
99
|
+
/** Every record a v2 or v3 declaration signs a role for, in declaration order. */
|
|
148
100
|
roles?: {
|
|
149
101
|
eventId: string;
|
|
150
102
|
role: DeclarationRole;
|
|
151
103
|
}[];
|
|
152
|
-
/**
|
|
153
|
-
* Every `chain_key` a v3 declaration claims is complete and in order, in
|
|
154
|
-
* declaration order. Empty for v1 and v2, and for anything this reader could
|
|
155
|
-
* not read.
|
|
156
|
-
*/
|
|
104
|
+
/** Every `chain_key` a v3 declaration claims, in declaration order. */
|
|
157
105
|
chains?: string[];
|
|
158
106
|
}
|
|
159
107
|
/**
|
|
160
|
-
* One of the pack's own records
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* An event with no readable `event_id` is given a positional name, the same
|
|
164
|
-
* `#n` convention `accountDisclosure` uses, so it is still reported rather
|
|
165
|
-
* than dropped. An unnameable record cannot be declared, so it can only ever
|
|
166
|
-
* be surplus, which is a deviation and is named as one.
|
|
108
|
+
* One of the pack's own records. An event with no readable `event_id` gets a
|
|
109
|
+
* positional `#n` name, so it is reported as surplus rather than dropped.
|
|
167
110
|
*/
|
|
168
111
|
export interface PackRecord {
|
|
169
112
|
eventId: string;
|
|
170
113
|
nameable: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Whether bytes for this record reached the reader at ALL, from either
|
|
173
|
-
* channel. This is what the disclosure account counts.
|
|
174
|
-
*/
|
|
114
|
+
/** Whether bytes reached the reader from either channel. */
|
|
175
115
|
disclosed: boolean;
|
|
176
116
|
/**
|
|
177
|
-
* Whether the bytes came from `events[].content`,
|
|
178
|
-
*
|
|
179
|
-
* apart because only this one is the holder's own word: the side-content
|
|
180
|
-
* map is filled in by whoever assembled the case (proof#147).
|
|
117
|
+
* Whether the bytes came from `events[].content`, inside the signed body.
|
|
118
|
+
* Only this channel is the holder's own word.
|
|
181
119
|
*/
|
|
182
120
|
disclosedInBody: boolean;
|
|
183
121
|
publicKey: string;
|
|
184
122
|
record: HandoffRecord | null;
|
|
185
123
|
/**
|
|
186
|
-
* Whether the pack
|
|
187
|
-
*
|
|
188
|
-
* withholding it is minimum disclosure rather than a defect, so "the pack
|
|
189
|
-
* supplied bytes this reader cannot read" and "the pack supplied none" are
|
|
190
|
-
* two different readings and never one.
|
|
124
|
+
* Whether the pack supplied `event_bytes` at all. Supplied-but-unreadable and
|
|
125
|
+
* not supplied are different readings: withholding is minimum disclosure.
|
|
191
126
|
*/
|
|
192
127
|
bytesSupplied: boolean;
|
|
193
128
|
/**
|
|
194
|
-
* Whether
|
|
195
|
-
*
|
|
196
|
-
* verifier binds `payload_hash` against. Rule 11 excuses a dangling link
|
|
197
|
-
* only for such a record's producing key.
|
|
129
|
+
* Whether the payload binding is undetermined: no `event_bytes` and no inline
|
|
130
|
+
* `payload`. Rule 11 excuses a dangling link only for such a record's key.
|
|
198
131
|
*/
|
|
199
132
|
bindingUndetermined: boolean;
|
|
200
133
|
/**
|
|
201
|
-
* The envelope's signed `payload_hash
|
|
202
|
-
*
|
|
203
|
-
* names: rule 11 excuses a dangling link only where the pointer equals it.
|
|
134
|
+
* The envelope's signed `payload_hash`, or `""`. Rule 11 excuses a dangling
|
|
135
|
+
* link only where the pointer equals it.
|
|
204
136
|
*/
|
|
205
137
|
payloadHash: string;
|
|
206
138
|
}
|
|
207
139
|
/**
|
|
208
|
-
* The pack's own records, in bundle order. Exported so
|
|
209
|
-
*
|
|
210
|
-
* it here, rather than through a second one beside it. A validation copied
|
|
211
|
-
* next to the one that enforces it drifts, and a copy that is looser blesses
|
|
212
|
-
* a value the real one then rejects.
|
|
140
|
+
* The pack's own records, in bundle order. Exported so `./case.ts` reads a
|
|
141
|
+
* pack through the same parser that grades it.
|
|
213
142
|
*/
|
|
214
143
|
export declare function packRecords(bundle: unknown, content: SideContentMap | null | undefined): PackRecord[];
|
|
215
144
|
/**
|
|
216
145
|
* Check a pack against the declaration inside its body.
|
|
217
146
|
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* already built.
|
|
222
|
-
*
|
|
223
|
-
* `chains` is `readChains` over the SAME bundle. Only a v3 declaration that
|
|
224
|
-
* claims a chain reads it (rule 11). It is an argument rather than computed
|
|
225
|
-
* here because `readChains` is asynchronous and this check is not, and Python's
|
|
226
|
-
* `check_declaration` takes it the same way so the two kernels share one
|
|
227
|
-
* contract. A v3 declaration that claims a chain, checked without it, reads as
|
|
228
|
-
* a reader that does not know v3 reads it: `partial`, nothing named, and the
|
|
229
|
-
* pack `incomplete`. Leaving it out can never read `verified`.
|
|
147
|
+
* @param content - The side-content map `verifyEvidenceBundle` takes.
|
|
148
|
+
* @param chains - `readChains` over the same bundle, read only for a v3 chain
|
|
149
|
+
* claim. Omitted, such a claim reads `incomplete`, never `verified`.
|
|
230
150
|
*
|
|
231
|
-
* The verdict
|
|
232
|
-
*
|
|
233
|
-
* signatures are forged, and saying so is `gradePack`'s job, which takes both.
|
|
151
|
+
* The verdict does not read the bundle verdict: a declaration can match over
|
|
152
|
+
* forged signatures, and `gradePack` combines the two.
|
|
234
153
|
*/
|
|
235
154
|
export declare function checkDeclaration(bundle: unknown, content?: SideContentMap | null, links?: readonly ChainLink[] | null): DeclarationCheck;
|
|
236
155
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* between surfaces is the verdict and the set of deviations, and those come
|
|
241
|
-
* from `checkDeclaration`. Both kernels return this same text for the same
|
|
242
|
-
* deviation, and `cross-kernel/run_cli.sh` holds the two commands to it.
|
|
243
|
-
*/
|
|
244
|
-
/**
|
|
245
|
-
* One line a surface can print beside the pack verdict: what the pack claimed
|
|
246
|
-
* to hold, and whether it does.
|
|
247
|
-
*
|
|
248
|
-
* Both kernels' commands print this sentence, so a reader who runs
|
|
249
|
-
* `sanning-proof verify` and `npx @sanning/proof verify` over one pack reads
|
|
250
|
-
* one sentence rather than two that differ by a word.
|
|
251
|
-
*
|
|
252
|
-
* `partial` is spelled out rather than printed as a word, because "partial" on
|
|
253
|
-
* its own beside a green pack reads as a hedge. What it means is that nobody
|
|
254
|
-
* said what the pack was meant to contain, and a reader deciding whether this
|
|
255
|
-
* is a full hand-over needs that in words.
|
|
256
|
-
*/
|
|
257
|
-
/**
|
|
258
|
-
* What a pack's declaration CLAIMS, for a reader one layer out.
|
|
259
|
-
*
|
|
260
|
-
* `checkDeclaration` answers "does this pack agree with its own claim". A case
|
|
261
|
-
* reader (`./case.ts`, anchor#198) needs a different thing from the same
|
|
262
|
-
* object: which records the holder claimed as a hand-off side at all, so that
|
|
263
|
-
* a conformant hand-off record the holder claimed NOWHERE is a named finding
|
|
264
|
-
* rather than a silence. That is the door proof#137 ratified open at this
|
|
265
|
-
* layer: `handoffs[]` MAY be empty, so rule 2 cannot reach a declared record
|
|
266
|
-
* and rule 7 cannot reach an unclaimed one.
|
|
267
|
-
*
|
|
268
|
-
* It is read HERE, from the same two functions `checkDeclaration` reads,
|
|
269
|
-
* rather than restated in the case layer. A second reader of one object drifts
|
|
270
|
-
* from the first, and a looser copy blesses a claim the real one rejects.
|
|
156
|
+
* What a pack's declaration claims, for `./case.ts`: which records the holder
|
|
157
|
+
* claimed as a hand-off side, so a hand-off record claimed nowhere is a named
|
|
158
|
+
* finding. Read from the same functions `checkDeclaration` uses.
|
|
271
159
|
*/
|
|
272
160
|
export interface DeclarationClaims {
|
|
273
161
|
/**
|
|
@@ -276,54 +164,40 @@ export interface DeclarationClaims {
|
|
|
276
164
|
*/
|
|
277
165
|
present: boolean;
|
|
278
166
|
/**
|
|
279
|
-
* Whether
|
|
280
|
-
*
|
|
281
|
-
* version and a malformed object, and a case reader must not read any of the
|
|
282
|
-
* three as "the holder claimed nothing to check".
|
|
167
|
+
* Whether the claim reads as a known version and satisfies §5.4.1. `false`
|
|
168
|
+
* never means "the holder claimed nothing to check".
|
|
283
169
|
*/
|
|
284
170
|
readable: boolean;
|
|
285
171
|
/** The case the declaration names, where it names one. */
|
|
286
172
|
caseId: string | null;
|
|
287
|
-
/**
|
|
288
|
-
* Every `event_id` a `handoffs[]` entry names on either side, in declaration
|
|
289
|
-
* order, with no duplicates. Empty where the holder claimed no pair, which
|
|
290
|
-
* is legal and is exactly the shape a case reader has to name.
|
|
291
|
-
*/
|
|
173
|
+
/** Every `event_id` a `handoffs[]` entry names, in order, without duplicates. */
|
|
292
174
|
claimedSides: string[];
|
|
293
|
-
/**
|
|
294
|
-
* The version the claim was read as, where `readable`; else `null`. The case
|
|
295
|
-
* reader's claim check is v1's alone (5.5.1 v1.20): a v2 pack's claim check
|
|
296
|
-
* is rule 9, which the declaration check already ran.
|
|
297
|
-
*/
|
|
175
|
+
/** The version the claim was read as, where `readable`; else `null`. */
|
|
298
176
|
version: string | null;
|
|
299
|
-
/** Every record a
|
|
177
|
+
/** Every record a readable v2 or v3 declaration signs a role for. */
|
|
300
178
|
roles: {
|
|
301
179
|
eventId: string;
|
|
302
180
|
role: DeclarationRole;
|
|
303
181
|
}[];
|
|
304
182
|
}
|
|
305
183
|
/**
|
|
306
|
-
* Read the claim a pack's declaration makes, without grading the pack.
|
|
307
|
-
*
|
|
308
|
-
* Deliberately total: a bundle this reader cannot read comes back with
|
|
309
|
-
* `readable: false` rather than throwing, because a case reader grades what it
|
|
310
|
-
* was handed and a reader that throws on a hostile pack cannot report that the
|
|
311
|
-
* pack is hostile.
|
|
184
|
+
* Read the claim a pack's declaration makes, without grading the pack. Total:
|
|
185
|
+
* never throws, so a hostile pack is reported rather than crashing the reader.
|
|
312
186
|
*/
|
|
313
187
|
export declare function declarationClaims(bundle: unknown): DeclarationClaims;
|
|
314
|
-
export declare function renderDeclarationSummary(check: DeclarationCheck): string;
|
|
315
188
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
189
|
+
* One line a surface can print beside the pack verdict. Both kernels print the
|
|
190
|
+
* same sentence.
|
|
318
191
|
*/
|
|
192
|
+
export declare function renderDeclarationSummary(check: DeclarationCheck): string;
|
|
193
|
+
/** The house wording for one note. */
|
|
319
194
|
export declare function renderNote(note: DeclarationNote): string;
|
|
320
195
|
/**
|
|
321
|
-
* The house wording for one content
|
|
322
|
-
*
|
|
323
|
-
* EVERY SENTENCE HERE NAMES THE CONTENT AND NOT THE HOLDER. That is the whole
|
|
324
|
-
* point of the kind: the bytes are unsigned and whoever assembled the case
|
|
325
|
-
* chose them, so a sentence that reads as an accusation would put the weaker
|
|
326
|
-
* word beside the stronger claim and an auditor would read the claim.
|
|
196
|
+
* The house wording for one content finding. Names the content, never the
|
|
197
|
+
* holder: the bytes are unsigned.
|
|
327
198
|
*/
|
|
328
199
|
export declare function renderContentFinding(finding: DeclarationContentFinding): string;
|
|
200
|
+
/**
|
|
201
|
+
* The house wording for one deviation. Both kernels return the same text.
|
|
202
|
+
*/
|
|
329
203
|
export declare function renderDeviation(deviation: DeclarationDeviation): string;
|