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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/backfill-timeline.d.ts +66 -0
  2. package/dist/backfill-timeline.js +401 -0
  3. package/dist/backfill-timeline.js.map +1 -0
  4. package/dist/chart-dataset.d.ts +35 -0
  5. package/dist/chart-dataset.js +16 -1
  6. package/dist/chart-dataset.js.map +1 -1
  7. package/dist/compliance-view.js +65 -14
  8. package/dist/compliance-view.js.map +1 -1
  9. package/dist/contract-report-wording.d.ts +3 -1
  10. package/dist/contract-report-wording.js +43 -10
  11. package/dist/contract-report-wording.js.map +1 -1
  12. package/dist/contract-report.d.ts +23 -1
  13. package/dist/contract-report.js +83 -3
  14. package/dist/contract-report.js.map +1 -1
  15. package/dist/core-strip.d.ts +19 -3
  16. package/dist/core-strip.js +76 -11
  17. package/dist/core-strip.js.map +1 -1
  18. package/dist/evidence-graph-view.d.ts +3 -0
  19. package/dist/evidence-graph-view.js +46 -2
  20. package/dist/evidence-graph-view.js.map +1 -1
  21. package/dist/evidence-graph.iife.js +1037 -448
  22. package/dist/history-view.d.ts +2 -2
  23. package/dist/history-view.iife.js +1 -0
  24. package/dist/history-view.iife.js.sha256 +1 -1
  25. package/dist/history-view.js +2 -1
  26. package/dist/history-view.js.map +1 -1
  27. package/dist/index.d.ts +4 -0
  28. package/dist/index.js +4 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/outcome-report-view.js +134 -6
  31. package/dist/outcome-report-view.js.map +1 -1
  32. package/dist/report-front.d.ts +2 -1
  33. package/dist/report-front.js.map +1 -1
  34. package/dist/studio-card.d.ts +79 -0
  35. package/dist/studio-card.js +383 -0
  36. package/dist/studio-card.js.map +1 -0
  37. package/dist/studio-pack.d.ts +10 -0
  38. package/dist/studio-pack.js +27 -0
  39. package/dist/studio-pack.js.map +1 -0
  40. package/dist/studio-view.d.ts +56 -0
  41. package/dist/studio-view.js +431 -0
  42. package/dist/studio-view.js.map +1 -0
  43. package/dist/subject-history.d.ts +10 -1
  44. package/dist/subject-history.js +19 -7
  45. package/dist/subject-history.js.map +1 -1
  46. package/dist/viewer-build.js +2 -2
  47. package/dist/wording/backfill-timeline.en.json +52 -0
  48. package/dist/wording/contract-report-eu-ai-act.en.json +38 -27
  49. package/dist/wording/contract-report-generic.en.json +8 -4
  50. package/dist/wording/contract-report-outcomes.en.json +25 -5
  51. package/dist/wording/studio-card.en.json +66 -0
  52. package/dist/wording/studio-view.en.json +39 -0
  53. package/package.json +2 -2
@@ -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("d2469c3f76ce0f01190ccde5328be1580f0005c3");
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.19.0",
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",
@@ -18003,6 +18221,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18003
18221
  "card.wording.refused.fit": "it does not fit this card's words",
18004
18222
  "front.mock": "Verdicts are from a mock judge and are placeholders.",
18005
18223
  "front.agg.evaluated": "{evaluations} of {requirements}",
18224
+ "front.agg.imported": "Imported: the records behind this result were all backfilled after the fact; none was recorded at the time.",
18006
18225
  "front.agg.evaluations.one": "{n} evaluation",
18007
18226
  "front.agg.evaluations.other": "{n} evaluations",
18008
18227
  "front.agg.requirements.one": "{n} requirement",
@@ -18014,10 +18233,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18014
18233
  "front.agg.later.one": "{n} evaluation not yet in force",
18015
18234
  "front.agg.later.other": "{n} evaluations not yet in force",
18016
18235
  "front.agg.mismatch": "count mismatch: the claims give {recomputed}",
18017
- "front.agg.as-of": "In force as of {date}.",
18018
- "front.agg.copied.both": "The dates and the out-of-scope switch are copied from the contract, not re-checked here.",
18019
- "front.agg.copied.dates": "The dates are copied from the contract, not re-checked here.",
18020
- "front.agg.copied.switch": "The out-of-scope switch is copied from the contract, not re-checked here.",
18236
+ "lines.later.readiness": "readiness only",
18237
+ "applicability.as_of": "In force as of {date}.",
18238
+ "applicability.not_yet_in_force.title": "Not yet in force",
18239
+ "applicability.not_yet_in_force.note": "Readiness only: these requirements apply from a later date, which the producer copied from the contract. They are in none of the met, not met or could not decide counts above, and a result here is never a violation.",
18240
+ "contract_fact.note": "Dates and the out-of-scope switch are the producer's copy of the contract, not re-checked by this page.",
18021
18241
  "prov.brief.judge.partial": "judge pinned for some results",
18022
18242
  "front.agg.excluded": "{excluded} excluded as not applicable",
18023
18243
  "front.agg.bucket.met": "Met",
@@ -18259,6 +18479,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18259
18479
  "lines.subject.tile.conversations": "conversations \xB7 {first} to {last} \xB7 of the report's {total}",
18260
18480
  "lines.subject.tile.resolved": "resolved \xB7 every term met",
18261
18481
  "lines.subject.tile.missed": "missed \xB7 one or more terms not met",
18482
+ "lines.subject.tile.resolved.tiered": "resolved \xB7 every must-have met",
18483
+ "lines.subject.tile.missed.tiered": "missed \xB7 one or more required terms not met",
18262
18484
  "lines.subject.tile.undecided": "could not decide",
18263
18485
  "lines.subject.headline": "One customer, {n} conversations",
18264
18486
  "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 +18513,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18291
18513
  "lines.subject.legend.undecided": "could not decide",
18292
18514
  "lines.subject.legend.order": "terms are in the contract's order",
18293
18515
  "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.",
18516
+ "lines.subject.gap.tiered": "Not drawn: when each term is met, and the adjudication. This bundle does not carry them.",
18294
18517
  "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."
18518
+ "lines.subject.note.nothing-applied": "{n} of {total} had no term that applied.",
18519
+ "lines.subject.note.none-counted": "{n} of {total} had no must-have term that applied; under this contract informational terms never change the answer.",
18520
+ "lines.subject.outcome.none-counted": "no must-have term applied"
18296
18521
  }
18297
18522
  };
18298
18523
 
@@ -18303,20 +18528,25 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18303
18528
  locale: "en",
