@action-state-group/capsule-viewer 0.10.0 → 0.11.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.
@@ -1977,11 +1977,11 @@ var EvidenceGraph = (() => {
1977
1977
  if (Type.equals(token.type, Type.tag)) {
1978
1978
  if (options.tags && typeof options.tags[token.value] === "function") {
1979
1979
  const decodeControl = createTagDecodeControl(tokeniser, options);
1980
- const result2 = options.tags[token.value](decodeControl);
1980
+ const result3 = options.tags[token.value](decodeControl);
1981
1981
  if (!decodeControl._called) {
1982
1982
  throw new Error(`${decodeErrPrefix} tag decoder must call decode() or entries()`);
1983
1983
  }
1984
- return result2;
1984
+ return result3;
1985
1985
  }
1986
1986
  throw new Error(`${decodeErrPrefix} tag not supported (${token.value})`);
1987
1987
  }
@@ -2172,7 +2172,7 @@ var EvidenceGraph = (() => {
2172
2172
  return 2 * leaves - bits;
2173
2173
  }
2174
2174
  function peakPositions(size) {
2175
- const result2 = [];
2175
+ const result3 = [];
2176
2176
  let remaining = size, offset = 0, prevHeight = Number.POSITIVE_INFINITY;
2177
2177
  while (remaining > 0) {
2178
2178
  let h = 0;
@@ -2180,11 +2180,11 @@ var EvidenceGraph = (() => {
2180
2180
  if (h >= prevHeight) break;
2181
2181
  const mountain = 2 ** (h + 1) - 1;
2182
2182
  offset += mountain;
2183
- result2.push(offset - 1);
2183
+ result3.push(offset - 1);
2184
2184
  remaining -= mountain;
2185
2185
  prevHeight = h;
2186
2186
  }
2187
- return result2;
2187
+ return result3;
2188
2188
  }
2189
2189
  function findContainingPeak(pos, peaks) {
2190
2190
  for (let i = 0; i < peaks.length; i += 1) {
@@ -3277,8 +3277,8 @@ var EvidenceGraph = (() => {
3277
3277
  function mod(a, b) {
3278
3278
  if (b <= _0n2)
3279
3279
  throw new Error("mod: expected positive modulus, got " + b);
3280
- const result2 = a % b;
3281
- return result2 >= _0n2 ? result2 : b + result2;
3280
+ const result3 = a % b;
3281
+ return result3 >= _0n2 ? result3 : b + result3;
3282
3282
  }
3283
3283
  function pow(num, power, modulo) {
3284
3284
  if (modulo <= _1n2)
@@ -5092,6 +5092,7 @@ var EvidenceGraph = (() => {
5092
5092
  readWordingPack: () => readWordingPack,
5093
5093
  readerAnchorWitness: () => readerAnchorWitness,
5094
5094
  readerCadenceWitness: () => readerCadenceWitness,
5095
+ readerCardSignature: () => readerCardSignature,
5095
5096
  readerWitnessPolicy: () => readerWitnessPolicy,
5096
5097
  registerPresentation: () => registerPresentation,
5097
5098
  renderChecking: () => renderChecking,
@@ -5116,19 +5117,19 @@ var EvidenceGraph = (() => {
5116
5117
  var CONTENT_TYPE = "application/agent-action-capsule-id";
5117
5118
  var hex64 = /^[0-9a-f]{64}$/u;
5118
5119
  function concat(...parts) {
5119
- const result2 = new Uint8Array(parts.reduce((length, part) => length + part.length, 0));
5120
+ const result3 = new Uint8Array(parts.reduce((length, part) => length + part.length, 0));
5120
5121
  let offset = 0;
5121
5122
  for (const part of parts) {
5122
- result2.set(part, offset);
5123
+ result3.set(part, offset);
5123
5124
  offset += part.length;
5124
5125
  }
5125
- return result2;
5126
+ return result3;
5126
5127
  }
5127
5128
  function hexToBytes(value) {
5128
- const result2 = new Uint8Array(value.length / 2);
5129
- for (let i = 0; i < result2.length; i += 1)
5130
- result2[i] = Number.parseInt(value.slice(i * 2, i * 2 + 2), 16);
5131
- return result2;
5129
+ const result3 = new Uint8Array(value.length / 2);
5130
+ for (let i = 0; i < result3.length; i += 1)
5131
+ result3[i] = Number.parseInt(value.slice(i * 2, i * 2 + 2), 16);
5132
+ return result3;
5132
5133
  }
5133
5134
  function equalBytes(left, right) {
5134
5135
  return left.length === right.length && left.every((byte, index) => byte === right[index]);
@@ -6019,10 +6020,10 @@ var EvidenceGraph = (() => {
6019
6020
  var object2 = asJsonObject;
6020
6021
  function decodeCapsuleJson(data) {
6021
6022
  const value = decodeStrictJson(data);
6022
- const result2 = object2(value);
6023
- if (result2 === void 0)
6023
+ const result3 = object2(value);
6024
+ if (result3 === void 0)
6024
6025
  throw new TypeError("Capsule is not a JSON object");
6025
- return result2;
6026
+ return result3;
6026
6027
  }
6027
6028
  async function computeCapsuleId(capsule) {
6028
6029
  if (capsule.format_version !== "4")
@@ -6978,11 +6979,11 @@ var EvidenceGraph = (() => {
6978
6979
  const members = [];
6979
6980
  for (const m of block.members) {
6980
6981
  byId.set(m.id, m);
6981
- const result2 = await verifyMember(m, missing.has(m.id), verifyMemberBundle);
6982
- members.push(result2.member);
6983
- closureFindings.push(...result2.closure);
6984
- failed2.push(...result2.failed);
6985
- withheld.push(...result2.withheld);
6982
+ const result3 = await verifyMember(m, missing.has(m.id), verifyMemberBundle);
6983
+ members.push(result3.member);
6984
+ closureFindings.push(...result3.closure);
6985
+ failed2.push(...result3.failed);
6986
+ withheld.push(...result3.withheld);
6986
6987
  }
6987
6988
  let compositionClosure;
6988
6989
  const closureMissing = sortedUnique(block.missing);
@@ -7007,19 +7008,19 @@ var EvidenceGraph = (() => {
7007
7008
  const corroborations = [];
7008
7009
  for (const j of block.joins) {
7009
7010
  const { derived, differences } = await derivedState(j, byId, missing);
7010
- const result2 = derived === void 0 ? "not_derivable" : derived === j.state ? "derived_matches" : "join_state_mismatch";
7011
+ const result3 = derived === void 0 ? "not_derivable" : derived === j.state ? "derived_matches" : "join_state_mismatch";
7011
7012
  joins.push({
7012
7013
  members: j.members,
7013
7014
  basis: j.basis,
7014
7015
  declared: j.state,
7015
7016
  ...derived === void 0 ? {} : { derived },
7016
- result: result2,
7017
+ result: result3,
7017
7018
  differences
7018
7019
  });
7019
7020
  const pair = `${j.members[0]},${j.members[1]}`;
7020
- if (result2 === "join_state_mismatch")
7021
+ if (result3 === "join_state_mismatch")
7021
7022
  failed2.push(`join_state_mismatch:${pair}`);
7022
- else if (result2 === "not_derivable")
7023
+ else if (result3 === "not_derivable")
7023
7024
  withheld.push(`join_not_derivable:${pair}`);
7024
7025
  corroborations.push(corroboration(j, derived, byId, observers));
7025
7026
  }
@@ -7385,8 +7386,8 @@ var EvidenceGraph = (() => {
7385
7386
  };
7386
7387
  try {
7387
7388
  const signature2 = digitPairs(record.signature, "signature"), keyId = digitPairs(record.key_id, "key_id");
7388
- const result2 = await verifyProducerEnvelope(await recordCapsuleId(record), signature2);
7389
- if (result2.ok && result2.publicKey !== void 0 && equalBytes(result2.publicKey, keyId))
7389
+ const result3 = await verifyProducerEnvelope(await recordCapsuleId(record), signature2);
7390
+ if (result3.ok && result3.publicKey !== void 0 && equalBytes(result3.publicKey, keyId))
7390
7391
  return { verdict: "authored", messages: [] };
7391
7392
  } catch (error) {
7392
7393
  return {
@@ -7550,8 +7551,8 @@ var EvidenceGraph = (() => {
7550
7551
  category_coverage_consistency: consistency(member, recordIds, inputs.recordCategories)
7551
7552
  };
7552
7553
  }
7553
- function categoryCoverageFails(result2) {
7554
- return result2 !== null && CATEGORY_COVERAGE_GATING.some((name) => result2[name] === "FAIL");
7554
+ function categoryCoverageFails(result3) {
7555
+ return result3 !== null && CATEGORY_COVERAGE_GATING.some((name) => result3[name] === "FAIL");
7555
7556
  }
7556
7557
 
7557
7558
  // node_modules/@action-state-group/agent-action-capsule/dist/cose-receipt.js
@@ -7942,15 +7943,15 @@ var EvidenceGraph = (() => {
7942
7943
  var P = 2n ** 256n - 2n ** 224n + 2n ** 192n + 2n ** 96n - 1n;
7943
7944
  var B = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604bn;
7944
7945
  function modPow(base, exponent) {
7945
- let result2 = 1n;
7946
+ let result3 = 1n;
7946
7947
  base %= P;
7947
7948
  while (exponent > 0n) {
7948
7949
  if (exponent & 1n)
7949
- result2 = result2 * base % P;
7950
+ result3 = result3 * base % P;
7950
7951
  base = base * base % P;
7951
7952
  exponent >>= 1n;
7952
7953
  }
7953
- return result2;
7954
+ return result3;
7954
7955
  }
7955
7956
  function onP256(point) {
7956
7957
  const rhs = (x) => ((x * x * x - 3n * x + B) % P + P) % P;
@@ -8128,7 +8129,7 @@ var EvidenceGraph = (() => {
8128
8129
  reason: `not checked: ${reason}`,
8129
8130
  notChecked: true
8130
8131
  });
8131
- var fromCoseResult = (result2) => result2.unavailable ? notChecked(result2.reason) : failed(result2.reason);
8132
+ var fromCoseResult = (result3) => result3.unavailable ? notChecked(result3.reason) : failed(result3.reason);
8132
8133
  function gradeOf(label) {
8133
8134
  return typeof label === "string" ? GRADES.get(label) ?? null : null;
8134
8135
  }
@@ -8159,15 +8160,15 @@ var EvidenceGraph = (() => {
8159
8160
  } catch {
8160
8161
  return failed("receipt_b64 is not canonical base64");
8161
8162
  }
8162
- const result2 = await verifyCoseReceipt(receipt, hexToBytes(expected), key);
8163
- if (!result2.ok)
8164
- return fromCoseResult(result2);
8165
- const label = result2.protectedHeaders.get(HDR_GRADE);
8163
+ const result3 = await verifyCoseReceipt(receipt, hexToBytes(expected), key);
8164
+ if (!result3.ok)
8165
+ return fromCoseResult(result3);
8166
+ const label = result3.protectedHeaders.get(HDR_GRADE);
8166
8167
  return {
8167
8168
  ok: true,
8168
8169
  reason: "ok",
8169
8170
  grade: gradeOf(label),
8170
- ...registrationTimeOf(result2.protectedHeaders)
8171
+ ...registrationTimeOf(result3.protectedHeaders)
8171
8172
  };
8172
8173
  }
8173
8174
  async function verifyScrapiReceipt(receipt, options) {
@@ -8175,15 +8176,15 @@ var EvidenceGraph = (() => {
8175
8176
  return notChecked("no key pinned for this service");
8176
8177
  try {
8177
8178
  const leaf = hexToBytes(await sha256Hex(options.checkpointCose));
8178
- const result2 = await verifyCoseReceipt(receipt, leaf, options.servicePublicKeySpki);
8179
- if (!result2.ok)
8180
- return fromCoseResult(result2);
8181
- const label = result2.protectedHeaders.get(HDR_GRADE);
8179
+ const result3 = await verifyCoseReceipt(receipt, leaf, options.servicePublicKeySpki);
8180
+ if (!result3.ok)
8181
+ return fromCoseResult(result3);
8182
+ const label = result3.protectedHeaders.get(HDR_GRADE);
8182
8183
  return {
8183
8184
  ok: true,
8184
8185
  reason: "ok",
8185
8186
  grade: gradeOf(label) ?? GRADE_OBSERVED_ONLY,
8186
- ...registrationTimeOf(result2.protectedHeaders)
8187
+ ...registrationTimeOf(result3.protectedHeaders)
8187
8188
  };
8188
8189
  } catch (error) {
8189
8190
  return failed(`unreadable receipt: ${String(error)}`);
@@ -8428,7 +8429,7 @@ ${body}
8428
8429
  });
8429
8430
  }
8430
8431
  }
8431
- const statuses = new Set(results.map((result2) => result2.status));
8432
+ const statuses = new Set(results.map((result3) => result3.status));
8432
8433
  return {
8433
8434
  status: malformed || statuses.has("fail") ? "fail" : statuses.has("pass") ? "pass" : "withheld",
8434
8435
  findings,
@@ -8554,10 +8555,10 @@ ${body}
8554
8555
  const leaf = hexToBytes(anchorDigest);
8555
8556
  let unavailable = false;
8556
8557
  for (const { name, spki } of keys) {
8557
- const result2 = await verifyCoseReceipt(receipt, leaf, spki);
8558
- if (result2.ok)
8558
+ const result3 = await verifyCoseReceipt(receipt, leaf, spki);
8559
+ if (result3.ok)
8559
8560
  return report("PASS", name, parsed.time);
8560
- if (result2.unavailable)
8561
+ if (result3.unavailable)
8561
8562
  unavailable = true;
8562
8563
  }
8563
8564
  return report(unavailable ? "NOT_CHECKED" : "FAIL");
@@ -8751,11 +8752,11 @@ ${body}
8751
8752
  continue;
8752
8753
  const id = capsuleIdOf(record);
8753
8754
  const { verdict: verdict2, messages } = await verifyRecordSignature(record);
8754
- const result2 = !seen.has(id) && Object.hasOwn(plain2.capsuleResults, id) ? plain2.capsuleResults[id] : void 0;
8755
+ const result3 = !seen.has(id) && Object.hasOwn(plain2.capsuleResults, id) ? plain2.capsuleResults[id] : void 0;
8755
8756
  seen.add(id);
8756
8757
  records.push({
8757
8758
  capsuleId: id,
8758
- identityOk: result2?.ok === true && result2.capsuleId === id,
8759
+ identityOk: result3?.ok === true && result3.capsuleId === id,
8759
8760
  signature: verdict2,
8760
8761
  keyId: typeof record.key_id === "string" ? record.key_id : null,
8761
8762
  seq: seqs.get(id) ?? null,
@@ -8961,9 +8962,9 @@ ${body}
8961
8962
  findings.push(`record_duplicate:${id}`);
8962
8963
  continue;
8963
8964
  }
8964
- const result2 = await verifyClass1(record);
8965
- results[id] = result2;
8966
- if (!result2.ok || result2.capsuleId !== id) {
8965
+ const result3 = await verifyClass1(record);
8966
+ results[id] = result3;
8967
+ if (!result3.ok || result3.capsuleId !== id) {
8967
8968
  findings.push(`record_identity_invalid:${id}`);
8968
8969
  continue;
8969
8970
  }
@@ -9473,8 +9474,8 @@ ${body}
9473
9474
  perRecordMembership: { status: "fail", findings: [] }
9474
9475
  } : plain2;
9475
9476
  }
9476
- function isProducerSelection(result2) {
9477
- return result2.intervalCoverage.status === "withheld" && result2.intervalCoverage.findings.includes(SELECTION_NOT_CHECKABLE);
9477
+ function isProducerSelection(result3) {
9478
+ return result3.intervalCoverage.status === "withheld" && result3.intervalCoverage.findings.includes(SELECTION_NOT_CHECKABLE);
9478
9479
  }
9479
9480
  function isVerifiedBundleContext(value) {
9480
9481
  return object8(value) && contexts.has(value);
@@ -9539,8 +9540,8 @@ ${body}
9539
9540
  }
9540
9541
  function resolveFromVerification(bundle, results, index) {
9541
9542
  const status2 = /* @__PURE__ */ new Map();
9542
- for (const result2 of results)
9543
- status2.set(`${result2.capsuleId}\0${result2.member}`, result2.status);
9543
+ for (const result3 of results)
9544
+ status2.set(`${result3.capsuleId}\0${result3.member}`, result3.status);
9544
9545
  const overlay = object8(bundle) && object8(bundle.disclosures) ? bundle.disclosures : {};
9545
9546
  const resolved = /* @__PURE__ */ new Map();
9546
9547
  const one = (id, field) => {
@@ -11034,12 +11035,12 @@ ${body}
11034
11035
  }
11035
11036
  return { withheld, mismatched, unreadable, invalid: invalid2, total };
11036
11037
  }
11037
- function caseRecord(result2, claims, sourceCapsuleId) {
11038
+ function caseRecord(result3, claims, sourceCapsuleId) {
11038
11039
  if (sourceCapsuleId === void 0)
11039
11040
  return void 0;
11040
11041
  for (const claim of claims)
11041
11042
  for (const ref of claim.evidence) {
11042
- const record = result2.records.get(ref.digest);
11043
+ const record = result3.records.get(ref.digest);
11043
11044
  if (record === void 0 || record.stated === void 0)
11044
11045
  continue;
11045
11046
  if (record.carriedCapsuleId === sourceCapsuleId || record.carriedCapsuleId === void 0 && record.bookRecordId === void 0 && record.capsuleId === sourceCapsuleId)
@@ -11129,7 +11130,7 @@ ${body}
11129
11130
  ];
11130
11131
  });
11131
11132
  }
11132
- function findTranscript(result2, conversationId, claims, sourceCapsuleId, caseFrom = "reports") {
11133
+ function findTranscript(result3, conversationId, claims, sourceCapsuleId, caseFrom = "reports") {
11133
11134
  const records = [];
11134
11135
  const seen = /* @__PURE__ */ new Set();
11135
11136
  for (const claim of claims)
@@ -11137,7 +11138,7 @@ ${body}
11137
11138
  if (seen.has(ref.digest))
11138
11139
  continue;
11139
11140
  seen.add(ref.digest);
11140
- const record = result2.records.get(ref.digest);
11141
+ const record = result3.records.get(ref.digest);
11141
11142
  if (record !== void 0)
11142
11143
  records.push(record);
11143
11144
  }
@@ -11195,10 +11196,10 @@ ${body}
11195
11196
  reason: "a cited transcript does not commit to the same input as the case record the judge read"
11196
11197
  };
11197
11198
  }
11198
- function groupClaims(result2, terms) {
11199
+ function groupClaims(result3, terms) {
11199
11200
  const order = checksById(terms);
11200
11201
  const byConversation = /* @__PURE__ */ new Map();
11201
- for (const claim of result2.claims) {
11202
+ for (const claim of result3.claims) {
11202
11203
  if (claim.type !== REQUIREMENT_CLAIM)
11203
11204
  continue;
11204
11205
  const grouping = parseClaimGrouping(claim);
@@ -11209,8 +11210,8 @@ ${body}
11209
11210
  byConversation.set(grouping.conversationId, list2);
11210
11211
  }
11211
11212
  const contractRef = packRef(terms);
11212
- const cited = new Set(result2.claims.map((claim) => JSON.stringify([claim.contractRef, claim.requirementRef])));
11213
- const reserved = (result2.requirementsCovered ?? []).filter((ref) => !cited.has(JSON.stringify([ref.contractRef, ref.requirementRef])) && (ref.contractRef !== contractRef || criterionRef(ref.requirementRef) === void 0)).length;
11213
+ const cited = new Set(result3.claims.map((claim) => JSON.stringify([claim.contractRef, claim.requirementRef])));
11214
+ const reserved = (result3.requirementsCovered ?? []).filter((ref) => !cited.has(JSON.stringify([ref.contractRef, ref.requirementRef])) && (ref.contractRef !== contractRef || criterionRef(ref.requirementRef) === void 0)).length;
11214
11215
  const allLater2 = /* @__PURE__ */ new Set();
11215
11216
  for (const [conversationId, claims] of byConversation) {
11216
11217
  const drawn = terms.checks.flatMap((check) => check.criteria.flatMap((criterion2) => {
@@ -11228,7 +11229,7 @@ ${body}
11228
11229
  if (!claims.some((candidate) => candidate.requirementRef === `${check.id}.${criterion2.id}`))
11229
11230
  missing += 1;
11230
11231
  }
11231
- const missingVerdict = missing <= result2.coverage.excludedNotApplicable - reserved ? "not_applicable" : "no_claim";
11232
+ const missingVerdict = missing <= result3.coverage.excludedNotApplicable - reserved ? "not_applicable" : "no_claim";
11232
11233
  const conversations = [];
11233
11234
  const notYetInForce = [];
11234
11235
  const byDay = /* @__PURE__ */ new Map();
@@ -11249,7 +11250,7 @@ ${body}
11249
11250
  continue;
11250
11251
  }
11251
11252
  const target = claim.later && !claim.failed ? laterCriteria : criteria;
11252
- const judgment = reportPayload(result2.records, claim);
11253
+ const judgment = reportPayload(result3.records, claim);
11253
11254
  const rationale = judgment ? asString2(judgment.rationale) : void 0;
11254
11255
  const reasonCode = judgment ? asString2(judgment.reason_code) : void 0;
11255
11256
  const sourceCapsuleId = judgment ? asString2(judgment.source_capsule_id) : void 0;
@@ -11257,7 +11258,7 @@ ${body}
11257
11258
  const clauseClaim = judgment !== void 0 && asString2(judgment.clause_id) === `${check.id}.${criterion2.id}` ? asString2(judgment.clause_claim) : void 0;
11258
11259
  const { probabilities, confidence } = parseJudgeProbabilities(rationale);
11259
11260
  const cited2 = claim.evidence[0]?.digest;
11260
- const record = cited2 === void 0 ? void 0 : result2.records.get(cited2);
11261
+ const record = cited2 === void 0 ? void 0 : result3.records.get(cited2);
11261
11262
  target.push({
11262
11263
  checkId: check.id,
11263
11264
  criterionId: criterion2.id,
@@ -11271,13 +11272,13 @@ ${body}
11271
11272
  ...record?.bookRecordId === void 0 ? {} : { reportRecordId: record.bookRecordId },
11272
11273
  ...sourceCapsuleId === void 0 ? {} : { sourceCapsuleId },
11273
11274
  ...judgePinDigest === void 0 ? {} : { judgePinDigest },
11274
- reportState: reportState(result2.records, claim),
11275
+ reportState: reportState(result3.records, claim),
11275
11276
  ...clauseClaim === void 0 || clauseClaim.trim() === "" ? {} : { clauseClaim }
11276
11277
  });
11277
11278
  }
11278
11279
  }
11279
11280
  const firstClaim = [...criteria, ...laterCriteria].find((c) => c.claim !== void 0)?.claim;
11280
- const judgedDay = (firstClaim === void 0 ? void 0 : reportSealedDay(result2.records, firstClaim)) ?? dayOf(void 0);
11281
+ const judgedDay = (firstClaim === void 0 ? void 0 : reportSealedDay(result3.records, firstClaim)) ?? dayOf(void 0);
11281
11282
  const checkVerdicts = /* @__PURE__ */ new Map();
11282
11283
  for (const check of terms.checks) {
11283
11284
  const forCheck = criteria.filter((c) => c.checkId === check.id);
@@ -11286,17 +11287,17 @@ ${body}
11286
11287
  const sources = new Set([...criteria, ...laterCriteria].flatMap((c) => c.sourceCapsuleId === void 0 ? [] : [c.sourceCapsuleId]));
11287
11288
  let caseFrom = "reports";
11288
11289
  if (sources.size === 0) {
11289
- const cited2 = claimsCitedCase(result2.records, conversationId, claims, result2.claims);
11290
+ const cited2 = claimsCitedCase(result3.records, conversationId, claims, result3.claims);
11290
11291
  if (cited2 !== void 0) {
11291
11292
  sources.add(cited2);
11292
11293
  caseFrom = "claims";
11293
11294
  }
11294
11295
  }
11295
- const dated = conversationDate(caseRecord(result2, claims, sources.size === 1 ? [...sources][0] : void 0), judgedDay);
11296
+ const dated = conversationDate(caseRecord(result3, claims, sources.size === 1 ? [...sources][0] : void 0), judgedDay);
11296
11297
  const date = dated.date;
11297
11298
  const conversation = {
11298
11299
  conversationId,
11299
- transcript: findTranscript(result2, conversationId, claims, sources.size === 1 ? [...sources][0] : void 0, caseFrom),
11300
+ transcript: findTranscript(result3, conversationId, claims, sources.size === 1 ? [...sources][0] : void 0, caseFrom),
11300
11301
  ...sources.size === 1 ? { sourceCapsuleId: [...sources][0], caseFrom } : {},
11301
11302
  day: date,
11302
11303
  dated,
@@ -11361,7 +11362,7 @@ ${body}
11361
11362
  axes_digest: pin.axesDigest
11362
11363
  };
11363
11364
  }
11364
- function buildRunInfo(result2, conversations) {
11365
+ function buildRunInfo(result3, conversations) {
11365
11366
  const claimContracts = /* @__PURE__ */ new Set();
11366
11367
  const reportContracts = /* @__PURE__ */ new Set();
11367
11368
  const pins = /* @__PURE__ */ new Set();
@@ -11372,7 +11373,7 @@ ${body}
11372
11373
  if (claim === void 0)
11373
11374
  continue;
11374
11375
  claimContracts.add(claim.contractRef);
11375
- const payload = reportPayload(result2.records, claim);
11376
+ const payload = reportPayload(result3.records, claim);
11376
11377
  const contract = asString2(payload?.contract_ref) ?? asString2(payload?.contract);
11377
11378
  if (contract !== void 0)
11378
11379
  reportContracts.add(contract);
@@ -11386,7 +11387,7 @@ ${body}
11386
11387
  }
11387
11388
  const contracts = claimContracts.size > 0 ? claimContracts : reportContracts;
11388
11389
  const pinned = contracts.size <= 1 && pins.size <= 1 && components.size <= 1;
11389
- const counted2 = withheldReports(result2.records, conversations.flatMap((c) => c.criteria.flatMap((cr) => cr.claim === void 0 ? [] : [cr.claim])));
11390
+ const counted2 = withheldReports(result3.records, conversations.flatMap((c) => c.criteria.flatMap((cr) => cr.claim === void 0 ? [] : [cr.claim])));
11390
11391
  return {
11391
11392
  ...counted2.withheld > 0 ? { reportsWithheld: counted2.withheld } : {},
11392
11393
  ...counted2.mismatched > 0 ? { reportsMismatched: counted2.mismatched } : {},
@@ -11410,8 +11411,8 @@ ${body}
11410
11411
  }
11411
11412
  return { ...runInfo, judgePinRecomputes: recomputes };
11412
11413
  }
11413
- function judgedCase(result2, caseDigest) {
11414
- const citing = result2.claims.filter((claim) => claim.type === REQUIREMENT_CLAIM && !claim.failed && claim.evidence.some((ref) => ref.digest === caseDigest));
11414
+ function judgedCase(result3, caseDigest) {
11415
+ const citing = result3.claims.filter((claim) => claim.type === REQUIREMENT_CLAIM && !claim.failed && claim.evidence.some((ref) => ref.digest === caseDigest));
11415
11416
  const first = citing[0];
11416
11417
  if (first === void 0)
11417
11418
  return void 0;
@@ -11423,16 +11424,16 @@ ${body}
11423
11424
  } : void 0;
11424
11425
  }
11425
11426
  var COUNTED_LABELS = /* @__PURE__ */ new Set(["met", "not_met"]);
11426
- function buildCalibration(result2) {
11427
+ function buildCalibration(result3) {
11427
11428
  const readings2 = [];
11428
- for (const claim of result2.claims) {
11429
+ for (const claim of result3.claims) {
11429
11430
  if (claim.type !== "calibration")
11430
11431
  continue;
11431
11432
  const summaries = [];
11432
11433
  const ratings = [];
11433
11434
  let ratingsNotMatching = 0;
11434
11435
  for (const digest of new Set(claim.evidence.map((ref) => ref.digest))) {
11435
- const payload = citedPayload(result2.records, digest);
11436
+ const payload = citedPayload(result3.records, digest);
11436
11437
  if (payload === void 0)
11437
11438
  continue;
11438
11439
  if (payload.record_version === CALIBRATION_SUMMARY_V1)
@@ -11443,7 +11444,7 @@ ${body}
11443
11444
  ratingsNotMatching += 1;
11444
11445
  continue;
11445
11446
  }
11446
- const judged = judgedCase(result2, rating.ratedCase.digest);
11447
+ const judged = judgedCase(result3, rating.ratedCase.digest);
11447
11448
  ratings.push({
11448
11449
  digest,
11449
11450
  rating,
@@ -11575,8 +11576,8 @@ ${body}
11575
11576
  }
11576
11577
  return out;
11577
11578
  }
11578
- function citedContract(result2, contractRef) {
11579
- for (const record of result2.records.values()) {
11579
+ function citedContract(result3, contractRef) {
11580
+ for (const record of result3.records.values()) {
11580
11581
  const input = record.carriedInput ?? record.agentInput;
11581
11582
  if (input.state !== "disclosed" || !isObject2(input.payload))
11582
11583
  continue;
@@ -11588,10 +11589,10 @@ ${body}
11588
11589
  }
11589
11590
  return void 0;
11590
11591
  }
11591
- function readOutcomeReportTerms(result2) {
11592
+ function readOutcomeReportTerms(result3) {
11592
11593
  const checks = /* @__PURE__ */ new Map();
11593
11594
  const contracts = /* @__PURE__ */ new Set();
11594
- for (const claim of result2.claims) {
11595
+ for (const claim of result3.claims) {
11595
11596
  if (claim.type !== REQUIREMENT_CLAIM)
11596
11597
  continue;
11597
11598
  const grouping = parseClaimGrouping(claim);
@@ -11604,8 +11605,8 @@ ${body}
11604
11605
  checks.set(grouping.checkId, criteria);
11605
11606
  }
11606
11607
  const contractRef = contracts.size === 1 ? [...contracts][0] : void 0;
11607
- const contract = contractRef === void 0 ? void 0 : citedContract(result2, contractRef);
11608
- const coveredRefs = result2.requirementsCovered === void 0 ? contractCriteria(contract) : result2.requirementsCovered.filter((covered) => covered.contractRef === contractRef).map((covered) => covered.requirementRef);
11608
+ const contract = contractRef === void 0 ? void 0 : citedContract(result3, contractRef);
11609
+ const coveredRefs = result3.requirementsCovered === void 0 ? contractCriteria(contract) : result3.requirementsCovered.filter((covered) => covered.contractRef === contractRef).map((covered) => covered.requirementRef);
11609
11610
  for (const ref of coveredRefs) {
11610
11611
  const split2 = criterionRef(ref);
11611
11612
  if (split2 === void 0)
@@ -11640,13 +11641,13 @@ ${body}
11640
11641
  reasonCodes: {}
11641
11642
  };
11642
11643
  }
11643
- function notRunCriteria(result2, terms) {
11644
- const covered = result2.requirementsCovered;
11644
+ function notRunCriteria(result3, terms) {
11645
+ const covered = result3.requirementsCovered;
11645
11646
  const contractRef = packRef(terms);
11646
11647
  if (covered === void 0 || contractRef === void 0)
11647
11648
  return [];
11648
11649
  const listed = new Set(covered.filter((ref) => ref.contractRef === contractRef).map((ref) => ref.requirementRef));
11649
- return contractCriteria(citedContract(result2, contractRef)).filter((id) => !listed.has(id));
11650
+ return contractCriteria(citedContract(result3, contractRef)).filter((id) => !listed.has(id));
11650
11651
  }
11651
11652
  function contractCriteria(contract) {
11652
11653
  const ids = [];
@@ -11672,9 +11673,9 @@ ${body}
11672
11673
  zoneNotStated: conversations.filter((c) => c.dated.zone === "not-stated").length
11673
11674
  };
11674
11675
  }
11675
- function buildOutcomeReportModel(result2, options) {
11676
- const terms = readOutcomeReportTerms(result2);
11677
- const { conversations, days, notYetInForce } = groupClaims(result2, terms);
11676
+ function buildOutcomeReportModel(result3, options) {
11677
+ const terms = readOutcomeReportTerms(result3);
11678
+ const { conversations, days, notYetInForce } = groupClaims(result3, terms);
11678
11679
  const dayList = [...days.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([date, convos]) => ({
11679
11680
  date,
11680
11681
  // No evaluation-report/v1 record carries a day-level policy-change
@@ -11686,7 +11687,7 @@ ${body}
11686
11687
  resolvedCount: convos.filter((c) => c.verdict === "met").length,
11687
11688
  judgedDays: [...new Set(convos.map((c) => c.judgedDay))].sort()
11688
11689
  }));
11689
- const calibration = buildCalibration(result2);
11690
+ const calibration = buildCalibration(result3);
11690
11691
  const { held: held2, added } = heldAndAdded(calibration);
11691
11692
  const checkPassCounts = /* @__PURE__ */ new Map();
11692
11693
  for (const check of terms.checks)
@@ -11703,7 +11704,7 @@ ${body}
11703
11704
  dating: buildDating(conversations),
11704
11705
  conversations,
11705
11706
  notYetInForce,
11706
- runInfo: buildRunInfo(result2, conversations),
11707
+ runInfo: buildRunInfo(result3, conversations),
11707
11708
  calibration,
11708
11709
  checkPassCounts,
11709
11710
  missedReasons: missedReasonGroups(terms, conversations),
@@ -11717,8 +11718,8 @@ ${body}
11717
11718
  notApplicableCount,
11718
11719
  outOfScopeCount,
11719
11720
  noClaimCount,
11720
- notRun: notRunCriteria(result2, terms),
11721
- capsuleId: result2.capsuleId
11721
+ notRun: notRunCriteria(result3, terms),
11722
+ capsuleId: result3.capsuleId
11722
11723
  };
11723
11724
  }
11724
11725
 
@@ -11835,12 +11836,12 @@ ${body}
11835
11836
  return invalid2.has(id) ? [] : [id];
11836
11837
  });
11837
11838
  }
11838
- function membershipProvenOrUnbound(result2) {
11839
- return result2.perRecordMembership.status === "pass" || result2.perRecordMembership.status === "fail" && result2.perRecordMembership.findings.length > 0 && result2.perRecordMembership.findings.length === unboundRecordIds(result2).length;
11839
+ function membershipProvenOrUnbound(result3) {
11840
+ return result3.perRecordMembership.status === "pass" || result3.perRecordMembership.status === "fail" && result3.perRecordMembership.findings.length > 0 && result3.perRecordMembership.findings.length === unboundRecordIds(result3).length;
11840
11841
  }
11841
- function bundleVerified(result2) {
11842
- const selected = isProducerSelection(result2);
11843
- return result2.graphClosure.status === "pass" && (selected || result2.intervalCoverage.status === "pass") && membershipProvenOrUnbound(result2) && Object.values(result2.capsuleResults).every((capsule) => capsule.ok) && result2.disclosures.every((disclosure) => disclosure.status === "disclosure_match" || disclosure.status === "withheld");
11842
+ function bundleVerified(result3) {
11843
+ const selected = isProducerSelection(result3);
11844
+ return result3.graphClosure.status === "pass" && (selected || result3.intervalCoverage.status === "pass") && membershipProvenOrUnbound(result3) && Object.values(result3.capsuleResults).every((capsule) => capsule.ok) && result3.disclosures.every((disclosure) => disclosure.status === "disclosure_match" || disclosure.status === "withheld");
11844
11845
  }
11845
11846
  function nonUnboundFindings(verified) {
11846
11847
  const names2 = [];
@@ -12219,7 +12220,7 @@ ${body}
12219
12220
  const results = Object.values(capsuleResults);
12220
12221
  if (results.length === 0)
12221
12222
  return "not_checked";
12222
- const failed2 = results.some((result2) => result2.findings.some((finding) => finding.severity === "error" && finding.check !== void 0 && checks.includes(finding.check)));
12223
+ const failed2 = results.some((result3) => result3.findings.some((finding) => finding.severity === "error" && finding.check !== void 0 && checks.includes(finding.check)));
12223
12224
  return failed2 ? "fail" : "pass";
12224
12225
  }
12225
12226
  function receiptGradeWord(value) {
@@ -13646,10 +13647,10 @@ ${body}
13646
13647
  return invalid(`${what} is not {digest_alg: "SHA-256", digest: <64-hex>}`);
13647
13648
  return value.digest;
13648
13649
  }
13649
- function resultDocument2(context, result2) {
13650
- const member = disclosureOf(context, result2.capsuleId, result2.member);
13650
+ function resultDocument2(context, result3) {
13651
+ const member = disclosureOf(context, result3.capsuleId, result3.member);
13651
13652
  if (member.state !== "disclosed" || !isObj3(member.payload)) return void 0;
13652
- const document2 = result2.form === "book" ? member.payload.statement : member.payload;
13653
+ const document2 = result3.form === "book" ? member.payload.statement : member.payload;
13653
13654
  return isObj3(document2) ? document2 : void 0;
13654
13655
  }
13655
13656
  async function digestOf(value) {
@@ -13701,8 +13702,8 @@ ${body}
13701
13702
  }
13702
13703
  return found;
13703
13704
  }
13704
- async function chartDatasetOf(context, result2) {
13705
- const document2 = resultDocument2(context, result2);
13705
+ async function chartDatasetOf(context, result3) {
13706
+ const document2 = resultDocument2(context, result3);
13706
13707
  if (document2 === void 0) return void 0;
13707
13708
  const planRef = digestRef(document2.plan_ref, "the Result's plan_ref");
13708
13709
  const datasetRef = digestRef(
@@ -14098,7 +14099,7 @@ ${s} [data-src="producer"]:not(.cv-src){font-style:italic}
14098
14099
  const found = globalThis.CapsuleViewerShowEvidence;
14099
14100
  return typeof found?.resolve === "function" && typeof found.render === "function" ? found : void 0;
14100
14101
  }
14101
- function evidenceAction(key, name, counted2, result2, w, summary = w.t("evidence.show")) {
14102
+ function evidenceAction(key, name, counted2, result3, w, summary = w.t("evidence.show")) {
14102
14103
  if (counted2.length === 0) return void 0;
14103
14104
  const claims = counted2.filter((c) => c !== void 0);
14104
14105
  const cited = /* @__PURE__ */ new Set();
@@ -14164,7 +14165,7 @@ ${s} [data-src="producer"]:not(.cv-src){font-style:italic}
14164
14165
  for (const claim of new Set(claims))
14165
14166
  sides.append(
14166
14167
  component.render(
14167
- component.resolve(result2, claim),
14168
+ component.resolve(result3, claim),
14168
14169
  details.ownerDocument
14169
14170
  )
14170
14171
  );
@@ -15479,11 +15480,11 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15479
15480
 
15480
15481
  // src/record-dating.ts
15481
15482
  var STATED_DAY2 = /^(\d{4}-\d{2}-\d{2})/u;
15482
- function caseRecord2(result2, claims, sourceCapsuleId) {
15483
+ function caseRecord2(result3, claims, sourceCapsuleId) {
15483
15484
  if (sourceCapsuleId === void 0) return void 0;
15484
15485
  for (const claim of claims)
15485
15486
  for (const ref of claim.evidence) {
15486
- const record = result2.records.get(ref.digest);
15487
+ const record = result3.records.get(ref.digest);
15487
15488
  if (record === void 0 || record.stated === void 0) continue;
15488
15489
  if (record.carriedCapsuleId === sourceCapsuleId || record.carriedCapsuleId === void 0 && record.bookRecordId === void 0 && record.capsuleId === sourceCapsuleId)
15489
15490
  return record;
@@ -15577,8 +15578,8 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15577
15578
  obligationKey: claim.requirementRef.slice(0, dot)
15578
15579
  };
15579
15580
  }
15580
- function countedClaims(result2, presentation) {
15581
- const parsed = result2.claims.flatMap((c) => {
15581
+ function countedClaims(result3, presentation) {
15582
+ const parsed = result3.claims.flatMap((c) => {
15582
15583
  const p = parseClaim(c);
15583
15584
  return p === void 0 ? [] : [p];
15584
15585
  });
@@ -15602,7 +15603,7 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15602
15603
  pack: { id: NOT_STATED, version: NOT_STATED }
15603
15604
  };
15604
15605
  }
15605
- function buildSessions(result2, claims, testIds) {
15606
+ function buildSessions(result3, claims, testIds) {
15606
15607
  const byConversation = /* @__PURE__ */ new Map();
15607
15608
  for (const p of claims) {
15608
15609
  const list2 = byConversation.get(p.conversationId) ?? [];
@@ -15632,18 +15633,18 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15632
15633
  verdict: "not_yet_in_force",
15633
15634
  tier: "not stated",
15634
15635
  claim,
15635
- reportState: reportState(result2.records, claim)
15636
+ reportState: reportState(result3.records, claim)
15636
15637
  });
15637
15638
  continue;
15638
15639
  }
15639
- const payload = reportPayload2(result2.records, claim);
15640
+ const payload = reportPayload2(result3.records, claim);
15640
15641
  const rationale = asString2(payload?.rationale);
15641
15642
  const contract = claim.contractRef || asString2(payload?.contract_ref) || asString2(payload?.contract);
15642
15643
  const judgePinDigest = asString2(payload?.judge_pin_digest);
15643
15644
  const source = asString2(payload?.source_capsule_id);
15644
15645
  if (source !== void 0) sources.add(source);
15645
15646
  if (judgedDay === NOT_STATED)
15646
- judgedDay = reportSealedDay(result2.records, claim) ?? dayOf2(payload);
15647
+ judgedDay = reportSealedDay(result3.records, claim) ?? dayOf2(payload);
15647
15648
  const reportDigest = claim.evidence[0]?.digest;
15648
15649
  tests.push({
15649
15650
  criterionId,
@@ -15656,16 +15657,16 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15656
15657
  ...rationale === void 0 ? {} : { rationale },
15657
15658
  ...contract === void 0 ? {} : { contract },
15658
15659
  ...judgePinDigest === void 0 ? {} : { judgePinDigest },
15659
- reportState: reportState(result2.records, claim)
15660
+ reportState: reportState(result3.records, claim)
15660
15661
  });
15661
15662
  }
15662
15663
  let caseFrom = "reports";
15663
15664
  if (sources.size === 0) {
15664
15665
  const cited = claimsCitedCase(
15665
- result2.records,
15666
+ result3.records,
15666
15667
  conversationId,
15667
15668
  conversationClaims,
15668
- result2.claims
15669
+ result3.claims
15669
15670
  );
15670
15671
  if (cited !== void 0) {
15671
15672
  sources.add(cited);
@@ -15674,7 +15675,7 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15674
15675
  }
15675
15676
  const sourceCapsuleId = sources.size === 1 ? [...sources][0] : void 0;
15676
15677
  const dated = conversationDate2(
15677
- caseRecord2(result2, conversationClaims, sourceCapsuleId),
15678
+ caseRecord2(result3, conversationClaims, sourceCapsuleId),
15678
15679
  judgedDay
15679
15680
  );
15680
15681
  sessions.push({
@@ -15685,7 +15686,7 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15685
15686
  tests,
15686
15687
  ...sourceCapsuleId === void 0 ? {} : { sourceCapsuleId, caseFrom },
15687
15688
  transcript: findTranscript(
15688
- result2,
15689
+ result3,
15689
15690
  conversationId,
15690
15691
  conversationClaims,
15691
15692
  sourceCapsuleId,
@@ -15698,11 +15699,11 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15698
15699
  );
15699
15700
  return sessions;
15700
15701
  }
15701
- function sealedWording(result2, claims, criterionId) {
15702
+ function sealedWording(result3, claims, criterionId) {
15702
15703
  const texts = /* @__PURE__ */ new Set();
15703
15704
  for (const p of claims) {
15704
15705
  if (p.claim.requirementRef !== criterionId) continue;
15705
- const text2 = asString2(reportPayload2(result2.records, p.claim)?.clause_claim);
15706
+ const text2 = asString2(reportPayload2(result3.records, p.claim)?.clause_claim);
15706
15707
  if (text2 !== void 0) texts.add(text2);
15707
15708
  }
15708
15709
  if (texts.size === 1) return { text: [...texts][0], source: "sealed" };
@@ -15771,7 +15772,7 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15771
15772
  rows
15772
15773
  };
15773
15774
  }
15774
- function buildRunInfo2(result2, sessions) {
15775
+ function buildRunInfo2(result3, sessions) {
15775
15776
  const contracts = /* @__PURE__ */ new Set();
15776
15777
  const pins = /* @__PURE__ */ new Set();
15777
15778
  for (const session of sessions)
@@ -15783,12 +15784,12 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15783
15784
  ...contracts.size === 1 ? { contract: [...contracts][0] } : {},
15784
15785
  ...pins.size === 1 ? { judgePinDigest: [...pins][0] } : {},
15785
15786
  pinned: contracts.size <= 1 && pins.size <= 1,
15786
- ...withheldOf(result2, sessions)
15787
+ ...withheldOf(result3, sessions)
15787
15788
  };
15788
15789
  }
15789
- function withheldOf(result2, sessions) {
15790
+ function withheldOf(result3, sessions) {
15790
15791
  const counted2 = withheldReports(
15791
- result2.records,
15792
+ result3.records,
15792
15793
  sessions.flatMap(
15793
15794
  (s) => s.tests.flatMap((t) => t.claim === void 0 ? [] : [t.claim])
15794
15795
  )
@@ -15827,8 +15828,8 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15827
15828
  ...days.length === 0 ? {} : { from: days[0], to: days[days.length - 1] }
15828
15829
  };
15829
15830
  }
15830
- function buildComplianceModel(result2, presentation) {
15831
- const { claims, pack } = countedClaims(result2, presentation);
15831
+ function buildComplianceModel(result3, presentation) {
15832
+ const { claims, pack } = countedClaims(result3, presentation);
15832
15833
  const tests = /* @__PURE__ */ new Map();
15833
15834
  for (const p of claims) {
15834
15835
  const list2 = tests.get(p.obligationKey) ?? [];
@@ -15837,7 +15838,7 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15837
15838
  tests.set(p.obligationKey, list2);
15838
15839
  }
15839
15840
  const testIds = [...tests.values()].flat();
15840
- const sessions = buildSessions(result2, claims, testIds);
15841
+ const sessions = buildSessions(result3, claims, testIds);
15841
15842
  const mappings = new Map(presentation.obligations.map((o) => [o.key, o]));
15842
15843
  const obligations = [...tests.entries()].map(([key, ids]) => {
15843
15844
  const mapping = mappings.get(key);
@@ -15851,7 +15852,7 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15851
15852
  (id) => buildRow(
15852
15853
  id,
15853
15854
  rowMappings.get(id),
15854
- sealedWording(result2, claims, id),
15855
+ sealedWording(result3, claims, id),
15855
15856
  sessions
15856
15857
  )
15857
15858
  )
@@ -15865,9 +15866,9 @@ path.cv-tl-good{fill:var(--person)}path.cv-tl-bad{fill:var(--bad)}path.cv-tl-ope
15865
15866
  findings: buildFindings(obligations),
15866
15867
  totalSessions: sessions.length,
15867
15868
  dating: complianceDating(sessions),
15868
- runInfo: buildRunInfo2(result2, sessions),
15869
+ runInfo: buildRunInfo2(result3, sessions),
15869
15870
  qualityProtocol: presentation.qualityProtocol,
15870
- capsuleId: result2.capsuleId
15871
+ capsuleId: result3.capsuleId
15871
15872
  };
15872
15873
  }
15873
15874
 
@@ -16620,13 +16621,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16620
16621
  }
16621
16622
  function builtCommit() {
16622
16623
  if (false) return void 0;
16623
- return commitPrefix("ba539fe78e33f83d44db1c1352e0c49cb1eee51b");
16624
+ return commitPrefix("60fb05dda0f3c2be341a9d5cccbb991bed45f0b9");
16624
16625
  }
16625
16626
  var commit = builtCommit();
16626
16627
  var unreleased = false;
16627
16628
  var VIEWER_BUILD = {
16628
16629
  viewer: "@action-state-group/capsule-viewer",
16629
- viewerVersion: "0.10.0",
16630
+ viewerVersion: "0.11.0",
16630
16631
  verifier: "@action-state-group/agent-action-capsule",
16631
16632
  verifierVersion: "0.13.0",
16632
16633
  cllVersion: "0.3.0",
@@ -20737,7 +20738,7 @@ ${key}`);
20737
20738
  }
20738
20739
  host.append(section);
20739
20740
  }
20740
- function renderRules(host, model, runInfo, result2, w) {
20741
+ function renderRules(host, model, runInfo, result3, w) {
20741
20742
  const tierOf = model.gating?.tierOf;
20742
20743
  const section = el8("section", "sec");
20743
20744
  section.dataset.section = "rules";
@@ -20843,7 +20844,7 @@ ${key}`);
20843
20844
  (cr) => cr.checkId === check.id && cr.criterionId === criterion2.id && pick(cr.verdict)
20844
20845
  )?.claim
20845
20846
  ),
20846
- result2,
20847
+ result3,
20847
20848
  w
20848
20849
  );
20849
20850
  if (action !== void 0) cell4.append(action);
@@ -21332,13 +21333,13 @@ ${key}`);
21332
21333
  section.append(toggle);
21333
21334
  host.append(section);
21334
21335
  }
21335
- async function resultDocument3(result2, bundle) {
21336
+ async function resultDocument3(result3, bundle) {
21336
21337
  try {
21337
21338
  const context = await verifiedBundleContext(bundle);
21338
- const member = disclosureOf(context, result2.capsuleId, result2.member);
21339
+ const member = disclosureOf(context, result3.capsuleId, result3.member);
21339
21340
  if (member.state !== "disclosed") return void 0;
21340
21341
  const payload = member.payload;
21341
- return result2.form === "book" && payload !== null && typeof payload === "object" ? payload.statement : payload;
21342
+ return result3.form === "book" && payload !== null && typeof payload === "object" ? payload.statement : payload;
21342
21343
  } catch {
21343
21344
  return void 0;
21344
21345
  }
@@ -21384,8 +21385,8 @@ ${key}`);
21384
21385
  page: "outcome-report",
21385
21386
  css: OUTCOME_REPORT_CSS
21386
21387
  };
21387
- async function drawLines(levels, result2, options, bundle, verified, w, tierOf) {
21388
- const built = buildOutcomeReportModel(result2, options);
21388
+ async function drawLines(levels, result3, options, bundle, verified, w, tierOf) {
21389
+ const built = buildOutcomeReportModel(result3, options);
21389
21390
  const model = tierOf === void 0 ? built : { ...built, gating: gating(built.conversations, tierOf) };
21390
21391
  const runInfo = await verifyJudgePin(model.runInfo);
21391
21392
  const claims = model.conversations.flatMap(
@@ -21401,7 +21402,7 @@ ${key}`);
21401
21402
  if (notes.childElementCount > 0) pad.append(notes);
21402
21403
  sheet.append(pad);
21403
21404
  levels.L0.append(sheet);
21404
- const slice2 = readSubjectHistory(await resultDocument3(result2, bundle));
21405
+ const slice2 = readSubjectHistory(await resultDocument3(result3, bundle));
21405
21406
  if (slice2 !== void 0) {
21406
21407
  const subject = renderSubjectHistory(
21407
21408
  subjectConversations(model, w),
@@ -21411,12 +21412,12 @@ ${key}`);
21411
21412
  );
21412
21413
  if (subject !== void 0) levels.L0.append(subject);
21413
21414
  }
21414
- renderRules(levels.L1, model, runInfo, result2, w);
21415
+ renderRules(levels.L1, model, runInfo, result3, w);
21415
21416
  leadWithProvenance(
21416
21417
  levels.L1,
21417
21418
  levels.L1.querySelector('[data-section="rules"]'),
21418
21419
  renderProvenance(
21419
- await provenanceLines(result2.records, claims, bundle, verified, w)
21420
+ await provenanceLines(result3.records, claims, bundle, verified, w)
21420
21421
  )
21421
21422
  );
21422
21423
  levels.L2.append(renderCheckYourself(bundle, w));
@@ -21703,7 +21704,7 @@ ${key}`);
21703
21704
  ...undecided
21704
21705
  };
21705
21706
  }
21706
- function rowResult(row2, model, result2, w) {
21707
+ function rowResult(row2, model, result3, w) {
21707
21708
  const cell2 = document.createElement("td");
21708
21709
  const status2 = rowStatus(row2, w);
21709
21710
  cell2.append(statusPill(status2.cls, status2.text));
@@ -21733,7 +21734,7 @@ ${key}`);
21733
21734
  `test:${row2.criterionId}:${bucket}`,
21734
21735
  `${row2.name} \xB7 ${word}: ${fmt4(ids.length)}`,
21735
21736
  ids.map((id) => claimOf(model, id, row2.criterionId)),
21736
- result2,
21737
+ result3,
21737
21738
  w,
21738
21739
  w.t("evidence.show.for", { what: word })
21739
21740
  );
@@ -21751,7 +21752,7 @@ ${key}`);
21751
21752
  ]);
21752
21753
  return model.sessions.filter((s) => !outside.has(s.conversationId)).map((s) => s.tests.find((t) => t.criterionId === row2.criterionId)?.claim);
21753
21754
  }
21754
- function renderSummary(host, model, presentation, result2, w, tierOf) {
21755
+ function renderSummary(host, model, presentation, result3, w, tierOf) {
21755
21756
  const section = el9("section", "");
21756
21757
  section.dataset.section = "summary";
21757
21758
  const regulation = maybeProducer(w, "p", "kicker", model.regulation, true);
@@ -21896,11 +21897,11 @@ ${key}`);
21896
21897
  `test:${test.criterionId}:checked-in`,
21897
21898
  `${test.name} \xB7 ${w.t("groups.summary.col.checked-in")}: ${count(w, "session", counted2)}`,
21898
21899
  populationClaims(test, model),
21899
- result2,
21900
+ result3,
21900
21901
  w
21901
21902
  );
21902
21903
  if (action !== void 0) checkedIn.append(action);
21903
- tr.append(nameCell, checkedIn, rowResult(test, model, result2, w));
21904
+ tr.append(nameCell, checkedIn, rowResult(test, model, result3, w));
21904
21905
  tbody.append(tr);
21905
21906
  if (sessionIds.length > 0) {
21906
21907
  const drillRow = el9("tr", "drill-row");
@@ -22360,8 +22361,8 @@ ${key}`);
22360
22361
  page: "compliance",
22361
22362
  css: COMPLIANCE_CSS
22362
22363
  };
22363
- async function drawGroups(levels, result2, presentation, bundle, verified, w, tierOf) {
22364
- const model = buildComplianceModel(result2, presentation);
22364
+ async function drawGroups(levels, result3, presentation, bundle, verified, w, tierOf) {
22365
+ const model = buildComplianceModel(result3, presentation);
22365
22366
  const claims = model.sessions.flatMap(
22366
22367
  (s) => s.tests.flatMap((t) => t.claim === void 0 ? [] : [t.claim])
22367
22368
  );
@@ -22369,12 +22370,12 @@ ${key}`);
22369
22370
  const sheet = el9("div", "l0-card");
22370
22371
  renderHeader(sheet, model, w, tierOf);
22371
22372
  levels.L0.append(sheet);
22372
- renderSummary(levels.L1, model, presentation, result2, w, tierOf);
22373
+ renderSummary(levels.L1, model, presentation, result3, w, tierOf);
22373
22374
  leadWithProvenance(
22374
22375
  levels.L1,
22375
22376
  levels.L1.querySelector('[data-section="summary"]'),
22376
22377
  renderProvenance(
22377
- await provenanceLines(result2.records, claims, bundle, verified, w)
22378
+ await provenanceLines(result3.records, claims, bundle, verified, w)
22378
22379
  )
22379
22380
  );
22380
22381
  renderFindings(levels.L1, model, w);
@@ -22384,18 +22385,18 @@ ${key}`);
22384
22385
 
22385
22386
  // src/contract-report.ts
22386
22387
  var FRAMES = { lines: LINES_FRAME, groups: GROUPS_FRAME };
22387
- function tierReader(result2, contract) {
22388
+ function tierReader(result3, contract) {
22388
22389
  if (contract === void 0) return void 0;
22389
- const single = citesOneContract(result2) ? result2.claims[0]?.contractRef : void 0;
22390
+ const single = citesOneContract(result3) ? result3.claims[0]?.contractRef : void 0;
22390
22391
  return (contractRef, requirementRef) => rowTier(contract, contractRef ?? single ?? "", requirementRef);
22391
22392
  }
22392
- function citesOneContract(result2) {
22393
- return new Set(result2.claims.map((claim) => claim.contractRef)).size <= 1;
22393
+ function citesOneContract(result3) {
22394
+ return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
22394
22395
  }
22395
- async function renderContractReport(result2, input, bundle, verified, host, wording, contract) {
22396
- const tierOf = tierReader(result2, contract);
22396
+ async function renderContractReport(result3, input, bundle, verified, host, wording, contract) {
22397
+ const tierOf = tierReader(result3, contract);
22397
22398
  const w = await contractReportWords(input.grouping, wording, {
22398
- singleContract: citesOneContract(result2)
22399
+ singleContract: citesOneContract(result3)
22399
22400
  });
22400
22401
  const frame2 = FRAMES[input.grouping];
22401
22402
  const regions = (
@@ -22417,7 +22418,7 @@ ${key}`);
22417
22418
  levels.L0.append(style);
22418
22419
  const refused = refusedWordingNotice(w);
22419
22420
  if (refused !== void 0) levels.L0.append(refused);
22420
- if (tierOf !== void 0 && result2.claims.some(
22421
+ if (tierOf !== void 0 && result3.claims.some(
22421
22422
  (claim) => tierOf(claim.contractRef, claim.requirementRef) === "informational"
22422
22423
  )) {
22423
22424
  const note = document.createElement("p");
@@ -22427,11 +22428,11 @@ ${key}`);
22427
22428
  levels.L0.append(note);
22428
22429
  }
22429
22430
  if (input.grouping === "lines")
22430
- await drawLines(levels, result2, input.options, bundle, verified, w, tierOf);
22431
+ await drawLines(levels, result3, input.options, bundle, verified, w, tierOf);
22431
22432
  else
22432
22433
  await drawGroups(
22433
22434
  levels,
22434
- result2,
22435
+ result3,
22435
22436
  input.presentation,
22436
22437
  bundle,
22437
22438
  verified,
@@ -22443,18 +22444,18 @@ ${key}`);
22443
22444
  regions.L2.append(levels.L2);
22444
22445
  applyDepth({ ...levels, depth: regions.depth });
22445
22446
  }
22446
- function renderOutcomeReportPage(result2, options, bundle, verified, root) {
22447
+ function renderOutcomeReportPage(result3, options, bundle, verified, root) {
22447
22448
  return renderContractReport(
22448
- result2,
22449
+ result3,
22449
22450
  { grouping: "lines", options },
22450
22451
  bundle,
22451
22452
  verified,
22452
22453
  root
22453
22454
  );
22454
22455
  }
22455
- function renderCompliancePage(result2, presentation, bundle, verified, root) {
22456
+ function renderCompliancePage(result3, presentation, bundle, verified, root) {
22456
22457
  return renderContractReport(
22457
- result2,
22458
+ result3,
22458
22459
  { grouping: "groups", presentation },
22459
22460
  bundle,
22460
22461
  verified,
@@ -22581,7 +22582,7 @@ ${key}`);
22581
22582
  }
22582
22583
  }
22583
22584
  function renderComposed(model, host, services) {
22584
- const result2 = model.result;
22585
+ const result3 = model.result;
22585
22586
  const section = element5("section");
22586
22587
  section.dataset.section = "composition";
22587
22588
  section.dataset.module = BUILTIN_MANIFEST_COMPOSED.id;
@@ -22589,11 +22590,11 @@ ${key}`);
22589
22590
  style.textContent = COMPOSED_CSS;
22590
22591
  section.append(style);
22591
22592
  section.append(element5("h2", "Composition"));
22592
- const status2 = element5("p", `composed/v1 check: ${result2.status}`);
22593
- status2.dataset.compositionStatus = result2.status;
22593
+ const status2 = element5("p", `composed/v1 check: ${result3.status}`);
22594
+ status2.dataset.compositionStatus = result3.status;
22594
22595
  section.append(status2);
22595
- if (result2.findings.length > 0)
22596
- section.append(element5("p", `findings: ${result2.findings.join(", ")}`));
22596
+ if (result3.findings.length > 0)
22597
+ section.append(element5("p", `findings: ${result3.findings.join(", ")}`));
22597
22598
  section.append(
22598
22599
  element5(
22599
22600
  "p",
@@ -22602,15 +22603,15 @@ ${key}`);
22602
22603
  );
22603
22604
  section.append(element5("h3", "Composed digest"));
22604
22605
  const digest = element5("dl");
22605
- digest.dataset.composedDigest = result2.composedDigest.declared;
22606
- digest.dataset.matches = String(result2.composedDigest.matches);
22606
+ digest.dataset.composedDigest = result3.composedDigest.declared;
22607
+ digest.dataset.matches = String(result3.composedDigest.matches);
22607
22608
  digest.append(
22608
22609
  element5("dt", "declared"),
22609
- element5("dd", result2.composedDigest.declared),
22610
+ element5("dd", result3.composedDigest.declared),
22610
22611
  element5("dt", "recomputed"),
22611
- element5("dd", result2.composedDigest.recomputed || "uncomputable"),
22612
+ element5("dd", result3.composedDigest.recomputed || "uncomputable"),
22612
22613
  element5("dt", "matches"),
22613
- element5("dd", result2.composedDigest.matches ? "yes" : "no")
22614
+ element5("dd", result3.composedDigest.matches ? "yes" : "no")
22614
22615
  );
22615
22616
  section.append(digest);
22616
22617
  section.append(element5("h3", "Members"));
@@ -22629,7 +22630,7 @@ ${key}`);
22629
22630
  "refusal signature",
22630
22631
  "findings"
22631
22632
  ],
22632
- result2.members.map((m) => {
22633
+ result3.members.map((m) => {
22633
22634
  const tr = row([
22634
22635
  m.id,
22635
22636
  m.observer,
@@ -22654,7 +22655,7 @@ ${key}`);
22654
22655
  table2(
22655
22656
  "composition-observers",
22656
22657
  ["observer", "role", "custody domain"],
22657
- result2.observers.map((o) => {
22658
+ result3.observers.map((o) => {
22658
22659
  const tr = row([o.id, o.role, o.custodyDomain]);
22659
22660
  tr.dataset.observerId = o.id;
22660
22661
  return tr;
@@ -22670,18 +22671,18 @@ ${key}`);
22670
22671
  section.append(element5("h3", "Composition closure"));
22671
22672
  const closure = element5(
22672
22673
  "p",
22673
- `${result2.compositionClosure.status}; missing: ${result2.compositionClosure.missing.length === 0 ? "none" : result2.compositionClosure.missing.join(", ")}; findings: ${findingsText(result2.compositionClosure.findings)}`
22674
+ `${result3.compositionClosure.status}; missing: ${result3.compositionClosure.missing.length === 0 ? "none" : result3.compositionClosure.missing.join(", ")}; findings: ${findingsText(result3.compositionClosure.findings)}`
22674
22675
  );
22675
- closure.dataset.closureStatus = result2.compositionClosure.status;
22676
+ closure.dataset.closureStatus = result3.compositionClosure.status;
22676
22677
  section.append(closure);
22677
22678
  section.append(element5("h3", "Joins"));
22678
- if (result2.joins.length === 0) section.append(element5("p", "No joins."));
22679
+ if (result3.joins.length === 0) section.append(element5("p", "No joins."));
22679
22680
  else {
22680
22681
  section.append(
22681
22682
  table2(
22682
22683
  "composition-joins",
22683
22684
  ["members", "basis", "declared", "derived", "result"],
22684
- result2.joins.map((j) => {
22685
+ result3.joins.map((j) => {
22685
22686
  const tr = row([
22686
22687
  pairText(j.members),
22687
22688
  j.basis,
@@ -22697,7 +22698,7 @@ ${key}`);
22697
22698
  })
22698
22699
  )
22699
22700
  );
22700
- for (const j of result2.joins) {
22701
+ for (const j of result3.joins) {
22701
22702
  if (j.differences.length === 0) continue;
22702
22703
  const details = services.details(
22703
22704
  `Differing values: ${pairText(j.members)}`
@@ -22712,7 +22713,7 @@ ${key}`);
22712
22713
  table2(
22713
22714
  "composition-agreement",
22714
22715
  ["members", "result"],
22715
- result2.corroboration.map((c) => {
22716
+ result3.corroboration.map((c) => {
22716
22717
  const tr = row([pairText(c.members), corroborationText(c)]);
22717
22718
  tr.dataset.agreementMembers = c.members.join(",");
22718
22719
  tr.dataset.corroboration = c.result;
@@ -22729,12 +22730,12 @@ ${key}`);
22729
22730
  manifest: BUILTIN_MANIFEST_COMPOSED,
22730
22731
  canRender: (context) => composedResult(context) !== void 0,
22731
22732
  buildModel: (context) => {
22732
- const result2 = composedResult(context);
22733
- if (result2 === void 0)
22733
+ const result3 = composedResult(context);
22734
+ if (result3 === void 0)
22734
22735
  throw new Error(
22735
22736
  `${BUILTIN_MANIFEST_COMPOSED.id}: buildModel called although canRender was false`
22736
22737
  );
22737
- return { result: result2 };
22738
+ return { result: result3 };
22738
22739
  },
22739
22740
  render: renderComposed
22740
22741
  };
@@ -23016,11 +23017,11 @@ ${key}`);
23016
23017
  refs.length === 0 ? void 0 : t("record.rung.9.count", { n: here, of: refs.length }),
23017
23018
  t("record.rung.9.sub")
23018
23019
  );
23019
- const result2 = input.result;
23020
- const citing = result2 === void 0 ? 0 : result2.claims.filter(
23020
+ const result3 = input.result;
23021
+ const citing = result3 === void 0 ? 0 : result3.claims.filter(
23021
23022
  (c) => c.evidence.some((e) => e.digest === capsuleId)
23022
23023
  ).length;
23023
- const isResult = result2?.capsuleId === capsuleId;
23024
+ const isResult = result3?.capsuleId === capsuleId;
23024
23025
  add2(
23025
23026
  10,
23026
23027
  "judgment",
@@ -23306,8 +23307,8 @@ ${key}`);
23306
23307
  return node;
23307
23308
  }
23308
23309
  var fmt5 = (n) => n.toLocaleString("en-US");
23309
- function mismatchMarker(result2, field, w) {
23310
- const mismatch = result2.countMismatches.find(
23310
+ function mismatchMarker(result3, field, w) {
23311
+ const mismatch = result3.countMismatches.find(
23311
23312
  (entry) => entry.field === field
23312
23313
  );
23313
23314
  if (mismatch === void 0) return void 0;
@@ -23321,18 +23322,18 @@ ${key}`);
23321
23322
  marker.dataset.recomputed = String(mismatch.recomputed);
23322
23323
  return marker;
23323
23324
  }
23324
- function renderAggregate(result2, w) {
23325
+ function renderAggregate(result3, w) {
23325
23326
  const out = document.createDocumentFragment();
23326
- const stated = result2.statedCoverage;
23327
+ const stated = result3.statedCoverage;
23327
23328
  const requirements = new Set(
23328
- result2.claims.filter((claim) => !claim.later).map(
23329
+ result3.claims.filter((claim) => !claim.later).map(
23329
23330
  (claim) => JSON.stringify([claim.contractRef, claim.requirementRef])
23330
23331
  )
23331
23332
  ).size;
23332
23333
  const line = el11("p", "agg-line");
23333
23334
  const marked = (text2, field) => {
23334
23335
  line.append(text2);
23335
- const marker = mismatchMarker(result2, field, w);
23336
+ const marker = mismatchMarker(result3, field, w);
23336
23337
  if (marker !== void 0) line.append(" ", marker);
23337
23338
  };
23338
23339
  marked(
@@ -23360,7 +23361,7 @@ ${key}`);
23360
23361
  "unknown_count"
23361
23362
  );
23362
23363
  const later = stated.notYetInForce;
23363
- if (later !== void 0 || result2.countMismatches.some((m) => m.field === "not_yet_in_force")) {
23364
+ if (later !== void 0 || result3.countMismatches.some((m) => m.field === "not_yet_in_force")) {
23364
23365
  line.append(" \xB7 ");
23365
23366
  marked(
23366
23367
  w.p("front.agg.later", later ?? 0, { n: fmt5(later ?? 0) }),
@@ -23376,10 +23377,10 @@ ${key}`);
23376
23377
  const buckets = el11("div", "agg-buckets");
23377
23378
  const of = w.t("front.agg.of", { n: fmt5(stated.evaluatedPopulation) });
23378
23379
  const entries = [
23379
- ["met", result2.buckets.met, "buckets.met"],
23380
- ["not_met", result2.buckets.notMet, "buckets.not_met"],
23381
- ["not_evaluable", result2.buckets.notEvaluable, "buckets.not_evaluable"],
23382
- ["out_of_scope", result2.buckets.outOfScope, "buckets.out_of_scope"]
23380
+ ["met", result3.buckets.met, "buckets.met"],
23381
+ ["not_met", result3.buckets.notMet, "buckets.not_met"],
23382
+ ["not_evaluable", result3.buckets.notEvaluable, "buckets.not_evaluable"],
23383
+ ["out_of_scope", result3.buckets.outOfScope, "buckets.out_of_scope"]
23383
23384
  ];
23384
23385
  for (const [verdict2, ids, field] of entries) {
23385
23386
  if (ids === void 0) continue;
@@ -23395,17 +23396,17 @@ ${key}`);
23395
23396
  el11("span", "agg-of", of)
23396
23397
  );
23397
23398
  box.append(caption);
23398
- const marker = mismatchMarker(result2, field, w);
23399
+ const marker = mismatchMarker(result3, field, w);
23399
23400
  if (marker !== void 0) box.append(marker);
23400
23401
  buckets.append(box);
23401
23402
  }
23402
23403
  out.append(buckets);
23403
- const dated = result2.claims.some((claim) => claim.appliesFrom !== void 0);
23404
- const switched = result2.buckets.outOfScope !== void 0;
23404
+ const dated = result3.claims.some((claim) => claim.appliesFrom !== void 0);
23405
+ const switched = result3.buckets.outOfScope !== void 0;
23405
23406
  if (dated || switched) {
23406
23407
  const copied = el11("p", "agg-note");
23407
23408
  if (dated) {
23408
- const date = utcDateOf(result2.generatedAt) ?? result2.generatedAt;
23409
+ const date = utcDateOf(result3.generatedAt) ?? result3.generatedAt;
23409
23410
  copied.append(w.t("front.agg.as-of", { date }), " ");
23410
23411
  copied.dataset.asOf = date;
23411
23412
  }
@@ -23421,9 +23422,9 @@ ${key}`);
23421
23422
  }
23422
23423
  var shortDigest = (digest) => digest.length > 12 ? `${digest.slice(0, 4)}\u2026${digest.slice(-4)}` : digest;
23423
23424
  function renderCoreIdentity(model) {
23424
- const { result: result2, words: w } = model;
23425
+ const { result: result3, words: w } = model;
23425
23426
  const refs = [
23426
- ...new Set(result2.claims.filter((c) => !c.later).map((c) => c.contractRef))
23427
+ ...new Set(result3.claims.filter((c) => !c.later).map((c) => c.contractRef))
23427
23428
  ];
23428
23429
  const kicker = [w.t("front.core.label")];
23429
23430
  if (refs.length === 1) {
@@ -23436,11 +23437,11 @@ ${key}`);
23436
23437
  );
23437
23438
  } else if (refs.length > 1)
23438
23439
  kicker.push(w.t("front.core.packs", { n: fmt5(refs.length) }));
23439
- const generated = utcDateOf(result2.generatedAt) === void 0 ? void 0 : result2.generatedAt;
23440
+ const generated = utcDateOf(result3.generatedAt) === void 0 ? void 0 : result3.generatedAt;
23440
23441
  if (generated !== void 0)
23441
23442
  kicker.push(w.t("front.core.generated", { time: generated }));
23442
23443
  const facts = [
23443
- w.t("front.core.result", { digest: shortDigest(result2.capsuleId) })
23444
+ w.t("front.core.result", { digest: shortDigest(result3.capsuleId) })
23444
23445
  ];
23445
23446
  if (model.pins.length === 1)
23446
23447
  facts.push(w.t("front.core.pin", { digest: shortDigest(model.pins[0]) }));
@@ -23461,10 +23462,10 @@ ${key}`);
23461
23462
  block.append(top, rest);
23462
23463
  return block;
23463
23464
  }
23464
- async function coreStripModel(result2, words) {
23465
- const tally = await tallyJudges(result2.records, result2.claims);
23465
+ async function coreStripModel(result3, words) {
23466
+ const tally = await tallyJudges(result3.records, result3.claims);
23466
23467
  return {
23467
- result: result2,
23468
+ result: result3,
23468
23469
  words,
23469
23470
  mock: judgedByMock(tally),
23470
23471
  pins: tally.pins.map((pin) => pin.digest)
@@ -24433,9 +24434,9 @@ ${pad.repeat(depth)}`;
24433
24434
  details.append(list2);
24434
24435
  return details;
24435
24436
  }
24436
- async function recordEntries(context, result2) {
24437
+ async function recordEntries(context, result3) {
24437
24438
  const read = /* @__PURE__ */ new Map();
24438
- for (const record of result2?.records.values() ?? []) {
24439
+ for (const record of result3?.records.values() ?? []) {
24439
24440
  const id = record.bookRecordId ?? record.capsuleId;
24440
24441
  if (!read.has(id)) read.set(id, record);
24441
24442
  }
@@ -24680,13 +24681,13 @@ ${pad.repeat(depth)}`;
24680
24681
  const recordPageStyle = element6("style");
24681
24682
  recordPageStyle.textContent = RECORD_PAGE_CSS;
24682
24683
  page.append(recordPageStyle);
24683
- let result2;
24684
+ let result3;
24684
24685
  try {
24685
- result2 = bundleVerified(verified) ? await resultRootOf(context) : void 0;
24686
+ result3 = bundleVerified(verified) ? await resultRootOf(context) : void 0;
24686
24687
  } catch {
24687
- result2 = void 0;
24688
+ result3 = void 0;
24688
24689
  }
24689
- const read = bundleVerified(verified) ? await recordEntries(context, result2) : /* @__PURE__ */ new Map();
24690
+ const read = bundleVerified(verified) ? await recordEntries(context, result3) : /* @__PURE__ */ new Map();
24690
24691
  const rawRecords = /* @__PURE__ */ new Map();
24691
24692
  for (const raw of Array.isArray(object13(bundle).records) ? object13(bundle).records : [])
24692
24693
  if (typeof object13(raw).capsule_id === "string")
@@ -24705,7 +24706,7 @@ ${pad.repeat(depth)}`;
24705
24706
  if (l3 !== void 0 && context.recordIndex.has(id))
24706
24707
  body.append(
24707
24708
  renderRecordPage(
24708
- { context, capsuleId: id, stamps, result: result2, voice: l3.voice },
24709
+ { context, capsuleId: id, stamps, result: result3, voice: l3.voice },
24709
24710
  l3.words
24710
24711
  )
24711
24712
  );
@@ -25074,8 +25075,8 @@ ${pad.repeat(depth)}`;
25074
25075
  return list2;
25075
25076
  }
25076
25077
  var CLAIM_TYPE_LABEL = (claim) => claim.recognized ? claim.type : `unrecognized (${claim.type})`;
25077
- function countMismatchMarker(result2, field) {
25078
- const mismatch = result2.countMismatches.find(
25078
+ function countMismatchMarker(result3, field) {
25079
+ const mismatch = result3.countMismatches.find(
25079
25080
  (entry) => entry.field === field
25080
25081
  );
25081
25082
  if (mismatch === void 0) return void 0;
@@ -25109,7 +25110,7 @@ ${pad.repeat(depth)}`;
25109
25110
  parent2.append(cell2);
25110
25111
  return cell2;
25111
25112
  }
25112
- function renderClose(close, result2, host) {
25113
+ function renderClose(close, result3, host) {
25113
25114
  host.append(element6("h4", "Close"));
25114
25115
  const details = element6("dl");
25115
25116
  if (close.period !== void 0)
@@ -25140,10 +25141,10 @@ ${pad.repeat(depth)}`;
25140
25141
  }
25141
25142
  host.append(details);
25142
25143
  host.append(element6("h5", "Cited Close"));
25143
- renderCitationList([close.closeRef], result2.records, host);
25144
+ renderCitationList([close.closeRef], result3.records, host);
25144
25145
  if (close.peerCloseRef !== void 0) {
25145
25146
  host.append(element6("h5", "Peer record"));
25146
- renderCitationList([close.peerCloseRef], result2.records, host);
25147
+ renderCitationList([close.peerCloseRef], result3.records, host);
25147
25148
  }
25148
25149
  if (close.links.length > 0) {
25149
25150
  host.append(element6("h5", "Links to the cited Close"));
@@ -25205,7 +25206,7 @@ ${pad.repeat(depth)}`;
25205
25206
  parent2.append(cell2);
25206
25207
  return cell2;
25207
25208
  }
25208
- function renderClaim(claim, result2, host) {
25209
+ function renderClaim(claim, result3, host) {
25209
25210
  host.replaceChildren();
25210
25211
  host.append(element6("h3", `Claim ${claim.id}`));
25211
25212
  const details = element6("dl");
@@ -25231,7 +25232,7 @@ ${pad.repeat(depth)}`;
25231
25232
  note.dataset.claimFailed = claim.failedOn ?? "close_state";
25232
25233
  host.append(note);
25233
25234
  }
25234
- if (claim.close !== void 0) renderClose(claim.close, result2, host);
25235
+ if (claim.close !== void 0) renderClose(claim.close, result3, host);
25235
25236
  if (claim.support === "unsupported") {
25236
25237
  const note = element6(
25237
25238
  "p",
@@ -25253,7 +25254,7 @@ ${pad.repeat(depth)}`;
25253
25254
  host.append(element6("h5", "Carrier evidence"));
25254
25255
  const list2 = renderCitationList(
25255
25256
  claim.presentation.evidence,
25256
- result2.records,
25257
+ result3.records,
25257
25258
  host
25258
25259
  );
25259
25260
  list2.dataset.carrierEvidence = String(claim.presentation.evidence.length);
@@ -25271,13 +25272,13 @@ ${pad.repeat(depth)}`;
25271
25272
  }
25272
25273
  host.append(element6("h4", "Evidence"));
25273
25274
  for (const ref of claim.evidence) {
25274
- const record = result2.records.get(ref.digest);
25275
+ const record = result3.records.get(ref.digest);
25275
25276
  if (record === void 0) {
25276
25277
  const missing = element6("p", `${ref.digest} \xB7 not in this bundle`);
25277
25278
  missing.dataset.evidence = "missing";
25278
25279
  host.append(missing);
25279
25280
  } else {
25280
- renderCitedRecord(record, result2.records, host);
25281
+ renderCitedRecord(record, result3.records, host);
25281
25282
  }
25282
25283
  }
25283
25284
  }
@@ -25290,23 +25291,23 @@ ${pad.repeat(depth)}`;
25290
25291
  ];
25291
25292
  var RESULT_COUNT_MARKS = `[${CORE_STRIP_ATTRIBUTE}], .cv-strip, [data-bucket], [data-bucket-count], [data-count-mismatch]`;
25292
25293
  var CARD_UNFIT_NOTE = "This Result's claims don't fit the report layout, so every claim is listed below instead.";
25293
- function renderResultPage(result2, root) {
25294
+ function renderResultPage(result3, root) {
25294
25295
  const section = element6("section");
25295
25296
  section.dataset.page = "result";
25296
25297
  section.append(element6("h1", "Evidence result"));
25297
- const later = result2.claims.filter((claim) => claim.later);
25298
- const byId = new Map(result2.claims.map((claim) => [claim.id, claim]));
25298
+ const later = result3.claims.filter((claim) => claim.later);
25299
+ const byId = new Map(result3.claims.map((claim) => [claim.id, claim]));
25299
25300
  const buckets = element6("section");
25300
25301
  buckets.dataset.buckets = "verdict";
25301
25302
  buckets.append(element6("h2", "Claims by verdict"));
25302
25303
  for (const [key, label, field] of BUCKETS) {
25303
- const ids = result2.buckets[key];
25304
+ const ids = result3.buckets[key];
25304
25305
  if (ids === void 0) continue;
25305
- const count2 = result2.bucketCounts[key] ?? 0;
25306
+ const count2 = result3.bucketCounts[key] ?? 0;
25306
25307
  const heading = element6("h3", `${label}: ${count2 === 0 ? "none" : count2}`);
25307
25308
  heading.dataset.bucketCount = String(count2);
25308
25309
  heading.dataset.bucketOf = key;
25309
- const marker = countMismatchMarker(result2, field);
25310
+ const marker = countMismatchMarker(result3, field);
25310
25311
  if (marker !== void 0) heading.append(" ", marker);
25311
25312
  buckets.append(heading);
25312
25313
  if (ids.length === 0) {
@@ -25331,12 +25332,12 @@ ${pad.repeat(depth)}`;
25331
25332
  }
25332
25333
  const failedHeading = element6(
25333
25334
  "h3",
25334
- `failed: ${result2.bucketCounts.failed === 0 ? "none" : result2.bucketCounts.failed}`
25335
+ `failed: ${result3.bucketCounts.failed === 0 ? "none" : result3.bucketCounts.failed}`
25335
25336
  );
25336
- failedHeading.dataset.bucketCount = String(result2.bucketCounts.failed);
25337
+ failedHeading.dataset.bucketCount = String(result3.bucketCounts.failed);
25337
25338
  failedHeading.dataset.bucketOf = "failed";
25338
25339
  buckets.append(failedHeading);
25339
- const failedIds = result2.claims.filter((claim) => claim.failed).map((claim) => claim.id);
25340
+ const failedIds = result3.claims.filter((claim) => claim.failed).map((claim) => claim.id);
25340
25341
  if (failedIds.length === 0) buckets.append(element6("p", "none"));
25341
25342
  else {
25342
25343
  const list2 = element6("ul");
@@ -25373,7 +25374,7 @@ ${pad.repeat(depth)}`;
25373
25374
  const table3 = document.createElement("table");
25374
25375
  table3.dataset.claims = "rows";
25375
25376
  const detail = element6("section");
25376
- for (const claim of result2.claims) {
25377
+ for (const claim of result3.claims) {
25377
25378
  const tr = document.createElement("tr");
25378
25379
  tr.dataset.claimRow = claim.id;
25379
25380
  tr.dataset.support = claim.support;
@@ -25386,7 +25387,7 @@ ${pad.repeat(depth)}`;
25386
25387
  const button = element6("button", claim.id);
25387
25388
  button.setAttribute("type", "button");
25388
25389
  button.dataset.claimId = claim.id;
25389
- button.addEventListener("click", () => renderClaim(claim, result2, detail));
25390
+ button.addEventListener("click", () => renderClaim(claim, result3, detail));
25390
25391
  idCell.append(button);
25391
25392
  tr.append(idCell, element6("td", claim.requirementRef));
25392
25393
  appendSufficiency(tr, claim);
@@ -25408,7 +25409,7 @@ ${pad.repeat(depth)}`;
25408
25409
  section.append(
25409
25410
  table3,
25410
25411
  detail,
25411
- renderProvenance2(result2.capsuleId, result2.logCoordinates, result2)
25412
+ renderProvenance2(result3.capsuleId, result3.logCoordinates, result3)
25412
25413
  );
25413
25414
  root.append(section);
25414
25415
  }
@@ -25543,15 +25544,15 @@ ${pad.repeat(depth)}`;
25543
25544
  if (presentation !== void 0) return { grouping: "groups", presentation };
25544
25545
  return void 0;
25545
25546
  }
25546
- function claimsFitCard(result2, grouping) {
25547
- if (new Set(result2.claims.map((c) => c.contractRef)).size > 1) return false;
25547
+ function claimsFitCard(result3, grouping) {
25548
+ if (new Set(result3.claims.map((c) => c.contractRef)).size > 1) return false;
25548
25549
  const placed = grouping === "lines" ? new Set(
25549
- readOutcomeReportTerms(result2).checks.flatMap(
25550
+ readOutcomeReportTerms(result3).checks.flatMap(
25550
25551
  (check) => check.criteria.map((criterion2) => `${check.id}.${criterion2.id}`)
25551
25552
  )
25552
25553
  ) : void 0;
25553
25554
  const seen = /* @__PURE__ */ new Set();
25554
- for (const claim of result2.claims) {
25555
+ for (const claim of result3.claims) {
25555
25556
  if (claim.type !== REQUIREMENT_CLAIM) return false;
25556
25557
  const sep = claim.id.indexOf("::");
25557
25558
  if (sep <= 0) return false;
@@ -25571,16 +25572,16 @@ ${pad.repeat(depth)}`;
25571
25572
  manifest: CONTRACT_REPORT_MANIFEST,
25572
25573
  canRender: (context) => isResultRoot(context),
25573
25574
  buildModel: async (context) => {
25574
- const result2 = defined(
25575
+ const result3 = defined(
25575
25576
  await resultRootOf(context),
25576
25577
  CONTRACT_REPORT_MANIFEST.id
25577
25578
  );
25578
25579
  const supported = contractReportInput(context.bundle);
25579
- const input = supported !== void 0 && claimsFitCard(result2, supported.grouping) ? supported : void 0;
25580
+ const input = supported !== void 0 && claimsFitCard(result3, supported.grouping) ? supported : void 0;
25580
25581
  if (typeof context.bundle === "object" && context.bundle !== null)
25581
25582
  contractReportDrawn.set(context.bundle, input ?? null);
25582
25583
  return {
25583
- result: result2,
25584
+ result: result3,
25584
25585
  ...input === void 0 ? {} : { input },
25585
25586
  ...supported !== void 0 && input === void 0 ? { unfit: true } : {},
25586
25587
  bundle: context.bundle,
@@ -25723,11 +25724,11 @@ ${pad.repeat(depth)}`;
25723
25724
  }
25724
25725
  return out;
25725
25726
  }
25726
- async function drawCharts(context, result2, charts, digests, words) {
25727
+ async function drawCharts(context, result3, charts, digests, words) {
25727
25728
  let dataset;
25728
25729
  let invalid2;
25729
25730
  try {
25730
- dataset = result2 === void 0 ? void 0 : await chartDatasetOf(context, result2);
25731
+ dataset = result3 === void 0 ? void 0 : await chartDatasetOf(context, result3);
25731
25732
  } catch (err) {
25732
25733
  if (!(err instanceof ChartRefusal)) throw err;
25733
25734
  invalid2 = err;
@@ -26084,16 +26085,16 @@ ${pad.repeat(depth)}`;
26084
26085
  const contract = await pageContract(options.contract);
26085
26086
  const charted = options.charts !== void 0 && options.charts.length > 0;
26086
26087
  if (verified) {
26087
- const result2 = await resultRootOf(context);
26088
+ const result3 = await resultRootOf(context);
26088
26089
  const grouping = contractReportGroupingOf(bundle) ?? "lines";
26089
- const words = result2 === void 0 && !charted ? void 0 : await contractReportWords(grouping, options.wording, {
26090
- singleContract: result2 !== void 0 && citesOneContract(result2)
26090
+ const words = result3 === void 0 && !charted ? void 0 : await contractReportWords(grouping, options.wording, {
26091
+ singleContract: result3 !== void 0 && citesOneContract(result3)
26091
26092
  });
26092
- if (result2 !== void 0) strip = await coreStripModel(result2, words);
26093
+ if (result3 !== void 0) strip = await coreStripModel(result3, words);
26093
26094
  if (charted)
26094
26095
  chartsNode = await drawCharts(
26095
26096
  context,
26096
- result2,
26097
+ result3,
26097
26098
  options.charts,
26098
26099
  chartDigests,
26099
26100
  words
@@ -26815,6 +26816,25 @@ ${pad.repeat(depth)}`;
26815
26816
  return result("NOT_CHECKED", "check_unavailable");
26816
26817
  }
26817
26818
  }
26819
+
26820
+ // src/card-signature.ts
26821
+ var result2 = (status2, keyId = null) => ({ status: status2, key_id: keyId });
26822
+ async function readerCardSignature(context) {
26823
+ if (!isVerifiedBundleContext(context)) return result2("NOT_CHECKED");
26824
+ const record = context.strict?.records.find(
26825
+ (r) => r.capsuleId === context.root
26826
+ );
26827
+ if (record === void 0) return result2("NOT_CHECKED");
26828
+ switch (record.signature) {
26829
+ case "authored":
26830
+ return record.keyId === null ? result2("NOT_CHECKED") : result2("PASS", record.keyId);
26831
+ case "invalid":
26832
+ return result2("FAIL");
26833
+ case "unclaimed":
26834
+ return result2("NOT_PRESENT");
26835
+ }
26836
+ return result2("NOT_CHECKED");
26837
+ }
26818
26838
  return __toCommonJS(browser_exports2);
26819
26839
  })();
26820
26840
  /*! Bundled license information: