@action-state-group/capsule-viewer 0.10.0 → 0.12.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
 
@@ -16023,7 +16024,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16023
16024
  return void 0;
16024
16025
  return { pack, tier: value.tier, salting, saltId };
16025
16026
  }
16026
- function readEntry2(value, operator) {
16027
+ function readEntry2(value, grouped) {
16027
16028
  if (!isObj4(value)) return void 0;
16028
16029
  const labels = value.request_labels;
16029
16030
  if (!Array.isArray(labels) || labels.length > MAX_LABELS || labels.some((l) => str(l, MAX_LABEL) === void 0))
@@ -16043,7 +16044,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16043
16044
  }
16044
16045
  let handle;
16045
16046
  let followUpOf;
16046
- if (operator) {
16047
+ if (grouped) {
16047
16048
  if (value.customer_handle !== void 0) {
16048
16049
  if (typeof value.customer_handle !== "string" || !HEX642.test(value.customer_handle))
16049
16050
  return void 0;
@@ -16072,15 +16073,17 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16072
16073
  if (!isObj4(block.conversations)) return void 0;
16073
16074
  const scope = readScope(block.handle_scope);
16074
16075
  const operator = scope?.tier === "operator";
16076
+ const grouped = operator || scope?.tier === "shared" && scope.salting === "per-share";
16075
16077
  const entries = /* @__PURE__ */ new Map();
16076
16078
  for (const [id, value] of Object.entries(block.conversations)) {
16077
- const entry = readEntry2(value, operator);
16079
+ const entry = readEntry2(value, grouped);
16078
16080
  if (entry !== void 0) entries.set(id, entry);
16079
16081
  }
16080
16082
  if (entries.size === 0) return void 0;
16081
16083
  return {
16082
16084
  tier: operator ? "operator" : "shared",
16083
- ...operator && scope !== void 0 ? { scope } : {},
16085
+ grouped,
16086
+ ...grouped && scope !== void 0 ? { scope } : {},
16084
16087
  entries
16085
16088
  };
16086
16089
  }
@@ -16237,7 +16240,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16237
16240
  block.append(
16238
16241
  el5("h3", "sh-head", w.t("lines.subject.headline", { n: fmt(n) }))
16239
16242
  );
16240
- block.append(el5("p", "sh-lede", w.t("lines.subject.explain", { n: fmt(n) })));
16243
+ block.append(
16244
+ el5(
16245
+ "p",
16246
+ "sh-lede",
16247
+ w.t(
16248
+ history.tier === "operator" ? "lines.subject.explain" : "lines.subject.explain.per-share",
16249
+ { n: fmt(n) }
16250
+ )
16251
+ )
16252
+ );
16241
16253
  block.append(timeline(rows, history, w));
16242
16254
  block.append(table(rows, history, w));
16243
16255
  const legend = el5("p", "sh-legend");
@@ -16343,7 +16355,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16343
16355
  section.dataset.section = "subject-history";
16344
16356
  section.dataset.tier = history.tier;
16345
16357
  section.append(el5("h2", "sh-title", w.t("lines.subject.title")));
16346
- if (history.tier === "operator") {
16358
+ if (history.grouped) {
16347
16359
  const groups = /* @__PURE__ */ new Map();
16348
16360
  for (const r of drawn) {
16349
16361
  const handle = history.entries.get(r.id)?.handle;
@@ -16351,7 +16363,15 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16351
16363
  groups.set(handle, [...groups.get(handle) ?? [], r]);
16352
16364
  }
16353
16365
  const repeat = [...groups].filter(([, list2]) => list2.length >= 2);
16354
- section.append(el5("p", "sh-slice", w.t("lines.subject.slice.operator")));
16366
+ section.append(
16367
+ el5(
16368
+ "p",
16369
+ "sh-slice",
16370
+ w.t(
16371
+ history.tier === "operator" ? "lines.subject.slice.operator" : "lines.subject.slice.per-share"
16372
+ )
16373
+ )
16374
+ );
16355
16375
  if (repeat.length === 0)
16356
16376
  section.append(el5("p", "sh-lede", w.t("lines.subject.none")));
16357
16377
  repeat.sort((a, b) => b[1].length - a[1].length || (a[0] < b[0] ? -1 : 1));
@@ -16620,13 +16640,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
16620
16640
  }
16621
16641
  function builtCommit() {
16622
16642
  if (false) return void 0;
16623
- return commitPrefix("ba539fe78e33f83d44db1c1352e0c49cb1eee51b");
16643
+ return commitPrefix("0e00716a96b9bad56001701a414493867678703d");
16624
16644
  }
16625
16645
  var commit = builtCommit();
16626
16646
  var unreleased = false;
16627
16647
  var VIEWER_BUILD = {
16628
16648
  viewer: "@action-state-group/capsule-viewer",
16629
- viewerVersion: "0.10.0",
16649
+ viewerVersion: "0.12.0",
16630
16650
  verifier: "@action-state-group/agent-action-capsule",
16631
16651
  verifierVersion: "0.13.0",
16632
16652
  cllVersion: "0.3.0",
@@ -17379,6 +17399,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17379
17399
  "record.rung.5.unanchored": "the checkpoint is not authenticated on this page",
17380
17400
  "lines.subject.title": "Same customer in this report",
17381
17401
  "lines.subject.slice.operator": "Slice: this report, filtered to one customer handle. Nothing is re-judged; the page shows what the report's Result already holds for the handle.",
17402
+ "lines.subject.slice.per-share": "Slice: this report, filtered to one customer handle. The handles on this page were made for this share only, so they match no handle in any other share. Nothing is re-judged; the page shows what the report's Result already holds for the handle.",
17382
17403
  "lines.subject.slice.shared": "This page does not group conversations by customer, so it does not say which are one customer's. Each conversation shows its requests, its band and the halves present, and nothing else about the customer.",
17383
17404
  "lines.subject.none": "No customer handle in this report has more than one conversation.",
17384
17405
  "lines.subject.core.customer": "Customer {handle}",
@@ -17391,6 +17412,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17391
17412
  "lines.subject.tile.undecided": "could not decide",
17392
17413
  "lines.subject.headline": "One customer, {n} conversations",
17393
17414
  "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.",
17415
+ "lines.subject.explain.per-share": "The handle is a salted commitment to the customer id, made for this share only. It says these {n} are the same customer; the handle alone does not say who.",
17394
17416
  "lines.subject.timeline.title": "Over time",
17395
17417
  "lines.subject.timeline.note": "The dashed link joins a conversation to the earlier one it follows up: the later record cites the earlier one (the producer's follow_up_of).",
17396
17418
  "lines.subject.follow.one": "{n} day to the follow-up",
@@ -18943,7 +18965,7 @@ ${key}`);
18943
18965
  return problems.map((p) => `${pack.id}: ${p}`);
18944
18966
  }
18945
18967
  var DEFAULT_PACK_SHA256 = Object.freeze({
18946
- lines: "b6a94ccd2fb2b1ee6675a031e9ef55ca7143a61ed1f5c5518d3c5a28ab3ed849",
18968
+ lines: "0448c4e5d6fa4b59cccdc5ed98b089946d9b217a76042dec222c5bd074ce4b45",
18947
18969
  groups: "90ded4f81aed5f5335cd85d71a930f6af31571d19eeb07e50f710d415420a768"
18948
18970
  });
18949
18971
  function fill(key, text2, vars) {
@@ -20737,7 +20759,7 @@ ${key}`);
20737
20759
  }
20738
20760
  host.append(section);
20739
20761
  }
20740
- function renderRules(host, model, runInfo, result2, w) {
20762
+ function renderRules(host, model, runInfo, result3, w) {
20741
20763
  const tierOf = model.gating?.tierOf;
20742
20764
  const section = el8("section", "sec");
20743
20765
  section.dataset.section = "rules";
@@ -20843,7 +20865,7 @@ ${key}`);
20843
20865
  (cr) => cr.checkId === check.id && cr.criterionId === criterion2.id && pick(cr.verdict)
20844
20866
  )?.claim
20845
20867
  ),
20846
- result2,
20868
+ result3,
20847
20869
  w
20848
20870
  );
20849
20871
  if (action !== void 0) cell4.append(action);
@@ -21332,13 +21354,13 @@ ${key}`);
21332
21354
  section.append(toggle);
21333
21355
  host.append(section);
21334
21356
  }
21335
- async function resultDocument3(result2, bundle) {
21357
+ async function resultDocument3(result3, bundle) {
21336
21358
  try {
21337
21359
  const context = await verifiedBundleContext(bundle);
21338
- const member = disclosureOf(context, result2.capsuleId, result2.member);
21360
+ const member = disclosureOf(context, result3.capsuleId, result3.member);
21339
21361
  if (member.state !== "disclosed") return void 0;
21340
21362
  const payload = member.payload;
21341
- return result2.form === "book" && payload !== null && typeof payload === "object" ? payload.statement : payload;
21363
+ return result3.form === "book" && payload !== null && typeof payload === "object" ? payload.statement : payload;
21342
21364
  } catch {
21343
21365
  return void 0;
21344
21366
  }
@@ -21384,8 +21406,8 @@ ${key}`);
21384
21406
  page: "outcome-report",
21385
21407
  css: OUTCOME_REPORT_CSS
21386
21408
  };
21387
- async function drawLines(levels, result2, options, bundle, verified, w, tierOf) {
21388
- const built = buildOutcomeReportModel(result2, options);
21409
+ async function drawLines(levels, result3, options, bundle, verified, w, tierOf) {
21410
+ const built = buildOutcomeReportModel(result3, options);
21389
21411
  const model = tierOf === void 0 ? built : { ...built, gating: gating(built.conversations, tierOf) };
21390
21412
  const runInfo = await verifyJudgePin(model.runInfo);
21391
21413
  const claims = model.conversations.flatMap(
@@ -21401,7 +21423,7 @@ ${key}`);
21401
21423
  if (notes.childElementCount > 0) pad.append(notes);
21402
21424
  sheet.append(pad);
21403
21425
  levels.L0.append(sheet);
21404
- const slice2 = readSubjectHistory(await resultDocument3(result2, bundle));
21426
+ const slice2 = readSubjectHistory(await resultDocument3(result3, bundle));
21405
21427
  if (slice2 !== void 0) {
21406
21428
  const subject = renderSubjectHistory(
21407
21429
  subjectConversations(model, w),
@@ -21411,12 +21433,12 @@ ${key}`);
21411
21433
  );
21412
21434
  if (subject !== void 0) levels.L0.append(subject);
21413
21435
  }
21414
- renderRules(levels.L1, model, runInfo, result2, w);
21436
+ renderRules(levels.L1, model, runInfo, result3, w);
21415
21437
  leadWithProvenance(
21416
21438
  levels.L1,
21417
21439
  levels.L1.querySelector('[data-section="rules"]'),
21418
21440
  renderProvenance(
21419
- await provenanceLines(result2.records, claims, bundle, verified, w)
21441
+ await provenanceLines(result3.records, claims, bundle, verified, w)
21420
21442
  )
21421
21443
  );
21422
21444
  levels.L2.append(renderCheckYourself(bundle, w));
@@ -21703,7 +21725,7 @@ ${key}`);
21703
21725
  ...undecided
21704
21726
  };
21705
21727
  }
21706
- function rowResult(row2, model, result2, w) {
21728
+ function rowResult(row2, model, result3, w) {
21707
21729
  const cell2 = document.createElement("td");
21708
21730
  const status2 = rowStatus(row2, w);
21709
21731
  cell2.append(statusPill(status2.cls, status2.text));
@@ -21733,7 +21755,7 @@ ${key}`);
21733
21755
  `test:${row2.criterionId}:${bucket}`,
21734
21756
  `${row2.name} \xB7 ${word}: ${fmt4(ids.length)}`,
21735
21757
  ids.map((id) => claimOf(model, id, row2.criterionId)),
21736
- result2,
21758
+ result3,
21737
21759
  w,
21738
21760
  w.t("evidence.show.for", { what: word })
21739
21761
  );
@@ -21751,7 +21773,7 @@ ${key}`);
21751
21773
  ]);
21752
21774
  return model.sessions.filter((s) => !outside.has(s.conversationId)).map((s) => s.tests.find((t) => t.criterionId === row2.criterionId)?.claim);
21753
21775
  }