18304
18529
  entries: {
18305
18530
  "layout.grouping": "groups",
18306
- "groups.rtier.must_have.title": "Must-have tests \xB7 {n}",
18531
+ "groups.rtier.must_have.title": "Must-have requirements \xB7 {n}",
18307
18532
  "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}",
18533
+ "groups.rtier.informational.title": "Informational requirements \xB7 {n}",
18534
+ "groups.rtier.informational.note": "Reported, never in the answer: a requirement not met here changes nothing above it.",
18535
+ "groups.rtier.unstated.title": "Requirements with no stated tier \xB7 {n}",
18311
18536
  "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.",
18537
+ "groups.rtier.sealed-note": "The sealed result counts informational requirements too; the lines this report derives leave them out.",
18538
+ "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}",
18539
+ "groups.rtier.totals.out-of-scope": " \xB7 {n} Out of scope",
18540
+ "groups.rtier.totals.unstated": " Evaluations this contract gives no tier, in neither count: {n}.",
18541
+ "groups.rtier.totals.failed": " Must-have evaluations that failed verification, still counted under their sealed verdict: {n}.",
18542
+ "groups.rtier.all-terms": "These totals count every requirement in force: no contract was given to separate the must-have ones.",
18313
18543
  "groups.producer.title": "The producer's mapping, not a sealed record",
18314
18544
  "groups.count.obligation.one": "{n} obligation",
18315
18545
  "groups.count.obligation.other": "{n} obligations",
18316
18546
  "groups.count.session.one": "{n} session",
18317
18547
  "groups.count.session.other": "{n} sessions",
18318
- "groups.count.test.one": "{n} test",
18319
- "groups.count.test.other": "{n} tests",
18548
+ "groups.count.test.one": "{n} requirement",
18549
+ "groups.count.test.other": "{n} requirements",
18320
18550
  "groups.count.exception.one": "{n} exception",
18321
18551
  "groups.count.exception.other": "{n} exceptions",
18322
18552
  "groups.count.result.one": "{n} result",
@@ -18333,12 +18563,12 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18333
18563
  "groups.sub": "{pack} \xB7 {obligations} \xB7 {sessions}",
18334
18564
  "groups.sub.judged": "{pack} \xB7 {obligations} \xB7 {sessions} \xB7 judged {period}",
18335
18565
  "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.",
18566
+ "groups.headline.one": "{met} of {n} session met every requirement that applied to it.",
18567
+ "groups.headline.other": "{met} of {n} sessions met every requirement that applied to them.",
18338
18568
  "groups.headline.missed": "{n} did not meet at least one.",
18339
18569
  "groups.headline.unverified": "{n} could not be verified.",
18340
18570
  "groups.headline.undecided": "{n} could not be decided.",
18341
- "groups.headline.nothing-applied": "{n} had no test that applied.",
18571
+ "groups.headline.nothing-applied": "{n} had no requirement that applied.",
18342
18572
  "groups.ob.worst.not_met": "worst: not met, {n} of {sessions} \xB7 derived",
18343
18573
  "groups.ob.worst.unverified": "worst: could not be verified, {n} of {sessions} \xB7 derived",
18344
18574
  "groups.ob.worst.undecided": "worst: could not be decided, {n} of {sessions} \xB7 derived",
@@ -18357,10 +18587,15 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18357
18587
  "groups.row.ok.all-decided": "No exceptions",
18358
18588
  "groups.row.ok": "No exceptions",
18359
18589
  "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",
18590
+ "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.",
18591
+ "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.`,
18592
+ "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.`,
18593
+ "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.",
18594
+ "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.",
18595
+ "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.",
18596
+ "groups.fn.resolved": "\xB2 A session is met when every requirement that applied to it was satisfied and at least one applied.",
18597
+ "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.",
18598
+ "groups.summary.col.test": "Obligation and requirement",
18364
18599
  "groups.summary.col.checked-in": "Checked in",
18365
18600
  "groups.summary.col.result": "Result",
18366
18601
  "groups.finding": "Finding {id}",
@@ -18368,23 +18603,23 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18368
18603
  "groups.session.unverified": "could not verify",
18369
18604
  "groups.session.undecided": "could not decide",
18370
18605
  "groups.session.ok": "no exceptions",
18371
- "groups.session.none": "no test applied",
18372
- "groups.h.test-by-test": "Test by test",
18606
+ "groups.session.none": "no requirement applied",
18607
+ "groups.h.test-by-test": "Requirement by requirement",
18373
18608
  "groups.unverified-note": "no verdict drawn: neither met nor an exception",
18374
18609
  "groups.pf.dated": "Dated",
18375
18610
  "groups.pf.session": "Session",
18376
18611
  "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",
18612
+ "groups.pf.h.each-report": "Each requirement's sealed report",
18613
+ "groups.pf.no-claim": "no claim: Result v0 carries none for a requirement that did not apply",
18379
18614
  "groups.pf.judge-pin": "judge pin {digest}",
18380
18615
  "groups.pf.rationale": "Rationale, as sealed: {rationale}",
18381
18616
  "groups.pf.absent": "absent",
18382
18617
  "groups.pin.differs": "disagrees across sessions",
18383
18618
  "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.",
18619
+ "groups.rp.toggle": "Proofs for this report: method, requirement wording, what ran, and how to verify the whole bundle",
18620
+ "groups.od.h": "Method and the wording of each requirement's check",
18621
+ "groups.od.mapped": "Title, article, summary, method, requirement names and the undecided-session note: the producer's mapping, in italics, not a sealed record.",
18622
+ "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
18623
  "groups.od.unmapped": "The producer's extension does not map this obligation: article, summary and method not stated.",
18389
18624
  "groups.od.judged-terms": "Judged terms: ",
18390
18625
  "groups.od.wording.sealed": "Wording run (sealed): {text}",
@@ -18394,7 +18629,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18394
18629
  "groups.q.none": "No quality protocol declared in this pack.",
18395
18630
  "groups.q.protocol": "Protocol ",
18396
18631
  "groups.q.unspecified": "unspecified",
18397
- "groups.q.tail": ". Recomputed tests are not sampled.",
18632
+ "groups.q.tail": ". Recomputed checks are not sampled.",
18398
18633
  "groups.ran.h": "What ran",
18399
18634
  "groups.ran.contract": "Contract",
18400
18635
  "groups.ran.contract.none": "no conversations",
@@ -18598,6 +18833,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18598
18833
  "card.wording.refused.fit": "it does not fit this card's words",
18599
18834
  "front.mock": "Verdicts are from a mock judge and are placeholders.",
18600
18835
  "front.agg.evaluated": "{evaluations} of {requirements}",
18836
+ "front.agg.imported": "Imported: the records behind this result were all backfilled after the fact; none was recorded at the time.",
18601
18837
  "front.agg.evaluations.one": "{n} evaluation",
18602
18838
  "front.agg.evaluations.other": "{n} evaluations",
18603
18839
  "front.agg.requirements.one": "{n} requirement",
@@ -18609,10 +18845,10 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18609
18845
  "front.agg.later.one": "{n} evaluation not yet in force",
18610
18846
  "front.agg.later.other": "{n} evaluations not yet in force",
18611
18847
  "front.agg.mismatch": "count mismatch: the claims give {recomputed}",
18612
- "front.agg.as-of": "In force as of {date}.",
18613
- "front.agg.copied.both": "The dates and the out-of-scope switch are copied from the contract, not re-checked here.",
18614
- "front.agg.copied.dates": "The dates are copied from the contract, not re-checked here.",
18615
- "front.agg.copied.switch": "The out-of-scope switch is copied from the contract, not re-checked here.",
18848
+ "applicability.as_of": "In force as of {date}.",
18849
+ "applicability.not_yet_in_force.title": "Not yet in force",
18850
+ "applicability.not_yet_in_force.note": "Readiness only: these requirements apply from a later date, which the producer copied from the contract. They are in none of the met, not met or could not decide counts above, and a result here is never a violation.",
18851
+ "contract_fact.note": "Dates and the out-of-scope switch are the producer's copy of the contract, not re-checked by this page.",
18616
18852
  "prov.brief.judge.partial": "judge pinned for some results",
18617
18853
  "front.agg.excluded": "{excluded} excluded as not applicable",
18618
18854
  "front.agg.bucket.met": "Met",
@@ -19028,6 +19264,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19028
19264
  "card.wording.refused.fit": "it does not fit this card's words",
19029
19265
  "front.mock": "Verdicts are from a mock judge and are placeholders.",
19030
19266
  "front.agg.evaluated": "{evaluations} of {requirements}",
19267
+ "front.agg.imported": "Imported: the records behind this result were all backfilled after the fact; none was recorded at the time.",
19031
19268
  "front.agg.evaluations.one": "{n} evaluation",
19032
19269
  "front.agg.evaluations.other": "{n} evaluations",
19033
19270
  "front.agg.requirements.one": "{n} requirement",
@@ -19039,10 +19276,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19039
19276
  "front.agg.later.one": "{n} evaluation not yet in force",
19040
19277
  "front.agg.later.other": "{n} evaluations not yet in force",
19041
19278
  "front.agg.mismatch": "count mismatch: the claims give {recomputed}",
19042
- "front.agg.as-of": "In force as of {date}.",
19043
- "front.agg.copied.both": "The dates and the out-of-scope switch are copied from the contract, not re-checked here.",
19044
- "front.agg.copied.dates": "The dates are copied from the contract, not re-checked here.",
19045
- "front.agg.copied.switch": "The out-of-scope switch is copied from the contract, not re-checked here.",
19279
+ "applicability.as_of": "In force as of {date}.",
19280
+ "contract_fact.note": "Dates and the out-of-scope switch are the producer's copy of the contract, not re-checked by this page.",
19046
19281
  "prov.brief.judge.partial": "judge pinned for some results",
19047
19282
  "front.agg.excluded": "{excluded} excluded as not applicable",
19048
19283
  "front.agg.bucket.met": "Met",
@@ -19295,6 +19530,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19295
19530
  "generic.rtier.unstated.title": "Requirements with no stated tier \xB7 {n}",
19296
19531
  "generic.rtier.unstated.note": "The contract given for this page states no tier for these, so they stay in the answer.",
19297
19532
  "generic.rtier.sealed-note": "The sealed result counts informational requirements too; the counts this report derives leave them out.",
19533
+ "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}",
19534
+ "generic.rtier.totals.out-of-scope": " \xB7 {n} Out of scope",
19535
+ "generic.rtier.totals.unstated": " Evaluations this contract gives no tier, in neither count: {n}.",
19536
+ "generic.rtier.totals.failed": " Must-have evaluations that failed verification, still counted under their sealed verdict: {n}.",
19537
+ "generic.rtier.all-terms": "These totals count every requirement in force: no contract was given to separate the must-have ones.",
19298
19538
  "generic.later.title": "Not yet in force \xB7 {n}",
19299
19539
  "generic.later.readiness": "readiness",
19300
19540
  "generic.later.note": "Applies from {date}, as the producer copied it from the contract, not re-checked here: readiness only, not counted.",
@@ -19330,6 +19570,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19330
19570
  throw new WordingPackError(
19331
19571
  `wording pack is not an ${WORDING_PACK_VERSION} object`
19332
19572
  );
19573
+ const reserved = Object.keys(entries).find((k) => k.startsWith("core."));
19574
+ if (reserved !== void 0)
19575
+ throw new WordingPackError(
19576
+ `wording pack carries the reserved key ${JSON.stringify(reserved)}`
19577
+ );
19333
19578
  return {
19334
19579
  id: p.id,
19335
19580
  locale: p.locale,
@@ -19339,8 +19584,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19339
19584
  async function checkWordingPackInput(wording) {
19340
19585
  if (!/^[0-9a-f]{64}$/u.test(wording.sha256))
19341
19586
  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)
19587
+ const digest2 = await sha256Hex(new TextEncoder().encode(wording.pack));
19588
+ if (digest2 !== wording.sha256)
19344
19589
  throw new WordingPackError(
19345
19590
  "wording pack bytes do not hash to its wording_sha256"
19346
19591
  );
@@ -19414,8 +19659,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19414
19659
  "lines.verdict.out_of_scope",
19415
19660
  "lines.pf.verdict.out_of_scope"
19416
19661
  ],
19417
- "tier.recomputed": ["lines.tier.recomputed"],
19418
- "tier.judged": ["lines.tier.judged"]
19662
+ "tier.recomputed": ["lines.tier.recomputed", "lines.rules.kind.recomputed"],
19663
+ "tier.judged": ["lines.tier.judged", "lines.rules.kind.judged"]
19419
19664
  },
