@sanning/proof 0.10.0 → 0.11.1
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 +4 -4
- package/dist/agent-proof.js +8 -2
- package/dist/case.d.ts +745 -0
- package/dist/case.js +1318 -0
- package/dist/chain.js +20 -1
- package/dist/cli.js +181 -27
- package/dist/crypto.d.ts +1 -0
- package/dist/crypto.js +29 -0
- package/dist/declaration.d.ts +284 -0
- package/dist/declaration.js +674 -0
- package/dist/evidence.js +296 -73
- package/dist/grading.d.ts +65 -4
- package/dist/grading.js +112 -6
- package/dist/handoff.d.ts +209 -0
- package/dist/handoff.js +617 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +50 -0
- package/dist/message-parts.d.ts +283 -0
- package/dist/message-parts.js +903 -0
- package/dist/verifier.d.ts +36 -0
- package/dist/verifier.js +150 -3
- package/package.json +1 -1
- package/src/agent-proof.ts +8 -2
- package/src/case.ts +1573 -0
- package/src/chain.ts +20 -1
- package/src/cli.ts +213 -29
- package/src/crypto.ts +28 -0
- package/src/declaration.ts +1005 -0
- package/src/evidence.ts +306 -71
- package/src/grading.ts +140 -6
- package/src/handoff.ts +694 -0
- package/src/index.ts +127 -0
- package/src/message-parts.ts +998 -0
- package/src/verifier.ts +150 -3
- package/vectors/README.md +36 -1
- package/vectors/jcs-reader.json +166 -0
- package/vectors/pack-grading.json +131 -3
package/src/index.ts
CHANGED
|
@@ -145,6 +145,80 @@ export type {
|
|
|
145
145
|
PackVerdict,
|
|
146
146
|
} from "./grading.js";
|
|
147
147
|
|
|
148
|
+
// The declaration (src/declaration.ts): what a pack SAYS it holds, checked
|
|
149
|
+
// against what it does (evidence-bundle.md §5.4).
|
|
150
|
+
//
|
|
151
|
+
// Every other check in this kernel checks a record that is PRESENT, so a pack
|
|
152
|
+
// with half its records dropped verifies perfectly and an auditor cannot tell
|
|
153
|
+
// a full hand-over from a trimmed one. The declaration is the pack's own
|
|
154
|
+
// statement of what it was meant to contain, inside `body` and therefore under
|
|
155
|
+
// the bundle's signature. Any deviation FAILS and every deviation is NAMED; a
|
|
156
|
+
// pack that carries no declaration is `partial`, never `verified`; and a
|
|
157
|
+
// reading that rests on the UNSIGNED content handed in beside the pack is
|
|
158
|
+
// named on its own and carries the weaker word, because whoever assembles a
|
|
159
|
+
// case chose those bytes (proof#147).
|
|
160
|
+
//
|
|
161
|
+
// Pure: data in, data out, no I/O. `gradePack` takes the result as an
|
|
162
|
+
// optional fourth argument, so a surface gets one verdict; omitting it is the
|
|
163
|
+
// pre-§5.4 behavior, unchanged. Additive: no existing export changes.
|
|
164
|
+
export {
|
|
165
|
+
DECLARATION_VERSION,
|
|
166
|
+
checkDeclaration,
|
|
167
|
+
declarationClaims,
|
|
168
|
+
packRecords,
|
|
169
|
+
renderContentFinding,
|
|
170
|
+
renderDeclarationSummary,
|
|
171
|
+
renderDeviation,
|
|
172
|
+
renderNote,
|
|
173
|
+
} from "./declaration.js";
|
|
174
|
+
export type {
|
|
175
|
+
DeclarationCheck,
|
|
176
|
+
DeclarationClaims,
|
|
177
|
+
DeclarationContentFinding,
|
|
178
|
+
DeclarationContentKind,
|
|
179
|
+
DeclarationDeviation,
|
|
180
|
+
DeclarationDeviationKind,
|
|
181
|
+
DeclarationNote,
|
|
182
|
+
DeclarationNoteKind,
|
|
183
|
+
DeclarationVerdict,
|
|
184
|
+
PackRecord,
|
|
185
|
+
} from "./declaration.js";
|
|
186
|
+
|
|
187
|
+
// The case (src/case.ts): one verdict over SEVERAL packs, across organizations
|
|
188
|
+
// (anchor#198). The layer above the declaration, and the closure for what a
|
|
189
|
+
// declaration cannot reach.
|
|
190
|
+
//
|
|
191
|
+
// A pack a party assembles about itself is not self-proving about what that
|
|
192
|
+
// party LEFT OUT (envelope-spec.md §4.1 A15, evidence-bundle.md §5.4.2 rule 7),
|
|
193
|
+
// because the omission happens before any reader runs. Reading several parties'
|
|
194
|
+
// packs at once is what closes it: a `handoff.sent` with no counterpart is
|
|
195
|
+
// always named, and where a pack signed by the key it names is in the case, the
|
|
196
|
+
// reading says that pack holds no counterpart. Whether a party that presented
|
|
197
|
+
// no such pack recorded anything is not established (proof#143). `readCase`
|
|
198
|
+
// verifies every pack itself, offline, so it is async. Matching is on keys and hashes alone and NEVER on tenancy, so a pair from two
|
|
199
|
+
// organizations verifies (DL-60).
|
|
200
|
+
//
|
|
201
|
+
// Pure: data in, data out, no I/O. Additive: a new module, no existing export
|
|
202
|
+
// changes, and no new verdict word anywhere.
|
|
203
|
+
export {
|
|
204
|
+
CASE_BODY_TYPES,
|
|
205
|
+
CASE_EXCEPTION_KINDS,
|
|
206
|
+
CASE_QUARANTINED_PROFILES,
|
|
207
|
+
CASE_RECORD_PROFILES,
|
|
208
|
+
CASE_VERDICTS,
|
|
209
|
+
readCase,
|
|
210
|
+
renderCaseSummary,
|
|
211
|
+
renderException,
|
|
212
|
+
} from "./case.js";
|
|
213
|
+
export type {
|
|
214
|
+
CaseException,
|
|
215
|
+
CaseExceptionKind,
|
|
216
|
+
CasePack,
|
|
217
|
+
CaseReading,
|
|
218
|
+
CaseRecordReading,
|
|
219
|
+
CaseVerdict,
|
|
220
|
+
} from "./case.js";
|
|
221
|
+
|
|
148
222
|
// Chain reading (src/chain.ts): following the pointer every sanning.events/v2
|
|
149
223
|
// record carries to the record before it, over the records ONE bundle presents.
|
|
150
224
|
//
|
|
@@ -195,3 +269,56 @@ export type {
|
|
|
195
269
|
AgentProofResult,
|
|
196
270
|
VerifyAgentProofOptions,
|
|
197
271
|
} from "./agent-proof.js";
|
|
272
|
+
|
|
273
|
+
// The hand-off pairing rule (src/handoff.ts): which records are candidates to
|
|
274
|
+
// be the counterpart of a hand-off record, how a candidate set of more than one
|
|
275
|
+
// is ordered, and what a formed pair grades to (specs/envelope-spec.md §4.1
|
|
276
|
+
// v1.9, proof#132 and proof#136). The Python half is src/sanning_proof/handoff.py and the two
|
|
277
|
+
// answer identically on identical bytes. Additive: a new module, and no
|
|
278
|
+
// existing export changes.
|
|
279
|
+
export {
|
|
280
|
+
CANDIDATE_NAMESPACE,
|
|
281
|
+
DEFINED_EVENT_TYPES,
|
|
282
|
+
NOT_A_HANDOFF_FINDING,
|
|
283
|
+
isConformantHandoffRecord,
|
|
284
|
+
readHandoff,
|
|
285
|
+
readHandoffs,
|
|
286
|
+
recordIsMalformed,
|
|
287
|
+
} from "./handoff.js";
|
|
288
|
+
export type {
|
|
289
|
+
CandidateReading,
|
|
290
|
+
HandoffReading,
|
|
291
|
+
HandoffRecord,
|
|
292
|
+
HandoffVerdict,
|
|
293
|
+
HeldRecord,
|
|
294
|
+
} from "./handoff.js";
|
|
295
|
+
|
|
296
|
+
// A file part's BYTES (src/message-parts.ts): what a file part is, and what a
|
|
297
|
+
// receiver that HOLDS a part's bytes commits to (envelope-spec.md section 4.1
|
|
298
|
+
// v1.13, A18, proof#145). A receiver that holds the bytes hashes them and, on a
|
|
299
|
+
// mismatch, commits to the message AS IT HELD IT, so the pair fails on
|
|
300
|
+
// `message_hash` rather than verifying over bytes nobody checked. The Python
|
|
301
|
+
// half is src/sanning_proof/message_parts.py and the two are held together by
|
|
302
|
+
// cross-kernel/run_parts.sh. Pure: it neither canonicalizes nor hashes the
|
|
303
|
+
// message.
|
|
304
|
+
export {
|
|
305
|
+
BYTES_FOR_UNKNOWN_PART,
|
|
306
|
+
CONFLICTING_PART_BYTES,
|
|
307
|
+
INLINE_BYTES_KEYS,
|
|
308
|
+
MESSAGE_RESULT_ORDER,
|
|
309
|
+
PARTS_NOT_AN_ARRAY,
|
|
310
|
+
PART_ENCODING_MISMATCH,
|
|
311
|
+
PART_INLINE_BYTES,
|
|
312
|
+
PART_INLINE_MISMATCHED,
|
|
313
|
+
PART_MALFORMED_DESCRIPTOR,
|
|
314
|
+
PART_MATCHED,
|
|
315
|
+
PART_MISMATCHED,
|
|
316
|
+
PART_NOT_A_FILE,
|
|
317
|
+
PART_SUPPLIED_TWICE,
|
|
318
|
+
PART_UNCHECKED,
|
|
319
|
+
REFUSAL_ORDER,
|
|
320
|
+
commitHeldMessage,
|
|
321
|
+
isFilePart,
|
|
322
|
+
uncheckedHeldParts,
|
|
323
|
+
} from "./message-parts.js";
|
|
324
|
+
export type { HeldMessage, Note, PartReading, Refusal, SuppliedPart } from "./message-parts.js";
|