21754
- function renderSummary(host, model, presentation, result2, w, tierOf) {
21776
+ function renderSummary(host, model, presentation, result3, w, tierOf) {
21755
21777
  const section = el9("section", "");
21756
21778
  section.dataset.section = "summary";
21757
21779
  const regulation = maybeProducer(w, "p", "kicker", model.regulation, true);
@@ -21896,11 +21918,11 @@ ${key}`);
21896
21918
  `test:${test.criterionId}:checked-in`,
21897
21919
  `${test.name} \xB7 ${w.t("groups.summary.col.checked-in")}: ${count(w, "session", counted2)}`,
21898
21920
  populationClaims(test, model),
21899
- result2,
21921
+ result3,
21900
21922
  w
21901
21923
  );
21902
21924
  if (action !== void 0) checkedIn.append(action);
21903
- tr.append(nameCell, checkedIn, rowResult(test, model, result2, w));
21925
+ tr.append(nameCell, checkedIn, rowResult(test, model, result3, w));
21904
21926
  tbody.append(tr);
21905
21927
  if (sessionIds.length > 0) {
21906
21928
  const drillRow = el9("tr", "drill-row");
@@ -22360,8 +22382,8 @@ ${key}`);
22360
22382
  page: "compliance",
22361
22383
  css: COMPLIANCE_CSS
22362
22384
  };