19420
19665
  groups: {
19421
19666
  "report.title": ["groups.kicker"],
@@ -19541,6 +19786,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19541
19786
  "lines.tier.mixed",
19542
19787
  "lines.tier.unknown"
19543
19788
  ],
19789
+ // The roll-up's chip says the same thing about a rule.
19790
+ ["lines.rules.kind.judged", "lines.rules.kind.recomputed"],
19544
19791
  // The Outcomes headline row labels.
19545
19792
  [
19546
19793
  "lines.line.resolved",
@@ -19695,11 +19942,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19695
19942
  "lines.line.added": "added",
19696
19943
  // recomputed tier: a fixed check anyone can repeat from the records.
19697
19944
  "lines.tier.recomputed": "tier.recomputed",
19945
+ "lines.rules.kind.recomputed": "tier.recomputed",
19698
19946
  "groups.tier.recomputed": "tier.recomputed",
19699
19947
  "generic.tier.recomputed": "tier.recomputed",
19700
19948
  // judged tier: a judgement, which must never read like the recomputed
19701
19949
  // tier above.
19702
19950
  "lines.tier.judged": "tier.judged",
19951
+ "lines.rules.kind.judged": "tier.judged",
19703
19952
  "groups.tier.judged": "tier.judged",
19704
19953
  "generic.tier.judged": "tier.judged"
19705
19954
  };
@@ -19737,6 +19986,23 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19737
19986
  "groups.rtier.unstated.note",
19738
19987
  "lines.rtier.sealed-note",
19739
19988
  "groups.rtier.sealed-note",
19989
+ // Which evaluations a total counts: a pack cannot make an all-requirements
19990
+ // total read as must-have only, or the reverse.
19991
+ "lines.rtier.totals",
19992
+ "lines.rtier.totals.out-of-scope",
19993
+ "lines.rtier.totals.unstated",
19994
+ "lines.rtier.totals.failed",
19995
+ "groups.rtier.totals",
19996
+ "groups.rtier.totals.out-of-scope",
19997
+ "groups.rtier.totals.unstated",
19998
+ "groups.rtier.totals.failed",
19999
+ "generic.rtier.totals",
20000
+ "generic.rtier.totals.out-of-scope",
20001
+ "generic.rtier.totals.unstated",
20002
+ "generic.rtier.totals.failed",
20003
+ "lines.rtier.all-terms",
20004
+ "groups.rtier.all-terms",
20005
+ "generic.rtier.all-terms",
19740
20006
  "generic.rtier.unstated.note",
19741
20007
  "generic.rtier.sealed-note",
19742
20008
  // The generic page's honesty lines: what its names and ids are, and what a
@@ -19748,13 +20014,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19748
20014
  // aggregate's unknown count is, what the page and the bundle carry, and
19749
20015
  // the producer's findings label.
19750
20016
  "front.mock",
20017
+ "front.agg.imported",
19751
20018
  "front.agg.unknown.one",
19752
20019
  "front.agg.unknown.other",
19753
20020
  "front.agg.mismatch",
19754
- "front.agg.as-of",
19755
- "front.agg.copied.both",
19756
- "front.agg.copied.dates",
19757
- "front.agg.copied.switch",
20021
+ // Module spec section 2, "Copied facts": a pack cannot make a date or a
20022
+ // switch copied from the contract read as checked here, and cannot
20023
+ // make a later claim read as in force.
20024
+ "applicability.as_of",
20025
+ "applicability.not_yet_in_force.note",
20026
+ "contract_fact.note",
19758
20027
  // The record page, the lowest level (record-page.ts): what each proof
19759
20028
  // proves and does not, what a status means, and what this page did not
19760
20029
  // run. A pack cannot make a rung read as proving more than it does.
@@ -19861,6 +20130,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19861
20130
  "spot.gap.adjudication",
19862
20131
  // Same customer in this report (subject-history.ts): what the bundle does not carry.
19863
20132
  "lines.subject.gap",
20133
+ "lines.subject.gap.tiered",
19864
20134
  // Both cards: a rule or conversation nobody could decide, by why.
19865
20135
  "lines.status.undecided.unjudged",
19866
20136
  "lines.status.undecided.withheld",
@@ -20071,6 +20341,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
20071
20341
  "lines.na-note.other",
20072
20342
  // The canvas's footnote that says what the page does not do.
20073
20343
  "lines.fn.readonly",
20344
+ "groups.fn.readonly",
20074
20345
  "lines.sentence.undecided.none",
20075
20346
  "lines.why.undecided.none",
20076
20347
  "lines.sentence.nothing-applied",
@@ -20329,9 +20600,9 @@ ${key}`);
20329
20600
  return problems.map((p) => `${pack.id}: ${p}`);
20330
20601
  }
20331
20602
  var DEFAULT_PACK_SHA256 = Object.freeze({
20332
- lines: "c8e7c5313deee0137654878727c8a79760286cc165b46c316b5956f498a83d80",
20333
- groups: "7527077ae3637ff772bc311878a76c8f25e1d16314244f9b5dc80cf1b8e131e0",
20334
- generic: "2b2de4e046cab88633f09b96729f18a12e0331708e13920a84f6c67f32302f77"
20603
+ lines: "4a03428e884337321754bd6657df0ebb6d5441821378a3b1ff17f2a625021cc5",
20604
+ groups: "76acc9598202663738d7d2903ca1a042d9b7ca21799297946e4da39ea77d5250",
20605
+ generic: "6c7570711462e9a9af94faac45f56414fd97a1681608be03299f6fa756eaa41c"
20335
20606
  });
20336
20607
  function fill(key, text2, vars) {
20337
20608
  return text2.replace(PLACEHOLDER, (whole, name) => {
@@ -20414,9 +20685,9 @@ ${key}`);
20414
20685
 
20415
20686
  // src/report-provenance.ts
20416
20687
  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);
20688
+ const digest2 = claim.evidence[0]?.digest;
20689
+ if (digest2 === void 0) return void 0;
20690
+ const record = records.get(digest2);
20420
20691
  if (record === void 0) return void 0;
20421
20692
  const input = record.carriedInput ?? record.agentInput;
20422
20693
  if (input.state !== "disclosed") return void 0;
@@ -20471,9 +20742,9 @@ ${key}`);
20471
20742
  else recomputedUnnamed += 1;
20472
20743
  continue;
20473
20744
  }
20474
- const digest = asString2(payload?.judge_pin_digest);
20475
- if (digest !== void 0) {
20476
- const entry = pins.get(digest) ?? {
20745
+ const digest2 = asString2(payload?.judge_pin_digest);
20746
+ if (digest2 !== void 0) {
20747
+ const entry = pins.get(digest2) ?? {
20477
20748
  count: 0,
20478
20749
  parts: /* @__PURE__ */ new Map(),
20479
20750
  bare: 0
@@ -20482,13 +20753,13 @@ ${key}`);
20482
20753
  const parts = pinComponents2(payload?.judge_pin);
20483
20754
  if (parts === void 0) entry.bare += 1;
20484
20755
  else entry.parts.set(new TextDecoder().decode(jcs(parts)), parts);
20485
- pins.set(digest, entry);
20756
+ pins.set(digest2, entry);
20486
20757
  continue;
20487
20758
  }
20488
20759
  unnamed += 1;
20489
20760
  }
20490
20761
  const counted2 = [];
20491
- for (const [digest, entry] of pins) {
20762
+ for (const [digest2, entry] of pins) {
20492
20763
  let model;
20493
20764
  let modelNotShown;
20494
20765
  if (entry.parts.size === 0) modelNotShown = "not_stated";
@@ -20498,7 +20769,7 @@ ${key}`);
20498
20769
  const parts = [...entry.parts.values()][0];
20499
20770
  const checked = await verifyJudgePin({
20500
20771
  pinned: true,
20501
- judgePinDigest: digest,
20772
+ judgePinDigest: digest2,
20502
20773
  judgePin: parts
20503
20774
  });
20504
20775
  if (checked.judgePinRecomputes === true)
@@ -20508,7 +20779,7 @@ ${key}`);
20508
20779
  else modelNotShown = "does_not_recompute";
20509
20780
  }
20510
20781
  counted2.push({
20511
- digest,
20782
+ digest: digest2,
20512
20783
  count: entry.count,
20513
20784
  ...model === void 0 ? {} : { model },
20514
20785
  ...modelNotShown === void 0 ? {} : { modelNotShown }
@@ -20529,7 +20800,7 @@ ${key}`);
20529
20800
  var fmt2 = (n) => n.toLocaleString();
20530
20801
  var quoted = (value) => JSON.stringify(value.length > 120 ? `${value.slice(0, 120)}\u2026` : value);
20531
20802
  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);
20803
+ var short = (digest2) => HEX_DIGEST2.test(digest2) ? digest2.length > 12 ? `${digest2.slice(0, 12)}\u2026` : digest2 : quoted(digest2);
20533
20804
  function judgedByMock(tally2) {
20534
20805
  return tally2.pins.some(
20535
20806
  (pin) => pin.model !== void 0 && /\bmock\b/i.test(pin.model)
@@ -20681,7 +20952,7 @@ ${key}`);
20681
20952
  const all = witnessEntries(checkpoint);
20682
20953
  const status2 = witnessStatus(bundle, verified);
20683
20954
  if (status2 === "invalid" && aac !== void 0) {
20684
- const failed2 = aac.receipts.filter((r) => r.status === "fail").map(
20955
+ const failed3 = aac.receipts.filter((r) => r.status === "fail").map(
20685
20956
  (r) => w.t("prov.witness.failed-entry", {
20686
20957
  witness: quoted(r.tsUrl),
20687
20958
  reason: quoted(r.reason)
@@ -20692,7 +20963,7 @@ ${key}`);
20692
20963
  ).length;
20693
20964
  const parts = [
20694
20965
  w.t("prov.witness.invalid"),
20695
- ...failed2.length === 0 ? [] : [w.t("prov.witness.failed", { witnesses: failed2.join("; ") })],
20966
+ ...failed3.length === 0 ? [] : [w.t("prov.witness.failed", { witnesses: failed3.join("; ") })],
20696
20967
  ...unreadable === 0 ? [] : [
20697
20968
  w.p("prov.witness.invalid.unreadable", unreadable, {
20698
20969
  n: fmt2(unreadable)
@@ -20700,7 +20971,7 @@ ${key}`);
20700
20971
  ],
20701
20972
  // AAC fails only on a failed receipt or an unreadable entry; should
20702
20973
  // it fail on anything else, its findings are named as it states them.
20703
- ...failed2.length === 0 && unreadable === 0 && aac.findings.length > 0 ? [
20974
+ ...failed3.length === 0 && unreadable === 0 && aac.findings.length > 0 ? [
20704
20975
  w.t("prov.witness.invalid.findings", {
20705
20976
  findings: aac.findings.map(quoted).join("; ")
20706
20977
  })
@@ -21078,8 +21349,8 @@ ${key}`);
21078
21349
  async function checkContractInput(contract) {
21079
21350
  if (!/^[0-9a-f]{64}$/u.test(contract.sha256))
21080
21351
  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)
21352
+ const digest2 = await sha256Hex(new TextEncoder().encode(contract.text));
21353
+ if (digest2 !== contract.sha256)
21083
21354
  throw new ContractError(
21084
21355
  "contract bytes do not hash to its contract_sha256"
21085
21356
  );
@@ -21342,13 +21613,13 @@ ${key}`);
21342
21613
  return Number.isInteger(n) && n >= 0 && n <= 12 ? w.t(`lines.count.${n}`) : String(n);
21343
21614
  }
21344
21615
  function unverifiedClause(model, list2, w, lower = false) {
21345
- const failed2 = list2.filter((c) => c.verdict === "failed");
21616
+ const failed3 = list2.filter((c) => c.verdict === "failed");
21346
21617
  const unsupported = list2.filter((c) => c.verdict === "unsupported");
21347
21618
  const parts = [];
21348
- if (failed2.length > 0)
21619
+ if (failed3.length > 0)
21349
21620
  parts.push(
21350
21621
  w.t("lines.sentence.unverified.failed", {
21351
- names: names(model, failed2, w)
21622
+ names: names(model, failed3, w)
21352
21623
  })
21353
21624
  );
21354
21625
  if (unsupported.length > 0)
@@ -21939,6 +22210,21 @@ ${key}`);
21939
22210
  );
21940
22211
  return parts.join(" ");
21941
22212
  }
22213
+ function reportTitle(model, w) {
22214
+ const title = w.section3("report.title") ?? w.t("lines.title");
22215
+ if (w.section3("report.title") !== void 0) return title;
22216
+ const first = model.days[0]?.date;
22217
+ const last = model.days[model.days.length - 1]?.date;
22218
+ if (first === void 0 || last === void 0) return title;
22219
+ const month = /^(\d{4})-(\d{2})-\d{2}/.exec(first);
22220
+ if (month === null || last.slice(0, 7) !== first.slice(0, 7)) return title;
22221
+ const n = Number(month[2]);
22222
+ if (n < 1 || n > 12) return title;
22223
+ return w.t("lines.title.month", {
22224
+ month: w.t(`calendar.month.${n}`),
22225
+ year: month[1]
22226
+ });
22227
+ }
21942
22228
  function renderMeta(host, model, w, notes) {
21943
22229
  const section = el8("section", "");
21944
22230
  section.dataset.section = "meta";
@@ -21948,7 +22234,7 @@ ${key}`);
21948
22234
  bill.append(el8("div", "v", packLine(model, w)));
21949
22235
  row1.append(bill);
21950
22236
  const title = el8("div", "ih-title");
21951
- title.append(el8("h1", "inv-title", w.t("lines.title")));
22237
+ title.append(el8("h1", "inv-title", reportTitle(model, w)));
21952
22238
  const summary = reportSummary(w);
21953
22239
  if (summary !== void 0) title.append(summary);
21954
22240
  if (model.terms.pack.locked !== NOT_STATED)
@@ -22149,12 +22435,67 @@ ${key}`);
22149
22435
  }
22150
22436
  host.append(section);
22151
22437
  }
22438
+ function renderNotYetInForce(host, model, w) {
22439
+ const entries = [
22440
+ ...model.conversations.map((c) => ({ c, later: c.notYetInForce })),
22441
+ ...model.notYetInForce.map((c) => ({ c, later: c.notYetInForce }))
22442
+ ].filter((e) => e.later.length > 0);
22443
+ if (entries.length === 0) return;
22444
+ const total = entries.reduce((sum, e) => sum + e.later.length, 0);
22445
+ const section = el8("section", "sec");
22446
+ section.dataset.section = "not-yet-in-force";
22447
+ section.dataset.count = String(total);
22448
+ section.append(
22449
+ el8(
22450
+ "h2",
22451
+ "",
22452
+ w.t("applicability.not_yet_in_force.title", { n: fmtCount(total) })
22453
+ ),
22454
+ el8("p", "lede", w.t("applicability.not_yet_in_force.note"))
22455
+ );
22456
+ const list2 = el8("ul", "later-list");
22457
+ for (const { c, later } of entries) {
22458
+ for (const cr of later) {
22459
+ const label = criterionLabel(model, cr.checkId, cr.criterionId, w);
22460
+ const item = el8("li", "later-item");
22461
+ item.dataset.conversation = c.conversationId;
22462
+ item.dataset.rule = `${cr.checkId}.${cr.criterionId}`;
22463
+ item.append(
22464
+ el8("b", "", label.label),
22465
+ document.createTextNode(` \xB7 ${c.conversationId} \xB7 `),
22466
+ el8(
22467
+ "span",
22468
+ "readiness",
22469
+ `${w.t("lines.later.readiness")}: ${w.enumWord("verdict", cr.verdict)}`
22470
+ )
22471
+ );
22472
+ if (cr.claim !== void 0) {
22473
+ const [, line, data] = assuranceRow(cr.claim, w);
22474
+ const assurance = el8("small", "assurance", ` \xB7 ${line}`);
22475
+ Object.assign(assurance.dataset, data);
22476
+ item.append(assurance);
22477
+ }
22478
+ list2.append(item);
22479
+ }
22480
+ }
22481
+ section.append(list2);
22482
+ host.append(section);
22483
+ }
22152
22484
  function renderRules(host, model, runInfo, result3, w) {
22153
22485
  const tierOf = model.gating?.tierOf;
22154
22486
  const section = el8("section", "sec");
22155
22487
  section.dataset.section = "rules";
22156
22488
  section.append(el8("h2", "", w.t("lines.rules.h")));
22157
22489
  section.append(el8("p", "lede", w.t("lines.rules.lede")));
22490
+ const ofNote = el8(
22491
+ "p",
22492
+ "lede",
22493
+ w.p("lines.rules.of.note", model.totalCount, {
22494
+ total: fmtCount(model.totalCount)
22495
+ })
22496
+ );
22497
+ ofNote.dataset.note = "rule-counts";
22498
+ section.append(ofNote);
22158
22499
  const table3 = el8("table", "rules");
22159
22500
  table3.dataset.rows = "rules";
22160
22501
  const thead = element3("thead");
@@ -22187,11 +22528,19 @@ ${key}`);
22187
22528
  const claim = model.conversations.flatMap((c) => c.criteria).find((c) => `${c.checkId}.${c.criterionId}` === ref && c.claim)?.claim;
22188
22529
  return tierOf(claim?.contractRef, ref);
22189
22530
  };
22531
+ const inForceRefs = new Set(
22532
+ model.conversations.flatMap(
22533
+ (c) => c.criteria.map((cr) => `${cr.checkId}.${cr.criterionId}`)
22534
+ )
22535
+ );
22536
+ const whollyLater = new Set(
22537
+ [...model.conversations, ...model.notYetInForce].flatMap((c) => c.notYetInForce).map((cr) => `${cr.checkId}.${cr.criterionId}`).filter((ref) => !inForceRefs.has(ref))
22538
+ );
22190
22539
  const tiers = /* @__PURE__ */ new Map();
22191
22540
  for (const check of model.terms.checks)
22192
22541
  for (const criterion2 of check.criteria) {
22193
22542
  const ref = `${check.id}.${criterion2.id}`;
22194
- tiers.set(ref, ruleTier(ref));
22543
+ if (!whollyLater.has(ref)) tiers.set(ref, ruleTier(ref));
22195
22544
  }
22196
22545
  const sections = tierOf === void 0 ? [void 0] : ROW_TIERS.filter((tier) => [...tiers.values()].includes(tier));
22197
22546
  for (const tier of sections) {
@@ -22210,7 +22559,7 @@ ${key}`);
22210
22559
  }
22211
22560
  for (const check of model.terms.checks) {
22212
22561
  const criteria = check.criteria.filter(
22213
- (criterion2) => tiers.get(`${check.id}.${criterion2.id}`) === tier
22562
+ (criterion2) => tiers.has(`${check.id}.${criterion2.id}`) && tiers.get(`${check.id}.${criterion2.id}`) === tier
22214
22563
  );
22215
22564
  if (criteria.length === 0) continue;
22216
22565
  const group = el8("tr", "grp");
@@ -22246,7 +22595,14 @@ ${key}`);
22246
22595
  const pick = picks[column];
22247
22596
  const cell4 = el8("td", className);
22248
22597
  cell4.dataset.column = column;
22249
- cell4.append(el8("span", "nv", fmtCount(counted2.length)));
22598
+ cell4.append(
22599
+ el8("span", "nv", fmtCount(counted2.length)),
22600
+ el8(
22601
+ "span",
22602
+ "nof",
22603
+ ` ${w.t("lines.rules.of", { total: fmtCount(model.totalCount) })}`
22604
+ )
22605
+ );
22250
22606
  const action = evidenceAction(
22251
22607
  `rule:${ref}:${column}`,
22252
22608
  `${label.label} \xB7 ${columnWord[column]}: ${fmtCount(counted2.length)}`,
@@ -22274,6 +22630,35 @@ ${key}`);
22274
22630
  tr.dataset.requirementTier = tier;
22275
22631
  nameCell.append(tierChip(tier, w));
22276
22632
  }
22633
+ const how = model.criterionTiers.get(ref);
22634
+ if (how === "judged" || how === "recomputed") {
22635
+ const chip = el8("span", "rtier", w.t(`lines.rules.kind.${how}`));
22636
+ chip.dataset.kind = how;
22637
+ nameCell.append(" ", chip);
22638
+ }
22639
+ if (na.length > 0) {
22640
+ const gap = el8(
22641
+ "small",
22642
+ "rdet",
22643
+ w.t("lines.rules.not_applied", { k: fmtCount(na.length) })
22644
+ );
22645
+ gap.dataset.note = "not-applied";
22646
+ nameCell.append(gap);
22647
+ }
22648
+ const laterHere = model.conversations.filter(
22649
+ (c) => c.notYetInForce.some(
22650
+ (cr) => cr.checkId === check.id && cr.criterionId === criterion2.id
22651
+ )
22652
+ );
22653
+ if (laterHere.length > 0) {
22654
+ const later = el8(
22655
+ "small",
22656
+ "rdet",
22657
+ w.t("lines.rules.not_in_force", { k: fmtCount(laterHere.length) })
22658
+ );
22659
+ later.dataset.note = "not-in-force";
22660
+ nameCell.append(later);
22661
+ }
22277
22662
  if (label.source === "sealed")
22278
22663
  nameCell.append(el8("small", "", label.text));
22279
22664
  const detail = w.row(ref, "detail");
@@ -22762,7 +23147,8 @@ ${key}`);
22762
23147
  function subjectConversations(model, w) {
22763
23148
  return model.conversations.map((c) => {
22764
23149
  const status2 = conversationStatus(c, model.gating);
22765
- const outcome = statusWord(status2, c, w, model.gating);
23150
+ const keptOut = status2 === "nothing-applied" && model.gating?.counted.has(c) === true;
23151
+ const outcome = keptOut ? { word: w.t("lines.subject.outcome.none-counted"), tone: "na" } : statusWord(status2, c, w, model.gating);
22766
23152
  const time = /T(\d{2}:\d{2})/u.exec(c.dated.stated ?? "")?.[1];
22767
23153
  const turns = c.transcript.state === "verified" || c.transcript.state === "cited" ? c.transcript.turns : void 0;
22768
23154
  return {
@@ -22770,6 +23156,7 @@ ${key}`);
22770
23156
  date: c.day,
22771
23157
  ...time === void 0 ? {} : { time },
22772
23158
  status: status2,
23159
+ ...keptOut ? { keptOut: true } : {},
22773
23160
  outcome,
22774
23161
  terms: c.criteria.map((cr) => ({
22775
23162
  ref: `${cr.checkId}.${cr.criterionId}`,
@@ -22823,6 +23210,14 @@ ${key}`);
22823
23210
  );
22824
23211
  note("readonly", w.t("lines.fn.readonly"));
22825
23212
  }
23213
+ function statesTiers(model) {
23214
+ return model.conversations.some(
23215
+ (c) => c.criteria.some((cr) => {
23216
+ const tier = criterionTier(cr, model.gating);
23217
+ return tier === "must_have" || tier === "informational";
23218
+ })
23219
+ );
23220
+ }
22826
23221
  async function drawLines(levels, result3, options, bundle, verified, w, tierOf) {
22827
23222
  const built = buildOutcomeReportModel(result3, options);
22828
23223
  const model = tierOf === void 0 ? built : { ...built, gating: gating(built.conversations, tierOf) };
@@ -22847,11 +23242,13 @@ ${key}`);
22847
23242
  subjectConversations(model, w),
22848
23243
  slice2,
22849
23244
  model.totalCount,
22850
- w
23245
+ w,
23246
+ statesTiers(model)
22851
23247
  );
22852
23248
  if (subject !== void 0) levels.L0.append(subject);
22853
23249
  }
22854
23250
  renderRules(levels.L1, model, runInfo, result3, w);
23251
+ renderNotYetInForce(levels.L1, model, w);
22855
23252
  leadWithProvenance(
22856
23253
  levels.L1,
22857
23254
  levels.L1.querySelector('[data-section="rules"]'),
@@ -23227,10 +23624,13 @@ ${key}`);
23227
23624
  model.sessions.flatMap((s) => s.tests).find((t) => t.criterionId === row2.criterionId && t.claim)?.claim?.contractRef,
23228
23625
  row2.criterionId
23229
23626
  );
23230
- const allRows = model.obligations.flatMap((o) => o.rows);
23627
+ const allRows = model.obligations.flatMap(
23628
+ (o) => o.rows.filter((r) => !allLater(r))
23629
+ );
23630
+ const laterRows = model.obligations.flatMap((o) => o.rows.filter(allLater));
23231
23631
  const sections = tierOf === void 0 ? [void 0] : ROW_TIERS.filter((tier) => allRows.some((r) => tierOfRow(r) === tier));
23232
- for (const tier of sections) {
23233
- if (tier !== void 0) {
23632
+ const drawSection = (tier, later) => {
23633
+ if (tier !== void 0 && !later) {
23234
23634
  const head2 = document.createElement("tbody");
23235
23635
  head2.dataset.requirementTier = tier;
23236
23636
  const tr = el9("tr", "tier");
@@ -23252,7 +23652,12 @@ ${key}`);
23252
23652
  table3.append(head2);
23253
23653
  }
23254
23654
  for (const given of model.obligations) {
23255
- const obligation = tier === void 0 ? given : { ...given, rows: given.rows.filter((r) => tierOfRow(r) === tier) };
23655
+ const obligation = {
23656
+ ...given,
23657
+ rows: given.rows.filter(
23658
+ (r) => allLater(r) === later && (tier === void 0 || tierOfRow(r) === tier)
23659
+ )
23660
+ };
23256
23661
  if (obligation.rows.length === 0) continue;
23257
23662
  const tbody = document.createElement("tbody");
23258
23663
  tbody.dataset.obligationGroup = obligation.key;
@@ -23299,7 +23704,7 @@ ${key}`);
23299
23704
  );
23300
23705
  return body;
23301
23706
  },
23302
- tier === void 0 ? `ob-${obligation.key}` : `ob-${obligation.key}-${tier}`,
23707
+ later ? `ob-${obligation.key}-later` : tier === void 0 ? `ob-${obligation.key}` : `ob-${obligation.key}-${tier}`,
23303
23708
  true
23304
23709
  );
23305
23710
  tbody.append(about);
@@ -23317,10 +23722,11 @@ ${key}`);
23317
23722
  const head2 = el9("div", "tnh");
23318
23723
  const testName = rowName2(w, "b", "", test);
23319
23724
  head2.append(testName, tierBadge(test.tier, w));
23320
- if (tier !== void 0) {
23321
- tr.dataset.requirementTier = tier;
23322
- const chip = el9("span", "rtier", w.t(`requirement_tier.${tier}`));
23323
- chip.dataset.requirementTier = tier;
23725
+ const rowTier2 = tier ?? (later ? tierOfRow(test) : void 0);
23726
+ if (rowTier2 !== void 0) {
23727
+ tr.dataset.requirementTier = rowTier2;
23728
+ const chip = el9("span", "rtier", w.t(`requirement_tier.${rowTier2}`));
23729
+ chip.dataset.requirementTier = rowTier2;
23324
23730
  head2.append(chip);
23325
23731
  }
23326
23732
  nameCell.append(head2);
@@ -23356,7 +23762,7 @@ ${key}`);
23356
23762
  testName,
23357
23763
  drillRow,
23358
23764
  () => renderSessionList(sessionIds, model, presentation, w),
23359
- `test-${obligation.key}-${test.criterionId}`
23765
+ `test-${obligation.key}-${test.criterionId}${later ? "-later" : ""}`
23360
23766
  );
