@action-state-group/capsule-viewer 0.18.2 → 0.18.3

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.
@@ -562,21 +562,21 @@ var EvidenceGraph = (() => {
562
562
  function encodeUint(writer, token) {
563
563
  return encodeUintValue(writer, 0, token.value);
564
564
  }
565
- function encodeUintValue(writer, major, uint2) {
566
- if (uint2 < uintBoundaries[0]) {
567
- const nuint = Number(uint2);
565
+ function encodeUintValue(writer, major, uint3) {
566
+ if (uint3 < uintBoundaries[0]) {
567
+ const nuint = Number(uint3);
568
568
  writer.pushByte(major | nuint);
569
- } else if (uint2 < uintBoundaries[1]) {
570
- const nuint = Number(uint2);
569
+ } else if (uint3 < uintBoundaries[1]) {
570
+ const nuint = Number(uint3);
571
571
  writer.push([major | 24, nuint]);
572
- } else if (uint2 < uintBoundaries[2]) {
573
- const nuint = Number(uint2);
572
+ } else if (uint3 < uintBoundaries[2]) {
573
+ const nuint = Number(uint3);
574
574
  writer.push([major | 25, nuint >>> 8, nuint & 255]);
575
- } else if (uint2 < uintBoundaries[3]) {
576
- const nuint = Number(uint2);
575
+ } else if (uint3 < uintBoundaries[3]) {
576
+ const nuint = Number(uint3);
577
577
  writer.push([major | 26, nuint >>> 24 & 255, nuint >>> 16 & 255, nuint >>> 8 & 255, nuint & 255]);
578
578
  } else {
579
- const buint = BigInt(uint2);
579
+ const buint = BigInt(uint3);
580
580
  if (buint < uintBoundaries[4]) {
581
581
  const set = [major | 27, 0, 0, 0, 0, 0, 0, 0];
582
582
  let lo = Number(buint & BigInt(4294967295));
@@ -610,17 +610,17 @@ var EvidenceGraph = (() => {
610
610
  encodeUint.encodedSize = function encodedSize(token) {
611
611
  return encodeUintValue.encodedSize(token.value);
612
612
  };
613
- encodeUintValue.encodedSize = function encodedSize2(uint2) {
614
- if (uint2 < uintBoundaries[0]) {
613
+ encodeUintValue.encodedSize = function encodedSize2(uint3) {
614
+ if (uint3 < uintBoundaries[0]) {
615
615
  return 1;
616
616
  }
617
- if (uint2 < uintBoundaries[1]) {
617
+ if (uint3 < uintBoundaries[1]) {
618
618
  return 2;
619
619
  }
620
- if (uint2 < uintBoundaries[2]) {
620
+ if (uint3 < uintBoundaries[2]) {
621
621
  return 3;
622
622
  }
623
- if (uint2 < uintBoundaries[3]) {
623
+ if (uint3 < uintBoundaries[3]) {
624
624
  return 5;
625
625
  }
626
626
  return 9;
@@ -1414,11 +1414,11 @@ var EvidenceGraph = (() => {
1414
1414
  encoders[tokens.type.major](writer, tokens, options);
1415
1415
  }
1416
1416
  }
1417
- function directEncodeUintValue(writer, major, uint2) {
1418
- if (uint2 < 24) {
1419
- writer.pushByte(major | Number(uint2));
1417
+ function directEncodeUintValue(writer, major, uint3) {
1418
+ if (uint3 < 24) {
1419
+ writer.pushByte(major | Number(uint3));
1420
1420
  } else {
1421
- encodeUintValue(writer, major, uint2);
1421
+ encodeUintValue(writer, major, uint3);
1422
1422
  }
1423
1423
  }
1424
1424
  function canDirectEncode(options) {
@@ -4821,11 +4821,11 @@ var EvidenceGraph = (() => {
4821
4821
  return false;
4822
4822
  }
4823
4823
  if (a.isSmallOrder() || rPoint.isSmallOrder()) return false;
4824
- const digest = new Uint8Array(64 + message.length);
4825
- digest.set(r);
4826
- digest.set(publicKey, 32);
4827
- digest.set(message, 64);
4828
- const k = littleEndian(sha512(digest)) % Point.Fn.ORDER;
4824
+ const digest2 = new Uint8Array(64 + message.length);
4825
+ digest2.set(r);
4826
+ digest2.set(publicKey, 32);
4827
+ digest2.set(message, 64);
4828
+ const k = littleEndian(sha512(digest2)) % Point.Fn.ORDER;
4829
4829
  return Point.BASE.multiplyUnsafe(s).equals(rPoint.add(a.multiplyUnsafe(k)));
4830
4830
  }
4831
4831
  var CHECKPOINT_CONTENT_TYPE, encodeCanonical, toHex2, bytesEqual, formatTime, Point, littleEndian;
@@ -5088,7 +5088,10 @@ var EvidenceGraph = (() => {
5088
5088
  historyViewStyles: () => historyViewStyles,
5089
5089
  mountPresentation: () => mountPresentation,
5090
5090
  mountPresentationFragment: () => mountPresentationFragment,
5091
+ mustHaveTotals: () => mustHaveTotals,
5091
5092
  obligationStatus: () => obligationStatus,
5093
+ parentWitnessLine: () => parentWitnessLine,
5094
+ parentWitnessTime: () => parentWitnessTime,
5092
5095
  paymentPreimageCheck: () => paymentPreimageCheck,
5093
5096
  placeholders: () => placeholders,
5094
5097
  readWordingPack: () => readWordingPack,
@@ -5624,14 +5627,14 @@ var EvidenceGraph = (() => {
5624
5627
  }
5625
5628
  async function sha256Hex(value) {
5626
5629
  const subtle = webCrypto();
5627
- let digest;
5630
+ let digest2;
5628
5631
  if (subtle !== void 0)
5629
- digest = new Uint8Array(await subtle.digest("SHA-256", value));
5632
+ digest2 = new Uint8Array(await subtle.digest("SHA-256", value));
5630
5633
  else if (sha256Fallback)
5631
- digest = sha256(value);
5634
+ digest2 = sha256(value);
5632
5635
  else
5633
5636
  throw new Sha256UnavailableError();
5634
- return Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("");
5637
+ return Array.from(digest2, (byte) => byte.toString(16).padStart(2, "0")).join("");
5635
5638
  }
5636
5639
  async function jsonDigest(value) {
5637
5640
  return sha256Hex(jcs(value));
@@ -6453,6 +6456,80 @@ var EvidenceGraph = (() => {
6453
6456
  // node_modules/@action-state-group/agent-action-capsule/dist/bundle.js
6454
6457
  init_browser();
6455
6458
 
6459
+ // node_modules/@action-state-group/agent-action-capsule/dist/cll-checkpoint.js
6460
+ init_browser();
6461
+ var object3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && !(value instanceof JsonNumber);
6462
+ var integer = (value) => typeof value === "number" && Number.isSafeInteger(value);
6463
+ var hex2 = (value) => Uint8Array.from(value.match(/../gu), (byte) => Number.parseInt(byte, 16));
6464
+ var encodeBase64Url = (bytes) => btoa(Array.from(bytes, (byte) => String.fromCharCode(byte)).join("")).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
6465
+ function base64UrlDecode(value) {
6466
+ const padded = `${value}${"=".repeat((4 - value.length % 4) % 4)}`;
6467
+ const binary = atob(padded.replaceAll("-", "+").replaceAll("_", "/"));
6468
+ const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
6469
+ if (encodeBase64Url(bytes) !== value)
6470
+ throw new TypeError("non-canonical base64url");
6471
+ return bytes;
6472
+ }
6473
+ function decodeCose(encoded) {
6474
+ if (typeof encoded !== "string" || !/^[A-Za-z0-9_-]*$/u.test(encoded))
6475
+ return void 0;
6476
+ try {
6477
+ return base64UrlDecode(encoded);
6478
+ } catch {
6479
+ return void 0;
6480
+ }
6481
+ }
6482
+ async function loadCheckpointMetadata() {
6483
+ try {
6484
+ const module = await Promise.resolve().then(() => (init_browser(), browser_exports));
6485
+ return typeof module.checkpointMetadata === "function" ? module.checkpointMetadata : void 0;
6486
+ } catch {
6487
+ return void 0;
6488
+ }
6489
+ }
6490
+ async function signedCheckpointFields(cose, checkpointMetadata2) {
6491
+ const verify = checkpointMetadata2 ?? await loadCheckpointMetadata();
6492
+ if (verify === void 0)
6493
+ return void 0;
6494
+ let metadata;
6495
+ try {
6496
+ metadata = await verify(cose);
6497
+ } catch {
6498
+ return void 0;
6499
+ }
6500
+ return metadata === void 0 ? void 0 : {
6501
+ log_id: metadata.logId,
6502
+ mmr_size: Number(metadata.size),
6503
+ root: metadata.root,
6504
+ key_id: metadata.keyId,
6505
+ timestamp: metadata.timestamp,
6506
+ prev_size: Number(metadata.previousSize),
6507
+ prev_root: metadata.previousRoot
6508
+ };
6509
+ }
6510
+ function parseProof(raw) {
6511
+ if (!object3(raw) || raw.v !== 1 || raw.kind !== "inclusion" || !integer(raw.size) || !integer(raw.leaf_index) || raw.size < 0 || raw.leaf_index < 0)
6512
+ return void 0;
6513
+ const hashes = (value) => Array.isArray(value) && value.every(isHex64) ? value : void 0;
6514
+ const witness = hashes(raw.witness), left = hashes(raw.peaks_left), right = hashes(raw.peaks_right);
6515
+ return witness && left && right ? {
6516
+ v: 1,
6517
+ kind: "inclusion",
6518
+ size: raw.size,
6519
+ leaf_index: raw.leaf_index,
6520
+ witness,
6521
+ peaks_left: left,
6522
+ peaks_right: right
6523
+ } : void 0;
6524
+ }
6525
+ async function verifyProof(root, identity2, proof, leafIndex = proof.leaf_index) {
6526
+ const flattened = proof.witness.map(hex2);
6527
+ if (proof.peaks_right.length)
6528
+ flattened.push(await rootFromPeaks2(proof.peaks_right.map(hex2)));
6529
+ flattened.push(...proof.peaks_left.map(hex2).toReversed());
6530
+ return verifyHexInclusion2(root, BigInt(proof.size), BigInt(leafIndex), identity2, flattened);
6531
+ }
6532
+
6456
6533
  // node_modules/@action-state-group/agent-action-capsule/dist/bip340.js
6457
6534
  var P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn;
6458
6535
  var N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n;
@@ -6659,7 +6736,7 @@ var EvidenceGraph = (() => {
6659
6736
  });
6660
6737
  return out;
6661
6738
  }
6662
- var hex2 = (bytes) => Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
6739
+ var hex3 = (bytes) => Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
6663
6740
  function hexToBytes4(text2) {
6664
6741
  const out = new Uint8Array(text2.length / 2);
6665
6742
  for (let i = 0; i < out.length; i++)
@@ -6808,7 +6885,7 @@ var EvidenceGraph = (() => {
6808
6885
  return false;
6809
6886
  if (!HEX64.test(key))
6810
6887
  return false;
6811
- const event = `[0,"${key}",${createdAt},${NOSTR_KIND},[],"${version}:${hex2(sha256(signed))}"]`;
6888
+ const event = `[0,"${key}",${createdAt},${NOSTR_KIND},[],"${version}:${hex3(sha256(signed))}"]`;
6812
6889
  return verifyBip340(key, sha256(encoder4.encode(event)), text2);
6813
6890
  }
6814
6891
  async function verifySig(key, keyType, sig, version, signed) {
@@ -6840,7 +6917,7 @@ var EvidenceGraph = (() => {
6840
6917
  }
6841
6918
  return STATUS_PASS;
6842
6919
  }
6843
- async function revocation(digest, keys, types, ts, statements) {
6920
+ async function revocation(digest2, keys, types, ts, statements) {
6844
6921
  for (const octets of statements) {
6845
6922
  let s;
6846
6923
  try {
@@ -6854,7 +6931,7 @@ var EvidenceGraph = (() => {
6854
6931
  "key_id",
6855
6932
  "revoked_at",
6856
6933
  "sig"
6857
- ]) || s.revocation_version !== REVOCATION_VERSION || s.binding !== digest || s.key_id !== keys[0] && s.key_id !== keys[1])
6934
+ ]) || s.revocation_version !== REVOCATION_VERSION || s.binding !== digest2 || s.key_id !== keys[0] && s.key_id !== keys[1])
6858
6935
  continue;
6859
6936
  const keyType = s.key_id === keys[1] ? types[1] : types[0];
6860
6937
  let signed;
@@ -6892,11 +6969,11 @@ var EvidenceGraph = (() => {
6892
6969
  return entries;
6893
6970
  }
6894
6971
  var floorSeconds = (t) => t >= 0n ? t / NS : -((-t + NS - 1n) / NS);
6895
- function whyNot(declared, received, l, digest, ts) {
6972
+ function whyNot(declared, received, l, digest2, ts) {
6896
6973
  if (declared.error !== void 0)
6897
6974
  return declared.error;
6898
6975
  const d = declared.declaration;
6899
- if (d.binding !== digest)
6976
+ if (d.binding !== digest2)
6900
6977
  return "the declaration names another binding";
6901
6978
  if (d.listDigest !== received)
6902
6979
  return "list_digest is not the digest of the list received";
@@ -6914,11 +6991,11 @@ var EvidenceGraph = (() => {
6914
6991
  return "the evaluation time is more than max_age after as_of";
6915
6992
  return "";
6916
6993
  }
6917
- function listReport(l, digest, ts) {
6918
- const received = hex2(sha256(toBytes(l.list)));
6994
+ function listReport(l, digest2, ts) {
6995
+ const received = hex3(sha256(toBytes(l.list)));
6919
6996
  const declared = parseDeclaration(l.declaration);
6920
6997
  const d = declared.declaration;
6921
- const reason = whyNot(declared, received, l, digest, ts);
6998
+ const reason = whyNot(declared, received, l, digest2, ts);
6922
6999
  return {
6923
7000
  profile: d.profile,
6924
7001
  assertedBy: d.assertedBy,
@@ -6935,7 +7012,7 @@ var EvidenceGraph = (() => {
6935
7012
  if (verify === void 0 || !Object.hasOwn(opts.credentialVerifiers, c.method))
6936
7013
  return STATUS_NOT_CHECKED;
6937
7014
  const octets = toBytes(opts.credential);
6938
- if (hex2(sha256(octets)) !== c.digest)
7015
+ if (hex3(sha256(octets)) !== c.digest)
6939
7016
  return STATUS_FAIL;
6940
7017
  const status2 = await verify(octets, c, keys);
6941
7018
  return status2 === STATUS_PASS || status2 === STATUS_FAIL || status2 === STATUS_INCONCLUSIVE ? status2 : STATUS_FAIL;
@@ -6957,7 +7034,7 @@ var EvidenceGraph = (() => {
6957
7034
  const r = value;
6958
7035
  let bindingDigest2;
6959
7036
  try {
6960
- bindingDigest2 = hex2(sha256(jcs(without(r, "sigs"))));
7037
+ bindingDigest2 = hex3(sha256(jcs(without(r, "sigs"))));
6961
7038
  } catch {
6962
7039
  }
6963
7040
  const claim = typeof r.claim === "string" ? r.claim : void 0;
@@ -7034,7 +7111,7 @@ var EvidenceGraph = (() => {
7034
7111
 
7035
7112
  // node_modules/@action-state-group/agent-action-capsule/dist/composed.js
7036
7113
  var COMPOSED_KIND = "composed/v1";
7037
- var object3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
7114
+ var object4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
7038
7115
  var isString = (value) => typeof value === "string";
7039
7116
  var LABEL = /^[A-Za-z0-9._:-]{1,128}$/u;
7040
7117
  var isLabel = (value) => isString(value) && LABEL.test(value);
@@ -7078,7 +7155,7 @@ var EvidenceGraph = (() => {
7078
7155
  if (index >= current.length)
7079
7156
  return { ok: false };
7080
7157
  current = current[index];
7081
- } else if (object3(current)) {
7158
+ } else if (object4(current)) {
7082
7159
  if (!Object.hasOwn(current, token))
7083
7160
  return { ok: false };
7084
7161
  current = current[token];
@@ -7106,9 +7183,9 @@ var EvidenceGraph = (() => {
7106
7183
  return ok2(labels);
7107
7184
  }
7108
7185
  function parseMember(raw, observers) {
7109
- if (!object3(raw))
7186
+ if (!object4(raw))
7110
7187
  return bad("not_an_object");
7111
- const { id, observer, request_digest: requestDigest, outcome, digest } = raw;
7188
+ const { id, observer, request_digest: requestDigest, outcome, digest: digest2 } = raw;
7112
7189
  if (!isLabel(id))
7113
7190
  return bad("id");
7114
7191
  if (!isLabel(observer))
@@ -7117,7 +7194,7 @@ var EvidenceGraph = (() => {
7117
7194
  return bad("observer_undeclared");
7118
7195
  if (!isHex64(requestDigest))
7119
7196
  return bad("request_digest");
7120
- if (!isHex64(digest))
7197
+ if (!isHex64(digest2))
7121
7198
  return bad("digest");
7122
7199
  if (!isString(outcome) || !Object.hasOwn(OUTCOME_BODY, outcome))
7123
7200
  return bad("outcome");
@@ -7128,7 +7205,7 @@ var EvidenceGraph = (() => {
7128
7205
  let response;
7129
7206
  if (Object.hasOwn(raw, "response")) {
7130
7207
  const value = raw.response;
7131
- if (outcome !== "artifact" || !object3(value) || !isHex64(value.request_digest) || !isHex64(value.artifact_digest))
7208
+ if (outcome !== "artifact" || !object4(value) || !isHex64(value.request_digest) || !isHex64(value.artifact_digest))
7132
7209
  return bad("response");
7133
7210
  response = value;
7134
7211
  }
@@ -7137,20 +7214,20 @@ var EvidenceGraph = (() => {
7137
7214
  observer,
7138
7215
  requestDigest,
7139
7216
  outcome,
7140
- digest,
7217
+ digest: digest2,
7141
7218
  ...response === void 0 ? {} : { response }
7142
7219
  };
7143
7220
  if (!Object.hasOwn(raw, bodyKey))
7144
7221
  return ok2(member);
7145
7222
  const body = raw[bodyKey];
7146
- if (!object3(body))
7223
+ if (!object4(body))
7147
7224
  return bad("body");
7148
7225
  if (outcome === "refusal") {
7149
7226
  if (!isHex64(body.request_digest) || !isString(body.reason) || !isString(body.issued_at))
7150
7227
  return bad("refusal_body");
7151
7228
  } else if (outcome === "absence") {
7152
7229
  const window = body.window;
7153
- if (!isHex64(body.request_digest) || !object3(window) || !isString(window.from) || !isString(window.to))
7230
+ if (!isHex64(body.request_digest) || !object4(window) || !isString(window.from) || !isString(window.to))
7154
7231
  return bad("absence_body");
7155
7232
  if (Object.hasOwn(body, "route") && !isString(body.route))
7156
7233
  return bad("absence_body");
@@ -7160,7 +7237,7 @@ var EvidenceGraph = (() => {
7160
7237
  return ok2({ ...member, body });
7161
7238
  }
7162
7239
  function parseJoin(raw, members) {
7163
- if (!object3(raw))
7240
+ if (!object4(raw))
7164
7241
  return bad("not_an_object");
7165
7242
  const pair = raw.members;
7166
7243
  if (!Array.isArray(pair) || pair.length !== 2)
@@ -7216,10 +7293,10 @@ var EvidenceGraph = (() => {
7216
7293
  return j.pointer === void 0 ? key : `${key}\0${j.pointer}`;
7217
7294
  };
7218
7295
  function parseComposed(raw) {
7219
- if (!object3(raw))
7296
+ if (!object4(raw))
7220
7297
  return bad("not_an_object");
7221
- const digest = raw.composed_digest;
7222
- if (!isHex64(digest))
7298
+ const digest2 = raw.composed_digest;
7299
+ if (!isHex64(digest2))
7223
7300
  return bad("composed_digest");
7224
7301
  const observerList = raw.observers;
7225
7302
  if (!Array.isArray(observerList) || observerList.length === 0)
@@ -7227,7 +7304,7 @@ var EvidenceGraph = (() => {
7227
7304
  const observerIds = /* @__PURE__ */ new Set();
7228
7305
  const observers = [];
7229
7306
  for (const [i, o] of observerList.entries()) {
7230
- if (!object3(o) || !isLabel(o.id) || !isString(o.role) || !isString(o.custody_domain))
7307
+ if (!object4(o) || !isLabel(o.id) || !isString(o.role) || !isString(o.custody_domain))
7231
7308
  return bad(`observer:${i}`);
7232
7309
  if (observerIds.has(o.id))
7233
7310
  return bad(`observer_id_duplicate:${o.id}`);
@@ -7278,7 +7355,7 @@ var EvidenceGraph = (() => {
7278
7355
  joins,
7279
7356
  notRequested: notRequested.value,
7280
7357
  missing: missing.value,
7281
- digest
7358
+ digest: digest2
7282
7359
  });
7283
7360
  }
7284
7361
  function composedBlockProblem(raw) {
@@ -7338,7 +7415,7 @@ var EvidenceGraph = (() => {
7338
7415
  if (!Array.isArray(records))
7339
7416
  return void 0;
7340
7417
  for (const record of records)
7341
- if (object3(record) && record.capsule_id === root)
7418
+ if (object4(record) && record.capsule_id === root)
7342
7419
  return record;
7343
7420
  return void 0;
7344
7421
  }
@@ -7351,11 +7428,11 @@ var EvidenceGraph = (() => {
7351
7428
  return false;
7352
7429
  }
7353
7430
  }
7354
- async function identifierMatches(record, pointer, digest) {
7431
+ async function identifierMatches(record, pointer, digest2) {
7355
7432
  const value = resolvePointer(record, pointer);
7356
7433
  if (!value.ok || !isString(value.value))
7357
7434
  return false;
7358
- return await sha256Hex(utf82.encode(value.value)) === digest;
7435
+ return await sha256Hex(utf82.encode(value.value)) === digest2;
7359
7436
  }
7360
7437
  var isEmptyHistory = (body) => Array.isArray(body.records) && body.records.length === 0 && !Object.hasOwn(body, "root");
7361
7438
  function recordSide(record, pointer) {
@@ -7387,7 +7464,7 @@ var EvidenceGraph = (() => {
7387
7464
  return { wellFormed: false };
7388
7465
  const standin = { ...record };
7389
7466
  if (Array.isArray(record.sigs))
7390
- standin.sigs = record.sigs.map((e) => object3(e) && Object.hasOwn(e, "sig") ? { ...e, sig: "" } : e);
7467
+ standin.sigs = record.sigs.map((e) => object4(e) && Object.hasOwn(e, "sig") ? { ...e, sig: "" } : e);
7391
7468
  try {
7392
7469
  jcs(standin);
7393
7470
  } catch {
@@ -7407,7 +7484,7 @@ var EvidenceGraph = (() => {
7407
7484
  return { report, wellFormed: false };
7408
7485
  if (Array.isArray(record.sigs) && ed25519Keys(record)) {
7409
7486
  for (const entry of record.sigs)
7410
- if (!object3(entry) || !isString(entry.sig) || !SIGNATURE_HEX.test(entry.sig))
7487
+ if (!object4(entry) || !isString(entry.sig) || !SIGNATURE_HEX.test(entry.sig))
7411
7488
  return { report, wellFormed: false };
7412
7489
  }
7413
7490
  let formReport = report;
@@ -7445,7 +7522,7 @@ var EvidenceGraph = (() => {
7445
7522
  }
7446
7523
  let derivable = false;
7447
7524
  for (const record of options.controllerBindings ?? []) {
7448
- if (!object3(record))
7525
+ if (!object4(record))
7449
7526
  continue;
7450
7527
  if (await bindingDigest(record) !== j.identifier)
7451
7528
  continue;
@@ -7568,7 +7645,7 @@ var EvidenceGraph = (() => {
7568
7645
  }
7569
7646
  async function verifyMember(m, declaredMissing, verifyMemberBundle, checkpoints) {
7570
7647
  const closure = [];
7571
- const failed2 = [];
7648
+ const failed3 = [];
7572
7649
  const withheld = [];
7573
7650
  const findings = [];
7574
7651
  const base = { id: m.id, observer: m.observer, outcome: m.outcome };
@@ -7581,7 +7658,7 @@ var EvidenceGraph = (() => {
7581
7658
  findings
7582
7659
  },
7583
7660
  closure,
7584
- failed: failed2,
7661
+ failed: failed3,
7585
7662
  withheld
7586
7663
  };
7587
7664
  if (m.body === void 0) {
@@ -7590,7 +7667,7 @@ var EvidenceGraph = (() => {
7590
7667
  return {
7591
7668
  member: { ...base, body: "absent", digest: "not_shown", findings },
7592
7669
  closure,
7593
- failed: failed2,
7670
+ failed: failed3,
7594
7671
  withheld
7595
7672
  };
7596
7673
  }
@@ -7612,11 +7689,11 @@ var EvidenceGraph = (() => {
7612
7689
  if (m.response !== void 0) {
7613
7690
  if (m.response.request_digest !== m.requestDigest) {
7614
7691
  findings.push("response_request_digest_mismatch");
7615
- failed2.push(`member_response_request_digest_mismatch:${m.id}`);
7692
+ failed3.push(`member_response_request_digest_mismatch:${m.id}`);
7616
7693
  }
7617
7694
  if (m.response.artifact_digest !== m.digest) {
7618
7695
  findings.push("response_artifact_digest_mismatch");
7619
- failed2.push(`member_response_artifact_digest_mismatch:${m.id}`);
7696
+ failed3.push(`member_response_artifact_digest_mismatch:${m.id}`);
7620
7697
  }
7621
7698
  }
7622
7699
  } else {
@@ -7627,12 +7704,12 @@ var EvidenceGraph = (() => {
7627
7704
  }
7628
7705
  if (m.body.request_digest !== m.requestDigest) {
7629
7706
  findings.push("request_digest_mismatch");
7630
- failed2.push(`member_request_digest_mismatch:${m.id}`);
7707
+ failed3.push(`member_request_digest_mismatch:${m.id}`);
7631
7708
  }
7632
7709
  }
7633
- let digest = "reproduced";
7710
+ let digest2 = "reproduced";
7634
7711
  if (computed === void 0 || computed !== m.digest) {
7635
- digest = "mismatch";
7712
+ digest2 = "mismatch";
7636
7713
  findings.push("member_digest_mismatch");
7637
7714
  closure.push(`member_digest_mismatch:${m.id}`);
7638
7715
  }
@@ -7650,14 +7727,14 @@ var EvidenceGraph = (() => {
7650
7727
  member: {
7651
7728
  ...base,
7652
7729
  body: "carried",
7653
- digest,
7730
+ digest: digest2,
7654
7731
  findings,
7655
7732
  ...bundle === void 0 ? {} : { bundle },
7656
7733
  ...refusalSignature === void 0 ? {} : { refusalSignature },
7657
7734
  ...responseSignature === void 0 ? {} : { responseSignature }
7658
7735
  },
7659
7736
  closure,
7660
- failed: failed2,
7737
+ failed: failed3,
7661
7738
  withheld
7662
7739
  };
7663
7740
  }
@@ -7673,7 +7750,7 @@ var EvidenceGraph = (() => {
7673
7750
  findings: [`composed_block_malformed:${parsed.reason}`]
7674
7751
  };
7675
7752
  const block = parsed.value;
7676
- const failed2 = [];
7753
+ const failed3 = [];
7677
7754
  const withheld = [];
7678
7755
  let recomputed = "";
7679
7756
  try {
@@ -7687,7 +7764,7 @@ var EvidenceGraph = (() => {
7687
7764
  matches: recomputed !== "" && recomputed === block.digest
7688
7765
  };
7689
7766
  if (!composedDigestResult.matches)
7690
- failed2.push("composed_digest_mismatch");
7767
+ failed3.push("composed_digest_mismatch");
7691
7768
  const missing = /* @__PURE__ */ new Set();
7692
7769
  const declared = new Set(block.members.map((m) => m.id));
7693
7770
  const closureFindings = [];
@@ -7706,7 +7783,7 @@ var EvidenceGraph = (() => {
7706
7783
  const result3 = await verifyMember(m, missing.has(m.id), verifyMemberBundle, checkpoints);
7707
7784
  members.push(result3.member);
7708
7785
  closureFindings.push(...result3.closure);
7709
- failed2.push(...result3.failed);
7786
+ failed3.push(...result3.failed);
7710
7787
  withheld.push(...result3.withheld);
7711
7788
  }
7712
7789
  let compositionClosure;
@@ -7717,7 +7794,7 @@ var EvidenceGraph = (() => {
7717
7794
  findings: closureFindings,
7718
7795
  missing: closureMissing
7719
7796
  };
7720
- failed2.push("composition_closure_fail");
7797
+ failed3.push("composition_closure_fail");
7721
7798
  } else if (block.missing.length > 0) {
7722
7799
  compositionClosure = {
7723
7800
  status: "withheld",
@@ -7743,16 +7820,16 @@ var EvidenceGraph = (() => {
7743
7820
  });
7744
7821
  const pair = `${j.members[0]},${j.members[1]}`;
7745
7822
  if (result3 === "join_state_mismatch")
7746
- failed2.push(`join_state_mismatch:${pair}`);
7823
+ failed3.push(`join_state_mismatch:${pair}`);
7747
7824
  else if (result3 === "not_derivable")
7748
7825
  withheld.push(`join_not_derivable:${pair}`);
7749
7826
  corroborations.push(corroboration(j, derived, byId, observers));
7750
7827
  }
7751
- const status2 = failed2.length > 0 ? "fail" : withheld.length > 0 ? "withheld" : "pass";
7828
+ const status2 = failed3.length > 0 ? "fail" : withheld.length > 0 ? "withheld" : "pass";
7752
7829
  return {
7753
7830
  status: status2,
7754
7831
  malformed: false,
7755
- findings: status2 === "fail" ? [...failed2, ...withheld] : withheld,
7832
+ findings: status2 === "fail" ? [...failed3, ...withheld] : withheld,
7756
7833
  composedDigest: composedDigestResult,
7757
7834
  members,
7758
7835
  observers: block.observers,
@@ -7775,14 +7852,14 @@ var EvidenceGraph = (() => {
7775
7852
  }
7776
7853
 
7777
7854
  // node_modules/@action-state-group/agent-action-capsule/dist/presentation.js
7778
- function object4(value) {
7855
+ function object5(value) {
7779
7856
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
7780
7857
  }
7781
7858
  var dataImageUrl = /^data:image\//u;
7782
7859
  function readPresentationBlock(bundle) {
7783
- const top = object4(bundle);
7784
- const extensions2 = object4(top?.extensions);
7785
- const block = object4(extensions2?.["presentation/v1"]);
7860
+ const top = object5(bundle);
7861
+ const extensions2 = object5(top?.extensions);
7862
+ const block = object5(extensions2?.["presentation/v1"]);
7786
7863
  if (block === void 0)
7787
7864
  return void 0;
7788
7865
  const name = typeof block.producer_display_name === "string" ? block.producer_display_name : void 0;
@@ -7800,7 +7877,7 @@ var EvidenceGraph = (() => {
7800
7877
  // node_modules/@action-state-group/agent-action-capsule/dist/extension-interpreters.js
7801
7878
  var BOOK_PAYLOADS_EXTENSION = "evidencebook/payloads";
7802
7879
  var AGENT_INPUT_ORIGINALS_EXTENSION = "capsulectl/agent-input-originals/v1";
7803
- var object5 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
7880
+ var object6 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
7804
7881
  var INTERPRETERS = Object.freeze({
7805
7882
  // the page header (capsule-viewer draws it) -> presentation.ts readPresentationBlock
7806
7883
  "presentation/v1": {
@@ -7823,16 +7900,16 @@ var EvidenceGraph = (() => {
7823
7900
  // a malformed block yields no composition result, so it is not interpreted.
7824
7901
  [COMPOSED_KIND]: {
7825
7902
  id: "aac.builtin.composed/v0",
7826
- accepts: (bundle) => object5(bundle) && object5(bundle.extensions) && composedBlockProblem(bundle.extensions[COMPOSED_KIND]) === void 0
7903
+ accepts: (bundle) => object6(bundle) && object6(bundle.extensions) && composedBlockProblem(bundle.extensions[COMPOSED_KIND]) === void 0
7827
7904
  },
7828
7905
  // result-root.ts buildResultRoot reads both blocks when it is an object
7829
7906
  [BOOK_PAYLOADS_EXTENSION]: {
7830
7907
  id: "result-root",
7831
- accepts: (bundle) => object5(bundle) && object5(bundle.extensions) && object5(bundle.extensions[BOOK_PAYLOADS_EXTENSION])
7908
+ accepts: (bundle) => object6(bundle) && object6(bundle.extensions) && object6(bundle.extensions[BOOK_PAYLOADS_EXTENSION])
7832
7909
  },
7833
7910
  [AGENT_INPUT_ORIGINALS_EXTENSION]: {
7834
7911
  id: "result-root",
7835
- accepts: (bundle) => object5(bundle) && object5(bundle.extensions) && object5(bundle.extensions[AGENT_INPUT_ORIGINALS_EXTENSION])
7912
+ accepts: (bundle) => object6(bundle) && object6(bundle.extensions) && object6(bundle.extensions[AGENT_INPUT_ORIGINALS_EXTENSION])
7836
7913
  }
7837
7914
  });
7838
7915
  function extensionInterpreter(kind, bundle) {
@@ -8143,7 +8220,7 @@ var EvidenceGraph = (() => {
8143
8220
  "category_coverage_signature",
8144
8221
  "category_coverage_consistency"
8145
8222
  ];
8146
- var object6 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && !(value instanceof JsonNumber);
8223
+ var object7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && !(value instanceof JsonNumber);
8147
8224
  var HEX1282 = /^[0-9a-f]{128}$/u;
8148
8225
  var ABSOLUTE_URI = /^[A-Za-z][A-Za-z0-9+.-]*:(?:[A-Za-z0-9._~!$&'()*+,;=:@/?-]|%[0-9A-Fa-f]{2})*$/u;
8149
8226
  var PRIVATE_SET = "x-";
@@ -8161,15 +8238,15 @@ var EvidenceGraph = (() => {
8161
8238
  return jcs({ category_coverage: unsigned, root });
8162
8239
  }
8163
8240
  function wellFormed2(member) {
8164
- if (!object6(member))
8241
+ if (!object7(member))
8165
8242
  return false;
8166
8243
  if (typeof member.set !== "string" || member.set === "")
8167
8244
  return false;
8168
8245
  const categories = member.categories;
8169
- if (!object6(categories) || Object.keys(categories).length === 0)
8246
+ if (!object7(categories) || Object.keys(categories).length === 0)
8170
8247
  return false;
8171
8248
  for (const [name, entry] of Object.entries(categories)) {
8172
- if (name === "" || !object6(entry) || !CATEGORY_STATUSES.includes(entry.status))
8249
+ if (name === "" || !object7(entry) || !CATEGORY_STATUSES.includes(entry.status))
8173
8250
  return false;
8174
8251
  const hasUri = Object.hasOwn(entry, "policy_uri");
8175
8252
  if (hasUri && !(typeof entry.policy_uri === "string" && ABSOLUTE_URI.test(entry.policy_uri)))
@@ -8184,7 +8261,7 @@ var EvidenceGraph = (() => {
8184
8261
  return false;
8185
8262
  if (hasSigner) {
8186
8263
  const signer = member.signer;
8187
- if (!object6(signer) || !isHex64(signer.key_id))
8264
+ if (!object7(signer) || !isHex64(signer.key_id))
8188
8265
  return false;
8189
8266
  if (typeof member.signature !== "string" || !HEX1282.test(member.signature))
8190
8267
  return false;
@@ -8234,13 +8311,13 @@ var EvidenceGraph = (() => {
8234
8311
  } catch {
8235
8312
  return "NOT_CHECKED";
8236
8313
  }
8237
- if (!object6(parsed))
8314
+ if (!object7(parsed))
8238
8315
  return "NOT_CHECKED";
8239
8316
  if (!Object.hasOwn(parsed, "categories"))
8240
8317
  return "NOT_PRESENT";
8241
8318
  const asked = parsed.categories;
8242
- const names2 = object6(asked) ? asked.names : void 0;
8243
- if (!object6(asked) || typeof asked.set !== "string" || !Array.isArray(names2) || names2.length === 0 || !names2.every((name) => typeof name === "string") || new Set(names2).size !== names2.length)
8319
+ const names2 = object7(asked) ? asked.names : void 0;
8320
+ if (!object7(asked) || typeof asked.set !== "string" || !Array.isArray(names2) || names2.length === 0 || !names2.every((name) => typeof name === "string") || new Set(names2).size !== names2.length)
8244
8321
  return "NOT_CHECKED";
8245
8322
  if (asked.set !== member.set)
8246
8323
  return "FAIL";
@@ -8266,7 +8343,7 @@ var EvidenceGraph = (() => {
8266
8343
  category_coverage_consistency: "NOT_CHECKED"
8267
8344
  };
8268
8345
  const records = Array.isArray(bundle.records) ? bundle.records : [];
8269
- const recordIds = records.filter(object6).map((record) => record.capsule_id).filter((id) => typeof id === "string");
8346
+ const recordIds = records.filter(object7).map((record) => record.capsule_id).filter((id) => typeof id === "string");
8270
8347
  return {
8271
8348
  category_coverage_form: "PASS",
8272
8349
  category_coverage_signature: await signature(member, Object.hasOwn(bundle, "root") ? bundle.root : null),
@@ -8279,6 +8356,9 @@ var EvidenceGraph = (() => {
8279
8356
  return result3 !== null && CATEGORY_COVERAGE_GATING.some((name) => result3[name] === "FAIL");
8280
8357
  }
8281
8358
 
8359
+ // node_modules/@action-state-group/agent-action-capsule/dist/parent-witness.js
8360
+ init_browser();
8361
+
8282
8362
  // node_modules/@action-state-group/agent-action-capsule/dist/cose-receipt.js
8283
8363
  var COSE_SIGN1_TAG = 18n;
8284
8364
  var HDR_ALG = 1n;
@@ -8659,11 +8739,11 @@ var EvidenceGraph = (() => {
8659
8739
  }
8660
8740
 
8661
8741
  // node_modules/@action-state-group/agent-action-capsule/dist/spki.js
8662
- var hex3 = (value) => Uint8Array.from(value.match(/../gu), (byte) => Number.parseInt(byte, 16));
8742
+ var hex4 = (value) => Uint8Array.from(value.match(/../gu), (byte) => Number.parseInt(byte, 16));
8663
8743
  var equal = (a, b) => a.length === b.length && a.every((byte, i) => byte === b[i]);
8664
8744
  var big = (bytes) => bytes.reduce((value, byte) => value << 8n | BigInt(byte), 0n);
8665
- var ED25519_ALGORITHM2 = hex3("06032b6570");
8666
- var P256_ALGORITHM2 = hex3("06072a8648ce3d020106082a8648ce3d030107");
8745
+ var ED25519_ALGORITHM2 = hex4("06032b6570");
8746
+ var P256_ALGORITHM2 = hex4("06072a8648ce3d020106082a8648ce3d030107");
8667
8747
  var P2 = 2n ** 256n - 2n ** 224n + 2n ** 192n + 2n ** 96n - 1n;
8668
8748
  var B = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604bn;
8669
8749
  function modPow2(base, exponent) {
@@ -8747,7 +8827,7 @@ var EvidenceGraph = (() => {
8747
8827
  "leaf_index",
8748
8828
  "tree_size"
8749
8829
  ];
8750
- var object7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
8830
+ var object8 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
8751
8831
  function bindingOf(url) {
8752
8832
  const separator = url.indexOf("://");
8753
8833
  const scheme = separator < 0 ? "" : url.slice(0, separator).toLowerCase();
@@ -8762,11 +8842,11 @@ var EvidenceGraph = (() => {
8762
8842
  return base.replace(/\/+$/u, "");
8763
8843
  }
8764
8844
  function witnessRowFor(directory, tsUrl) {
8765
- const rows = object7(directory) ? directory.witnesses : directory;
8845
+ const rows = object8(directory) ? directory.witnesses : directory;
8766
8846
  if (!Array.isArray(rows))
8767
8847
  return void 0;
8768
8848
  const binding = bindingOf(tsUrl), endpoint = endpointOf(tsUrl);
8769
- return rows.find((row2) => object7(row2) && (Object.hasOwn(row2, "binding") ? row2.binding : BINDING_CLL) === binding && endpointMatches(Object.hasOwn(row2, "endpoint") ? row2.endpoint : "", endpoint));
8849
+ return rows.find((row2) => object8(row2) && (Object.hasOwn(row2, "binding") ? row2.binding : BINDING_CLL) === binding && endpointMatches(Object.hasOwn(row2, "endpoint") ? row2.endpoint : "", endpoint));
8770
8850
  }
8771
8851
  var endpointMatches = (value, endpoint) => typeof value === "string" && value.replace(/\/+$/u, "") === endpoint;
8772
8852
  function base64Canonical(value) {
@@ -8779,7 +8859,7 @@ var EvidenceGraph = (() => {
8779
8859
  }
8780
8860
  var ED25519_SPKI_PREFIX = hexToBytes("302a300506032b6570032100");
8781
8861
  var ed25519Spki = (raw) => concat(ED25519_SPKI_PREFIX, raw);
8782
- var hex4 = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
8862
+ var hex5 = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
8783
8863
  function fromHex(value) {
8784
8864
  if (typeof value !== "string" || !/^(?:\s*[0-9A-Fa-f]{2})*\s*$/u.test(value))
8785
8865
  throw new TypeError("not hex");
@@ -8790,7 +8870,7 @@ var EvidenceGraph = (() => {
8790
8870
  return value;
8791
8871
  if (typeof value === "string")
8792
8872
  return [...value];
8793
- if (object7(value))
8873
+ if (object8(value))
8794
8874
  return Object.keys(value);
8795
8875
  if (value === null || value === void 0 || value === false || value === 0)
8796
8876
  return [];
@@ -8812,7 +8892,7 @@ var EvidenceGraph = (() => {
8812
8892
  continue;
8813
8893
  byId.set(await sha256Hex(der), der);
8814
8894
  if (der.length === 44 && der.subarray(0, 12).every((b, i) => b === ED25519_SPKI_PREFIX[i]))
8815
- byId.set(hex4(der.subarray(12)), der);
8895
+ byId.set(hex5(der.subarray(12)), der);
8816
8896
  }
8817
8897
  const keys = [];
8818
8898
  for (const keyId of keyIds) {
@@ -8974,12 +9054,12 @@ ${body}
8974
9054
  return fail2("the Rekor key is not an ECDSA P-256 key");
8975
9055
  }
8976
9056
  try {
8977
- if (!object7(receipt))
9057
+ if (!object8(receipt))
8978
9058
  return fail2("receipt is not an object");
8979
9059
  if (receipt.logID !== await sha256Hex(key))
8980
9060
  return fail2("logID is not the pinned Rekor key");
8981
9061
  const verification = receipt.verification;
8982
- const timestamp = object7(verification) ? verification.signedEntryTimestamp : void 0;
9062
+ const timestamp = object8(verification) ? verification.signedEntryTimestamp : void 0;
8983
9063
  if (!timestamp)
8984
9064
  return fail2("no signedEntryTimestamp");
8985
9065
  const integratedTime = jsonInteger(receipt.integratedTime), logIndex = jsonInteger(receipt.logIndex);
@@ -8993,17 +9073,17 @@ ${body}
8993
9073
  const entry = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(base64Canonical(receipt.body)));
8994
9074
  if (nestedTooDeep(entry))
8995
9075
  return fail2("unreadable receipt: body nested too deeply");
8996
- if (!object7(entry) || entry.kind !== "dsse")
9076
+ if (!object8(entry) || entry.kind !== "dsse")
8997
9077
  return fail2("entry kind is not dsse");
8998
9078
  const spec = entry.spec || {};
8999
- if (!object7(spec))
9079
+ if (!object8(spec))
9000
9080
  return fail2("entry spec is not an object");
9001
9081
  const payloadHash = spec.payloadHash || {};
9002
- if (!object7(payloadHash) || payloadHash.algorithm !== "sha256" || payloadHash.value !== await sha256Hex(cose))
9082
+ if (!object8(payloadHash) || payloadHash.algorithm !== "sha256" || payloadHash.value !== await sha256Hex(cose))
9003
9083
  return fail2("entry payloadHash is not this checkpoint's bytes");
9004
9084
  const verifiers = /* @__PURE__ */ new Set();
9005
9085
  for (const signature2 of pyIterate(spec.signatures)) {
9006
- if (!object7(signature2))
9086
+ if (!object8(signature2))
9007
9087
  return fail2("entry signature is not an object");
9008
9088
  const verifier = Object.hasOwn(signature2, "verifier") ? signature2.verifier : "";
9009
9089
  verifiers.add(pyStrip(latin1(base64Canonical(verifier)).replaceAll("\r", "")));
@@ -9057,7 +9137,7 @@ ${body}
9057
9137
  });
9058
9138
  }
9059
9139
  var isRecord = (entry) => {
9060
- if (!object7(entry) || !RECORD_FIELDS.every((name) => Object.hasOwn(entry, name)))
9140
+ if (!object8(entry) || !RECORD_FIELDS.every((name) => Object.hasOwn(entry, name)))
9061
9141
  return false;
9062
9142
  if (!["ts_url", "entry_hash", "receipt_b64"].every((name) => typeof entry[name] === "string" && entry[name] !== ""))
9063
9143
  return false;
@@ -9308,6 +9388,127 @@ ${body}
9308
9388
  };
9309
9389
  }
9310
9390
 
9391
+ // node_modules/@action-state-group/agent-action-capsule/dist/parent-witness.js
9392
+ var PARENT_LOG_WITNESS_KIND = "parent-log-witness/v1";
9393
+ var PARENT_WITNESS_MAX_PATH = 32;
9394
+ var failed2 = (finding) => ({
9395
+ status: "fail",
9396
+ findings: [finding],
9397
+ extent: null,
9398
+ receipts: []
9399
+ });
9400
+ var uint = (value) => integer(value) && value >= 0;
9401
+ var hexList = (value) => Array.isArray(value) && value.every(isHex64);
9402
+ async function digest(...parts) {
9403
+ const joined = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
9404
+ let offset = 0;
9405
+ for (const part of parts) {
9406
+ joined.set(part, offset);
9407
+ offset += part.length;
9408
+ }
9409
+ return hex2(await sha256Hex(joined));
9410
+ }
9411
+ async function treeLeaf(logId, size, checkpointCose, salt) {
9412
+ return digest(Uint8Array.of(0), jcs({
9413
+ checkpoint_sha256: await sha256Hex(checkpointCose),
9414
+ log_id: logId,
9415
+ salt,
9416
+ size
9417
+ }));
9418
+ }
9419
+ async function treeRoot(leaf, index, path2) {
9420
+ let h = leaf;
9421
+ for (const [level, sibling] of path2.entries())
9422
+ h = Math.floor(index / 2 ** level) % 2 === 0 ? await digest(Uint8Array.of(1), h, sibling) : await digest(Uint8Array.of(1), sibling, h);
9423
+ return h;
9424
+ }
9425
+ async function signedCheckpoint(stated) {
9426
+ const checkpoint = object3(stated) ? stated.checkpoint : void 0;
9427
+ const cose = decodeCose(object3(checkpoint) ? checkpoint.cose : void 0);
9428
+ if (cose === void 0)
9429
+ return "malformed";
9430
+ const signed = await signedCheckpointFields(cose);
9431
+ return signed === void 0 ? "invalid" : { signed, cose };
9432
+ }
9433
+ function consistencyProof2(raw) {
9434
+ if (!object3(raw) || raw.kind !== "consistency" || raw.v !== 1 || !uint(raw.old_size) || !uint(raw.new_size) || !hexList(raw.old_peaks) || !hexList(raw.new_peaks) || !Array.isArray(raw.witness) || !raw.witness.every(hexList))
9435
+ return void 0;
9436
+ return {
9437
+ oldSize: BigInt(raw.old_size),
9438
+ newSize: BigInt(raw.new_size),
9439
+ oldPeaks: raw.old_peaks.map(hex2),
9440
+ witness: raw.witness.map((path2) => path2.map(hex2)),
9441
+ newPeaks: raw.new_peaks.map(hex2)
9442
+ };
9443
+ }
9444
+ async function verifyParentLogWitness(block, signed, cose, directory) {
9445
+ if (signed === void 0 || cose === void 0)
9446
+ return {
9447
+ status: "withheld",
9448
+ findings: ["checkpoint_unverified"],
9449
+ extent: null,
9450
+ receipts: []
9451
+ };
9452
+ if (!object3(block))
9453
+ return failed2("parent_witness_malformed");
9454
+ let covered = signed, coveredCose = cose;
9455
+ if (Object.hasOwn(block, "earlier")) {
9456
+ const earlier = block.earlier;
9457
+ const prior = await signedCheckpoint(earlier);
9458
+ if (prior === "malformed")
9459
+ return failed2("parent_witness_earlier_checkpoint_malformed");
9460
+ if (prior === "invalid")
9461
+ return failed2("parent_witness_earlier_checkpoint_signature_invalid");
9462
+ if (prior.signed.key_id !== signed.key_id || prior.signed.log_id !== signed.log_id || prior.signed.mmr_size >= signed.mmr_size)
9463
+ return failed2("parent_witness_earlier_checkpoint_not_this_log");
9464
+ const proof = consistencyProof2(earlier.consistency_proof);
9465
+ if (proof === void 0 || proof.oldSize !== BigInt(prior.signed.mmr_size) || proof.newSize !== BigInt(signed.mmr_size) || !await verifyConsistency2(hex2(prior.signed.root), hex2(signed.root), proof))
9466
+ return failed2("parent_witness_earlier_checkpoint_not_a_prefix");
9467
+ covered = prior.signed;
9468
+ coveredCose = prior.cose;
9469
+ }
9470
+ const logId = block.log_id, size = block.size;
9471
+ if (typeof logId !== "string" || logId !== covered.log_id || !uint(size) || size !== covered.mmr_size)
9472
+ return failed2("parent_witness_leaf_does_not_name_this_checkpoint");
9473
+ const path2 = block.path;
9474
+ if (!Array.isArray(path2) || path2.length > PARENT_WITNESS_MAX_PATH || !path2.every(isHex64))
9475
+ return failed2("parent_witness_path_malformed");
9476
+ const salt = block.salt, index = block.index;
9477
+ if (typeof salt !== "string" || salt === "" || !uint(index) || index >= 2 ** path2.length)
9478
+ return failed2("parent_witness_leaf_malformed");
9479
+ let leaf;
9480
+ try {
9481
+ leaf = await treeLeaf(logId, size, coveredCose, salt);
9482
+ } catch {
9483
+ return failed2("parent_witness_leaf_malformed");
9484
+ }
9485
+ const root = await treeRoot(leaf, index, path2.map(hex2));
9486
+ const parent2 = block.parent;
9487
+ const parentCheckpoint = await signedCheckpoint(parent2);
9488
+ if (parentCheckpoint === "malformed")
9489
+ return failed2("parent_witness_parent_checkpoint_malformed");
9490
+ if (parentCheckpoint === "invalid")
9491
+ return failed2("parent_witness_parent_checkpoint_signature_invalid");
9492
+ const parentSigned = parentCheckpoint.signed;
9493
+ if (parentSigned.key_id !== signed.key_id)
9494
+ return failed2("parent_witness_parent_signer_differs");
9495
+ const stated = parent2;
9496
+ if (typeof stated.log_id !== "string" || stated.log_id !== parentSigned.log_id)
9497
+ return failed2("parent_witness_parent_log_id_mismatch");
9498
+ const entryIndex = stated.entry_index;
9499
+ const inclusion = parseProof(stated.inclusion_proof);
9500
+ if (!uint(entryIndex) || inclusion === void 0 || inclusion.size !== parentSigned.mmr_size || inclusion.leaf_index !== entryIndex || !await verifyProof(hex2(parentSigned.root), Array.from(root, (byte) => byte.toString(16).padStart(2, "0")).join(""), inclusion, entryIndex))
9501
+ return failed2("parent_witness_entry_not_included");
9502
+ const { status: status2, findings, receipts: receipts3 } = await verifyWitnessReceipts(stated.witnesses, parentSigned, parentCheckpoint.cose, directory);
9503
+ const entries = leafCount(BigInt(covered.mmr_size)), of = leafCount(BigInt(signed.mmr_size));
9504
+ return {
9505
+ status: status2,
9506
+ findings,
9507
+ extent: status2 === "pass" && entries !== void 0 && of !== void 0 ? { entries: Number(entries), of: Number(of) } : null,
9508
+ receipts: receipts3
9509
+ };
9510
+ }
9511
+
9311
9512
  // node_modules/@action-state-group/agent-action-capsule/dist/bundle.js
9312
9513
  var Ed25519UnavailableError = class extends Error {
9313
9514
  constructor() {
@@ -9320,18 +9521,6 @@ ${body}
9320
9521
  status: "fail",
9321
9522
  findings
9322
9523
  });
9323
- var object8 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && !(value instanceof JsonNumber);
9324
- var integer = (value) => typeof value === "number" && Number.isSafeInteger(value);
9325
- var hex5 = (value) => Uint8Array.from(value.match(/../gu), (byte) => Number.parseInt(byte, 16));
9326
- function base64UrlDecode(value) {
9327
- const padded = `${value}${"=".repeat((4 - value.length % 4) % 4)}`;
9328
- const binary = atob(padded.replaceAll("-", "+").replaceAll("_", "/"));
9329
- const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
9330
- if (encodeBase64Url(bytes) !== value)
9331
- throw new TypeError("non-canonical base64url");
9332
- return bytes;
9333
- }
9334
- var encodeBase64Url = (bytes) => btoa(Array.from(bytes, (byte) => String.fromCharCode(byte)).join("")).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
9335
9524
  function decodeFragment(fragment) {
9336
9525
  if (!/^[A-Za-z0-9_-]*$/u.test(fragment))
9337
9526
  throw new TypeError("fragment base64url");
@@ -9375,7 +9564,7 @@ ${body}
9375
9564
  const plain2 = await verifyPlain(bundle, options);
9376
9565
  return options.strict === true ? {
9377
9566
  plain: plain2,
9378
- strict: await strict(plain2, object8(bundle) ? bundle : void 0, options)
9567
+ strict: await strict(plain2, object3(bundle) ? bundle : void 0, options)
9379
9568
  } : { plain: plain2 };
9380
9569
  } catch (error) {
9381
9570
  if (!(error instanceof RangeError))
@@ -9392,7 +9581,8 @@ ${body}
9392
9581
  witnesses: null,
9393
9582
  records: [],
9394
9583
  checkpointAuthenticated: false,
9395
- signerMatchesCheckpoint: null
9584
+ signerMatchesCheckpoint: null,
9585
+ parentWitness: null
9396
9586
  }
9397
9587
  }
9398
9588
  } : { plain: plain2 };
@@ -9412,11 +9602,11 @@ ${body}
9412
9602
  };
9413
9603
  }
9414
9604
  async function verifyPlain(bundle, options) {
9415
- if (!object8(bundle))
9605
+ if (!object3(bundle))
9416
9606
  return malformedBundle();
9417
- let digest;
9607
+ let digest2;
9418
9608
  try {
9419
- digest = await bundleDigest(bundle);
9609
+ digest2 = await bundleDigest(bundle);
9420
9610
  } catch {
9421
9611
  }
9422
9612
  const collected = await collectRecords(bundle.records);
@@ -9432,7 +9622,7 @@ ${body}
9432
9622
  findings: ["no_records"]
9433
9623
  };
9434
9624
  [intervalCoverage, perRecordMembership] = [noRecords, noRecords];
9435
- const signed = (await strictCheckpoint(object8(bundle.checkpoint) ? bundle.checkpoint : {}, object8(bundle.completeness_certificate) ? bundle.completeness_certificate : {})).signed;
9625
+ const signed = (await strictCheckpoint(object3(bundle.checkpoint) ? bundle.checkpoint : {}, object3(bundle.completeness_certificate) ? bundle.completeness_certificate : {})).signed;
9436
9626
  if (signed !== void 0)
9437
9627
  emptyHistoryCheckpoint = {
9438
9628
  keyId: signed.key_id,
@@ -9445,14 +9635,14 @@ ${body}
9445
9635
  [intervalCoverage, perRecordMembership] = await completeness(bundle, collected.records);
9446
9636
  }
9447
9637
  return {
9448
- ...digest === void 0 ? {} : { bundleDigest: digest },
9638
+ ...digest2 === void 0 ? {} : { bundleDigest: digest2 },
9449
9639
  graphClosure,
9450
9640
  intervalCoverage,
9451
9641
  perRecordMembership,
9452
9642
  ...history === void 0 ? {} : { history },
9453
9643
  ...emptyHistoryCheckpoint === void 0 ? {} : { emptyHistoryCheckpoint },
9454
9644
  disclosures: await disclosures(Object.hasOwn(bundle, "disclosures") ? bundle.disclosures : {}, collected.records),
9455
- extensions: await extensions(bundle, digest !== void 0, options),
9645
+ extensions: await extensions(bundle, digest2 !== void 0, options),
9456
9646
  countersignatures: Array.isArray(bundle.countersignatures) ? bundle.countersignatures.map((value) => ({
9457
9647
  value,
9458
9648
  status: "unverified"
@@ -9490,14 +9680,15 @@ ${body}
9490
9680
  witnesses: null,
9491
9681
  records: [],
9492
9682
  checkpointAuthenticated: false,
9493
- signerMatchesCheckpoint: null
9683
+ signerMatchesCheckpoint: null,
9684
+ parentWitness: null
9494
9685
  }
9495
9686
  };
9496
9687
  const seqs = membershipSeqs(bundle);
9497
9688
  const records = [];
9498
9689
  const seen = /* @__PURE__ */ new Set();
9499
9690
  for (const record of Array.isArray(bundle.records) ? bundle.records : []) {
9500
- if (!object8(record))
9691
+ if (!object3(record))
9501
9692
  continue;
9502
9693
  const id = capsuleIdOf(record);
9503
9694
  const { verdict: verdict2, messages } = await verifyRecordSignature(record);
@@ -9523,11 +9714,11 @@ ${body}
9523
9714
  status: unclaimed.length ? "withheld" : "pass",
9524
9715
  findings: signatureFindings
9525
9716
  };
9526
- const stated = object8(bundle.checkpoint) ? bundle.checkpoint : {};
9527
- const checkpoint = await strictCheckpoint(stated, object8(bundle.completeness_certificate) ? bundle.completeness_certificate : {});
9717
+ const stated = object3(bundle.checkpoint) ? bundle.checkpoint : {};
9718
+ const checkpoint = await strictCheckpoint(stated, object3(bundle.completeness_certificate) ? bundle.completeness_certificate : {});
9528
9719
  const authenticated = checkpoint.signed !== void 0;
9529
9720
  let intervalCoverage = plain2.intervalCoverage, perRecordMembership = plain2.perRecordMembership;
9530
- if (object8(bundle.completeness) && bundle.completeness.selection === SELECTION_PRODUCER_SELECTED) {
9721
+ if (object3(bundle.completeness) && bundle.completeness.selection === SELECTION_PRODUCER_SELECTED) {
9531
9722
  intervalCoverage = {
9532
9723
  status: "withheld",
9533
9724
  findings: [SELECTION_NOT_CHECKABLE]
@@ -9535,7 +9726,7 @@ ${body}
9535
9726
  if (checkpoint.signed !== void 0)
9536
9727
  perRecordMembership = await selectedMembership(bundle, checkpoint.signed.root, checkpoint.signed.mmr_size, checkpoint.signed.log_id);
9537
9728
  else if (checkpoint.claim.status === "fail")
9538
- perRecordMembership = object8(bundle.completeness_certificate) && "non_record_leaves" in bundle.completeness_certificate ? fail("completeness_certificate_invalid") : { status: "withheld", findings: ["checkpoint_unverified"] };
9729
+ perRecordMembership = object3(bundle.completeness_certificate) && "non_record_leaves" in bundle.completeness_certificate ? fail("completeness_certificate_invalid") : { status: "withheld", findings: ["checkpoint_unverified"] };
9539
9730
  }
9540
9731
  if (!authenticated) {
9541
9732
  intervalCoverage = unanchored(intervalCoverage);
@@ -9550,21 +9741,29 @@ ${body}
9550
9741
  { name: "per_record_membership", ...perRecordMembership }
9551
9742
  ];
9552
9743
  if (Object.hasOwn(bundle, "disclosures")) {
9553
- const failed3 = plain2.disclosures.filter((d) => d.status !== DISCLOSURE_MATCH && d.status !== "withheld").map((d) => `${d.status}:${d.capsuleId}:${d.member}`);
9744
+ const failed4 = plain2.disclosures.filter((d) => d.status !== DISCLOSURE_MATCH && d.status !== "withheld").map((d) => `${d.status}:${d.capsuleId}:${d.member}`);
9554
9745
  claims.push({
9555
9746
  name: "disclosures",
9556
- ...failed3.length ? fail(...failed3) : pass()
9747
+ ...failed4.length ? fail(...failed4) : pass()
9557
9748
  });
9558
9749
  }
9559
9750
  const witnesses = await verifyWitnessReceipts(stated.witnesses, checkpoint.signed, checkpoint.cose, options.witnessDirectory);
9751
+ const parentWitness = object3(bundle.extensions) && Object.hasOwn(bundle.extensions, PARENT_LOG_WITNESS_KIND) ? await verifyParentLogWitness(bundle.extensions[PARENT_LOG_WITNESS_KIND], checkpoint.signed, checkpoint.cose, options.witnessDirectory) : null;
9560
9752
  const checkpointKey = checkpoint.signed?.key_id;
9561
- const failed2 = claims.some((claim) => claim.status === "fail") || witnesses.status === "fail" || categoryCoverageFails(plain2.categoryCoverage);
9753
+ const failed3 = claims.some((claim) => claim.status === "fail") || witnesses.status === "fail" || parentWitness?.status === "fail" || categoryCoverageFails(plain2.categoryCoverage);
9562
9754
  return {
9563
9755
  ...plain2,
9756
+ ...parentWitness === null ? {} : {
9757
+ extensions: plain2.extensions.map((extension) => extension.kind === PARENT_LOG_WITNESS_KIND ? {
9758
+ kind: PARENT_LOG_WITNESS_KIND,
9759
+ status: parentWitness.status,
9760
+ integrityCovered: extension.integrityCovered
9761
+ } : extension)
9762
+ },
9564
9763
  intervalCoverage,
9565
9764
  perRecordMembership,
9566
9765
  strict: {
9567
- verdict: failed2 ? "INVALID" : claims.every((claim) => claim.status === "pass") ? "VALID" : "INCOMPLETE",
9766
+ verdict: failed3 ? "INVALID" : claims.every((claim) => claim.status === "pass") ? "VALID" : "INCOMPLETE",
9568
9767
  kindOk: true,
9569
9768
  claims,
9570
9769
  witnesses: {
@@ -9580,7 +9779,8 @@ ${body}
9580
9779
  witnesses: Array.isArray(stated.witnesses) ? stated.witnesses : []
9581
9780
  }
9582
9781
  },
9583
- signerMatchesCheckpoint: checkpointKey && records.length ? records.every((r) => r.keyId === checkpointKey) : null
9782
+ signerMatchesCheckpoint: checkpointKey && records.length ? records.every((r) => r.keyId === checkpointKey) : null,
9783
+ parentWitness
9584
9784
  }
9585
9785
  };
9586
9786
  }
@@ -9591,9 +9791,9 @@ ${body}
9591
9791
  const findings = [];
9592
9792
  if (bundle.bundle_version !== "2" || bundle.bundle_kind !== "evidence-bundle/v2")
9593
9793
  findings.push("bundle_version_or_kind_invalid");
9594
- const complete = object8(bundle.completeness) ? bundle.completeness : {};
9794
+ const complete = object3(bundle.completeness) ? bundle.completeness : {};
9595
9795
  const missing = complete.missing;
9596
- if (!object8(bundle.completeness) || complete.records_mode !== "complete" || complete.payloads_mode !== "none" || Object.hasOwn(complete, "missing") && (!Array.isArray(missing) || missing.length !== 0))
9796
+ if (!object3(bundle.completeness) || complete.records_mode !== "complete" || complete.payloads_mode !== "none" || Object.hasOwn(complete, "missing") && (!Array.isArray(missing) || missing.length !== 0))
9597
9797
  findings.push("empty_history_completeness_invalid");
9598
9798
  for (const name of [
9599
9799
  "completeness_certificate",
@@ -9627,31 +9827,12 @@ ${body}
9627
9827
  findings: ["checkpoint_verifier_unavailable"]
9628
9828
  }
9629
9829
  };
9630
- let cose;
9631
- try {
9632
- if (typeof encoded !== "string" || !/^[A-Za-z0-9_-]*$/u.test(encoded))
9633
- throw new TypeError("checkpoint.cose is not unpadded base64url");
9634
- cose = base64UrlDecode(encoded);
9635
- } catch {
9830
+ const cose = decodeCose(encoded);
9831
+ if (cose === void 0)
9636
9832
  return { claim: fail("checkpoint_signature_malformed") };
9637
- }
9638
- let metadata;
9639
- try {
9640
- metadata = await checkpointMetadata2(cose);
9641
- } catch {
9642
- metadata = void 0;
9643
- }
9644
- if (metadata === void 0)
9833
+ const signed = await signedCheckpointFields(cose, checkpointMetadata2);
9834
+ if (signed === void 0)
9645
9835
  return { claim: fail("checkpoint_signature_invalid") };
9646
- const signed = {
9647
- log_id: metadata.logId,
9648
- mmr_size: Number(metadata.size),
9649
- root: metadata.root,
9650
- key_id: metadata.keyId,
9651
- timestamp: metadata.timestamp,
9652
- prev_size: Number(metadata.previousSize),
9653
- prev_root: metadata.previousRoot
9654
- };
9655
9836
  const findings = [
9656
9837
  ...SIGNED_CHECKPOINT_FIELDS.filter((name) => Object.hasOwn(stated, name) && !sameJson(stated[name], signed[name]) || // The certificate's log_id is a second stated copy of the signed one
9657
9838
  // (bundle -01 §Completeness): either copy differing is one mismatch.
@@ -9672,16 +9853,16 @@ ${body}
9672
9853
  }
9673
9854
  async function selectedMembership(bundle, rootHex, size, logId) {
9674
9855
  const certificate = bundle.completeness_certificate;
9675
- const members = object8(certificate) ? certificate.memberships : void 0;
9676
- if (!object8(certificate) || !object8(members) || Object.hasOwn(certificate, "non_record_leaves") || certificate.range_root !== rootHex || certificate.log_id !== logId || typeof logId !== "string" || !isHex64(rootHex) || !integer(size))
9856
+ const members = object3(certificate) ? certificate.memberships : void 0;
9857
+ if (!object3(certificate) || !object3(members) || Object.hasOwn(certificate, "non_record_leaves") || certificate.range_root !== rootHex || certificate.log_id !== logId || typeof logId !== "string" || !isHex64(rootHex) || !integer(size))
9677
9858
  return fail("completeness_certificate_invalid");
9678
- const root = hex5(rootHex);
9679
- const ids = (Array.isArray(bundle.records) ? bundle.records : []).filter(object8).map(capsuleIdOf);
9859
+ const root = hex2(rootHex);
9860
+ const ids = (Array.isArray(bundle.records) ? bundle.records : []).filter(object3).map(capsuleIdOf);
9680
9861
  const findings = [], seen = /* @__PURE__ */ new Set();
9681
9862
  for (const id of ids) {
9682
9863
  const member = Object.hasOwn(members, id) ? members[id] : void 0;
9683
- const coordinates = object8(member) ? member.log_coordinates : void 0;
9684
- if (!object8(coordinates)) {
9864
+ const coordinates = object3(member) ? member.log_coordinates : void 0;
9865
+ if (!object3(coordinates)) {
9685
9866
  findings.push(`membership_record_unbound:${id}`);
9686
9867
  continue;
9687
9868
  }
@@ -9691,7 +9872,7 @@ ${body}
9691
9872
  continue;
9692
9873
  }
9693
9874
  seen.add(seq);
9694
- const proof = object8(member) ? parseProof(member.inclusion_proof) : void 0;
9875
+ const proof = object3(member) ? parseProof(member.inclusion_proof) : void 0;
9695
9876
  if (!proof || !isHex64(id) || proof.size !== size || proof.leaf_index !== index || !await verifyProof(root, id, proof, index))
9696
9877
  findings.push(`membership_proof_invalid:${id}`);
9697
9878
  }
@@ -9702,12 +9883,12 @@ ${body}
9702
9883
  }
9703
9884
  function membershipSeqs(bundle) {
9704
9885
  const certificate = bundle.completeness_certificate;
9705
- const members = object8(certificate) ? certificate.memberships : void 0;
9886
+ const members = object3(certificate) ? certificate.memberships : void 0;
9706
9887
  const out = /* @__PURE__ */ new Map();
9707
- if (object8(members))
9888
+ if (object3(members))
9708
9889
  for (const [id, member] of Object.entries(members)) {
9709
- const coordinates = object8(member) ? member.log_coordinates : void 0;
9710
- const seq = object8(coordinates) ? coordinates.seq : void 0;
9890
+ const coordinates = object3(member) ? member.log_coordinates : void 0;
9891
+ const seq = object3(coordinates) ? coordinates.seq : void 0;
9711
9892
  if (integer(seq))
9712
9893
  out.set(id, seq);
9713
9894
  }
@@ -9718,7 +9899,7 @@ ${body}
9718
9899
  if (!Array.isArray(raw))
9719
9900
  return { records, results, findings: ["records_malformed"] };
9720
9901
  for (const [index, record] of raw.entries()) {
9721
- if (!object8(record)) {
9902
+ if (!object3(record)) {
9722
9903
  findings.push(`record_malformed:${index}`);
9723
9904
  continue;
9724
9905
  }
@@ -9749,7 +9930,7 @@ ${body}
9749
9930
  if (!isHex64(root) || !records.has(root))
9750
9931
  return fail(...findings, "root_not_supplied_with_matching_identity");
9751
9932
  const complete = bundle.completeness;
9752
- if (!object8(complete))
9933
+ if (!object3(complete))
9753
9934
  return fail(...findings, "completeness_malformed");
9754
9935
  const depth = complete.closure_depth ?? 2;
9755
9936
  if (!integer(depth) || depth < 0)
@@ -9783,17 +9964,17 @@ ${body}
9783
9964
  }
9784
9965
  function citations(record) {
9785
9966
  const targets = [], chain = record.chain;
9786
- if (object8(chain) && typeof chain.parent_capsule_id === "string")
9967
+ if (object3(chain) && typeof chain.parent_capsule_id === "string")
9787
9968
  targets.push(chain.parent_capsule_id);
9788
9969
  if (Array.isArray(record.references)) {
9789
9970
  for (const reference of record.references)
9790
- if (object8(reference) && reference.type === "agent-action-capsule" && reference.digest_alg === "SHA-256" && typeof reference.digest === "string")
9971
+ if (object3(reference) && reference.type === "agent-action-capsule" && reference.digest_alg === "SHA-256" && typeof reference.digest === "string")
9791
9972
  targets.push(reference.digest);
9792
9973
  }
9793
9974
  return targets;
9794
9975
  }
9795
9976
  async function completeness(bundle, records) {
9796
- if (!object8(bundle.completeness_certificate) || !object8(bundle.checkpoint)) {
9977
+ if (!object3(bundle.completeness_certificate) || !object3(bundle.checkpoint)) {
9797
9978
  const absent = {
9798
9979
  status: "withheld",
9799
9980
  findings: ["completeness_evidence_absent"]
@@ -9801,7 +9982,7 @@ ${body}
9801
9982
  return [absent, absent];
9802
9983
  }
9803
9984
  const certificate = bundle.completeness_certificate;
9804
- if (object8(bundle.completeness) && Object.hasOwn(bundle.completeness, "selection")) {
9985
+ if (object3(bundle.completeness) && Object.hasOwn(bundle.completeness, "selection")) {
9805
9986
  if (bundle.completeness.selection === SELECTION_PRODUCER_SELECTED)
9806
9987
  return plainSelected(bundle, bundle.checkpoint);
9807
9988
  const unsupported = {
@@ -9824,10 +10005,10 @@ ${body}
9824
10005
  fail("checkpoint_authentication_invalid"),
9825
10006
  fail("checkpoint_authentication_invalid")
9826
10007
  ];
9827
- const { findings, failed: failed2 } = await memberships(parsed.root, parsed.logId, parsed.firstSeq, parsed.lastSeq, certificate, records, bundle.completeness, parsed.rangeProof.size);
10008
+ const { findings, failed: failed3 } = await memberships(parsed.root, parsed.logId, parsed.firstSeq, parsed.lastSeq, certificate, records, bundle.completeness, parsed.rangeProof.size);
9828
10009
  const qualifier = checkpointStatus === "verified" ? [] : ["checkpoint_unverified"];
9829
10010
  const interval = { status: "pass", findings: qualifier };
9830
- if (failed2)
10011
+ if (failed3)
9831
10012
  return [interval, fail(...findings)];
9832
10013
  if (findings.length)
9833
10014
  return [
@@ -9844,7 +10025,7 @@ ${body}
9844
10025
  const membership = await selectedMembership(bundle, checkpoint.root, checkpoint.mmr_size, checkpoint.log_id);
9845
10026
  if (membership.status !== "pass")
9846
10027
  return [interval, membership];
9847
- const status2 = await authenticateCheckpoint(checkpoint, checkpoint.log_id, hex5(checkpoint.root), checkpoint.mmr_size);
10028
+ const status2 = await authenticateCheckpoint(checkpoint, checkpoint.log_id, hex2(checkpoint.root), checkpoint.mmr_size);
9848
10029
  if (status2 === "invalid")
9849
10030
  return [interval, fail("checkpoint_authentication_invalid")];
9850
10031
  return [
@@ -9852,14 +10033,6 @@ ${body}
9852
10033
  status2 === "verified" ? pass() : { status: "pass", findings: ["checkpoint_unverified"] }
9853
10034
  ];
9854
10035
  }
9855
- async function loadCheckpointMetadata() {
9856
- try {
9857
- const module = await Promise.resolve().then(() => (init_browser(), browser_exports));
9858
- return typeof module.checkpointMetadata === "function" ? module.checkpointMetadata : void 0;
9859
- } catch {
9860
- return void 0;
9861
- }
9862
- }
9863
10036
  async function authenticateCheckpoint(checkpoint, logId, root, size) {
9864
10037
  if (!Object.hasOwn(checkpoint, "cose"))
9865
10038
  return "unverified";
@@ -9884,7 +10057,7 @@ ${body}
9884
10057
  return void 0;
9885
10058
  const { fromSeq, toSeq, size, fromIndex, toIndex, witness } = range;
9886
10059
  return {
9887
- root: hex5(rootHex),
10060
+ root: hex2(rootHex),
9888
10061
  logId,
9889
10062
  firstSeq,
9890
10063
  lastSeq,
@@ -9908,7 +10081,7 @@ ${body}
9908
10081
  };
9909
10082
  }
9910
10083
  function parseRangeProof(raw) {
9911
- const range = object8(raw) ? raw : void 0, fromSeq = range?.from_seq, toSeq = range?.to_seq, size = range?.size, fromIndex = range?.from_index, toIndex = range?.to_index, witness = range?.witness;
10084
+ const range = object3(raw) ? raw : void 0, fromSeq = range?.from_seq, toSeq = range?.to_seq, size = range?.size, fromIndex = range?.from_index, toIndex = range?.to_index, witness = range?.witness;
9912
10085
  if (!integer(fromSeq) || !integer(toSeq) || !integer(size) || !integer(fromIndex) || !integer(toIndex) || fromSeq < 1 || toSeq < fromSeq || size < 0 || fromIndex < 0 || toIndex < fromIndex || !Array.isArray(witness) || !witness.every(isHex64))
9913
10086
  return void 0;
9914
10087
  return { fromSeq, toSeq, size, fromIndex, toIndex, witness };
@@ -9918,19 +10091,19 @@ ${body}
9918
10091
  const raw = certificate.body_digests;
9919
10092
  if (leaves === void 0 || leaves !== BigInt(last) || proof.fromSeq !== first || proof.toSeq !== last || proof.fromIndex !== first - 1 || proof.toIndex !== last - 1 || !Array.isArray(raw) || raw.length !== last - first + 1 || !raw.every(isHex64))
9920
10093
  return false;
9921
- return verifyRange2(root, BigInt(proof.size), BigInt(proof.fromIndex), BigInt(proof.toIndex), raw.map(hex5), proof.proof);
10094
+ return verifyRange2(root, BigInt(proof.size), BigInt(proof.fromIndex), BigInt(proof.toIndex), raw.map(hex2), proof.proof);
9922
10095
  }
9923
10096
  async function memberships(root, logId, first, last, certificate, records, completeness2, checkpointSize) {
9924
10097
  const raw = certificate.memberships;
9925
- if (!object8(raw))
10098
+ if (!object3(raw))
9926
10099
  return { findings: ["memberships_absent"], failed: true };
9927
10100
  const bySequence = /* @__PURE__ */ new Set(), boundRecords = /* @__PURE__ */ new Set(), findings = [];
9928
10101
  for (const [id, member] of Object.entries(raw)) {
9929
- if (!isHex64(id) || !records.has(id) || !object8(member)) {
10102
+ if (!isHex64(id) || !records.has(id) || !object3(member)) {
9930
10103
  findings.push(`membership_record_unknown:${id}`);
9931
10104
  continue;
9932
10105
  }
9933
- const coordinates = object8(member.log_coordinates) ? member.log_coordinates : void 0;
10106
+ const coordinates = object3(member.log_coordinates) ? member.log_coordinates : void 0;
9934
10107
  if (!coordinates) {
9935
10108
  findings.push(`membership_coordinates_missing:${id}`);
9936
10109
  continue;
@@ -9960,7 +10133,7 @@ ${body}
9960
10133
  for (let seq = first; seq <= last; seq += 1)
9961
10134
  if (!bySequence.has(seq) && !leafSeqs.has(seq))
9962
10135
  findings.push(`membership_record_missing:${seq}`);
9963
- const declaredMissing = object8(completeness2) && Array.isArray(completeness2.missing) ? new Set(completeness2.missing.filter(isHex64)) : /* @__PURE__ */ new Set();
10136
+ const declaredMissing = object3(completeness2) && Array.isArray(completeness2.missing) ? new Set(completeness2.missing.filter(isHex64)) : /* @__PURE__ */ new Set();
9964
10137
  for (const id of records.keys())
9965
10138
  if (!boundRecords.has(id) && !declaredMissing.has(id))
9966
10139
  findings.push(`membership_record_unbound:${id}`);
@@ -9977,8 +10150,8 @@ ${body}
9977
10150
  function statedSeqs(members) {
9978
10151
  const out = /* @__PURE__ */ new Set();
9979
10152
  for (const member of Object.values(members)) {
9980
- const coordinates = object8(member) ? member.log_coordinates : void 0;
9981
- const seq = object8(coordinates) ? coordinates.seq : void 0;
10153
+ const coordinates = object3(member) ? member.log_coordinates : void 0;
10154
+ const seq = object3(coordinates) ? coordinates.seq : void 0;
9982
10155
  if (integer(seq))
9983
10156
  out.add(seq);
9984
10157
  }
@@ -9991,7 +10164,7 @@ ${body}
9991
10164
  const digests = Array.isArray(bodyDigests) ? bodyDigests : [];
9992
10165
  const findings = [];
9993
10166
  for (const [index, element7] of raw.entries()) {
9994
- if (!object8(element7)) {
10167
+ if (!object3(element7)) {
9995
10168
  findings.push(`non_record_leaf_element_invalid:${index}`);
9996
10169
  continue;
9997
10170
  }
@@ -10002,8 +10175,8 @@ ${body}
10002
10175
  }
10003
10176
  accounted.add(seq);
10004
10177
  const content = element7.content;
10005
- const recordType = object8(content) ? content.record_type : void 0;
10006
- if (!object8(content) || typeof recordType !== "string") {
10178
+ const recordType = object3(content) ? content.record_type : void 0;
10179
+ if (!object3(content) || typeof recordType !== "string") {
10007
10180
  findings.push(`non_record_leaf_malformed:${seq}`);
10008
10181
  continue;
10009
10182
  }
@@ -10025,45 +10198,23 @@ ${body}
10025
10198
  async function paddingLeaf(content) {
10026
10199
  return jsonDigest(Object.fromEntries(Object.entries(content).filter(([name]) => name !== "capsule_id")));
10027
10200
  }
10028
- function parseProof(raw) {
10029
- if (!object8(raw) || raw.v !== 1 || raw.kind !== "inclusion" || !integer(raw.size) || !integer(raw.leaf_index) || raw.size < 0 || raw.leaf_index < 0)
10030
- return void 0;
10031
- const hashes = (value) => Array.isArray(value) && value.every(isHex64) ? value : void 0;
10032
- const witness = hashes(raw.witness), left = hashes(raw.peaks_left), right = hashes(raw.peaks_right);
10033
- return witness && left && right ? {
10034
- v: 1,
10035
- kind: "inclusion",
10036
- size: raw.size,
10037
- leaf_index: raw.leaf_index,
10038
- witness,
10039
- peaks_left: left,
10040
- peaks_right: right
10041
- } : void 0;
10042
- }
10043
- async function verifyProof(root, identity2, proof, leafIndex = proof.leaf_index) {
10044
- const flattened = proof.witness.map(hex5);
10045
- if (proof.peaks_right.length)
10046
- flattened.push(await rootFromPeaks2(proof.peaks_right.map(hex5)));
10047
- flattened.push(...proof.peaks_left.map(hex5).toReversed());
10048
- return verifyHexInclusion2(root, BigInt(proof.size), BigInt(leafIndex), identity2, flattened);
10049
- }
10050
10201
  async function disclosures(raw, records) {
10051
10202
  if (raw === void 0)
10052
10203
  raw = {};
10053
- if (!object8(raw))
10204
+ if (!object3(raw))
10054
10205
  return [{ capsuleId: "", member: "", status: DISCLOSURE_MISMATCH }];
10055
10206
  const findings = [];
10056
10207
  for (const [id, record] of [...records.entries()].sort(([a], [b]) => a.localeCompare(b))) {
10057
- if (Object.hasOwn(raw, id) && !object8(raw[id]))
10208
+ if (Object.hasOwn(raw, id) && !object3(raw[id]))
10058
10209
  continue;
10059
- const supplied = object8(raw[id]) ? raw[id] : {};
10210
+ const supplied = object3(raw[id]) ? raw[id] : {};
10060
10211
  for (const [member, path2] of Object.entries(disclosureEligibleFields))
10061
10212
  if (!Object.hasOwn(supplied, member) && typeof resolveDisclosurePath(record, path2) === "string")
10062
10213
  findings.push({ capsuleId: id, member, status: "withheld" });
10063
10214
  }
10064
10215
  for (const id of Object.keys(raw).sort()) {
10065
10216
  const members = raw[id], record = records.get(id);
10066
- if (!object8(members) || !record) {
10217
+ if (!object3(members) || !record) {
10067
10218
  findings.push({ capsuleId: id, member: "", status: DISCLOSURE_MISMATCH });
10068
10219
  continue;
10069
10220
  }
@@ -10099,7 +10250,7 @@ ${body}
10099
10250
  }
10100
10251
  async function extensions(bundle, covered, options) {
10101
10252
  const raw = bundle.extensions;
10102
- if (!object8(raw))
10253
+ if (!object3(raw))
10103
10254
  return [];
10104
10255
  const results = [];
10105
10256
  for (const kind of Object.keys(raw).sort()) {
@@ -10252,7 +10403,7 @@ ${body}
10252
10403
  return result3.intervalCoverage.status === "withheld" && result3.intervalCoverage.findings.includes(SELECTION_NOT_CHECKABLE);
10253
10404
  }
10254
10405
  function isVerifiedBundleContext(value) {
10255
- return object8(value) && contexts.has(value);
10406
+ return object3(value) && contexts.has(value);
10256
10407
  }
10257
10408
  var WITHHELD = Object.freeze({ state: "withheld" });
10258
10409
  var MISMATCHED = Object.freeze({
@@ -10264,7 +10415,8 @@ ${body}
10264
10415
  throw new Sha256UnavailableError();
10265
10416
  const ed255192 = await probeEd25519();
10266
10417
  const { plain: plain2, strict: strict2 } = await verifyPlainAndStrict(owned, {
10267
- strict: ed255192
10418
+ strict: ed255192,
10419
+ ...options.witnessDirectory === void 0 ? {} : { witnessDirectory: deepFreeze(ownedCopy(options.witnessDirectory)) }
10268
10420
  });
10269
10421
  return contextFrom(owned, readSelection(plain2, strict2), strict2?.strict, options.countersigners === void 0 ? void 0 : deepFreeze(ownedCopy(options.countersigners)));
10270
10422
  }
@@ -10280,20 +10432,20 @@ ${body}
10280
10432
  ({ records, recordIndex, resolvedDisclosures } = reuse);
10281
10433
  } else {
10282
10434
  const index = /* @__PURE__ */ new Map();
10283
- if (object8(bundle) && Array.isArray(bundle.records)) {
10435
+ if (object3(bundle) && Array.isArray(bundle.records)) {
10284
10436
  for (const record of bundle.records)
10285
- if (object8(record) && typeof record.capsule_id === "string" && !index.has(record.capsule_id) && verification.capsuleResults[record.capsule_id]?.ok === true && verification.capsuleResults[record.capsule_id]?.capsuleId === record.capsule_id)
10437
+ if (object3(record) && typeof record.capsule_id === "string" && !index.has(record.capsule_id) && verification.capsuleResults[record.capsule_id]?.ok === true && verification.capsuleResults[record.capsule_id]?.capsuleId === record.capsule_id)
10286
10438
  index.set(record.capsule_id, record);
10287
10439
  }
10288
10440
  records = Object.freeze([...index.values()]);
10289
10441
  recordIndex = new ReadonlyMapView(index);
10290
10442
  resolvedDisclosures = resolveFromVerification(bundle, verification.disclosures, index);
10291
10443
  }
10292
- const certificate = object8(bundle) ? bundle.completeness_certificate : void 0;
10444
+ const certificate = object3(bundle) ? bundle.completeness_certificate : void 0;
10293
10445
  deepFreeze(verification);
10294
10446
  const context = deepFreeze({
10295
10447
  bundle,
10296
- root: object8(bundle) && typeof bundle.root === "string" ? bundle.root : void 0,
10448
+ root: object3(bundle) && typeof bundle.root === "string" ? bundle.root : void 0,
10297
10449
  verification,
10298
10450
  strict: strict2,
10299
10451
  resolvedDisclosures,
@@ -10306,7 +10458,7 @@ ${body}
10306
10458
  graphClosure: verification.graphClosure,
10307
10459
  intervalCoverage: verification.intervalCoverage,
10308
10460
  perRecordMembership: verification.perRecordMembership,
10309
- memberships: object8(certificate) && object8(certificate.memberships) ? certificate.memberships : {}
10461
+ memberships: object3(certificate) && object3(certificate.memberships) ? certificate.memberships : {}
10310
10462
  }
10311
10463
  });
10312
10464
  contexts.add(context);
@@ -10316,13 +10468,13 @@ ${body}
10316
10468
  const status2 = /* @__PURE__ */ new Map();
10317
10469
  for (const result3 of results)
10318
10470
  status2.set(`${result3.capsuleId}\0${result3.member}`, result3.status);
10319
- const overlay = object8(bundle) && object8(bundle.disclosures) ? bundle.disclosures : {};
10471
+ const overlay = object3(bundle) && object3(bundle.disclosures) ? bundle.disclosures : {};
10320
10472
  const resolved = /* @__PURE__ */ new Map();
10321
10473
  const one = (id, field) => {
10322
10474
  switch (status2.get(`${id}\0${field}`)) {
10323
10475
  case DISCLOSURE_MATCH: {
10324
10476
  const entry = overlay[id];
10325
- return object8(entry) && Object.hasOwn(entry, field) ? Object.freeze({ state: "disclosed", payload: entry[field] }) : MISMATCHED;
10477
+ return object3(entry) && Object.hasOwn(entry, field) ? Object.freeze({ state: "disclosed", payload: entry[field] }) : MISMATCHED;
10326
10478
  }
10327
10479
  case DISCLOSURE_MISMATCH:
10328
10480
  case DISCLOSURE_NO_COMMITTED_DIGEST:
@@ -10373,10 +10525,10 @@ ${body}
10373
10525
  if (!isObject2(value) || !hasExactly(value, ["type", "digest_alg", "digest", "citation_purpose"]))
10374
10526
  return void 0;
10375
10527
  const type = nonEmpty(value.type);
10376
- const digest = asString(value.digest);
10377
- if (type === void 0 || value.digest_alg !== "SHA-256" || digest === void 0 || !HEX_DIGEST.test(digest) || value.citation_purpose !== purpose)
10528
+ const digest2 = asString(value.digest);
10529
+ if (type === void 0 || value.digest_alg !== "SHA-256" || digest2 === void 0 || !HEX_DIGEST.test(digest2) || value.citation_purpose !== purpose)
10378
10530
  return void 0;
10379
- return { type, digest };
10531
+ return { type, digest: digest2 };
10380
10532
  };
10381
10533
  var readClause = (value) => {
10382
10534
  if (!isObject2(value) || !hasExactly(value, ["clause_ref", "agreement", "drift"]))
@@ -11073,14 +11225,14 @@ ${body}
11073
11225
  return findings;
11074
11226
  }
11075
11227
  var countOf = (value) => nonNegativeInteger(value) ? value : 0;
11076
- function recomputeCounts(document2, failed2 = /* @__PURE__ */ new Set()) {
11228
+ function recomputeCounts(document2, failed3 = /* @__PURE__ */ new Set()) {
11077
11229
  const claims = document2.claims;
11078
11230
  const aggregate = document2.aggregate;
11079
11231
  const coverage = aggregate.coverage;
11080
11232
  const buckets = aggregate.buckets;
11081
11233
  const later = laterClaimIds(document2);
11082
11234
  const inForce = claims.filter((claim) => !later.has(claim.id));
11083
- const standing = inForce.filter((claim) => !failed2.has(claim.id));
11235
+ const standing = inForce.filter((claim) => !failed3.has(claim.id));
11084
11236
  const fourth = Object.hasOwn(buckets, "out_of_scope");
11085
11237
  const verdictCount = (verdict2) => standing.filter((claim) => claim.verdict === verdict2).length;
11086
11238
  const stated = {
@@ -11127,7 +11279,7 @@ ${body}
11127
11279
  ...fourth ? { outOfScope: recomputed["buckets.out_of_scope"] } : {},
11128
11280
  // A later claim that failed verification is still a failure: applicability
11129
11281
  // takes a claim out of the verdict counts, never out of verification.
11130
- failed: claims.filter((claim) => failed2.has(claim.id)).length
11282
+ failed: claims.filter((claim) => failed3.has(claim.id)).length
11131
11283
  },
11132
11284
  mismatches
11133
11285
  };
@@ -11271,19 +11423,19 @@ ${body}
11271
11423
  return void 0;
11272
11424
  }
11273
11425
  }
11274
- async function bookPayload(payloads, digest) {
11275
- if (!Object.hasOwn(payloads, digest))
11426
+ async function bookPayload(payloads, digest2) {
11427
+ if (!Object.hasOwn(payloads, digest2))
11276
11428
  return "absent";
11277
- const encoded = asString2(payloads[digest]);
11429
+ const encoded = asString2(payloads[digest2]);
11278
11430
  if (encoded === void 0)
11279
11431
  return "failed";
11280
11432
  const bytes = base64UrlBytes(encoded);
11281
11433
  if (bytes === void 0)
11282
11434
  return "failed";
11283
- return await sha256Hex(bytes) === digest ? bytes : "failed";
11435
+ return await sha256Hex(bytes) === digest2 ? bytes : "failed";
11284
11436
  }
11285
- async function verifiedBookPayload(payloads, digest) {
11286
- const payload = await bookPayload(payloads, digest);
11437
+ async function verifiedBookPayload(payloads, digest2) {
11438
+ const payload = await bookPayload(payloads, digest2);
11287
11439
  return typeof payload === "string" ? void 0 : payload;
11288
11440
  }
11289
11441
  async function carriedCapsuleId(header, payloads) {
@@ -11346,13 +11498,13 @@ ${body}
11346
11498
  return { state: "withheld" };
11347
11499
  let disclosed;
11348
11500
  let found = false;
11349
- let failed2 = false;
11350
- for (const digest of commitments.slice(1)) {
11351
- const bytes = await bookPayload(payloads, digest);
11501
+ let failed3 = false;
11502
+ for (const digest2 of commitments.slice(1)) {
11503
+ const bytes = await bookPayload(payloads, digest2);
11352
11504
  if (bytes === "absent")
11353
11505
  continue;
11354
11506
  if (bytes === "failed") {
11355
- failed2 = true;
11507
+ failed3 = true;
11356
11508
  continue;
11357
11509
  }
11358
11510
  let value;
@@ -11372,10 +11524,10 @@ ${body}
11372
11524
  disclosed = value;
11373
11525
  found = true;
11374
11526
  } else {
11375
- failed2 = true;
11527
+ failed3 = true;
11376
11528
  }
11377
11529
  }
11378
- if (failed2)
11530
+ if (failed3)
11379
11531
  return { state: "disclosure_mismatch" };
11380
11532
  if (found)
11381
11533
  return { state: "disclosed", payload: disclosed };
@@ -11482,12 +11634,12 @@ ${body}
11482
11634
  for (const raw of document2.claims) {
11483
11635
  const evidence = [];
11484
11636
  for (const ref of raw.evidence) {
11485
- const digest = ref.digest;
11486
- const carrier = recordsById.has(digest) ? void 0 : await bookCarrier(digest);
11487
- const resolved = recordsById.has(digest) || carrier !== void 0;
11488
- evidence.push({ digest, resolved });
11637
+ const digest2 = ref.digest;
11638
+ const carrier = recordsById.has(digest2) ? void 0 : await bookCarrier(digest2);
11639
+ const resolved = recordsById.has(digest2) || carrier !== void 0;
11640
+ evidence.push({ digest: digest2, resolved });
11489
11641
  if (resolved)
11490
- await resolveRecord(digest, carrier);
11642
+ await resolveRecord(digest2, carrier);
11491
11643
  }
11492
11644
  const missing = evidence.filter((ref) => !ref.resolved).map((ref) => ref.digest);
11493
11645
  const type = Object.hasOwn(raw, "type") ? typeof raw.type === "string" ? raw.type : JSON.stringify(raw.type) : REQUIREMENT_CLAIM;
@@ -11541,10 +11693,10 @@ ${body}
11541
11693
  const outside = [
11542
11694
  ["close_ref", close.closeRef],
11543
11695
  ["peer_close_ref", close.peerCloseRef]
11544
- ].filter(([, digest]) => digest !== void 0 && !inEvidence.has(digest));
11696
+ ].filter(([, digest2]) => digest2 !== void 0 && !inEvidence.has(digest2));
11545
11697
  if (outside.length > 0) {
11546
11698
  failedOn = "evidence";
11547
- failure = outside.map(([field, digest]) => `${field} ${digest} is not among the claim's evidence[] digests`).join("; ");
11699
+ failure = outside.map(([field, digest2]) => `${field} ${digest2} is not among the claim's evidence[] digests`).join("; ");
11548
11700
  } else if (close.stateMismatch) {
11549
11701
  failedOn = "close_state";
11550
11702
  const why = close.ignored.length === 0 ? "" : ` (ignored ${close.ignored.map((link) => `${link.type} from ${link.recordId}: ${link.reason}`).join("; ")})`;
@@ -11699,11 +11851,11 @@ ${body}
11699
11851
  return claim.verdict;
11700
11852
  }
11701
11853
  function reportPayload(records, claim) {
11702
- const digest = claim.evidence[0]?.digest;
11703
- return digest === void 0 ? void 0 : citedPayload(records, digest);
11854
+ const digest2 = claim.evidence[0]?.digest;
11855
+ return digest2 === void 0 ? void 0 : citedPayload(records, digest2);
11704
11856
  }
11705
- function citedPayload(records, digest) {
11706
- const record = records.get(digest);
11857
+ function citedPayload(records, digest2) {
11858
+ const record = records.get(digest2);
11707
11859
  if (record === void 0)
11708
11860
  return void 0;
11709
11861
  const input = record.carriedInput ?? record.agentInput;
@@ -11727,13 +11879,13 @@ ${body}
11727
11879
  }
11728
11880
  if (reportState(records, claim) !== "withheld")
11729
11881
  return void 0;
11730
- const digest = claim.evidence[0]?.digest;
11731
- const timestamp = digest === void 0 ? void 0 : records.get(digest)?.stated?.timestamp;
11882
+ const digest2 = claim.evidence[0]?.digest;
11883
+ const timestamp = digest2 === void 0 ? void 0 : records.get(digest2)?.stated?.timestamp;
11732
11884
  return timestamp === void 0 ? void 0 : STATED_DAY.exec(timestamp)?.[1];
11733
11885
  }
11734
11886
  function reportState(records, claim) {
11735
- const digest = claim.evidence[0]?.digest;
11736
- const record = digest === void 0 ? void 0 : records.get(digest);
11887
+ const digest2 = claim.evidence[0]?.digest;
11888
+ const record = digest2 === void 0 ? void 0 : records.get(digest2);
11737
11889
  if (record === void 0)
11738
11890
  return "not_carried";
11739
11891
  const input = record.carriedInput ?? record.agentInput;
@@ -12207,12 +12359,12 @@ ${body}
12207
12359
  const summaries = [];
12208
12360
  const ratings = [];
12209
12361
  let ratingsNotMatching = 0;
12210
- for (const digest of new Set(claim.evidence.map((ref) => ref.digest))) {
12211
- const payload = citedPayload(result3.records, digest);
12362
+ for (const digest2 of new Set(claim.evidence.map((ref) => ref.digest))) {
12363
+ const payload = citedPayload(result3.records, digest2);
12212
12364
  if (payload === void 0)
12213
12365
  continue;
12214
12366
  if (payload.record_version === CALIBRATION_SUMMARY_V1)
12215
- summaries.push({ digest, payload });
12367
+ summaries.push({ digest: digest2, payload });
12216
12368
  else if (payload.record_version === HUMAN_RATING_V1) {
12217
12369
  const rating = readHumanRating(payload);
12218
12370
  if (rating === void 0) {
@@ -12221,7 +12373,7 @@ ${body}
12221
12373
  }
12222
12374
  const judged = judgedCase(result3, rating.ratedCase.digest);
12223
12375
  ratings.push({
12224
- digest,
12376
+ digest: digest2,
12225
12377
  rating,
12226
12378
  ...judged === void 0 ? {} : {
12227
12379
  judged,
@@ -12285,10 +12437,10 @@ ${body}
12285
12437
  for (const reading of readings2) {
12286
12438
  if (reading.state !== "read")
12287
12439
  continue;
12288
- for (const { digest, rating, judged } of reading.ratings) {
12289
- if (judged === void 0 || seen.has(digest))
12440
+ for (const { digest: digest2, rating, judged } of reading.ratings) {
12441
+ if (judged === void 0 || seen.has(digest2))
12290
12442
  continue;
12291
- seen.add(digest);
12443
+ seen.add(digest2);
12292
12444
  if (judged.verdict === "met" && rating.label === "not_met")
12293
12445
  held2 += 1;
12294
12446
  else if (judged.verdict === "not_met" && rating.label === "met")
@@ -12525,8 +12677,8 @@ ${body}
12525
12677
  continue;
12526
12678
  const reason = asString2(raw.reason);
12527
12679
  const citations2 = [];
12528
- for (const digest of rowCitationDigests(raw)) {
12529
- const record = recordsById.get(digest);
12680
+ for (const digest2 of rowCitationDigests(raw)) {
12681
+ const record = recordsById.get(digest2);
12530
12682
  if (record === void 0)
12531
12683
  continue;
12532
12684
  const resolved = disclosureOf(context, record.capsule_id, "agent_input");
@@ -12666,6 +12818,7 @@ ${body}
12666
12818
  "cited-signers",
12667
12819
  "producer-signatures",
12668
12820
  "witness-receipts",
12821
+ "parent-log-witness",
12669
12822
  "countersignature-types",
12670
12823
  "countersignature-receipts"
12671
12824
  ]);
@@ -12752,9 +12905,9 @@ ${body}
12752
12905
  if (notChecked2.length > 0)
12753
12906
  sentences.push(`This page did not check ${notChecked2.join("; ")}.`);
12754
12907
  } else if (verdict2 === "invalid") {
12755
- const failed2 = strict2.claims.filter((entry) => entry.status === "fail");
12756
- const unboundOnly = coverage.uncheckpointed > 0 && failed2.length === 1 && failed2[0].name === "per_record_membership" && strict2.witnesses?.status !== "fail";
12757
- const named = failed2.map((entry) => {
12908
+ const failed3 = strict2.claims.filter((entry) => entry.status === "fail");
12909
+ const unboundOnly = coverage.uncheckpointed > 0 && failed3.length === 1 && failed3[0].name === "per_record_membership" && strict2.witnesses?.status !== "fail" && strict2.parentWitness?.status !== "fail";
12910
+ const named = failed3.map((entry) => {
12758
12911
  const invalid2 = entry.findings.filter((f) => f.startsWith("producer_signature_invalid:")).length;
12759
12912
  if (entry.name === "signatures" && invalid2 > 0)
12760
12913
  return coverage.total === 1 ? "the record's producer signature does not verify (producer_signature_invalid)" : `${invalid2} of ${coverage.total} records' producer signatures do not verify (producer_signature_invalid)`;
@@ -12784,6 +12937,11 @@ ${body}
12784
12937
  if (invalid2 > 0)
12785
12938
  named.push(`${receipts3(invalid2, "do not verify", "does not verify")} (witness_receipt_invalid)`);
12786
12939
  }
12940
+ const parent2 = strict2.parentWitness;
12941
+ if (parent2?.status === "fail") {
12942
+ const links = parent2.findings.filter((f) => f.startsWith("parent_witness_"));
12943
+ named.push(links.length > 0 ? `the chain to the parent log's witnessed checkpoint does not hold (${findingNames(links).join(", ")})` : `the witness receipt over the parent log's checkpoint is malformed or does not verify (${findingNames(parent2.findings).join(", ")})`);
12944
+ }
12787
12945
  sentences.push(unboundOnly ? uncheckpointed : `What failed: ${named.join("; ")}.`);
12788
12946
  }
12789
12947
  }
@@ -12847,6 +13005,7 @@ ${body}
12847
13005
  "cited-signers": "The producer signature on the records this page cites as signers, each marked beside it as verified or not. Not the signature on every record.",
12848
13006
  "producer-signatures": "The producer signature on every record.",
12849
13007
  "witness-receipts": "Each witness receipt this file carries.",
13008
+ "parent-log-witness": "The chain from this file's log to another log whose checkpoint a witness signed, and that witness's receipt.",
12850
13009
  "countersignature-types": "A countersignature of a type this page does not check.",
12851
13010
  "countersignature-receipts": "The receipt carried with a countersignature."
12852
13011
  });
@@ -12863,6 +13022,7 @@ ${body}
12863
13022
  "cited-signers": "cited producer signatures",
12864
13023
  "producer-signatures": "producer signatures",
12865
13024
  "witness-receipts": "witness receipts",
13025
+ "parent-log-witness": "parent-log witness (parent-log-witness/v1)",
12866
13026
  "countersignature-types": "countersignature types",
12867
13027
  "countersignature-receipts": "countersignature receipts"
12868
13028
  });
@@ -12967,18 +13127,25 @@ ${body}
12967
13127
  ran("witness-receipts", true);
12968
13128
  else if (witnesses !== null && witnesses !== void 0 && !witnesses.findings.includes("witness_receipt_absent"))
12969
13129
  outcome.set("witness-receipts", "notChecked");
13130
+ const parent2 = strict2.parentWitness;
13131
+ if (parent2?.status === "fail")
13132
+ ran("parent-log-witness", false);
13133
+ else if (parent2?.status === "pass")
13134
+ ran("parent-log-witness", true);
13135
+ else if (parent2 !== null && parent2 !== void 0)
13136
+ outcome.set("parent-log-witness", "notChecked");
12970
13137
  }
12971
13138
  const pick = (which) => VERIFICATION_CHECK_IDS.filter((id) => outcome.get(id) === which);
12972
- const failed2 = pick("failed");
13139
+ const failed3 = pick("failed");
12973
13140
  return {
12974
13141
  page: pick("page"),
12975
- failed: failed2,
13142
+ failed: failed3,
12976
13143
  notChecked: pick("notChecked"),
12977
13144
  // The note says the range and membership checks passed on a checkpoint
12978
13145
  // the producer asserted: true only when the page's own checks
12979
13146
  // (bundleVerified) pass, no check on this page failed and the
12980
13147
  // checkpoint line is in the not-checked list.
12981
- passedWithoutCheckpoint: passedWithoutCheckpoint && outcome.get("checkpoint-signature") === "notChecked" && failed2.length === 0 && bundleVerified(verified)
13148
+ passedWithoutCheckpoint: passedWithoutCheckpoint && outcome.get("checkpoint-signature") === "notChecked" && failed3.length === 0 && bundleVerified(verified)
12982
13149
  };
12983
13150
  }
12984
13151
  var VERIFY_INDEPENDENTLY_LINE = "verify independently at verify.agentactioncapsule.org or with a full verifier";
@@ -12995,8 +13162,8 @@ ${body}
12995
13162
  const results = Object.values(capsuleResults);
12996
13163
  if (results.length === 0)
12997
13164
  return "not_checked";
12998
- const failed2 = results.some((result3) => result3.findings.some((finding) => finding.severity === "error" && finding.check !== void 0 && checks.includes(finding.check)));
12999
- return failed2 ? "fail" : "pass";
13165
+ const failed3 = results.some((result3) => result3.findings.some((finding) => finding.severity === "error" && finding.check !== void 0 && checks.includes(finding.check)));
13166
+ return failed3 ? "fail" : "pass";
13000
13167
  }
13001
13168
  function receiptGradeWord(value) {
13002
13169
  return value === "mmr-verified" ? "consistency-verified" : value === "countersigned-observed" ? "existence-and-time" : void 0;
@@ -13012,6 +13179,21 @@ ${body}
13012
13179
  return typeof witness === "string" && typeof time === "string" && grade !== void 0 ? [{ witness, grade, time }] : [];
13013
13180
  });
13014
13181
  }
13182
+ function parentWitnessEntry(strict2) {
13183
+ const parent2 = strict2?.parentWitness;
13184
+ if (parent2?.status !== "pass" || parent2.extent === null)
13185
+ return void 0;
13186
+ return {
13187
+ entries: parent2.extent.entries,
13188
+ of: parent2.extent.of,
13189
+ whole: parent2.extent.entries === parent2.extent.of,
13190
+ receipts: parent2.receipts.filter((r) => r.status === "pass").map((r) => ({
13191
+ witness: r.tsUrl,
13192
+ keyId: r.keyId,
13193
+ registrationTime: r.registrationTime
13194
+ }))
13195
+ };
13196
+ }
13015
13197
  function completenessStatement(raw) {
13016
13198
  const record = object9(raw);
13017
13199
  if (record === void 0)
@@ -13042,12 +13224,14 @@ ${body}
13042
13224
  summarize("Per-record membership", verified.perRecordMembership.status)
13043
13225
  ];
13044
13226
  const coverage = coverageStatement(verified);
13227
+ const parentWitness = parentWitnessEntry(checkInputs.strict);
13045
13228
  return {
13046
13229
  ...verified.bundleDigest === void 0 ? {} : { bundleDigest: verified.bundleDigest },
13047
13230
  ...typeof checkpoint?.root === "string" ? { checkpointRoot: checkpoint.root } : {},
13048
13231
  ...typeof checkpoint?.mmr_size === "number" ? { checkpointSize: checkpoint.mmr_size } : {},
13049
13232
  receipts: receipts(top.receipts),
13050
- selfWitnessed: checkpoint !== void 0 && receipts(top.receipts).length === 0,
13233
+ selfWitnessed: checkpoint !== void 0 && receipts(top.receipts).length === 0 && checkInputs.strict?.witnesses?.status !== "pass" && parentWitness === void 0,
13234
+ ...parentWitness === void 0 ? {} : { parentWitness },
13051
13235
  records: recordCoverage(top, verified, coverage),
13052
13236
  uncheckpointedCount: unboundRecordIds(verified).length,
13053
13237
  coverage,
@@ -14442,8 +14626,8 @@ ${body}
14442
14626
  const consider = async (value) => {
14443
14627
  if (!isObj3(value) || value.dataset_version === void 0 && !(isObj3(value.header) && value.header.ir_version !== void 0))
14444
14628
  return;
14445
- const digest = await digestOf(value);
14446
- if (digest !== void 0) found.set(digest, value);
14629
+ const digest2 = await digestOf(value);
14630
+ if (digest2 !== void 0) found.set(digest2, value);
14447
14631
  };
14448
14632
  for (const record of context.records) {
14449
14633
  for (const member of ["agent_input", "agent_output"]) {
@@ -14462,15 +14646,15 @@ ${body}
14462
14646
  for (const record of context.records) {
14463
14647
  const inline = record[RECORD_HEADER_MEMBER];
14464
14648
  if (isObj3(inline)) {
14465
- const digest2 = await digestOf(inline);
14466
- if (digest2 !== void 0)
14467
- found.set(digest2, { header: inline, recordId: record.capsule_id });
14649
+ const digest3 = await digestOf(inline);
14650
+ if (digest3 !== void 0)
14651
+ found.set(digest3, { header: inline, recordId: record.capsule_id });
14468
14652
  continue;
14469
14653
  }
14470
- const digest = committedDigest(record, "agent_input");
14654
+ const digest2 = committedDigest(record, "agent_input");
14471
14655
  const disclosed = disclosureOf(context, record.capsule_id, "agent_input");
14472
- if (digest !== void 0 && disclosed.state === "disclosed" && isObj3(disclosed.payload))
14473
- found.set(digest, {
14656
+ if (digest2 !== void 0 && disclosed.state === "disclosed" && isObj3(disclosed.payload))
14657
+ found.set(digest2, {
14474
14658
  header: disclosed.payload,
14475
14659
  recordId: record.capsule_id
14476
14660
  });
@@ -14907,19 +15091,19 @@ ${s} [data-src="producer"]:not(.cv-src){font-style:italic}
14907
15091
  const body = el2("div", "cv-ev-body");
14908
15092
  body.append(el2("p", "cv-ev-k", w.t("evidence.records")));
14909
15093
  const list2 = el2("ul", "cv-ev-list");
14910
- for (const digest of cited) {
15094
+ for (const digest2 of cited) {
14911
15095
  const item = element2("li");
14912
- item.dataset.cited = digest;
15096
+ item.dataset.cited = digest2;
14913
15097
  const link = element2("a");
14914
- link.setAttribute("href", `#${recordAddress(digest)}`);
14915
- link.append(element2("code", digest));
15098
+ link.setAttribute("href", `#${recordAddress(digest2)}`);
15099
+ link.append(element2("code", digest2));
14916
15100
  item.append(link);
14917
15101
  list2.append(item);
14918
15102
  }
14919
- for (const digest of missing) {
15103
+ for (const digest2 of missing) {
14920
15104
  const item = element2("li");
14921
- item.dataset.missing = digest;
14922
- item.append(element2("code", digest), ` ${w.t("evidence.not-in-bundle")}`);
15105
+ item.dataset.missing = digest2;
15106
+ item.append(element2("code", digest2), ` ${w.t("evidence.not-in-bundle")}`);
14923
15107
  list2.append(item);
14924
15108
  }
14925
15109
  if (citeNothing > 0) {
@@ -16384,9 +16568,9 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
16384
16568
  return claim.verdict;
16385
16569
  }
16386
16570
  function reportPayload2(records, claim) {
16387
- const digest = claim.evidence[0]?.digest;
16388
- if (digest === void 0) return void 0;
16389
- const record = records.get(digest);
16571
+ const digest2 = claim.evidence[0]?.digest;
16572
+ if (digest2 === void 0) return void 0;
16573
+ const record = records.get(digest2);
16390
16574
  if (record === void 0) return void 0;
16391
16575
  const input = record.carriedInput ?? record.agentInput;
16392
16576
  if (input.state !== "disclosed") return void 0;
@@ -17007,7 +17191,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17007
17191
  box.append(el5("b", "", big2), el5("span", "", caption));
17008
17192
  return box;
17009
17193
  }
17010
- function customerBlock(handle, rows, history, reportTotal, w) {
17194
+ function customerBlock(handle, rows, history, reportTotal, w, tiered) {
17011
17195
  const block = el5("article", "sh-cust");
17012
17196
  block.dataset.handle = handle;
17013
17197
  const n = rows.length;
@@ -17057,14 +17241,25 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17057
17241
  total: fmt(reportTotal)
17058
17242
  })
17059
17243
  ),
17060
- tile("ok", of(count2("resolved")), w.t("lines.subject.tile.resolved")),
17061
- tile("bad", of(count2("missed")), w.t("lines.subject.tile.missed")),
17244
+ tile(
17245
+ "ok",
17246
+ of(count2("resolved")),
17247
+ w.t(`lines.subject.tile.resolved${tiered ? ".tiered" : ""}`)
17248
+ ),
17249
+ tile(
17250
+ "bad",
17251
+ of(count2("missed")),
17252
+ w.t(`lines.subject.tile.missed${tiered ? ".tiered" : ""}`)
17253
+ ),
17062
17254
  tile("ne", of(count2("undecided")), w.t("lines.subject.tile.undecided"))
17063
17255
  );
17064
17256
  block.append(tiles);
17065
17257
  const unverified = count2("unverified");
17066
- const nothing = count2("nothing-applied");
17067
- if (unverified + nothing > 0) {
17258
+ const keptOut = rows.filter(
17259
+ (r) => r.status === "nothing-applied" && r.keptOut === true
17260
+ ).length;
17261
+ const nothing = count2("nothing-applied") - keptOut;
17262
+ if (unverified + nothing + keptOut > 0) {
17068
17263
  const rest = [
17069
17264
  ...unverified > 0 ? [
17070
17265
  w.t("lines.subject.note.unverified", {
@@ -17077,6 +17272,12 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17077
17272
  n: fmt(nothing),
17078
17273
  total: fmt(n)
17079
17274
  })
17275
+ ] : [],
17276
+ ...keptOut > 0 ? [
17277
+ w.t("lines.subject.note.none-counted", {
17278
+ n: fmt(keptOut),
17279
+ total: fmt(n)
17280
+ })
17080
17281
  ] : []
17081
17282
  ];
17082
17283
  block.append(el5("p", "sh-note", rest.join(" ")));
@@ -17190,7 +17391,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17190
17391
  }
17191
17392
  return section;
17192
17393
  }
17193
- function renderSubjectHistory(rows, history, reportTotal, w) {
17394
+ function renderSubjectHistory(rows, history, reportTotal, w, tiered = false) {
17194
17395
  const drawn = rows.filter((r) => history.entries.has(r.id)).sort(
17195
17396
  (a, b) => a.date === b.date ? a.id < b.id ? -1 : 1 : a.date < b.date ? -1 : 1
17196
17397
  );
@@ -17220,12 +17421,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17220
17421
  section.append(el5("p", "sh-lede", w.t("lines.subject.none")));
17221
17422
  repeat.sort((a, b) => b[1].length - a[1].length || (a[0] < b[0] ? -1 : 1));
17222
17423
  for (const [handle, list2] of repeat)
17223
- section.append(customerBlock(handle, list2, history, reportTotal, w));
17424
+ section.append(
17425
+ customerBlock(handle, list2, history, reportTotal, w, tiered)
17426
+ );
17224
17427
  } else {
17225
17428
  section.append(el5("p", "sh-slice", w.t("lines.subject.slice.shared")));
17226
17429
  section.append(table(drawn, history, w));
17227
17430
  }
17228
- section.append(el5("p", "sh-gap", w.t("lines.subject.gap")));
17431
+ section.append(
17432
+ el5("p", "sh-gap", w.t(`lines.subject.gap${tiered ? ".tiered" : ""}`))
17433
+ );
17229
17434
  return section;
17230
17435
  }
17231
17436
  var SUBJECT_HISTORY_CSS = `
@@ -17484,15 +17689,15 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17484
17689
  }
17485
17690
  function builtCommit() {
17486
17691
  if (false) return void 0;
17487
- return commitPrefix("99da5596517c25d1fce5b9b2d03d09ec7913d114");
17692
+ return commitPrefix("d9acdea4c629e3ae42db08872d96da9e982c589a");
17488
17693
  }
17489
17694
  var commit = builtCommit();
17490
17695
  var unreleased = false;
17491
17696
  var VIEWER_BUILD = {
17492
17697
  viewer: "@action-state-group/capsule-viewer",
17493
- viewerVersion: "0.18.2",
17698
+ viewerVersion: "0.18.3",
17494
17699
  verifier: "@action-state-group/agent-action-capsule",
17495
- verifierVersion: "0.13.1",
17700
+ verifierVersion: "0.14.0",
17496
17701
  cllVersion: "0.3.0",
17497
17702
  ...commit === void 0 ? {} : { commit },
17498
17703
  ...unreleased ? { unreleased: true } : {}
@@ -17612,9 +17817,22 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17612
17817
  "lines.rtier.unstated.title": "Terms with no stated tier \xB7 {n}",
17613
17818
  "lines.rtier.unstated.note": "The contract given for this page states no tier for these, so they stay in the answer.",
17614
17819
  "lines.rtier.sealed-note": "The sealed result counts informational terms too; the lines this report derives leave them out.",
17820
+ "lines.rtier.totals": "Must-have only, under contract {contract} (sha256 {digest}): {met} Met \xB7 {not_met} Not met \xB7 {undecided} Could not decide{out_of_scope}, of {n} must-have evaluations. {informational} informational evaluations are reported apart.{unstated}{failed}",
17821
+ "lines.rtier.totals.out-of-scope": " \xB7 {n} Out of scope",
17822
+ "lines.rtier.totals.unstated": " Evaluations this contract gives no tier, in neither count: {n}.",
17823
+ "lines.rtier.totals.failed": " Must-have evaluations that failed verification, still counted under their sealed verdict: {n}.",
17824
+ "lines.rtier.all-terms": "These totals count every rule in force: no contract was given to separate the must-have ones.",
17615
17825
  "lines.title": "Outcome report",
17826
+ "lines.title.month": "Outcome report, {month} {year}",
17616
17827
  "lines.share": "{count} of {total}",
17617
17828
  "lines.share.percent": "{p}%",
17829
+ "lines.rules.of": "of {total}",
17830
+ "lines.rules.of.note.one": "Counts are out of the report's {total} conversation.",
17831
+ "lines.rules.of.note.other": "Counts are out of the report's {total} conversations.",
17832
+ "lines.rules.not_applied": "did not apply in {k}",
17833
+ "lines.rules.not_in_force": "not yet in force in {k}",
17834
+ "lines.rules.kind.judged": "Judged",
17835
+ "lines.rules.kind.recomputed": "Computed",
17618
17836
  "lines.tier.judged": "judged",
17619
17837
  "lines.tier.recomputed": "recomputed",
17620
17838
  "lines.tier.unknown": "tier unknown \u2014 no claims observed",
@@ -18259,6 +18477,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18259
18477
  "lines.subject.tile.conversations": "conversations \xB7 {first} to {last} \xB7 of the report's {total}",
18260
18478
  "lines.subject.tile.resolved": "resolved \xB7 every term met",
18261
18479
  "lines.subject.tile.missed": "missed \xB7 one or more terms not met",
18480
+ "lines.subject.tile.resolved.tiered": "resolved \xB7 every must-have met",
18481
+ "lines.subject.tile.missed.tiered": "missed \xB7 one or more required terms not met",
18262
18482
  "lines.subject.tile.undecided": "could not decide",
18263
18483
  "lines.subject.headline": "One customer, {n} conversations",
18264
18484
  "lines.subject.explain": "The handle is a salted commitment to the customer id, stable within this pack's scope and your tier. It tells you these {n} are the same customer; the handle alone does not say who.",
@@ -18291,8 +18511,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18291
18511
  "lines.subject.legend.undecided": "could not decide",
18292
18512
  "lines.subject.legend.order": "terms are in the contract's order",
18293
18513
  "lines.subject.gap": "Not drawn: which terms are must-have and which informational, when each term is met, and the adjudication. This bundle does not carry them.",
18514
+ "lines.subject.gap.tiered": "Not drawn: when each term is met, and the adjudication. This bundle does not carry them.",
18294
18515
  "lines.subject.note.unverified": "{n} of {total} could not be verified.",
18295
- "lines.subject.note.nothing-applied": "{n} of {total} had no term that applied."
18516
+ "lines.subject.note.nothing-applied": "{n} of {total} had no term that applied.",
18517
+ "lines.subject.note.none-counted": "{n} of {total} had no must-have term that applied; under this contract informational terms never change the answer.",
18518
+ "lines.subject.outcome.none-counted": "no must-have term applied"
18296
18519
  }
18297
18520
  };
18298
18521
 
@@ -18303,20 +18526,25 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18303
18526
  locale: "en",
18304
18527
  entries: {
18305
18528
  "layout.grouping": "groups",
18306
- "groups.rtier.must_have.title": "Must-have tests \xB7 {n}",
18529
+ "groups.rtier.must_have.title": "Must-have requirements \xB7 {n}",
18307
18530
  "groups.rtier.must_have.note": "These count in the answer.",
18308
- "groups.rtier.informational.title": "Informational tests \xB7 {n}",
18309
- "groups.rtier.informational.note": "Reported, never in the answer: a test not met here changes nothing above it.",
18310
- "groups.rtier.unstated.title": "Tests with no stated tier \xB7 {n}",
18531
+ "groups.rtier.informational.title": "Informational requirements \xB7 {n}",
18532
+ "groups.rtier.informational.note": "Reported, never in the answer: a requirement not met here changes nothing above it.",
18533
+ "groups.rtier.unstated.title": "Requirements with no stated tier \xB7 {n}",
18311
18534
  "groups.rtier.unstated.note": "The contract given for this page states no tier for these, so they stay in the answer.",
18312
- "groups.rtier.sealed-note": "The sealed result counts informational tests too; the lines this report derives leave them out.",
18535
+ "groups.rtier.sealed-note": "The sealed result counts informational requirements too; the lines this report derives leave them out.",
18536
+ "groups.rtier.totals": "Must-have only, under contract {contract} (sha256 {digest}): {met} Met \xB7 {not_met} Not met \xB7 {undecided} Could not decide{out_of_scope}, of {n} must-have evaluations. {informational} informational evaluations are reported apart.{unstated}{failed}",
18537
+ "groups.rtier.totals.out-of-scope": " \xB7 {n} Out of scope",
18538
+ "groups.rtier.totals.unstated": " Evaluations this contract gives no tier, in neither count: {n}.",
18539
+ "groups.rtier.totals.failed": " Must-have evaluations that failed verification, still counted under their sealed verdict: {n}.",
18540
+ "groups.rtier.all-terms": "These totals count every requirement in force: no contract was given to separate the must-have ones.",
18313
18541
  "groups.producer.title": "The producer's mapping, not a sealed record",
18314
18542
  "groups.count.obligation.one": "{n} obligation",
18315
18543
  "groups.count.obligation.other": "{n} obligations",
18316
18544
  "groups.count.session.one": "{n} session",
18317
18545
  "groups.count.session.other": "{n} sessions",
18318
- "groups.count.test.one": "{n} test",
18319
- "groups.count.test.other": "{n} tests",
18546
+ "groups.count.test.one": "{n} requirement",
18547
+ "groups.count.test.other": "{n} requirements",
18320
18548
  "groups.count.exception.one": "{n} exception",
18321
18549
  "groups.count.exception.other": "{n} exceptions",
18322
18550
  "groups.count.result.one": "{n} result",
@@ -18333,12 +18561,12 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18333
18561
  "groups.sub": "{pack} \xB7 {obligations} \xB7 {sessions}",
18334
18562
  "groups.sub.judged": "{pack} \xB7 {obligations} \xB7 {sessions} \xB7 judged {period}",
18335
18563
  "groups.sub.dated": "{pack} \xB7 {obligations} \xB7 {sessions} \xB7 {period}",
18336
- "groups.headline.one": "{met} of {n} session met every test that applied to it.",
18337
- "groups.headline.other": "{met} of {n} sessions met every test that applied to them.",
18564
+ "groups.headline.one": "{met} of {n} session met every requirement that applied to it.",
18565
+ "groups.headline.other": "{met} of {n} sessions met every requirement that applied to them.",
18338
18566
  "groups.headline.missed": "{n} did not meet at least one.",
18339
18567
  "groups.headline.unverified": "{n} could not be verified.",
18340
18568
  "groups.headline.undecided": "{n} could not be decided.",
18341
- "groups.headline.nothing-applied": "{n} had no test that applied.",
18569
+ "groups.headline.nothing-applied": "{n} had no requirement that applied.",
18342
18570
  "groups.ob.worst.not_met": "worst: not met, {n} of {sessions} \xB7 derived",
18343
18571
  "groups.ob.worst.unverified": "worst: could not be verified, {n} of {sessions} \xB7 derived",
18344
18572
  "groups.ob.worst.undecided": "worst: could not be decided, {n} of {sessions} \xB7 derived",
@@ -18357,10 +18585,15 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18357
18585
  "groups.row.ok.all-decided": "No exceptions",
18358
18586
  "groups.row.ok": "No exceptions",
18359
18587
  "groups.summary.h": "What was checked and what we found",
18360
- "groups.summary.lede": "Each session (one conversation with the agent) was checked against {tests} under {obligations}. Results are counts of sessions: there is no overall score. Open a test to read the sessions behind its exceptions.",
18361
- "groups.summary.basis": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, obligation titles, test names, the article, the plain-language summary, applicability, method, finding ids, severities, recommendations and the notes on undecided tests and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them.`,
18362
- "groups.summary.basis.pack-titles": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, test names, the article, the plain-language summary, applicability, method, finding ids, severities, recommendations and the notes on undecided tests and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them. Obligation titles are the Act's article headings, from this page's wording pack.`,
18363
- "groups.summary.col.test": "Obligation and test",
18588
+ "groups.summary.lede": "Each session (one conversation with the agent) was checked against {tests} under {obligations}. Results are counts of sessions: there is no overall score. Open a requirement to read the sessions behind its exceptions.",
18589
+ "groups.summary.basis": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, obligation titles, requirement names, the article, the plain-language summary, applicability, method, finding ids, severities, recommendations and the notes on undecided requirements and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them.`,
18590
+ "groups.summary.basis.pack-titles": `Every count and result is read from the sealed claims and reports in this bundle, or marked "not stated". The regulation named above, requirement names, the article, the plain-language summary, applicability, method, finding ids, severities, recommendations and the notes on undecided requirements and quality checks are the producer's mapping, set in italics: carried beside the signed records, not in them. Obligation titles are the Act's article headings, from this page's wording pack.`,
18591
+ "groups.fn.records.one": "\xB9 Records are the {records} sealed items in this bundle. A session is one conversation with the agent, made of one or more records; this bundle has {n} session.",
18592
+ "groups.fn.records.other": "\xB9 Records are the {records} sealed items in this bundle. A session is one conversation with the agent, made of one or more records; this bundle has {n} sessions.",
18593
+ "groups.fn.resolved.tiered": "\xB2 A session is met when every requirement that applied to it was satisfied and at least one applied. A requirement the contract marks informational never changes the answer.",
18594
+ "groups.fn.resolved": "\xB2 A session is met when every requirement that applied to it was satisfied and at least one applied.",
18595
+ "groups.fn.readonly": "\xB3 This page is read-only: it records nothing the reader does. To disagree, send an evidence request or open a dispute.",
18596
+ "groups.summary.col.test": "Obligation and requirement",
18364
18597
  "groups.summary.col.checked-in": "Checked in",
18365
18598
  "groups.summary.col.result": "Result",
18366
18599
  "groups.finding": "Finding {id}",
@@ -18368,23 +18601,23 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18368
18601
  "groups.session.unverified": "could not verify",
18369
18602
  "groups.session.undecided": "could not decide",
18370
18603
  "groups.session.ok": "no exceptions",
18371
- "groups.session.none": "no test applied",
18372
- "groups.h.test-by-test": "Test by test",
18604
+ "groups.session.none": "no requirement applied",
18605
+ "groups.h.test-by-test": "Requirement by requirement",
18373
18606
  "groups.unverified-note": "no verdict drawn: neither met nor an exception",
18374
18607
  "groups.pf.dated": "Dated",
18375
18608
  "groups.pf.session": "Session",
18376
18609
  "groups.pf.case-record.from-claims": "{record} (cited by every claim of this session; the reports that name it are withheld)",
18377
- "groups.pf.h.each-report": "Each test's sealed report",
18378
- "groups.pf.no-claim": "no claim: Result v0 carries none for a test that did not apply",
18610
+ "groups.pf.h.each-report": "Each requirement's sealed report",
18611
+ "groups.pf.no-claim": "no claim: Result v0 carries none for a requirement that did not apply",
18379
18612
  "groups.pf.judge-pin": "judge pin {digest}",
18380
18613
  "groups.pf.rationale": "Rationale, as sealed: {rationale}",
18381
18614
  "groups.pf.absent": "absent",
18382
18615
  "groups.pin.differs": "disagrees across sessions",
18383
18616
  "groups.pin.none": "no judged sessions cited",
18384
- "groups.rp.toggle": "Proofs for this report: method, test wording, what ran, and how to verify the whole bundle",
18385
- "groups.od.h": "Method and the wording each test ran",
18386
- "groups.od.mapped": "Title, article, summary, method, test names and the undecided-session note: the producer's mapping, in italics, not a sealed record.",
18387
- "groups.od.mapped.pack-titles": "Article, summary, method, test names and the undecided-session note: the producer's mapping, in italics, not a sealed record. The title is the Act's article heading, from this page's wording pack.",
18617
+ "groups.rp.toggle": "Proofs for this report: method, requirement wording, what ran, and how to verify the whole bundle",
18618
+ "groups.od.h": "Method and the wording of each requirement's check",
18619
+ "groups.od.mapped": "Title, article, summary, method, requirement names and the undecided-session note: the producer's mapping, in italics, not a sealed record.",
18620
+ "groups.od.mapped.pack-titles": "Article, summary, method, requirement names and the undecided-session note: the producer's mapping, in italics, not a sealed record. The title is the Act's article heading, from this page's wording pack.",
18388
18621
  "groups.od.unmapped": "The producer's extension does not map this obligation: article, summary and method not stated.",
18389
18622
  "groups.od.judged-terms": "Judged terms: ",
18390
18623
  "groups.od.wording.sealed": "Wording run (sealed): {text}",
@@ -18394,7 +18627,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18394
18627
  "groups.q.none": "No quality protocol declared in this pack.",
18395
18628
  "groups.q.protocol": "Protocol ",
18396
18629
  "groups.q.unspecified": "unspecified",
18397
- "groups.q.tail": ". Recomputed tests are not sampled.",
18630
+ "groups.q.tail": ". Recomputed checks are not sampled.",
18398
18631
  "groups.ran.h": "What ran",
18399
18632
  "groups.ran.contract": "Contract",
18400
18633
  "groups.ran.contract.none": "no conversations",
@@ -19295,6 +19528,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19295
19528
  "generic.rtier.unstated.title": "Requirements with no stated tier \xB7 {n}",
19296
19529
  "generic.rtier.unstated.note": "The contract given for this page states no tier for these, so they stay in the answer.",
19297
19530
  "generic.rtier.sealed-note": "The sealed result counts informational requirements too; the counts this report derives leave them out.",
19531
+ "generic.rtier.totals": "Must-have only, under contract {contract} (sha256 {digest}): {met} Met \xB7 {not_met} Not met \xB7 {undecided} Could not decide{out_of_scope}, of {n} must-have evaluations. {informational} informational evaluations are reported apart.{unstated}{failed}",
19532
+ "generic.rtier.totals.out-of-scope": " \xB7 {n} Out of scope",
19533
+ "generic.rtier.totals.unstated": " Evaluations this contract gives no tier, in neither count: {n}.",
19534
+ "generic.rtier.totals.failed": " Must-have evaluations that failed verification, still counted under their sealed verdict: {n}.",
19535
+ "generic.rtier.all-terms": "These totals count every requirement in force: no contract was given to separate the must-have ones.",
19298
19536
  "generic.later.title": "Not yet in force \xB7 {n}",
19299
19537
  "generic.later.readiness": "readiness",
19300
19538
  "generic.later.note": "Applies from {date}, as the producer copied it from the contract, not re-checked here: readiness only, not counted.",
@@ -19339,8 +19577,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19339
19577
  async function checkWordingPackInput(wording) {
19340
19578
  if (!/^[0-9a-f]{64}$/u.test(wording.sha256))
19341
19579
  throw new WordingPackError("wording sha256 is not a lowercase hex SHA-256");
19342
- const digest = await sha256Hex(new TextEncoder().encode(wording.pack));
19343
- if (digest !== wording.sha256)
19580
+ const digest2 = await sha256Hex(new TextEncoder().encode(wording.pack));
19581
+ if (digest2 !== wording.sha256)
19344
19582
  throw new WordingPackError(
19345
19583
  "wording pack bytes do not hash to its wording_sha256"
19346
19584
  );
@@ -19414,8 +19652,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19414
19652
  "lines.verdict.out_of_scope",
19415
19653
  "lines.pf.verdict.out_of_scope"
19416
19654
  ],
19417
- "tier.recomputed": ["lines.tier.recomputed"],
19418
- "tier.judged": ["lines.tier.judged"]
19655
+ "tier.recomputed": ["lines.tier.recomputed", "lines.rules.kind.recomputed"],
19656
+ "tier.judged": ["lines.tier.judged", "lines.rules.kind.judged"]
19419
19657
  },
19420
19658
  groups: {
19421
19659
  "report.title": ["groups.kicker"],
@@ -19541,6 +19779,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19541
19779
  "lines.tier.mixed",
19542
19780
  "lines.tier.unknown"
19543
19781
  ],
19782
+ // The roll-up's chip says the same thing about a rule.
19783
+ ["lines.rules.kind.judged", "lines.rules.kind.recomputed"],
19544
19784
  // The Outcomes headline row labels.
19545
19785
  [
19546
19786
  "lines.line.resolved",
@@ -19695,11 +19935,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19695
19935
  "lines.line.added": "added",
19696
19936
  // recomputed tier: a fixed check anyone can repeat from the records.
19697
19937
  "lines.tier.recomputed": "tier.recomputed",
19938
+ "lines.rules.kind.recomputed": "tier.recomputed",
19698
19939
  "groups.tier.recomputed": "tier.recomputed",
19699
19940
  "generic.tier.recomputed": "tier.recomputed",
19700
19941
  // judged tier: a judgement, which must never read like the recomputed
19701
19942
  // tier above.
19702
19943
  "lines.tier.judged": "tier.judged",
19944
+ "lines.rules.kind.judged": "tier.judged",
19703
19945
  "groups.tier.judged": "tier.judged",
19704
19946
  "generic.tier.judged": "tier.judged"
19705
19947
  };
@@ -19737,6 +19979,23 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19737
19979
  "groups.rtier.unstated.note",
19738
19980
  "lines.rtier.sealed-note",
19739
19981
  "groups.rtier.sealed-note",
19982
+ // Which evaluations a total counts: a pack cannot make an all-requirements
19983
+ // total read as must-have only, or the reverse.
19984
+ "lines.rtier.totals",
19985
+ "lines.rtier.totals.out-of-scope",
19986
+ "lines.rtier.totals.unstated",
19987
+ "lines.rtier.totals.failed",
19988
+ "groups.rtier.totals",
19989
+ "groups.rtier.totals.out-of-scope",
19990
+ "groups.rtier.totals.unstated",
19991
+ "groups.rtier.totals.failed",
19992
+ "generic.rtier.totals",
19993
+ "generic.rtier.totals.out-of-scope",
19994
+ "generic.rtier.totals.unstated",
19995
+ "generic.rtier.totals.failed",
19996
+ "lines.rtier.all-terms",
19997
+ "groups.rtier.all-terms",
19998
+ "generic.rtier.all-terms",
19740
19999
  "generic.rtier.unstated.note",
19741
20000
  "generic.rtier.sealed-note",
19742
20001
  // The generic page's honesty lines: what its names and ids are, and what a
@@ -19861,6 +20120,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19861
20120
  "spot.gap.adjudication",
19862
20121
  // Same customer in this report (subject-history.ts): what the bundle does not carry.
19863
20122
  "lines.subject.gap",
20123
+ "lines.subject.gap.tiered",
19864
20124
  // Both cards: a rule or conversation nobody could decide, by why.
19865
20125
  "lines.status.undecided.unjudged",
19866
20126
  "lines.status.undecided.withheld",
@@ -20071,6 +20331,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
20071
20331
  "lines.na-note.other",
20072
20332
  // The canvas's footnote that says what the page does not do.
20073
20333
  "lines.fn.readonly",
20334
+ "groups.fn.readonly",
20074
20335
  "lines.sentence.undecided.none",
20075
20336
  "lines.why.undecided.none",
20076
20337
  "lines.sentence.nothing-applied",
@@ -20329,9 +20590,9 @@ ${key}`);
20329
20590
  return problems.map((p) => `${pack.id}: ${p}`);
20330
20591
  }
20331
20592
  var DEFAULT_PACK_SHA256 = Object.freeze({
20332
- lines: "c8e7c5313deee0137654878727c8a79760286cc165b46c316b5956f498a83d80",
20333
- groups: "7527077ae3637ff772bc311878a76c8f25e1d16314244f9b5dc80cf1b8e131e0",
20334
- generic: "2b2de4e046cab88633f09b96729f18a12e0331708e13920a84f6c67f32302f77"
20593
+ lines: "80b1373cd923bbf0fcf5ffaa2499d851f6f0907bca1263948cbea502f62df3b7",
20594
+ groups: "004c1c663a60e8c0248219c6be9b2c91aa89108c648d30144d141137cd02ea99",
20595
+ generic: "10e802539747ebff6fc92b1947d083609c99ab33ad4b3579ed4e1d66425defa0"
20335
20596
  });
20336
20597
  function fill(key, text2, vars) {
20337
20598
  return text2.replace(PLACEHOLDER, (whole, name) => {
@@ -20414,9 +20675,9 @@ ${key}`);
20414
20675
 
20415
20676
  // src/report-provenance.ts
20416
20677
  function reportPayload3(records, claim) {
20417
- const digest = claim.evidence[0]?.digest;
20418
- if (digest === void 0) return void 0;
20419
- const record = records.get(digest);
20678
+ const digest2 = claim.evidence[0]?.digest;
20679
+ if (digest2 === void 0) return void 0;
20680
+ const record = records.get(digest2);
20420
20681
  if (record === void 0) return void 0;
20421
20682
  const input = record.carriedInput ?? record.agentInput;
20422
20683
  if (input.state !== "disclosed") return void 0;
@@ -20471,9 +20732,9 @@ ${key}`);
20471
20732
  else recomputedUnnamed += 1;
20472
20733
  continue;
20473
20734
  }
20474
- const digest = asString2(payload?.judge_pin_digest);
20475
- if (digest !== void 0) {
20476
- const entry = pins.get(digest) ?? {
20735
+ const digest2 = asString2(payload?.judge_pin_digest);
20736
+ if (digest2 !== void 0) {
20737
+ const entry = pins.get(digest2) ?? {
20477
20738
  count: 0,
20478
20739
  parts: /* @__PURE__ */ new Map(),
20479
20740
  bare: 0
@@ -20482,13 +20743,13 @@ ${key}`);
20482
20743
  const parts = pinComponents2(payload?.judge_pin);
20483
20744
  if (parts === void 0) entry.bare += 1;
20484
20745
  else entry.parts.set(new TextDecoder().decode(jcs(parts)), parts);
20485
- pins.set(digest, entry);
20746
+ pins.set(digest2, entry);
20486
20747
  continue;
20487
20748
  }
20488
20749
  unnamed += 1;
20489
20750
  }
20490
20751
  const counted2 = [];
20491
- for (const [digest, entry] of pins) {
20752
+ for (const [digest2, entry] of pins) {
20492
20753
  let model;
20493
20754
  let modelNotShown;
20494
20755
  if (entry.parts.size === 0) modelNotShown = "not_stated";
@@ -20498,7 +20759,7 @@ ${key}`);
20498
20759
  const parts = [...entry.parts.values()][0];
20499
20760
  const checked = await verifyJudgePin({
20500
20761
  pinned: true,
20501
- judgePinDigest: digest,
20762
+ judgePinDigest: digest2,
20502
20763
  judgePin: parts
20503
20764
  });
20504
20765
  if (checked.judgePinRecomputes === true)
@@ -20508,7 +20769,7 @@ ${key}`);
20508
20769
  else modelNotShown = "does_not_recompute";
20509
20770
  }
20510
20771
  counted2.push({
20511
- digest,
20772
+ digest: digest2,
20512
20773
  count: entry.count,
20513
20774
  ...model === void 0 ? {} : { model },
20514
20775
  ...modelNotShown === void 0 ? {} : { modelNotShown }
@@ -20529,7 +20790,7 @@ ${key}`);
20529
20790
  var fmt2 = (n) => n.toLocaleString();
20530
20791
  var quoted = (value) => JSON.stringify(value.length > 120 ? `${value.slice(0, 120)}\u2026` : value);
20531
20792
  var HEX_DIGEST2 = /^[0-9a-f]+$/iu;
20532
- var short = (digest) => HEX_DIGEST2.test(digest) ? digest.length > 12 ? `${digest.slice(0, 12)}\u2026` : digest : quoted(digest);
20793
+ var short = (digest2) => HEX_DIGEST2.test(digest2) ? digest2.length > 12 ? `${digest2.slice(0, 12)}\u2026` : digest2 : quoted(digest2);
20533
20794
  function judgedByMock(tally2) {
20534
20795
  return tally2.pins.some(
20535
20796
  (pin) => pin.model !== void 0 && /\bmock\b/i.test(pin.model)
@@ -20681,7 +20942,7 @@ ${key}`);
20681
20942
  const all = witnessEntries(checkpoint);
20682
20943
  const status2 = witnessStatus(bundle, verified);
20683
20944
  if (status2 === "invalid" && aac !== void 0) {
20684
- const failed2 = aac.receipts.filter((r) => r.status === "fail").map(
20945
+ const failed3 = aac.receipts.filter((r) => r.status === "fail").map(
20685
20946
  (r) => w.t("prov.witness.failed-entry", {
20686
20947
  witness: quoted(r.tsUrl),
20687
20948
  reason: quoted(r.reason)
@@ -20692,7 +20953,7 @@ ${key}`);
20692
20953
  ).length;
20693
20954
  const parts = [
20694
20955
  w.t("prov.witness.invalid"),
20695
- ...failed2.length === 0 ? [] : [w.t("prov.witness.failed", { witnesses: failed2.join("; ") })],
20956
+ ...failed3.length === 0 ? [] : [w.t("prov.witness.failed", { witnesses: failed3.join("; ") })],
20696
20957
  ...unreadable === 0 ? [] : [
20697
20958
  w.p("prov.witness.invalid.unreadable", unreadable, {
20698
20959
  n: fmt2(unreadable)
@@ -20700,7 +20961,7 @@ ${key}`);
20700
20961
  ],
20701
20962
  // AAC fails only on a failed receipt or an unreadable entry; should
20702
20963
  // it fail on anything else, its findings are named as it states them.
20703
- ...failed2.length === 0 && unreadable === 0 && aac.findings.length > 0 ? [
20964
+ ...failed3.length === 0 && unreadable === 0 && aac.findings.length > 0 ? [
20704
20965
  w.t("prov.witness.invalid.findings", {
20705
20966
  findings: aac.findings.map(quoted).join("; ")
20706
20967
  })
@@ -21078,8 +21339,8 @@ ${key}`);
21078
21339
  async function checkContractInput(contract) {
21079
21340
  if (!/^[0-9a-f]{64}$/u.test(contract.sha256))
21080
21341
  throw new ContractError("contract sha256 is not a lowercase hex SHA-256");
21081
- const digest = await sha256Hex(new TextEncoder().encode(contract.text));
21082
- if (digest !== contract.sha256)
21342
+ const digest2 = await sha256Hex(new TextEncoder().encode(contract.text));
21343
+ if (digest2 !== contract.sha256)
21083
21344
  throw new ContractError(
21084
21345
  "contract bytes do not hash to its contract_sha256"
21085
21346
  );
@@ -21342,13 +21603,13 @@ ${key}`);
21342
21603
  return Number.isInteger(n) && n >= 0 && n <= 12 ? w.t(`lines.count.${n}`) : String(n);
21343
21604
  }
21344
21605
  function unverifiedClause(model, list2, w, lower = false) {
21345
- const failed2 = list2.filter((c) => c.verdict === "failed");
21606
+ const failed3 = list2.filter((c) => c.verdict === "failed");
21346
21607
  const unsupported = list2.filter((c) => c.verdict === "unsupported");
21347
21608
  const parts = [];
21348
- if (failed2.length > 0)
21609
+ if (failed3.length > 0)
21349
21610
  parts.push(
21350
21611
  w.t("lines.sentence.unverified.failed", {
21351
- names: names(model, failed2, w)
21612
+ names: names(model, failed3, w)
21352
21613
  })
21353
21614
  );
21354
21615
  if (unsupported.length > 0)
@@ -21939,6 +22200,21 @@ ${key}`);
21939
22200
  );
21940
22201
  return parts.join(" ");
21941
22202
  }
22203
+ function reportTitle(model, w) {
22204
+ const title = w.section3("report.title") ?? w.t("lines.title");
22205
+ if (w.section3("report.title") !== void 0) return title;
22206
+ const first = model.days[0]?.date;
22207
+ const last = model.days[model.days.length - 1]?.date;
22208
+ if (first === void 0 || last === void 0) return title;
22209
+ const month = /^(\d{4})-(\d{2})-\d{2}/.exec(first);
22210
+ if (month === null || last.slice(0, 7) !== first.slice(0, 7)) return title;
22211
+ const n = Number(month[2]);
22212
+ if (n < 1 || n > 12) return title;
22213
+ return w.t("lines.title.month", {
22214
+ month: w.t(`calendar.month.${n}`),
22215
+ year: month[1]
22216
+ });
22217
+ }
21942
22218
  function renderMeta(host, model, w, notes) {
21943
22219
  const section = el8("section", "");
21944
22220
  section.dataset.section = "meta";
@@ -21948,7 +22224,7 @@ ${key}`);
21948
22224
  bill.append(el8("div", "v", packLine(model, w)));
21949
22225
  row1.append(bill);
21950
22226
  const title = el8("div", "ih-title");
21951
- title.append(el8("h1", "inv-title", w.t("lines.title")));
22227
+ title.append(el8("h1", "inv-title", reportTitle(model, w)));
21952
22228
  const summary = reportSummary(w);
21953
22229
  if (summary !== void 0) title.append(summary);
21954
22230
  if (model.terms.pack.locked !== NOT_STATED)
@@ -22155,6 +22431,15 @@ ${key}`);
22155
22431
  section.dataset.section = "rules";
22156
22432
  section.append(el8("h2", "", w.t("lines.rules.h")));
22157
22433
  section.append(el8("p", "lede", w.t("lines.rules.lede")));
22434
+ const ofNote = el8(
22435
+ "p",
22436
+ "lede",
22437
+ w.p("lines.rules.of.note", model.totalCount, {
22438
+ total: fmtCount(model.totalCount)
22439
+ })
22440
+ );
22441
+ ofNote.dataset.note = "rule-counts";
22442
+ section.append(ofNote);
22158
22443
  const table3 = el8("table", "rules");
22159
22444
  table3.dataset.rows = "rules";
22160
22445
  const thead = element3("thead");
@@ -22246,7 +22531,14 @@ ${key}`);
22246
22531
  const pick = picks[column];
22247
22532
  const cell4 = el8("td", className);
22248
22533
  cell4.dataset.column = column;
22249
- cell4.append(el8("span", "nv", fmtCount(counted2.length)));
22534
+ cell4.append(
22535
+ el8("span", "nv", fmtCount(counted2.length)),
22536
+ el8(
22537
+ "span",
22538
+ "nof",
22539
+ ` ${w.t("lines.rules.of", { total: fmtCount(model.totalCount) })}`
22540
+ )
22541
+ );
22250
22542
  const action = evidenceAction(
22251
22543
  `rule:${ref}:${column}`,
22252
22544
  `${label.label} \xB7 ${columnWord[column]}: ${fmtCount(counted2.length)}`,
@@ -22274,6 +22566,35 @@ ${key}`);
22274
22566
  tr.dataset.requirementTier = tier;
22275
22567
  nameCell.append(tierChip(tier, w));
22276
22568
  }
22569
+ const how = model.criterionTiers.get(ref);
22570
+ if (how === "judged" || how === "recomputed") {
22571
+ const chip = el8("span", "rtier", w.t(`lines.rules.kind.${how}`));
22572
+ chip.dataset.kind = how;
22573
+ nameCell.append(" ", chip);
22574
+ }
22575
+ if (na.length > 0) {
22576
+ const gap = el8(
22577
+ "small",
22578
+ "rdet",
22579
+ w.t("lines.rules.not_applied", { k: fmtCount(na.length) })
22580
+ );
22581
+ gap.dataset.note = "not-applied";
22582
+ nameCell.append(gap);
22583
+ }
22584
+ const laterHere = model.conversations.filter(
22585
+ (c) => c.notYetInForce.some(
22586
+ (cr) => cr.checkId === check.id && cr.criterionId === criterion2.id
22587
+ )
22588
+ );
22589
+ if (laterHere.length > 0) {
22590
+ const later = el8(
22591
+ "small",
22592
+ "rdet",
22593
+ w.t("lines.rules.not_in_force", { k: fmtCount(laterHere.length) })
22594
+ );
22595
+ later.dataset.note = "not-in-force";
22596
+ nameCell.append(later);
22597
+ }
22277
22598
  if (label.source === "sealed")
22278
22599
  nameCell.append(el8("small", "", label.text));
22279
22600
  const detail = w.row(ref, "detail");
@@ -22762,7 +23083,8 @@ ${key}`);
22762
23083
  function subjectConversations(model, w) {
22763
23084
  return model.conversations.map((c) => {
22764
23085
  const status2 = conversationStatus(c, model.gating);
22765
- const outcome = statusWord(status2, c, w, model.gating);
23086
+ const keptOut = status2 === "nothing-applied" && model.gating?.counted.has(c) === true;
23087
+ const outcome = keptOut ? { word: w.t("lines.subject.outcome.none-counted"), tone: "na" } : statusWord(status2, c, w, model.gating);
22766
23088
  const time = /T(\d{2}:\d{2})/u.exec(c.dated.stated ?? "")?.[1];
22767
23089
  const turns = c.transcript.state === "verified" || c.transcript.state === "cited" ? c.transcript.turns : void 0;
22768
23090
  return {
@@ -22770,6 +23092,7 @@ ${key}`);
22770
23092
  date: c.day,
22771
23093
  ...time === void 0 ? {} : { time },
22772
23094
  status: status2,
23095
+ ...keptOut ? { keptOut: true } : {},
22773
23096
  outcome,
22774
23097
  terms: c.criteria.map((cr) => ({
22775
23098
  ref: `${cr.checkId}.${cr.criterionId}`,
@@ -22823,6 +23146,14 @@ ${key}`);
22823
23146
  );
22824
23147
  note("readonly", w.t("lines.fn.readonly"));
22825
23148
  }
23149
+ function statesTiers(model) {
23150
+ return model.conversations.some(
23151
+ (c) => c.criteria.some((cr) => {
23152
+ const tier = criterionTier(cr, model.gating);
23153
+ return tier === "must_have" || tier === "informational";
23154
+ })
23155
+ );
23156
+ }
22826
23157
  async function drawLines(levels, result3, options, bundle, verified, w, tierOf) {
22827
23158
  const built = buildOutcomeReportModel(result3, options);
22828
23159
  const model = tierOf === void 0 ? built : { ...built, gating: gating(built.conversations, tierOf) };
@@ -22847,7 +23178,8 @@ ${key}`);
22847
23178
  subjectConversations(model, w),
22848
23179
  slice2,
22849
23180
  model.totalCount,
22850
- w
23181
+ w,
23182
+ statesTiers(model)
22851
23183
  );
22852
23184
  if (subject !== void 0) levels.L0.append(subject);
22853
23185
  }
@@ -23382,6 +23714,29 @@ ${key}`);
23382
23714
  section.append(notes);
23383
23715
  host.append(section);
23384
23716
  }
23717
+ function renderCanvasNotes2(host, model, bundle, w, tiered) {
23718
+ const notes = el9("aside", "footnotes");
23719
+ notes.dataset.section = "canvas-notes";
23720
+ const note = (key, text2) => {
23721
+ const p = el9("p", "", text2);
23722
+ p.dataset.footnote = key;
23723
+ notes.append(p);
23724
+ };
23725
+ const records = bundle?.records;
23726
+ if (Array.isArray(records))
23727
+ note(
23728
+ "records",
23729
+ w.p("groups.fn.records", model.totalSessions, {
23730
+ records: records.length.toLocaleString()
23731
+ })
23732
+ );
23733
+ note(
23734
+ "resolved",
23735
+ w.t(tiered ? "groups.fn.resolved.tiered" : "groups.fn.resolved")
23736
+ );
23737
+ note("readonly", w.t("groups.fn.readonly"));
23738
+ host.append(notes);
23739
+ }
23385
23740
  function renderFindings(host, model, w) {
23386
23741
  if (model.findings.length === 0) return;
23387
23742
  const section = el9("section", "findings");
@@ -23831,6 +24186,7 @@ ${key}`);
23831
24186
  )
23832
24187
  );
23833
24188
  renderFindings(levels.L1, model, w);
24189
+ renderCanvasNotes2(levels.L1, model, bundle, w, tierOf !== void 0);
23834
24190
  levels.L2.append(renderCheckYourself(bundle, w));
23835
24191
  renderReportProofs2(levels.L2, model, bundle, verified, w);
23836
24192
  }
@@ -24138,6 +24494,33 @@ ${key}`);
24138
24494
  const single = citesOneContract(result3) ? result3.claims[0]?.contractRef : void 0;
24139
24495
  return (contractRef, requirementRef) => rowTier(contract, contractRef ?? single ?? "", requirementRef);
24140
24496
  }
24497
+ var fmtCount2 = (n) => n.toLocaleString("en-US");
24498
+ function mustHaveTotals(result3, tierOf) {
24499
+ if (tierOf === void 0) return void 0;
24500
+ const { met, notMet, notEvaluable, outOfScope } = result3.buckets;
24501
+ const byId = new Map(result3.claims.map((claim) => [claim.id, claim]));
24502
+ const listed = [met, notMet, notEvaluable, outOfScope ?? []].flatMap(
24503
+ (ids) => ids.flatMap((id) => {
24504
+ const claim = byId.get(id);
24505
+ return claim === void 0 || claim.type === "calibration" ? [] : [{ claim, tier: tierOf(claim.contractRef, claim.requirementRef) }];
24506
+ })
24507
+ );
24508
+ const inList = (ids, tier) => ids.filter((id) => {
24509
+ const claim = byId.get(id);
24510
+ return claim !== void 0 && claim.type !== "calibration" && tierOf(claim.contractRef, claim.requirementRef) === tier;
24511
+ }).length;
24512
+ const ofTier = (tier) => listed.filter((e) => e.tier === tier);
24513
+ return {
24514
+ met: inList(met, "must_have"),
24515
+ notMet: inList(notMet, "must_have"),
24516
+ notEvaluable: inList(notEvaluable, "must_have"),
24517
+ outOfScope: outOfScope === void 0 ? void 0 : inList(outOfScope, "must_have"),
24518
+ evaluations: ofTier("must_have").length,
24519
+ informational: ofTier("informational").length,
24520
+ unstated: ofTier("unstated").length,
24521
+ failed: ofTier("must_have").filter((e) => e.claim.failed).length
24522
+ };
24523
+ }
24141
24524
  function citesOneContract(result3) {
24142
24525
  return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
24143
24526
  }
@@ -24166,6 +24549,38 @@ ${key}`);
24166
24549
  levels.L0.append(style);
24167
24550
  const refused = refusedWordingNotice(w);
24168
24551
  if (refused !== void 0) levels.L0.append(refused);
24552
+ const totals = mustHaveTotals(result3, tierOf);
24553
+ if (contract !== void 0 && totals !== void 0) {
24554
+ const note = document.createElement("p");
24555
+ note.className = "tier-note";
24556
+ note.dataset.mustHaveTotals = String(totals.evaluations);
24557
+ note.textContent = w.t(`${input.grouping}.rtier.totals`, {
24558
+ contract: contract.ref,
24559
+ digest: contract.sha256,
24560
+ met: fmtCount2(totals.met),
24561
+ not_met: fmtCount2(totals.notMet),
24562
+ undecided: fmtCount2(totals.notEvaluable),
24563
+ out_of_scope: totals.outOfScope === void 0 ? "" : w.t(`${input.grouping}.rtier.totals.out-of-scope`, {
24564
+ n: fmtCount2(totals.outOfScope)
24565
+ }),
24566
+ n: fmtCount2(totals.evaluations),
24567
+ informational: fmtCount2(totals.informational),
24568
+ unstated: totals.unstated === 0 ? "" : w.t(`${input.grouping}.rtier.totals.unstated`, {
24569
+ n: fmtCount2(totals.unstated)
24570
+ }),
24571
+ failed: totals.failed === 0 ? "" : w.t(`${input.grouping}.rtier.totals.failed`, {
24572
+ n: fmtCount2(totals.failed)
24573
+ })
24574
+ });
24575
+ note.style.overflowWrap = "anywhere";
24576
+ levels.L0.append(note);
24577
+ } else if (tierOf === void 0 && result3.claims.length > 0) {
24578
+ const note = document.createElement("p");
24579
+ note.className = "tier-note";
24580
+ note.dataset.sealedCounts = "all-terms";
24581
+ note.textContent = w.t(`${input.grouping}.rtier.all-terms`);
24582
+ levels.L0.append(note);
24583
+ }
24169
24584
  if (tierOf !== void 0 && result3.claims.some(
24170
24585
  (claim) => tierOf(claim.contractRef, claim.requirementRef) === "informational"
24171
24586
  )) {
@@ -24351,10 +24766,10 @@ ${key}`);
24351
24766
  )
24352
24767
  );
24353
24768
  section.append(element5("h3", "Composed digest"));
24354
- const digest = element5("dl");
24355
- digest.dataset.composedDigest = result3.composedDigest.declared;
24356
- digest.dataset.matches = String(result3.composedDigest.matches);
24357
- digest.append(
24769
+ const digest2 = element5("dl");
24770
+ digest2.dataset.composedDigest = result3.composedDigest.declared;
24771
+ digest2.dataset.matches = String(result3.composedDigest.matches);
24772
+ digest2.append(
24358
24773
  element5("dt", "declared"),
24359
24774
  element5("dd", result3.composedDigest.declared),
24360
24775
  element5("dt", "recomputed"),
@@ -24362,7 +24777,7 @@ ${key}`);
24362
24777
  element5("dt", "matches"),
24363
24778
  element5("dd", result3.composedDigest.matches ? "yes" : "no")
24364
24779
  );
24365
- section.append(digest);
24780
+ section.append(digest2);
24366
24781
  section.append(element5("h3", "Members"));
24367
24782
  section.append(
24368
24783
  table2(
@@ -25219,7 +25634,7 @@ ${key}`);
25219
25634
  }
25220
25635
  return out;
25221
25636
  }
25222
- var shortDigest = (digest) => digest.length > 12 ? `${digest.slice(0, 4)}\u2026${digest.slice(-4)}` : digest;
25637
+ var shortDigest = (digest2) => digest2.length > 12 ? `${digest2.slice(0, 4)}\u2026${digest2.slice(-4)}` : digest2;
25223
25638
  function renderCoreIdentity(model) {
25224
25639
  const { result: result3, words: w } = model;
25225
25640
  const refs = [
@@ -25973,25 +26388,25 @@ ${pad.repeat(depth)}`;
25973
26388
  }
25974
26389
  function checkedSummaryLine(verified, model) {
25975
26390
  const total = model.checks.length;
25976
- const failed2 = model.checks.filter((c) => c.status === "fail").length;
26391
+ const failed3 = model.checks.filter((c) => c.status === "fail").length;
25977
26392
  const passed = model.checks.filter((c) => c.status === "pass").length;
25978
- const notRun = total - failed2 - passed;
26393
+ const notRun = total - failed3 - passed;
25979
26394
  const pageFailed = model.checkLists.failed.filter(
25980
26395
  (id) => !NUMBERED_CHECK_GROUND.has(id)
25981
26396
  ).length;
25982
26397
  const notRunNote = notRun > 0 ? `, ${notRun} not run` : "";
25983
26398
  const leads = [];
25984
- if (failed2 > 0)
25985
- leads.push(`${failed2} of ${total} checks failed${notRunNote}`);
26399
+ if (failed3 > 0)
26400
+ leads.push(`${failed3} of ${total} checks failed${notRunNote}`);
25986
26401
  if (pageFailed > 0)
25987
26402
  leads.push(
25988
26403
  `${pageFailed} ${pageFailed === 1 ? "check" : "checks"} on this page failed`
25989
26404
  );
25990
- if (failed2 === 0 && pageFailed === 0)
26405
+ if (failed3 === 0 && pageFailed === 0)
25991
26406
  leads.push(
25992
26407
  verified ? `${passed} of ${total} checks passed${notRunNote}` : SUMMARY_NOT_VERIFIED
25993
26408
  );
25994
- if (failed2 === 0 && (pageFailed > 0 || !verified) && notRun > 0)
26409
+ if (failed3 === 0 && (pageFailed > 0 || !verified) && notRun > 0)
25995
26410
  leads.push(`${notRun} of ${total} checks not run`);
25996
26411
  const parts = [...leads, topLevelRecordsWord(model.records.length)];
25997
26412
  const signatures2 = model.checkLists.notChecked.flatMap((id) => {
@@ -26116,6 +26531,38 @@ ${pad.repeat(depth)}`;
26116
26531
  });
26117
26532
  host.append(list2);
26118
26533
  }
26534
+ function parentWitnessLine(parent2) {
26535
+ const lead = "witnessed through a parent log: ";
26536
+ if (parent2.whole)
26537
+ return parent2.of === 1 ? `${lead}its only entry` : `${lead}all ${parent2.of} entries`;
26538
+ const covered = parent2.entries === 1 ? "entry 1" : `entries 1\u2013${parent2.entries}`;
26539
+ const first = parent2.entries + 1;
26540
+ const rest = first === parent2.of ? `entry ${parent2.of} is` : `entries ${first}\u2013${parent2.of} are`;
26541
+ return `${lead}${covered} of ${parent2.of}; ${rest} not covered by this witness`;
26542
+ }
26543
+ function parentWitnessTime(seconds) {
26544
+ if (seconds === null) return "time not stated";
26545
+ const date = new Date(seconds * 1e3);
26546
+ if (Number.isNaN(date.getTime()))
26547
+ return `time not a valid date (signed as ${seconds} seconds since 1970)`;
26548
+ return `recorded ${date.toISOString().replace("T", " ").replace(/\.\d+Z$/u, "")} UTC`;
26549
+ }
26550
+ function renderParentWitness(host, parent2) {
26551
+ const line = element6("p", parentWitnessLine(parent2));
26552
+ line.dataset.witness = "parent";
26553
+ line.dataset.whole = String(parent2.whole);
26554
+ host.append(line);
26555
+ const list2 = element6("ul");
26556
+ parent2.receipts.forEach(
26557
+ (receipt) => list2.append(
26558
+ element6(
26559
+ "li",
26560
+ `${receipt.witness} \xB7 ${parentWitnessTime(receipt.registrationTime)}`
26561
+ )
26562
+ )
26563
+ );
26564
+ host.append(list2);
26565
+ }
26119
26566
  var COVERAGE_LABEL = Object.freeze({
26120
26567
  checkpointed: "checkpointed",
26121
26568
  uncheckpointed: "uncheckpointed",
@@ -26467,6 +26914,8 @@ ${pad.repeat(depth)}`;
26467
26914
  );
26468
26915
  page.append(summary);
26469
26916
  renderReceipts(page, model.receipts);
26917
+ if (model.parentWitness !== void 0)
26918
+ renderParentWitness(page, model.parentWitness);
26470
26919
  if (model.selfWitnessed) {
26471
26920
  const witness = element6(
26472
26921
  "p",
@@ -27904,8 +28353,8 @@ ${pad.repeat(depth)}`;
27904
28353
  words
27905
28354
  );
27906
28355
  } else
27907
- for (const digest of chartDigests)
27908
- digest.refused = "the bundle did not verify";
28356
+ for (const digest2 of chartDigests)
28357
+ digest2.refused = "the bundle did not verify";
27909
28358
  const depth = options.depth ?? "L0";
27910
28359
  const region = (name) => {
27911
28360
  const node = document.createElement("div");
@@ -28214,8 +28663,8 @@ ${pad.repeat(depth)}`;
28214
28663
  for (const action of root.querySelectorAll(
28215
28664
  "details.cv-ev[data-cites]"
28216
28665
  ))
28217
- for (const digest of (action.dataset.cites ?? "").split(" ")) {
28218
- const entry = anchors.get(recordAddress(digest))?.closest("details.cv-record");
28666
+ for (const digest2 of (action.dataset.cites ?? "").split(" ")) {
28667
+ const entry = anchors.get(recordAddress(digest2))?.closest("details.cv-record");
28219
28668
  if (entry === void 0 || entry === null) continue;
28220
28669
  const list2 = citing.get(entry) ?? [];
28221
28670
  if (!list2.includes(action)) list2.push(action);
@@ -28317,12 +28766,12 @@ ${pad.repeat(depth)}`;
28317
28766
  let same3 = "not_carried";
28318
28767
  if (checkpoint !== null) {
28319
28768
  try {
28320
- const digest = await globalThis.crypto.subtle.digest(
28769
+ const digest2 = await globalThis.crypto.subtle.digest(
28321
28770
  "SHA-256",
28322
28771
  fromHex2(checkpoint)
28323
28772
  );
28324
28773
  same3 = Array.from(
28325
- new Uint8Array(digest),
28774
+ new Uint8Array(digest2),
28326
28775
  (b) => b.toString(16).padStart(2, "0")
28327
28776
  ).join("") === anchor ? "match" : "mismatch";
28328
28777
  } catch {
@@ -28363,14 +28812,14 @@ ${pad.repeat(depth)}`;
28363
28812
  const octets = new Uint8Array(new ArrayBuffer(32));
28364
28813
  for (let i = 0; i < 32; i += 1)
28365
28814
  octets[i] = Number.parseInt(preimage.slice(2 * i, 2 * i + 2), 16);
28366
- let digest;
28815
+ let digest2;
28367
28816
  try {
28368
- digest = await globalThis.crypto.subtle.digest("SHA-256", octets);
28817
+ digest2 = await globalThis.crypto.subtle.digest("SHA-256", octets);
28369
28818
  } catch {
28370
28819
  return "NOT_CHECKED";
28371
28820
  }
28372
28821
  const hex6 = Array.from(
28373
- new Uint8Array(digest),
28822
+ new Uint8Array(digest2),
28374
28823
  (b) => b.toString(16).padStart(2, "0")
28375
28824
  ).join("");
28376
28825
  return hex6 === hash2.toLowerCase() ? "PASS" : "FAIL";
@@ -28410,7 +28859,7 @@ ${pad.repeat(depth)}`;
28410
28859
  return void 0;
28411
28860
  }
28412
28861
  };
28413
- var uint = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
28862
+ var uint2 = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
28414
28863
  var sha2564 = async (...parts) => {
28415
28864
  const joined = new Uint8Array(
28416
28865
  new ArrayBuffer(parts.reduce((n, p) => n + p.length, 0))
@@ -28436,7 +28885,7 @@ ${pad.repeat(depth)}`;
28436
28885
  };
28437
28886
  var included = async (root, size, leafIndex, identity2, raw) => {
28438
28887
  if (!object15(raw) || raw.v !== 1 || raw.kind !== "inclusion") return false;
28439
- const proofSize = uint(raw.size), proofIndex = uint(raw.leaf_index), witness = hashList(raw.witness), left = hashList(raw.peaks_left), right = hashList(raw.peaks_right);
28888
+ const proofSize = uint2(raw.size), proofIndex = uint2(raw.leaf_index), witness = hashList(raw.witness), left = hashList(raw.peaks_left), right = hashList(raw.peaks_right);
28440
28889
  if (proofSize === void 0 || BigInt(proofSize) !== size || proofIndex !== leafIndex || !witness || !left || !right)
28441
28890
  return false;
28442
28891
  const flattened = [...witness];
@@ -28446,7 +28895,7 @@ ${pad.repeat(depth)}`;
28446
28895
  };
28447
28896
  var consistent = async (oldRoot, oldSize, newRoot, newSize, raw) => {
28448
28897
  if (!object15(raw) || raw.v !== 1 || raw.kind !== "consistency") return false;
28449
- const from = uint(raw.old_size), to = uint(raw.new_size), oldPeaks = hashList(raw.old_peaks), newPeaks = hashList(raw.new_peaks), steps = Array.isArray(raw.witness) ? raw.witness.map(hashList) : void 0, a = fromHex3(oldRoot), b = fromHex3(newRoot);
28898
+ const from = uint2(raw.old_size), to = uint2(raw.new_size), oldPeaks = hashList(raw.old_peaks), newPeaks = hashList(raw.new_peaks), steps = Array.isArray(raw.witness) ? raw.witness.map(hashList) : void 0, a = fromHex3(oldRoot), b = fromHex3(newRoot);
28450
28899
  if (from === void 0 || to === void 0 || BigInt(from) !== oldSize || BigInt(to) !== newSize || !oldPeaks || !newPeaks || !steps || steps.some((s) => s === void 0) || !a || !b)
28451
28900
  return false;
28452
28901
  return verifyConsistency2(a, b, {
@@ -28504,7 +28953,7 @@ ${pad.repeat(depth)}`;
28504
28953
  if (logId === "" && typeof chain.deal_log_id === "string")
28505
28954
  logId = chain.deal_log_id;
28506
28955
  const salt = typeof chain.salt === "string" ? chain.salt : "";
28507
- const size = uint(chain.size), index = uint(chain.index);
28956
+ const size = uint2(chain.size), index = uint2(chain.index);
28508
28957
  if (logId !== deal.logId || size === void 0 || BigInt(size) !== deal.size)
28509
28958
  return fail2("cadence_leaf_does_not_name_this_checkpoint");
28510
28959
  if (index === void 0 || index >= 2 ** CADENCE_DEPTH || salt === "")
@@ -28529,7 +28978,7 @@ ${pad.repeat(depth)}`;
28529
28978
  if (cadence.keyId !== deal.keyId)
28530
28979
  return fail2("cadence_checkpoint_signer_differs");
28531
28980
  if (inner.log_id !== cadence.logId) return fail2("cadence_log_id_mismatch");
28532
- const entry = uint(inner.entry_index);
28981
+ const entry = uint2(inner.entry_index);
28533
28982
  const cadenceRootBytes = fromHex3(cadence.root);
28534
28983
  if (entry === void 0 || !cadenceRootBytes || !await included(
28535
28984
  cadenceRootBytes,
@@ -28570,7 +29019,7 @@ ${pad.repeat(depth)}`;
28570
29019
  ({ name, keys: keys2 }) => keys2.map((key) => ({ name, key: fromHex3(key) }))
28571
29020
  );
28572
29021
  if (keys.length === 0) return result("NOT_CHECKED", "no_reader_witness");
28573
- let failed2 = false;
29022
+ let failed3 = false;
28574
29023
  let chosen;
28575
29024
  for (const entry of entries) {
28576
29025
  if (entry.is_stub === true) continue;
@@ -28585,7 +29034,7 @@ ${pad.repeat(depth)}`;
28585
29034
  if (outcome.notChecked) unavailable = true;
28586
29035
  }
28587
29036
  if (passed === void 0) {
28588
- if (!unavailable) failed2 = true;
29037
+ if (!unavailable) failed3 = true;
28589
29038
  continue;
28590
29039
  }
28591
29040
  if (chosen === void 0 || passed.time !== null && (chosen.time === null || passed.time < chosen.time))
@@ -28593,7 +29042,7 @@ ${pad.repeat(depth)}`;
28593
29042
  }
28594
29043
  if (chosen !== void 0)
28595
29044
  return result("PASS", null, chosen.name, chosen.time);
28596
- if (failed2) return result("FAIL", "receipt_not_verified");
29045
+ if (failed3) return result("FAIL", "receipt_not_verified");
28597
29046
  return result("NOT_CHECKED", "receipt_not_checked");
28598
29047
  }
28599
29048
  async function readerCadenceWitness(context) {
@@ -29435,7 +29884,7 @@ ${pad.repeat(depth)}`;
29435
29884
  const failedRow = rows.some(
29436
29885
  (x) => x.kind === "checkpoint" && x.signature === "fail"
29437
29886
  );
29438
- const failed2 = failedCheck || failedRow;
29887
+ const failed3 = failedCheck || failedRow;
29439
29888
  const allPass = rows.length > 0 && rows.every((x) => x.kind !== "checkpoint" || x.signature === "pass") && checks.filter((c) => !SLOT_CHECKS.has(c.id) && c.status !== "not_run").every((c) => c.status === "pass") && (kind === "deal" || checks.some(
29440
29889
  (c) => c.id === "checkpoint_signatures" && c.status === "pass"
29441
29890
  ));
@@ -29489,7 +29938,7 @@ ${pad.repeat(depth)}`;
29489
29938
  if (refusedReason !== void 0)
29490
29939
  heroLines.push(say("hero.refused.reason", { reason: refusedReason }));
29491
29940
  } else if (outcome === "unreadable") heroLines.push(say("hero.unreadable"));
29492
- else if (failed2) heroLines.push(say("hero.failed"));
29941
+ else if (failed3) heroLines.push(say("hero.failed"));
29493
29942
  else if (rows.length === 0)
29494
29943
  heroLines.push(
29495
29944
  say(kind === "checkpoint" ? "hero.none.checkpoints" : "hero.none.deals")
@@ -29692,7 +30141,7 @@ ${pad.repeat(depth)}`;
29692
30141
  )
29693
30142
  )
29694
30143
  ) : null;
29695
- const callout = outcome === "answered" && !failed2 ? el13(
30144
+ const callout = outcome === "answered" && !failed3 ? el13(
29696
30145
  "aside",
29697
30146
  { class: "cvh-callout", "data-history": "does-not-show" },
29698
30147
  el13("h2", null, say("callout.heading")),
@@ -29824,7 +30273,7 @@ ${pad.repeat(depth)}`;
29824
30273
  class: "cvh-checked",
29825
30274
  "data-history": "checked"
29826
30275
  };
29827
- if (failed2 || outcome !== "answered") checkedAttrs["open"] = "";
30276
+ if (failed3 || outcome !== "answered") checkedAttrs["open"] = "";
29828
30277
  const panel = el13(
29829
30278
  "details",
29830
30279
  checkedAttrs,
@@ -29860,7 +30309,7 @@ ${pad.repeat(depth)}`;
29860
30309
  "data-history": "view",
29861
30310
  "data-kind": kind,
29862
30311
  "data-surface": surface,
29863
- "data-verdict": failed2 ? "failed" : allPass ? "pass" : "unchecked"
30312
+ "data-verdict": failed3 ? "failed" : allPass ? "pass" : "unchecked"
29864
30313
  },
29865
30314
  header,
29866
30315
  el13("div", { class: "cvh-main" }, hero, chips, rowList, periodBlock),