22363
- async function drawGroups(levels, result2, presentation, bundle, verified, w, tierOf) {
22364
- const model = buildComplianceModel(result2, presentation);
22385
+ async function drawGroups(levels, result3, presentation, bundle, verified, w, tierOf) {
22386
+ const model = buildComplianceModel(result3, presentation);
22365
22387
  const claims = model.sessions.flatMap(
22366
22388
  (s) => s.tests.flatMap((t) => t.claim === void 0 ? [] : [t.claim])
22367
22389
  );
@@ -22369,12 +22391,12 @@ ${key}`);
22369
22391
  const sheet = el9("div", "l0-card");
22370
22392
  renderHeader(sheet, model, w, tierOf);
22371
22393
  levels.L0.append(sheet);
22372
- renderSummary(levels.L1, model, presentation, result2, w, tierOf);
22394
+ renderSummary(levels.L1, model, presentation, result3, w, tierOf);
22373
22395
  leadWithProvenance(
22374
22396
  levels.L1,
22375
22397
  levels.L1.querySelector('[data-section="summary"]'),
22376
22398
  renderProvenance(
22377
- await provenanceLines(result2.records, claims, bundle, verified, w)
22399
+ await provenanceLines(result3.records, claims, bundle, verified, w)
22378
22400
  )
22379
22401
  );
22380
22402
  renderFindings(levels.L1, model, w);
@@ -22384,18 +22406,18 @@ ${key}`);
22384
22406
 
22385
22407
  // src/contract-report.ts
22386
22408
  var FRAMES = { lines: LINES_FRAME, groups: GROUPS_FRAME };
22387
- function tierReader(result2, contract) {
22409
+ function tierReader(result3, contract) {
22388
22410
  if (contract === void 0) return void 0;
22389
- const single = citesOneContract(result2) ? result2.claims[0]?.contractRef : void 0;
22411
+ const single = citesOneContract(result3) ? result3.claims[0]?.contractRef : void 0;
22390
22412
  return (contractRef, requirementRef) => rowTier(contract, contractRef ?? single ?? "", requirementRef);
22391
22413
  }
22392
- function citesOneContract(result2) {
22393
- return new Set(result2.claims.map((claim) => claim.contractRef)).size <= 1;
22414
+ function citesOneContract(result3) {
22415
+ return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
22394
22416
  }
22395
- async function renderContractReport(result2, input, bundle, verified, host, wording, contract) {
22396
- const tierOf = tierReader(result2, contract);
22417
+ async function renderContractReport(result3, input, bundle, verified, host, wording, contract) {
22418
+ const tierOf = tierReader(result3, contract);
22397
22419
  const w = await contractReportWords(input.grouping, wording, {
22398
- singleContract: citesOneContract(result2)
22420
+ singleContract: citesOneContract(result3)
22399
22421
  });
22400
22422
  const frame2 = FRAMES[input.grouping];
22401
22423
  const regions = (
@@ -22417,7 +22439,7 @@ ${key}`);
22417
22439
  levels.L0.append(style);
22418
22440
  const refused = refusedWordingNotice(w);
22419
22441
  if (refused !== void 0) levels.L0.append(refused);
22420
- if (tierOf !== void 0 && result2.claims.some(
22442
+ if (tierOf !== void 0 && result3.claims.some(
22421
22443
  (claim) => tierOf(claim.contractRef, claim.requirementRef) === "informational"
22422
22444
  )) {
22423
22445
  const note = document.createElement("p");
@@ -22427,11 +22449,11 @@ ${key}`);
22427
22449
  levels.L0.append(note);
22428
22450
  }
22429
22451
  if (input.grouping === "lines")
22430
- await drawLines(levels, result2, input.options, bundle, verified, w, tierOf);
22452
+ await drawLines(levels, result3, input.options, bundle, verified, w, tierOf);
22431
22453
  else
22432
22454
  await drawGroups(
22433
22455
  levels,
22434
- result2,
22456
+ result3,
22435
22457
  input.presentation,
22436
22458
  bundle,
22437
22459
  verified,
@@ -22443,18 +22465,18 @@ ${key}`);
22443
22465
  regions.L2.append(levels.L2);
22444
22466
  applyDepth({ ...levels, depth: regions.depth });
22445
22467
  }
22446
- function renderOutcomeReportPage(result2, options, bundle, verified, root) {
22468
+ function renderOutcomeReportPage(result3, options, bundle, verified, root) {
22447
22469
  return renderContractReport(
22448
- result2,
22470
+ result3,
22449
22471
  { grouping: "lines", options },
22450
22472
  bundle,
22451
22473
  verified,
22452
22474
  root
22453
22475
  );
22454
22476
  }
22455
- function renderCompliancePage(result2, presentation, bundle, verified, root) {
22477
+ function renderCompliancePage(result3, presentation, bundle, verified, root) {
22456
22478
  return renderContractReport(
22457
- result2,
22479
+ result3,
22458
22480
  { grouping: "groups", presentation },
22459
22481
  bundle,
22460
22482
  verified,
@@ -22581,7 +22603,7 @@ ${key}`);
22581
22603
  }
22582
22604
  }
22583
22605
  function renderComposed(model, host, services) {
22584
- const result2 = model.result;
22606
+ const result3 = model.result;
22585
22607
  const section = element5("section");
22586
22608
  section.dataset.section = "composition";
22587
22609
  section.dataset.module = BUILTIN_MANIFEST_COMPOSED.id;
@@ -22589,11 +22611,11 @@ ${key}`);
22589
22611
  style.textContent = COMPOSED_CSS;
22590
22612
  section.append(style);
22591
22613
  section.append(element5("h2", "Composition"));
22592
- const status2 = element5("p", `composed/v1 check: ${result2.status}`);
22593
- status2.dataset.compositionStatus = result2.status;
22614
+ const status2 = element5("p", `composed/v1 check: ${result3.status}`);
22615
+ status2.dataset.compositionStatus = result3.status;
22594
22616
  section.append(status2);
22595
- if (result2.findings.length > 0)
22596
- section.append(element5("p", `findings: ${result2.findings.join(", ")}`));
22617
+ if (result3.findings.length > 0)
22618
+ section.append(element5("p", `findings: ${result3.findings.join(", ")}`));
22597
22619
  section.append(
22598
22620
  element5(
22599
22621
  "p",
@@ -22602,15 +22624,15 @@ ${key}`);
22602
22624
  );
22603
22625
  section.append(element5("h3", "Composed digest"));
22604
22626
  const digest = element5("dl");
22605
- digest.dataset.composedDigest = result2.composedDigest.declared;
22606
- digest.dataset.matches = String(result2.composedDigest.matches);
22627
+ digest.dataset.composedDigest = result3.composedDigest.declared;
22628
+ digest.dataset.matches = String(result3.composedDigest.matches);
22607
22629
  digest.append(
22608
22630
  element5("dt", "declared"),
22609
- element5("dd", result2.composedDigest.declared),
22631
+ element5("dd", result3.composedDigest.declared),
22610
22632
  element5("dt", "recomputed"),
22611
- element5("dd", result2.composedDigest.recomputed || "uncomputable"),
22633
+ element5("dd", result3.composedDigest.recomputed || "uncomputable"),
22612
22634
  element5("dt", "matches"),
22613
- element5("dd", result2.composedDigest.matches ? "yes" : "no")
22635
+ element5("dd", result3.composedDigest.matches ? "yes" : "no")
22614
22636
  );
22615
22637
  section.append(digest);
22616
22638
  section.append(element5("h3", "Members"));
@@ -22629,7 +22651,7 @@ ${key}`);
22629
22651
  "refusal signature",
22630
22652
  "findings"
22631
22653
  ],
22632
- result2.members.map((m) => {
22654
+ result3.members.map((m) => {
22633
22655
  const tr = row([
22634
22656
  m.id,
22635
22657
  m.observer,
@@ -22654,7 +22676,7 @@ ${key}`);
22654
22676
  table2(
22655
22677
  "composition-observers",
22656
22678
  ["observer", "role", "custody domain"],
22657
- result2.observers.map((o) => {
22679
+ result3.observers.map((o) => {
22658
22680
  const tr = row([o.id, o.role, o.custodyDomain]);
22659
22681
  tr.dataset.observerId = o.id;
22660
22682
  return tr;
@@ -22670,18 +22692,18 @@ ${key}`);
22670
22692
  section.append(element5("h3", "Composition closure"));
22671
22693
  const closure = element5(
22672
22694
  "p",
22673
- `${result2.compositionClosure.status}; missing: ${result2.compositionClosure.missing.length === 0 ? "none" : result2.compositionClosure.missing.join(", ")}; findings: ${findingsText(result2.compositionClosure.findings)}`
22695
+ `${result3.compositionClosure.status}; missing: ${result3.compositionClosure.missing.length === 0 ? "none" : result3.compositionClosure.missing.join(", ")}; findings: ${findingsText(result3.compositionClosure.findings)}`
22674
22696
  );
22675
- closure.dataset.closureStatus = result2.compositionClosure.status;
22697
+ closure.dataset.closureStatus = result3.compositionClosure.status;
22676
22698
  section.append(closure);
22677
22699
  section.append(element5("h3", "Joins"));
22678
- if (result2.joins.length === 0) section.append(element5("p", "No joins."));
22700
+ if (result3.joins.length === 0) section.append(element5("p", "No joins."));
22679
22701
  else {
22680
22702
  section.append(
22681
22703
  table2(
22682
22704
  "composition-joins",
22683
22705
  ["members", "basis", "declared", "derived", "result"],
22684
- result2.joins.map((j) => {
22706
+ result3.joins.map((j) => {
22685
22707
  const tr = row([
22686
22708
  pairText(j.members),
22687
22709
  j.basis,
@@ -22697,7 +22719,7 @@ ${key}`);
22697
22719
  })
22698
22720
  )
22699
22721
  );