23361
23767
  toggle.dataset.records = "sessions";
23362
23768
  toggle.dataset.drill = test.criterionId;
@@ -23366,6 +23772,28 @@ ${key}`);
23366
23772
  }
23367
23773
  table3.append(tbody);
23368
23774
  }
23775
+ };
23776
+ for (const tier of sections) drawSection(tier, false);
23777
+ if (laterRows.length > 0) {
23778
+ const head2 = document.createElement("tbody");
23779
+ head2.dataset.section = "not-yet-in-force";
23780
+ const tr = el9("tr", "tier later");
23781
+ const cell2 = el9("td", "");
23782
+ cell2.setAttribute("colspan", "3");
23783
+ cell2.append(
23784
+ el9(
23785
+ "b",
23786
+ "",
23787
+ w.t("applicability.not_yet_in_force.title", {
23788
+ n: fmt4(laterRows.length)
23789
+ })
23790
+ ),
23791
+ el9("small", "", w.t("applicability.not_yet_in_force.note"))
23792
+ );
23793
+ tr.append(cell2);
23794
+ head2.append(tr);
23795
+ table3.append(head2);
23796
+ drawSection(void 0, true);
23369
23797
  }
23370
23798
  section.append(table3);
23371
23799
  const notes = el9("aside", "footnotes");
@@ -23382,6 +23810,29 @@ ${key}`);
23382
23810
  section.append(notes);
23383
23811
  host.append(section);
23384
23812
  }
23813
+ function renderCanvasNotes2(host, model, bundle, w, tiered) {
23814
+ const notes = el9("aside", "footnotes");
23815
+ notes.dataset.section = "canvas-notes";
23816
+ const note = (key, text2) => {
23817
+ const p = el9("p", "", text2);
23818
+ p.dataset.footnote = key;
23819
+ notes.append(p);
23820
+ };
23821
+ const records = bundle?.records;
23822
+ if (Array.isArray(records))
23823
+ note(
23824
+ "records",
23825
+ w.p("groups.fn.records", model.totalSessions, {
23826
+ records: records.length.toLocaleString()
23827
+ })
23828
+ );
23829
+ note(
23830
+ "resolved",
23831
+ w.t(tiered ? "groups.fn.resolved.tiered" : "groups.fn.resolved")
23832
+ );
23833
+ note("readonly", w.t("groups.fn.readonly"));
23834
+ host.append(notes);
23835
+ }
23385
23836
  function renderFindings(host, model, w) {
23386
23837
  if (model.findings.length === 0) return;
23387
23838
  const section = el9("section", "findings");
@@ -23831,6 +24282,7 @@ ${key}`);
23831
24282
  )
23832
24283
  );
23833
24284
  renderFindings(levels.L1, model, w);
24285
+ renderCanvasNotes2(levels.L1, model, bundle, w, tierOf !== void 0);
23834
24286
  levels.L2.append(renderCheckYourself(bundle, w));
23835
24287
  renderReportProofs2(levels.L2, model, bundle, verified, w);
23836
24288
  }
@@ -24138,6 +24590,33 @@ ${key}`);
24138
24590
  const single = citesOneContract(result3) ? result3.claims[0]?.contractRef : void 0;
24139
24591
  return (contractRef, requirementRef) => rowTier(contract, contractRef ?? single ?? "", requirementRef);
24140
24592
  }
24593
+ var fmtCount2 = (n) => n.toLocaleString("en-US");
24594
+ function mustHaveTotals(result3, tierOf) {
24595
+ if (tierOf === void 0) return void 0;
24596
+ const { met, notMet, notEvaluable, outOfScope } = result3.buckets;
24597
+ const byId = new Map(result3.claims.map((claim) => [claim.id, claim]));
24598
+ const listed = [met, notMet, notEvaluable, outOfScope ?? []].flatMap(
24599
+ (ids) => ids.flatMap((id) => {
24600
+ const claim = byId.get(id);
24601
+ return claim === void 0 || claim.type === "calibration" ? [] : [{ claim, tier: tierOf(claim.contractRef, claim.requirementRef) }];
24602
+ })
24603
+ );
24604
+ const inList = (ids, tier) => ids.filter((id) => {
24605
+ const claim = byId.get(id);
24606
+ return claim !== void 0 && claim.type !== "calibration" && tierOf(claim.contractRef, claim.requirementRef) === tier;
24607
+ }).length;
24608
+ const ofTier = (tier) => listed.filter((e) => e.tier === tier);
24609
+ return {
24610
+ met: inList(met, "must_have"),
24611
+ notMet: inList(notMet, "must_have"),
24612
+ notEvaluable: inList(notEvaluable, "must_have"),
24613
+ outOfScope: outOfScope === void 0 ? void 0 : inList(outOfScope, "must_have"),
24614
+ evaluations: ofTier("must_have").length,
24615
+ informational: ofTier("informational").length,
24616
+ unstated: ofTier("unstated").length,
24617
+ failed: ofTier("must_have").filter((e) => e.claim.failed).length
24618
+ };
24619
+ }
24141
24620
  function citesOneContract(result3) {
24142
24621
  return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
24143
24622
  }
@@ -24166,6 +24645,38 @@ ${key}`);
24166
24645
  levels.L0.append(style);
24167
24646
  const refused = refusedWordingNotice(w);
24168
24647
  if (refused !== void 0) levels.L0.append(refused);
24648
+ const totals = mustHaveTotals(result3, tierOf);
24649
+ if (contract !== void 0 && totals !== void 0) {
24650
+ const note = document.createElement("p");
24651
+ note.className = "tier-note";
24652
+ note.dataset.mustHaveTotals = String(totals.evaluations);
24653
+ note.textContent = w.t(`${input.grouping}.rtier.totals`, {
24654
+ contract: contract.ref,
24655
+ digest: contract.sha256,
24656
+ met: fmtCount2(totals.met),
24657
+ not_met: fmtCount2(totals.notMet),
24658
+ undecided: fmtCount2(totals.notEvaluable),
24659
+ out_of_scope: totals.outOfScope === void 0 ? "" : w.t(`${input.grouping}.rtier.totals.out-of-scope`, {
24660
+ n: fmtCount2(totals.outOfScope)
24661
+ }),
24662
+ n: fmtCount2(totals.evaluations),
24663
+ informational: fmtCount2(totals.informational),
24664
+ unstated: totals.unstated === 0 ? "" : w.t(`${input.grouping}.rtier.totals.unstated`, {
24665
+ n: fmtCount2(totals.unstated)
24666
+ }),
24667
+ failed: totals.failed === 0 ? "" : w.t(`${input.grouping}.rtier.totals.failed`, {
24668
+ n: fmtCount2(totals.failed)
24669
+ })
24670
+ });
24671
+ note.style.overflowWrap = "anywhere";
24672
+ levels.L0.append(note);
24673
+ } else if (tierOf === void 0 && result3.claims.length > 0) {
24674
+ const note = document.createElement("p");
24675
+ note.className = "tier-note";
24676
+ note.dataset.sealedCounts = "all-terms";
24677
+ note.textContent = w.t(`${input.grouping}.rtier.all-terms`);
24678
+ levels.L0.append(note);
24679
+ }
24169
24680
  if (tierOf !== void 0 && result3.claims.some(
24170
24681
  (claim) => tierOf(claim.contractRef, claim.requirementRef) === "informational"
24171
24682
  )) {
@@ -24351,10 +24862,10 @@ ${key}`);
24351
24862
  )
24352
24863
  );
24353
24864
  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(
24865
+ const digest2 = element5("dl");
24866
+ digest2.dataset.composedDigest = result3.composedDigest.declared;
24867
+ digest2.dataset.matches = String(result3.composedDigest.matches);
24868
+ digest2.append(
24358
24869
  element5("dt", "declared"),
24359
24870
  element5("dd", result3.composedDigest.declared),
24360
24871
  element5("dt", "recomputed"),
@@ -24362,7 +24873,7 @@ ${key}`);
24362
24873
  element5("dt", "matches"),
24363
24874
  element5("dd", result3.composedDigest.matches ? "yes" : "no")
24364
24875
  );
24365
- section.append(digest);
24876
+ section.append(digest2);
24366
24877
  section.append(element5("h3", "Members"));
24367
24878
  section.append(
24368
24879
  table2(
@@ -25195,31 +25706,38 @@ ${key}`);
25195
25706
  el12("span", "agg-of", of)
25196
25707
  );
25197
25708
  box.append(caption);
25709
+ if (verdict2 === "out_of_scope") {
25710
+ const fact = el12("div", "agg-fact", contractFactNote(w));
25711
+ fact.dataset.contractFact = "out-of-scope";
25712
+ box.append(fact);
25713
+ }
25198
25714
  const marker = mismatchMarker(figure, field, w);
25199
25715
  if (marker !== void 0) box.append(marker);
25200
25716
  buckets.append(box);
25201
25717
  }
25202
25718
  out.append(buckets);
25203
25719
  const dated = result3.claims.some((claim) => claim.appliesFrom !== void 0);
25204
- const switched = result3.buckets.outOfScope !== void 0;
25205
- if (dated || switched) {
25720
+ if (dated) {
25206
25721
  const copied = el12("p", "agg-note");
25207
25722
  if (dated) {
25208
25723
  const date = utcDateOf(result3.generatedAt) ?? result3.generatedAt;
25209
- copied.append(w.t("front.agg.as-of", { date }), " ");
25724
+ const word = w.section3("applicability.as_of");
25725
+ copied.append(
25726
+ word !== void 0 && word.split("{date}").length === 2 ? word.replace("{date}", date) : date,
25727
+ " "
25728
+ );
25210
25729
  copied.dataset.asOf = date;
25211
25730
  }
25212
- copied.append(
25213
- w.t(
25214
- dated && switched ? "front.agg.copied.both" : dated ? "front.agg.copied.dates" : "front.agg.copied.switch"
25215
- )
25216
- );
25731
+ copied.append(contractFactNote(w));
25217
25732
  copied.dataset.copiedFacts = "contract";
25218
25733
  out.append(copied);
25219
25734
  }
25220
25735
  return out;
25221
25736
  }