22700
- for (const j of result2.joins) {
22722
+ for (const j of result3.joins) {
22701
22723
  if (j.differences.length === 0) continue;
22702
22724
  const details = services.details(
22703
22725
  `Differing values: ${pairText(j.members)}`
@@ -22712,7 +22734,7 @@ ${key}`);
22712
22734
  table2(
22713
22735
  "composition-agreement",
22714
22736
  ["members", "result"],
22715
- result2.corroboration.map((c) => {
22737
+ result3.corroboration.map((c) => {
22716
22738
  const tr = row([pairText(c.members), corroborationText(c)]);
22717
22739
  tr.dataset.agreementMembers = c.members.join(",");
22718
22740
  tr.dataset.corroboration = c.result;
@@ -22729,12 +22751,12 @@ ${key}`);
22729
22751
  manifest: BUILTIN_MANIFEST_COMPOSED,
22730
22752
  canRender: (context) => composedResult(context) !== void 0,
22731
22753
  buildModel: (context) => {
22732
- const result2 = composedResult(context);
22733
- if (result2 === void 0)
22754
+ const result3 = composedResult(context);
22755
+ if (result3 === void 0)
22734
22756
  throw new Error(
22735
22757
  `${BUILTIN_MANIFEST_COMPOSED.id}: buildModel called although canRender was false`
22736
22758
  );
22737
- return { result: result2 };
22759
+ return { result: result3 };
22738
22760
  },
22739
22761
  render: renderComposed
22740
22762
  };
@@ -23016,11 +23038,11 @@ ${key}`);
23016
23038
  refs.length === 0 ? void 0 : t("record.rung.9.count", { n: here, of: refs.length }),
23017
23039
  t("record.rung.9.sub")
23018
23040
  );
23019
- const result2 = input.result;
23020
- const citing = result2 === void 0 ? 0 : result2.claims.filter(
23041
+ const result3 = input.result;
23042
+ const citing = result3 === void 0 ? 0 : result3.claims.filter(
23021
23043
  (c) => c.evidence.some((e) => e.digest === capsuleId)
23022
23044
  ).length;
23023
- const isResult = result2?.capsuleId === capsuleId;
23045
+ const isResult = result3?.capsuleId === capsuleId;
23024
23046
  add2(
23025
23047
  10,
23026
23048
  "judgment",
@@ -23306,8 +23328,8 @@ ${key}`);
23306
23328
  return node;
23307
23329
  }
23308
23330
  var fmt5 = (n) => n.toLocaleString("en-US");
23309
- function mismatchMarker(result2, field, w) {
23310
- const mismatch = result2.countMismatches.find(
23331
+ function mismatchMarker(result3, field, w) {
23332
+ const mismatch = result3.countMismatches.find(
23311
23333
  (entry) => entry.field === field
23312
23334
  );
23313
23335
  if (mismatch === void 0) return void 0;
@@ -23321,18 +23343,18 @@ ${key}`);
23321
23343
  marker.dataset.recomputed = String(mismatch.recomputed);
23322
23344
  return marker;
23323
23345
  }
23324
- function renderAggregate(result2, w) {
23346
+ function renderAggregate(result3, w) {
23325
23347
  const out = document.createDocumentFragment();
23326
- const stated = result2.statedCoverage;
23348
+ const stated = result3.statedCoverage;
23327
23349
  const requirements = new Set(
23328
- result2.claims.filter((claim) => !claim.later).map(
23350
+ result3.claims.filter((claim) => !claim.later).map(
23329
23351
  (claim) => JSON.stringify([claim.contractRef, claim.requirementRef])
23330
23352
  )
23331
23353
  ).size;
23332
23354
  const line = el11("p", "agg-line");
23333
23355
  const marked = (text2, field) => {
23334
23356
  line.append(text2);
23335
- const marker = mismatchMarker(result2, field, w);
23357
+ const marker = mismatchMarker(result3, field, w);
23336
23358
  if (marker !== void 0) line.append(" ", marker);
23337
23359
  };
23338
23360
  marked(
@@ -23360,7 +23382,7 @@ ${key}`);
23360
23382
  "unknown_count"
23361
23383
  );
23362
23384
  const later = stated.notYetInForce;
23363
- if (later !== void 0 || result2.countMismatches.some((m) => m.field === "not_yet_in_force")) {
23385
+ if (later !== void 0 || result3.countMismatches.some((m) => m.field === "not_yet_in_force")) {
23364
23386
  line.append(" \xB7 ");
23365
23387
  marked(
23366
23388
  w.p("front.agg.later", later ?? 0, { n: fmt5(later ?? 0) }),
@@ -23376,10 +23398,10 @@ ${key}`);
23376
23398
  const buckets = el11("div", "agg-buckets");
23377
23399
  const of = w.t("front.agg.of", { n: fmt5(stated.evaluatedPopulation) });
23378
23400
  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"]
23401
+ ["met", result3.buckets.met, "buckets.met"],
23402
+ ["not_met", result3.buckets.notMet, "buckets.not_met"],
23403
+ ["not_evaluable", result3.buckets.notEvaluable, "buckets.not_evaluable"],
23404
+ ["out_of_scope", result3.buckets.outOfScope, "buckets.out_of_scope"]
23383
23405
  ];
23384
23406
  for (const [verdict2, ids, field] of entries) {
23385
23407
  if (ids === void 0) continue;
@@ -23395,17 +23417,17 @@ ${key}`);
23395
23417
  el11("span", "agg-of", of)
23396
23418
  );
23397
23419
  box.append(caption);
23398
- const marker = mismatchMarker(result2, field, w);
23420
+ const marker = mismatchMarker(result3, field, w);
23399
23421
  if (marker !== void 0) box.append(marker);
23400
23422
  buckets.append(box);
23401
23423
  }
23402
23424
  out.append(buckets);
23403
- const dated = result2.claims.some((claim) => claim.appliesFrom !== void 0);
23404
- const switched = result2.buckets.outOfScope !== void 0;
23425
+ const dated = result3.claims.some((claim) => claim.appliesFrom !== void 0);
23426
+ const switched = result3.buckets.outOfScope !== void 0;
23405
23427
  if (dated || switched) {
23406
23428
  const copied = el11("p", "agg-note");
23407
23429
  if (dated) {
23408
- const date = utcDateOf(result2.generatedAt) ?? result2.generatedAt;
23430
+ const date = utcDateOf(result3.generatedAt) ?? result3.generatedAt;
23409
23431
  copied.append(w.t("front.agg.as-of", { date }), " ");
23410
23432
  copied.dataset.asOf = date;
23411
23433
  }
@@ -23421,9 +23443,9 @@ ${key}`);
23421
23443
  }
23422
23444
  var shortDigest = (digest) => digest.length > 12 ? `${digest.slice(0, 4)}\u2026${digest.slice(-4)}` : digest;
23423
23445
  function renderCoreIdentity(model) {
23424
- const { result: result2, words: w } = model;
23446
+ const { result: result3, words: w } = model;
23425
23447
  const refs = [
23426
- ...new Set(result2.claims.filter((c) => !c.later).map((c) => c.contractRef))
23448
+ ...new Set(result3.claims.filter((c) => !c.later).map((c) => c.contractRef))
23427
23449
  ];
23428
23450
  const kicker = [w.t("front.core.label")];
23429
23451
  if (refs.length === 1) {
@@ -23436,11 +23458,11 @@ ${key}`);
23436
23458
  );