25222
- var shortDigest = (digest) => digest.length > 12 ? `${digest.slice(0, 4)}\u2026${digest.slice(-4)}` : digest;
25737
+ function contractFactNote(w) {
25738
+ return w.section3("contract_fact.note") ?? DEFAULT_PACKS.lines.entries["contract_fact.note"];
25739
+ }
25740
+ var shortDigest = (digest2) => digest2.length > 12 ? `${digest2.slice(0, 4)}\u2026${digest2.slice(-4)}` : digest2;
25223
25741
  function renderCoreIdentity(model) {
25224
25742
  const { result: result3, words: w } = model;
25225
25743
  const refs = [
@@ -25261,10 +25779,33 @@ ${key}`);
25261
25779
  block.append(top, rest);
25262
25780
  return block;
25263
25781
  }
25264
- async function coreStripModel(result3, words) {
25782
+ function backfillOnly(document2) {
25783
+ const isObj5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
25784
+ if (!isObj5(document2) || !isObj5(document2["coverage_report"])) return false;
25785
+ const requirements = document2["coverage_report"]["requirements"];
25786
+ if (!Array.isArray(requirements)) return false;
25787
+ let records = 0;
25788
+ for (const requirement of requirements) {
25789
+ if (!isObj5(requirement)) return false;
25790
+ const list2 = requirement["sources"];
25791
+ if (list2 === void 0) continue;
25792
+ if (!Array.isArray(list2)) return false;
25793
+ for (const source of list2) {
25794
+ if (!isObj5(source)) return false;
25795
+ const { contemporaneous_count: live, backfilled_count: back } = source;
25796
+ const total = source["record_count"];
25797
+ if (live !== 0 || !Number.isSafeInteger(total) || total < 0 || back !== total)
25798
+ return false;
25799
+ records += total;
25800
+ }
25801
+ }
25802
+ return records > 0;
25803
+ }
25804
+ async function coreStripModel(result3, words, document2) {
25265
25805
  const tally2 = await tallyJudges(result3.records, result3.claims);
25266
25806
  return {
25267
25807
  result: result3,
25808
+ imported: backfillOnly(document2),
25268
25809
  words,
25269
25810
  mock: judgedByMock(tally2),
25270
25811
  pins: tally2.pins.map((pin) => pin.digest)
@@ -25282,6 +25823,14 @@ ${key}`);
25282
25823
  mark.dataset.section = "mock-judge";
25283
25824
  strip.append(mark);
25284
25825
  }
25826
+ if (model.imported) {
25827
+ const note = tagSource(
25828
+ el12("p", "agg-note imported", model.words.t("front.agg.imported")),
25829
+ "core"
25830
+ );
25831
+ note.dataset.imported = "";
25832
+ strip.append(note);
25833
+ }
25285
25834
  strip.append(renderCoreIdentity(model));
25286
25835
  strip.append(renderAggregate(model.result, model.words));
25287
25836
  return strip;
@@ -25973,25 +26522,25 @@ ${pad.repeat(depth)}`;
25973
26522
  }
25974
26523
  function checkedSummaryLine(verified, model) {
25975
26524
  const total = model.checks.length;
25976
- const failed2 = model.checks.filter((c) => c.status === "fail").length;
26525
+ const failed3 = model.checks.filter((c) => c.status === "fail").length;
25977
26526
  const passed = model.checks.filter((c) => c.status === "pass").length;
25978
- const notRun = total - failed2 - passed;
26527
+ const notRun = total - failed3 - passed;
25979
26528
  const pageFailed = model.checkLists.failed.filter(
25980
26529
  (id) => !NUMBERED_CHECK_GROUND.has(id)
25981
26530
  ).length;
25982
26531
  const notRunNote = notRun > 0 ? `, ${notRun} not run` : "";
25983
26532
  const leads = [];
25984
- if (failed2 > 0)
25985
- leads.push(`${failed2} of ${total} checks failed${notRunNote}`);
26533
+ if (failed3 > 0)
26534
+ leads.push(`${failed3} of ${total} checks failed${notRunNote}`);
25986
26535
  if (pageFailed > 0)
25987
26536
  leads.push(
25988
26537
  `${pageFailed} ${pageFailed === 1 ? "check" : "checks"} on this page failed`
25989
26538
  );
25990
- if (failed2 === 0 && pageFailed === 0)
26539
+ if (failed3 === 0 && pageFailed === 0)
25991
26540
  leads.push(
25992
26541
  verified ? `${passed} of ${total} checks passed${notRunNote}` : SUMMARY_NOT_VERIFIED
25993
26542
  );
25994
- if (failed2 === 0 && (pageFailed > 0 || !verified) && notRun > 0)
26543
+ if (failed3 === 0 && (pageFailed > 0 || !verified) && notRun > 0)
25995
26544
  leads.push(`${notRun} of ${total} checks not run`);
25996
26545
  const parts = [...leads, topLevelRecordsWord(model.records.length)];
25997
26546
  const signatures2 = model.checkLists.notChecked.flatMap((id) => {
@@ -26116,6 +26665,38 @@ ${pad.repeat(depth)}`;
26116
26665
  });
26117
26666
  host.append(list2);
26118
26667
  }
26668
+ function parentWitnessLine(parent2) {
26669
+ const lead = "witnessed through a parent log: ";
26670
+ if (parent2.whole)
26671
+ return parent2.of === 1 ? `${lead}its only entry` : `${lead}all ${parent2.of} entries`;
26672
+ const covered = parent2.entries === 1 ? "entry 1" : `entries 1\u2013${parent2.entries}`;
26673
+ const first = parent2.entries + 1;
26674
+ const rest = first === parent2.of ? `entry ${parent2.of} is` : `entries ${first}\u2013${parent2.of} are`;
26675
+ return `${lead}${covered} of ${parent2.of}; ${rest} not covered by this witness`;
26676
+ }
26677
+ function parentWitnessTime(seconds) {
26678
+ if (seconds === null) return "time not stated";
26679
+ const date = new Date(seconds * 1e3);
26680
+ if (Number.isNaN(date.getTime()))
26681
+ return `time not a valid date (signed as ${seconds} seconds since 1970)`;
26682
+ return `recorded ${date.toISOString().replace("T", " ").replace(/\.\d+Z$/u, "")} UTC`;
26683
+ }
26684
+ function renderParentWitness(host, parent2) {
26685
+ const line = element6("p", parentWitnessLine(parent2));
26686
+ line.dataset.witness = "parent";
26687
+ line.dataset.whole = String(parent2.whole);
26688
+ host.append(line);
26689
+ const list2 = element6("ul");
26690
+ parent2.receipts.forEach(
26691
+ (receipt) => list2.append(
26692
+ element6(
26693
+ "li",
26694
+ `${receipt.witness} \xB7 ${parentWitnessTime(receipt.registrationTime)}`
26695
+ )
26696
+ )
26697
+ );
26698
+ host.append(list2);
26699
+ }
26119
26700
  var COVERAGE_LABEL = Object.freeze({
26120
26701
  checkpointed: "checkpointed",
26121
26702
  uncheckpointed: "uncheckpointed",
@@ -26467,6 +27048,8 @@ ${pad.repeat(depth)}`;
26467
27048
  );
26468
27049
  page.append(summary);
26469
27050
  renderReceipts(page, model.receipts);
27051
+ if (model.parentWitness !== void 0)
27052
+ renderParentWitness(page, model.parentWitness);
26470
27053
  if (model.selfWitnessed) {
26471
27054
  const witness = element6(
26472
27055
  "p",
@@ -27894,7 +28477,12 @@ ${pad.repeat(depth)}`;
27894
28477
  const words = result3 === void 0 && !charted ? void 0 : await contractReportWords(grouping, options.wording, {
27895
28478
  singleContract: result3 !== void 0 && citesOneContract(result3)
27896
28479
  });
27897
- if (result3 !== void 0) strip = await coreStripModel(result3, words);
28480
+ if (result3 !== void 0)
28481
+ strip = await coreStripModel(
28482
+ result3,
28483
+ words,
28484
+ resultDocument2(context, result3)
28485
+ );
27898
28486
  if (charted)
27899
28487
  chartsNode = await drawCharts(
27900
28488
  context,
@@ -27904,8 +28492,8 @@ ${pad.repeat(depth)}`;
27904
28492
  words
27905
28493
  );
27906
28494
  } else
27907
- for (const digest of chartDigests)
27908
- digest.refused = "the bundle did not verify";
28495
+ for (const digest2 of chartDigests)
28496
+ digest2.refused = "the bundle did not verify";
27909
28497
  const depth = options.depth ?? "L0";
27910
28498
  const region = (name) => {
27911
28499
  const node = document.createElement("div");
@@ -28214,8 +28802,8 @@ ${pad.repeat(depth)}`;
28214
28802
  for (const action of root.querySelectorAll(
28215
28803
  "details.cv-ev[data-cites]"
28216
28804
  ))
28217
- for (const digest of (action.dataset.cites ?? "").split(" ")) {
28218
- const entry = anchors.get(recordAddress(digest))?.closest("details.cv-record");
28805
+ for (const digest2 of (action.dataset.cites ?? "").split(" ")) {
28806
+ const entry = anchors.get(recordAddress(digest2))?.closest("details.cv-record");
28219
28807
  if (entry === void 0 || entry === null) continue;
28220
28808
  const list2 = citing.get(entry) ?? [];
28221
28809
  if (!list2.includes(action)) list2.push(action);
@@ -28317,12 +28905,12 @@ ${pad.repeat(depth)}`;
28317
28905
  let same3 = "not_carried";
28318
28906
  if (checkpoint !== null) {
28319
28907
  try {
28320
- const digest = await globalThis.crypto.subtle.digest(
28908
+ const digest2 = await globalThis.crypto.subtle.digest(
28321
28909
  "SHA-256",
28322
28910
  fromHex2(checkpoint)
28323
28911
  );
28324
28912
  same3 = Array.from(
28325
- new Uint8Array(digest),
28913
+ new Uint8Array(digest2),
28326
28914
  (b) => b.toString(16).padStart(2, "0")
28327
28915
  ).join("") === anchor ? "match" : "mismatch";
28328
28916
  } catch {
@@ -28363,14 +28951,14 @@ ${pad.repeat(depth)}`;
28363
28951
  const octets = new Uint8Array(new ArrayBuffer(32));
28364
28952
  for (let i = 0; i < 32; i += 1)
28365
28953
  octets[i] = Number.parseInt(preimage.slice(2 * i, 2 * i + 2), 16);
28366
- let digest;
28954
+ let digest2;
28367
28955
  try {
28368
- digest = await globalThis.crypto.subtle.digest("SHA-256", octets);
28956
+ digest2 = await globalThis.crypto.subtle.digest("SHA-256", octets);
28369
28957
  } catch {
28370
28958
  return "NOT_CHECKED";
28371
28959
  }
28372
28960
  const hex6 = Array.from(
28373
- new Uint8Array(digest),
28961
+ new Uint8Array(digest2),
28374
28962
  (b) => b.toString(16).padStart(2, "0")
28375
28963
  ).join("");
28376
28964
  return hex6 === hash2.toLowerCase() ? "PASS" : "FAIL";
@@ -28410,7 +28998,7 @@ ${pad.repeat(depth)}`;
28410
28998
  return void 0;
28411
28999
  }
28412
29000
  };
28413
- var uint = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
29001
+ var uint2 = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
28414
29002
  var sha2564 = async (...parts) => {
28415
29003
  const joined = new Uint8Array(
28416
29004
  new ArrayBuffer(parts.reduce((n, p) => n + p.length, 0))
@@ -28436,7 +29024,7 @@ ${pad.repeat(depth)}`;
28436
29024
  };
28437
29025
  var included = async (root, size, leafIndex, identity2, raw) => {
28438
29026
  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);
29027
+ 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
29028
  if (proofSize === void 0 || BigInt(proofSize) !== size || proofIndex !== leafIndex || !witness || !left || !right)
28441
29029
  return false;
28442
29030
  const flattened = [...witness];
@@ -28446,7 +29034,7 @@ ${pad.repeat(depth)}`;
28446
29034
  };
28447
29035
  var consistent = async (oldRoot, oldSize, newRoot, newSize, raw) => {
28448
29036
  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);
29037
+ 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
29038
  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
29039
  return false;
28452
29040
  return verifyConsistency2(a, b, {
@@ -28504,7 +29092,7 @@ ${pad.repeat(depth)}`;
28504
29092
  if (logId === "" && typeof chain.deal_log_id === "string")
28505
29093
  logId = chain.deal_log_id;
28506
29094
  const salt = typeof chain.salt === "string" ? chain.salt : "";
28507
- const size = uint(chain.size), index = uint(chain.index);
29095
+ const size = uint2(chain.size), index = uint2(chain.index);
28508
29096
  if (logId !== deal.logId || size === void 0 || BigInt(size) !== deal.size)
28509
29097
  return fail2("cadence_leaf_does_not_name_this_checkpoint");
28510
29098
  if (index === void 0 || index >= 2 ** CADENCE_DEPTH || salt === "")
@@ -28529,7 +29117,7 @@ ${pad.repeat(depth)}`;
28529
29117
  if (cadence.keyId !== deal.keyId)
28530
29118
  return fail2("cadence_checkpoint_signer_differs");
28531
29119
  if (inner.log_id !== cadence.logId) return fail2("cadence_log_id_mismatch");
28532
- const entry = uint(inner.entry_index);
29120
+ const entry = uint2(inner.entry_index);
28533
29121
  const cadenceRootBytes = fromHex3(cadence.root);
28534
29122
  if (entry === void 0 || !cadenceRootBytes || !await included(
28535
29123
  cadenceRootBytes,
@@ -28570,7 +29158,7 @@ ${pad.repeat(depth)}`;
28570
29158
  ({ name, keys: keys2 }) => keys2.map((key) => ({ name, key: fromHex3(key) }))
28571
29159
  );
28572
29160
  if (keys.length === 0) return result("NOT_CHECKED", "no_reader_witness");
28573
- let failed2 = false;
29161
+ let failed3 = false;
28574
29162
  let chosen;
28575
29163
  for (const entry of entries) {
28576
29164
  if (entry.is_stub === true) continue;
@@ -28585,7 +29173,7 @@ ${pad.repeat(depth)}`;
28585
29173
  if (outcome.notChecked) unavailable = true;
28586
29174
  }
28587
29175
  if (passed === void 0) {
28588
- if (!unavailable) failed2 = true;
29176
+ if (!unavailable) failed3 = true;
28589
29177
  continue;
28590
29178
  }
28591
29179
  if (chosen === void 0 || passed.time !== null && (chosen.time === null || passed.time < chosen.time))
@@ -28593,7 +29181,7 @@ ${pad.repeat(depth)}`;
28593
29181
  }
28594
29182
  if (chosen !== void 0)
28595
29183
  return result("PASS", null, chosen.name, chosen.time);
28596
- if (failed2) return result("FAIL", "receipt_not_verified");
29184
+ if (failed3) return result("FAIL", "receipt_not_verified");
28597
29185
  return result("NOT_CHECKED", "receipt_not_checked");
28598
29186
  }
28599
29187
  async function readerCadenceWitness(context) {
@@ -29435,7 +30023,7 @@ ${pad.repeat(depth)}`;
29435
30023
  const failedRow = rows.some(
29436
30024
  (x) => x.kind === "checkpoint" && x.signature === "fail"
29437
30025
  );
29438
- const failed2 = failedCheck || failedRow;
30026
+ const failed3 = failedCheck || failedRow;
29439
30027
  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
30028
  (c) => c.id === "checkpoint_signatures" && c.status === "pass"
29441
30029
  ));
@@ -29489,7 +30077,7 @@ ${pad.repeat(depth)}`;
29489
30077
  if (refusedReason !== void 0)
29490
30078
  heroLines.push(say("hero.refused.reason", { reason: refusedReason }));
29491
30079
  } else if (outcome === "unreadable") heroLines.push(say("hero.unreadable"));
29492
- else if (failed2) heroLines.push(say("hero.failed"));
30080
+ else if (failed3) heroLines.push(say("hero.failed"));
29493
30081
  else if (rows.length === 0)
29494
30082
  heroLines.push(
29495
30083
  say(kind === "checkpoint" ? "hero.none.checkpoints" : "hero.none.deals")
@@ -29692,7 +30280,7 @@ ${pad.repeat(depth)}`;
29692
30280
  )
29693
30281
  )
29694
30282
  ) : null;
29695
- const callout = outcome === "answered" && !failed2 ? el13(
30283
+ const callout = outcome === "answered" && !failed3 ? el13(
29696
30284
  "aside",
29697
30285
  { class: "cvh-callout", "data-history": "does-not-show" },
29698
30286
  el13("h2", null, say("callout.heading")),
@@ -29824,7 +30412,7 @@ ${pad.repeat(depth)}`;
29824
30412
  class: "cvh-checked",
29825
30413
  "data-history": "checked"
29826
30414
  };
29827
- if (failed2 || outcome !== "answered") checkedAttrs["open"] = "";
30415
+ if (failed3 || outcome !== "answered") checkedAttrs["open"] = "";
29828
30416
  const panel = el13(
29829
30417
  "details",
29830
30418
  checkedAttrs,
@@ -29860,7 +30448,7 @@ ${pad.repeat(depth)}`;
29860
30448
  "data-history": "view",
29861
30449
  "data-kind": kind,
29862
30450
  "data-surface": surface,
29863
- "data-verdict": failed2 ? "failed" : allPass ? "pass" : "unchecked"
30451
+ "data-verdict": failed3 ? "failed" : allPass ? "pass" : "unchecked"
29864
30452
  },
29865
30453
  header,
29866
30454
  el13("div", { class: "cvh-main" }, hero, chips, rowList, periodBlock),
@@ -29909,6 +30497,7 @@ ${pad.repeat(depth)}`;
29909
30497
  .cvh-seal-title{font-weight:700}.cvh-checked summary{cursor:pointer;font-weight:700;color:var(--cvh-navy)}
29910
30498
  .cvh-check[data-status=fail]{color:var(--cvh-bad)}.cvh-check[data-status=pass]{color:var(--cvh-ok)}
29911
30499
  .cvh-main,.cvh-side{display:grid;gap:16px;align-content:start}.cvh-refused{border:1px solid var(--cvh-bad);color:var(--cvh-bad);padding:8px 12px;border-radius:8px}
30500
+ @media screen and (prefers-color-scheme:dark){.cv-history{--cvh-ink:#e8eaee;--cvh-slate:#a3a9b3;--cvh-line:#33373e;--cvh-cream:#22262d;--cvh-navy:#c3d0e8;--cvh-ok:#5fcf90;--cvh-bad:#ff8f84;background:#16181c;color-scheme:dark}.cvh-badge[data-audience=private]{background:#3a2f1a;border-color:#e6b85c}}
29912
30501
  @media (min-width:900px){.cv-history{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}.cvh-header{grid-column:1/-1}}
29913
30502
  @media print{.cv-history{max-width:none;grid-template-columns:1fr}.cvh-proof code{display:block}}
29914
30503
  `;