23437
23459
  } else if (refs.length > 1)
23438
23460
  kicker.push(w.t("front.core.packs", { n: fmt5(refs.length) }));
23439
- const generated = utcDateOf(result2.generatedAt) === void 0 ? void 0 : result2.generatedAt;
23461
+ const generated = utcDateOf(result3.generatedAt) === void 0 ? void 0 : result3.generatedAt;
23440
23462
  if (generated !== void 0)
23441
23463
  kicker.push(w.t("front.core.generated", { time: generated }));
23442
23464
  const facts = [
23443
- w.t("front.core.result", { digest: shortDigest(result2.capsuleId) })
23465
+ w.t("front.core.result", { digest: shortDigest(result3.capsuleId) })
23444
23466
  ];
23445
23467
  if (model.pins.length === 1)
23446
23468
  facts.push(w.t("front.core.pin", { digest: shortDigest(model.pins[0]) }));
@@ -23461,10 +23483,10 @@ ${key}`);
23461
23483
  block.append(top, rest);
23462
23484
  return block;
23463
23485
  }
23464
- async function coreStripModel(result2, words) {
23465
- const tally = await tallyJudges(result2.records, result2.claims);
23486
+ async function coreStripModel(result3, words) {
23487
+ const tally = await tallyJudges(result3.records, result3.claims);
23466
23488
  return {
23467
- result: result2,
23489
+ result: result3,
23468
23490
  words,
23469
23491
  mock: judgedByMock(tally),
23470
23492
  pins: tally.pins.map((pin) => pin.digest)
@@ -24433,9 +24455,9 @@ ${pad.repeat(depth)}`;
24433
24455
  details.append(list2);
24434
24456
  return details;
24435
24457
  }
24436
- async function recordEntries(context, result2) {
24458
+ async function recordEntries(context, result3) {
24437
24459
  const read = /* @__PURE__ */ new Map();
24438
- for (const record of result2?.records.values() ?? []) {
24460
+ for (const record of result3?.records.values() ?? []) {
24439
24461
  const id = record.bookRecordId ?? record.capsuleId;
24440
24462
  if (!read.has(id)) read.set(id, record);
24441
24463
  }
@@ -24680,13 +24702,13 @@ ${pad.repeat(depth)}`;
24680
24702
  const recordPageStyle = element6("style");
24681
24703
  recordPageStyle.textContent = RECORD_PAGE_CSS;
24682
24704
  page.append(recordPageStyle);
24683
- let result2;
24705
+ let result3;
24684
24706
  try {
24685
- result2 = bundleVerified(verified) ? await resultRootOf(context) : void 0;
24707
+ result3 = bundleVerified(verified) ? await resultRootOf(context) : void 0;
24686
24708
  } catch {
24687
- result2 = void 0;
24709
+ result3 = void 0;
24688
24710
  }
24689
- const read = bundleVerified(verified) ? await recordEntries(context, result2) : /* @__PURE__ */ new Map();
24711
+ const read = bundleVerified(verified) ? await recordEntries(context, result3) : /* @__PURE__ */ new Map();
24690
24712
  const rawRecords = /* @__PURE__ */ new Map();
24691
24713
  for (const raw of Array.isArray(object13(bundle).records) ? object13(bundle).records : [])
24692
24714
  if (typeof object13(raw).capsule_id === "string")
@@ -24705,7 +24727,7 @@ ${pad.repeat(depth)}`;
24705
24727
  if (l3 !== void 0 && context.recordIndex.has(id))
24706
24728
  body.append(
24707
24729
  renderRecordPage(
24708
- { context, capsuleId: id, stamps, result: result2, voice: l3.voice },
24730
+ { context, capsuleId: id, stamps, result: result3, voice: l3.voice },
24709
24731
  l3.words
24710
24732
  )
24711
24733
  );
@@ -25074,8 +25096,8 @@ ${pad.repeat(depth)}`;
25074
25096
  return list2;
25075
25097
  }
25076
25098
  var CLAIM_TYPE_LABEL = (claim) => claim.recognized ? claim.type : `unrecognized (${claim.type})`;
25077
- function countMismatchMarker(result2, field) {
25078
- const mismatch = result2.countMismatches.find(
25099
+ function countMismatchMarker(result3, field) {
25100
+ const mismatch = result3.countMismatches.find(
25079
25101
  (entry) => entry.field === field
25080
25102
  );
25081
25103
  if (mismatch === void 0) return void 0;
@@ -25109,7 +25131,7 @@ ${pad.repeat(depth)}`;
25109
25131
  parent2.append(cell2);
25110
25132
  return cell2;
25111
25133
  }
25112
- function renderClose(close, result2, host) {
25134
+ function renderClose(close, result3, host) {
25113
25135
  host.append(element6("h4", "Close"));
25114
25136
  const details = element6("dl");
25115
25137
  if (close.period !== void 0)
@@ -25140,10 +25162,10 @@ ${pad.repeat(depth)}`;
25140
25162
  }
25141
25163
  host.append(details);
25142
25164
  host.append(element6("h5", "Cited Close"));
25143
- renderCitationList([close.closeRef], result2.records, host);
25165
+ renderCitationList([close.closeRef], result3.records, host);
25144
25166
  if (close.peerCloseRef !== void 0) {
25145
25167
  host.append(element6("h5", "Peer record"));
25146
- renderCitationList([close.peerCloseRef], result2.records, host);
25168
+ renderCitationList([close.peerCloseRef], result3.records, host);
25147
25169
  }
25148
25170
  if (close.links.length > 0) {
25149
25171
  host.append(element6("h5", "Links to the cited Close"));
@@ -25205,7 +25227,7 @@ ${pad.repeat(depth)}`;
25205
25227
  parent2.append(cell2);
25206
25228
  return cell2;
25207
25229
  }
25208
- function renderClaim(claim, result2, host) {
25230
+ function renderClaim(claim, result3, host) {
25209
25231
  host.replaceChildren();
25210
25232
  host.append(element6("h3", `Claim ${claim.id}`));
25211
25233
  const details = element6("dl");
@@ -25231,7 +25253,7 @@ ${pad.repeat(depth)}`;
25231
25253
  note.dataset.claimFailed = claim.failedOn ?? "close_state";
25232
25254
  host.append(note);
25233
25255
  }
25234
- if (claim.close !== void 0) renderClose(claim.close, result2, host);
25256
+ if (claim.close !== void 0) renderClose(claim.close, result3, host);
25235
25257
  if (claim.support === "unsupported") {
25236
25258
  const note = element6(
25237
25259
  "p",
@@ -25253,7 +25275,7 @@ ${pad.repeat(depth)}`;
25253
25275
  host.append(element6("h5", "Carrier evidence"));
25254
25276
  const list2 = renderCitationList(
25255
25277
  claim.presentation.evidence,
25256
- result2.records,
25278
+ result3.records,
25257
25279
  host
25258
25280
  );
25259
25281
  list2.dataset.carrierEvidence = String(claim.presentation.evidence.length);
@@ -25271,13 +25293,13 @@ ${pad.repeat(depth)}`;
25271
25293
  }
25272
25294
  host.append(element6("h4", "Evidence"));
25273
25295
  for (const ref of claim.evidence) {
25274
- const record = result2.records.get(ref.digest);
25296
+ const record = result3.records.get(ref.digest);
25275
25297
  if (record === void 0) {
25276
25298
  const missing = element6("p", `${ref.digest} \xB7 not in this bundle`);
25277
25299
  missing.dataset.evidence = "missing";
25278
25300
  host.append(missing);
25279
25301
  } else {
25280
- renderCitedRecord(record, result2.records, host);
25302
+ renderCitedRecord(record, result3.records, host);
25281
25303
  }
25282
25304
  }
25283
25305
  }
@@ -25290,23 +25312,23 @@ ${pad.repeat(depth)}`;
25290
25312
  ];
25291
25313
  var RESULT_COUNT_MARKS = `[${CORE_STRIP_ATTRIBUTE}], .cv-strip, [data-bucket], [data-bucket-count], [data-count-mismatch]`;
25292
25314
  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) {
25315
+ function renderResultPage(result3, root) {
25294
25316
  const section = element6("section");
25295
25317
  section.dataset.page = "result";
25296
25318
  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]));
25319
+ const later = result3.claims.filter((claim) => claim.later);
25320
+ const byId = new Map(result3.claims.map((claim) => [claim.id, claim]));
25299
25321
  const buckets = element6("section");
25300
25322
  buckets.dataset.buckets = "verdict";
25301
25323
  buckets.append(element6("h2", "Claims by verdict"));
25302
25324
  for (const [key, label, field] of BUCKETS) {
25303
- const ids = result2.buckets[key];
25325
+ const ids = result3.buckets[key];
25304
25326
  if (ids === void 0) continue;
25305
- const count2 = result2.bucketCounts[key] ?? 0;
25327
+ const count2 = result3.bucketCounts[key] ?? 0;
25306
25328
  const heading = element6("h3", `${label}: ${count2 === 0 ? "none" : count2}`);
25307
25329
  heading.dataset.bucketCount = String(count2);
25308
25330
  heading.dataset.bucketOf = key;
25309
- const marker = countMismatchMarker(result2, field);
25331
+ const marker = countMismatchMarker(result3, field);
25310
25332
  if (marker !== void 0) heading.append(" ", marker);
25311
25333
  buckets.append(heading);
25312
25334
  if (ids.length === 0) {
@@ -25331,12 +25353,12 @@ ${pad.repeat(depth)}`;
25331
25353
  }
25332
25354
  const failedHeading = element6(
25333
25355
  "h3",
25334
- `failed: ${result2.bucketCounts.failed === 0 ? "none" : result2.bucketCounts.failed}`
25356
+ `failed: ${result3.bucketCounts.failed === 0 ? "none" : result3.bucketCounts.failed}`
25335
25357
  );
25336
- failedHeading.dataset.bucketCount = String(result2.bucketCounts.failed);
25358
+ failedHeading.dataset.bucketCount = String(result3.bucketCounts.failed);
25337
25359
  failedHeading.dataset.bucketOf = "failed";
25338
25360
  buckets.append(failedHeading);
25339
- const failedIds = result2.claims.filter((claim) => claim.failed).map((claim) => claim.id);
25361
+ const failedIds = result3.claims.filter((claim) => claim.failed).map((claim) => claim.id);
25340
25362
  if (failedIds.length === 0) buckets.append(element6("p", "none"));
25341
25363
  else {
25342
25364
  const list2 = element6("ul");
@@ -25373,7 +25395,7 @@ ${pad.repeat(depth)}`;
25373
25395
  const table3 = document.createElement("table");
25374
25396
  table3.dataset.claims = "rows";
25375
25397
  const detail = element6("section");
25376
- for (const claim of result2.claims) {
25398
+ for (const claim of result3.claims) {
25377
25399
  const tr = document.createElement("tr");
25378
25400
  tr.dataset.claimRow = claim.id;
25379
25401
  tr.dataset.support = claim.support;
@@ -25386,7 +25408,7 @@ ${pad.repeat(depth)}`;
25386
25408
  const button = element6("button", claim.id);
25387
25409
  button.setAttribute("type", "button");
25388
25410
  button.dataset.claimId = claim.id;
25389
- button.addEventListener("click", () => renderClaim(claim, result2, detail));
25411
+ button.addEventListener("click", () => renderClaim(claim, result3, detail));
25390
25412
  idCell.append(button);
25391
25413
  tr.append(idCell, element6("td", claim.requirementRef));
25392
25414
  appendSufficiency(tr, claim);
@@ -25408,7 +25430,7 @@ ${pad.repeat(depth)}`;
25408
25430
  section.append(
25409
25431
  table3,
25410
25432
  detail,
25411
- renderProvenance2(result2.capsuleId, result2.logCoordinates, result2)
25433
+ renderProvenance2(result3.capsuleId, result3.logCoordinates, result3)
25412
25434
  );
25413
25435
  root.append(section);
25414
25436
  }
@@ -25543,15 +25565,15 @@ ${pad.repeat(depth)}`;
25543
25565
  if (presentation !== void 0) return { grouping: "groups", presentation };
25544
25566
  return void 0;
25545
25567
  }
25546
- function claimsFitCard(result2, grouping) {
25547
- if (new Set(result2.claims.map((c) => c.contractRef)).size > 1) return false;
25568
+ function claimsFitCard(result3, grouping) {
25569
+ if (new Set(result3.claims.map((c) => c.contractRef)).size > 1) return false;
25548
25570
  const placed = grouping === "lines" ? new Set(
25549
- readOutcomeReportTerms(result2).checks.flatMap(
25571
+ readOutcomeReportTerms(result3).checks.flatMap(
25550
25572
  (check) => check.criteria.map((criterion2) => `${check.id}.${criterion2.id}`)
25551
25573
  )
25552
25574
  ) : void 0;
25553
25575
  const seen = /* @__PURE__ */ new Set();
25554
- for (const claim of result2.claims) {
25576
+ for (const claim of result3.claims) {
25555
25577
  if (claim.type !== REQUIREMENT_CLAIM) return false;
25556
25578
  const sep = claim.id.indexOf("::");
25557
25579
  if (sep <= 0) return false;
@@ -25571,16 +25593,16 @@ ${pad.repeat(depth)}`;
25571
25593
  manifest: CONTRACT_REPORT_MANIFEST,
25572
25594
  canRender: (context) => isResultRoot(context),
25573
25595
  buildModel: async (context) => {
25574
- const result2 = defined(
25596
+ const result3 = defined(
25575
25597
  await resultRootOf(context),
25576
25598
  CONTRACT_REPORT_MANIFEST.id
25577
25599
  );
25578
25600
  const supported = contractReportInput(context.bundle);
25579
- const input = supported !== void 0 && claimsFitCard(result2, supported.grouping) ? supported : void 0;
25601
+ const input = supported !== void 0 && claimsFitCard(result3, supported.grouping) ? supported : void 0;
25580
25602
  if (typeof context.bundle === "object" && context.bundle !== null)
25581
25603
  contractReportDrawn.set(context.bundle, input ?? null);
25582
25604
  return {
25583
- result: result2,
25605
+ result: result3,
25584
25606
  ...input === void 0 ? {} : { input },
25585
25607
  ...supported !== void 0 && input === void 0 ? { unfit: true } : {},
25586
25608
  bundle: context.bundle,
@@ -25723,11 +25745,11 @@ ${pad.repeat(depth)}`;
25723
25745
  }
25724
25746
  return out;
25725
25747
  }
25726
- async function drawCharts(context, result2, charts, digests, words) {
25748
+ async function drawCharts(context, result3, charts, digests, words) {
25727
25749
  let dataset;
25728
25750
  let invalid2;
25729
25751
  try {
25730
- dataset = result2 === void 0 ? void 0 : await chartDatasetOf(context, result2);
25752
+ dataset = result3 === void 0 ? void 0 : await chartDatasetOf(context, result3);
25731
25753
  } catch (err) {
25732
25754
  if (!(err instanceof ChartRefusal)) throw err;
25733
25755
  invalid2 = err;
@@ -26084,16 +26106,16 @@ ${pad.repeat(depth)}`;
26084
26106
  const contract = await pageContract(options.contract);
26085
26107
  const charted = options.charts !== void 0 && options.charts.length > 0;
26086
26108
  if (verified) {
26087
- const result2 = await resultRootOf(context);
26109
+ const result3 = await resultRootOf(context);
26088
26110
  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)
26111
+ const words = result3 === void 0 && !charted ? void 0 : await contractReportWords(grouping, options.wording, {
26112
+ singleContract: result3 !== void 0 && citesOneContract(result3)
26091
26113
  });
26092
- if (result2 !== void 0) strip = await coreStripModel(result2, words);
26114
+ if (result3 !== void 0) strip = await coreStripModel(result3, words);
26093
26115
  if (charted)
26094
26116
  chartsNode = await drawCharts(
26095
26117
  context,
26096
- result2,
26118
+ result3,
26097
26119
  options.charts,
26098
26120
  chartDigests,
26099
26121
  words
@@ -26815,6 +26837,25 @@ ${pad.repeat(depth)}`;
26815
26837
  return result("NOT_CHECKED", "check_unavailable");
26816
26838
  }
26817
26839
  }
26840
+
26841
+ // src/card-signature.ts
26842
+ var result2 = (status2, keyId = null) => ({ status: status2, key_id: keyId });
26843
+ async function readerCardSignature(context) {
26844
+ if (!isVerifiedBundleContext(context)) return result2("NOT_CHECKED");
26845
+ const record = context.strict?.records.find(
26846
+ (r) => r.capsuleId === context.root
26847
+ );
26848
+ if (record === void 0) return result2("NOT_CHECKED");
26849
+ switch (record.signature) {
26850
+ case "authored":
26851
+ return record.keyId === null ? result2("NOT_CHECKED") : result2("PASS", record.keyId);
26852
+ case "invalid":
26853
+ return result2("FAIL");
26854
+ case "unclaimed":
26855
+ return result2("NOT_PRESENT");
26856
+ }
26857
+ return result2("NOT_CHECKED");
26858
+ }
26818
26859
  return __toCommonJS(browser_exports2);
26819
26860
  })();
26820
26861
  /*! Bundled license information: