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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/backfill-timeline.d.ts +66 -0
  2. package/dist/backfill-timeline.js +401 -0
  3. package/dist/backfill-timeline.js.map +1 -0
  4. package/dist/chart-dataset.d.ts +35 -0
  5. package/dist/chart-dataset.js +16 -1
  6. package/dist/chart-dataset.js.map +1 -1
  7. package/dist/compliance-view.js +41 -14
  8. package/dist/compliance-view.js.map +1 -1
  9. package/dist/contract-report-wording.d.ts +3 -1
  10. package/dist/contract-report-wording.js +18 -8
  11. package/dist/contract-report-wording.js.map +1 -1
  12. package/dist/core-strip.d.ts +19 -3
  13. package/dist/core-strip.js +76 -11
  14. package/dist/core-strip.js.map +1 -1
  15. package/dist/evidence-graph-view.js +2 -2
  16. package/dist/evidence-graph-view.js.map +1 -1
  17. package/dist/evidence-graph.iife.js +291 -104
  18. package/dist/history-view.d.ts +2 -2
  19. package/dist/history-view.iife.js +1 -0
  20. package/dist/history-view.iife.js.sha256 +1 -1
  21. package/dist/history-view.js +2 -1
  22. package/dist/history-view.js.map +1 -1
  23. package/dist/index.d.ts +4 -0
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/outcome-report-view.js +53 -2
  27. package/dist/outcome-report-view.js.map +1 -1
  28. package/dist/report-front.d.ts +2 -1
  29. package/dist/report-front.js.map +1 -1
  30. package/dist/studio-card.d.ts +79 -0
  31. package/dist/studio-card.js +383 -0
  32. package/dist/studio-card.js.map +1 -0
  33. package/dist/studio-pack.d.ts +10 -0
  34. package/dist/studio-pack.js +27 -0
  35. package/dist/studio-pack.js.map +1 -0
  36. package/dist/studio-view.d.ts +56 -0
  37. package/dist/studio-view.js +431 -0
  38. package/dist/studio-view.js.map +1 -0
  39. package/dist/viewer-build.js +2 -2
  40. package/dist/wording/backfill-timeline.en.json +52 -0
  41. package/dist/wording/contract-report-eu-ai-act.en.json +5 -4
  42. package/dist/wording/contract-report-generic.en.json +3 -4
  43. package/dist/wording/contract-report-outcomes.en.json +6 -4
  44. package/dist/wording/studio-card.en.json +66 -0
  45. package/dist/wording/studio-view.en.json +39 -0
  46. package/package.json +7 -2
@@ -2542,7 +2542,7 @@ var EvidenceGraph = (() => {
2542
2542
  }
2543
2543
  });
2544
2544
 
2545
- // node_modules/@action-state-group/cll/dist/chunk-FSX46CVZ.js
2545
+ // node_modules/@action-state-group/cll/dist/chunk-X2Y6VH3Q.js
2546
2546
  function validateIdentifier(value) {
2547
2547
  const length = new TextEncoder().encode(value).length;
2548
2548
  if (length < 1 || length > limits.identifier || !/^[A-Za-z0-9._:/-]+$/u.test(value))
@@ -2552,8 +2552,8 @@ var EvidenceGraph = (() => {
2552
2552
  );
2553
2553
  }
2554
2554
  var limits, CllError;
2555
- var init_chunk_FSX46CVZ = __esm({
2556
- "node_modules/@action-state-group/cll/dist/chunk-FSX46CVZ.js"() {
2555
+ var init_chunk_X2Y6VH3Q = __esm({
2556
+ "node_modules/@action-state-group/cll/dist/chunk-X2Y6VH3Q.js"() {
2557
2557
  limits = Object.freeze({
2558
2558
  entryBytes: 32,
2559
2559
  witnesses: 32,
@@ -4645,56 +4645,85 @@ var EvidenceGraph = (() => {
4645
4645
  }
4646
4646
  });
4647
4647
 
4648
- // node_modules/@action-state-group/cll/dist/chunk-YQXOEEBD.js
4648
+ // node_modules/@action-state-group/cll/dist/chunk-L6ZLKNEI.js
4649
+ function decodeCheckpointStatement(cose) {
4650
+ if (cose.length < 2 || cose.length > limits.checkpointPayload || cose[0] !== 210)
4651
+ return void 0;
4652
+ const items = decode(cose.subarray(1), {
4653
+ allowIndefinite: false,
4654
+ coerceUndefinedToNull: false,
4655
+ useMaps: true
4656
+ });
4657
+ if (!Array.isArray(items) || items.length !== 4 || !(items[0] instanceof Uint8Array) || !(items[1] instanceof Map) || items[1].size !== 0 || !(items[2] instanceof Uint8Array) || !(items[3] instanceof Uint8Array))
4658
+ return void 0;
4659
+ const headers = decode(items[0], {
4660
+ allowIndefinite: false,
4661
+ useMaps: true
4662
+ });
4663
+ if (!(headers instanceof Map)) return void 0;
4664
+ const kid = headers.get(4);
4665
+ const cwt = headers.get(15);
4666
+ if (headers.size !== 4 || headers.get(1) !== -8 || headers.get(3) !== CHECKPOINT_CONTENT_TYPE || !(kid instanceof Uint8Array) || kid.length !== 32 || !(cwt instanceof Map) || cwt.size !== 2)
4667
+ return void 0;
4668
+ const logId = cwt.get(1);
4669
+ const subject = cwt.get(2);
4670
+ if (typeof logId !== "string" || typeof subject !== "string")
4671
+ return void 0;
4672
+ validateIdentifier(logId);
4673
+ const claims = decode(items[2], {
4674
+ allowIndefinite: false,
4675
+ coerceUndefinedToNull: false,
4676
+ useMaps: true
4677
+ });
4678
+ if (!(claims instanceof Map) || !bytesEqual(encodeCanonical(claims), items[2]))
4679
+ return void 0;
4680
+ const allowedClaims = /* @__PURE__ */ new Set([
4681
+ "kind",
4682
+ "log_size",
4683
+ "commitment",
4684
+ "prev_size",
4685
+ "prev_commitment",
4686
+ "issued_at",
4687
+ "cadence",
4688
+ "consistency_proof"
4689
+ ]);
4690
+ if (claims.size < 6 || claims.size > 8 || [...claims.keys()].some(
4691
+ (key) => typeof key !== "string" || !allowedClaims.has(key)
4692
+ ) || claims.get("kind") !== "cll-checkpoint")
4693
+ return void 0;
4694
+ return {
4695
+ items,
4696
+ kid,
4697
+ logId,
4698
+ subject,
4699
+ claims
4700
+ };
4701
+ }
4702
+ async function checkpointRejectionFieldWith(crypto, cose) {
4703
+ try {
4704
+ const statement = decodeCheckpointStatement(cose);
4705
+ if (statement === void 0) return void 0;
4706
+ const issuedAt = statement.claims.get("issued_at");
4707
+ if (typeof issuedAt === "string" && isRfc3339(issuedAt)) return void 0;
4708
+ const { items, kid } = statement;
4709
+ return await crypto.verifyEd25519(
4710
+ kid,
4711
+ signatureMessage(items),
4712
+ items[3]
4713
+ ) === true ? "issued_at" : void 0;
4714
+ } catch {
4715
+ return void 0;
4716
+ }
4717
+ }
4649
4718
  async function verifyCheckpointWith(crypto, cose) {
4650
4719
  try {
4651
- if (cose.length < 2 || cose.length > limits.checkpointPayload || cose[0] !== 210)
4652
- return false;
4653
- const items = decode(cose.subarray(1), {
4654
- allowIndefinite: false,
4655
- coerceUndefinedToNull: false,
4656
- useMaps: true
4657
- });
4658
- if (!Array.isArray(items) || items.length !== 4 || !(items[0] instanceof Uint8Array) || !(items[1] instanceof Map) || items[1].size !== 0 || !(items[2] instanceof Uint8Array) || !(items[3] instanceof Uint8Array))
4659
- return false;
4660
- const headers = decode(items[0], {
4661
- allowIndefinite: false,
4662
- useMaps: true
4663
- });
4664
- if (!(headers instanceof Map)) return false;
4665
- const kid = headers.get(4);
4666
- const cwt = headers.get(15);
4667
- if (headers.size !== 4 || headers.get(1) !== -8 || headers.get(3) !== CHECKPOINT_CONTENT_TYPE || !(kid instanceof Uint8Array) || kid.length !== 32 || !(cwt instanceof Map) || cwt.size !== 2)
4668
- return false;
4669
- const logId = cwt.get(1);
4670
- const subject = cwt.get(2);
4671
- if (typeof logId !== "string" || typeof subject !== "string") return false;
4672
- validateIdentifier(logId);
4673
- const claims = decode(items[2], {
4674
- allowIndefinite: false,
4675
- coerceUndefinedToNull: false,
4676
- useMaps: true
4677
- });
4678
- if (!(claims instanceof Map) || !bytesEqual(encodeCanonical(claims), items[2]))
4679
- return false;
4680
- const allowedClaims = /* @__PURE__ */ new Set([
4681
- "kind",
4682
- "log_size",
4683
- "commitment",
4684
- "prev_size",
4685
- "prev_commitment",
4686
- "issued_at",
4687
- "cadence",
4688
- "consistency_proof"
4689
- ]);
4690
- if (claims.size < 6 || claims.size > 8 || [...claims.keys()].some(
4691
- (key) => typeof key !== "string" || !allowedClaims.has(key)
4692
- ) || claims.get("kind") !== "cll-checkpoint")
4693
- return false;
4720
+ const statement = decodeCheckpointStatement(cose);
4721
+ if (statement === void 0) return false;
4722
+ const { items, kid, logId, subject, claims } = statement;
4694
4723
  const logSize = claims.get("log_size");
4695
4724
  const previousSize = claims.get("prev_size");
4696
4725
  const issuedAt = claims.get("issued_at");
4697
- if (!Number.isSafeInteger(logSize) || logSize < 1 || !Number.isSafeInteger(previousSize) || previousSize < 0 || previousSize >= logSize || typeof issuedAt !== "string" || formatTime(issuedAt) !== issuedAt || subject !== `${logId}#${logSize}`)
4726
+ if (!Number.isSafeInteger(logSize) || logSize < 1 || !Number.isSafeInteger(previousSize) || previousSize < 0 || previousSize >= logSize || typeof issuedAt !== "string" || !isRfc3339(issuedAt) || subject !== logId && subject !== `${logId}#${logSize}`)
4698
4727
  return false;
4699
4728
  const decodePeaks = (value) => {
4700
4729
  if (!(value instanceof Uint8Array)) return void 0;
@@ -4760,11 +4789,7 @@ var EvidenceGraph = (() => {
4760
4789
  if (!Number.isSafeInteger(cadence) || cadence < 1)
4761
4790
  return false;
4762
4791
  }
4763
- return await crypto.verifyEd25519(
4764
- kid,
4765
- encodeCanonical(["Signature1", items[0], new Uint8Array(), items[2]]),
4766
- items[3]
4767
- ) === true;
4792
+ return await crypto.verifyEd25519(kid, signatureMessage(items), items[3]) === true;
4768
4793
  } catch {
4769
4794
  return false;
4770
4795
  }
@@ -4828,11 +4853,11 @@ var EvidenceGraph = (() => {
4828
4853
  const k = littleEndian(sha512(digest2)) % Point.Fn.ORDER;
4829
4854
  return Point.BASE.multiplyUnsafe(s).equals(rPoint.add(a.multiplyUnsafe(k)));
4830
4855
  }
4831
- var CHECKPOINT_CONTENT_TYPE, encodeCanonical, toHex2, bytesEqual, formatTime, Point, littleEndian;
4832
- var init_chunk_YQXOEEBD = __esm({
4833
- "node_modules/@action-state-group/cll/dist/chunk-YQXOEEBD.js"() {
4856
+ var CHECKPOINT_CONTENT_TYPE, encodeCanonical, toHex2, bytesEqual, formatTime, isRfc3339, signatureMessage, Point, littleEndian;
4857
+ var init_chunk_L6ZLKNEI = __esm({
4858
+ "node_modules/@action-state-group/cll/dist/chunk-L6ZLKNEI.js"() {
4834
4859
  init_chunk_JR35ZH2C();
4835
- init_chunk_FSX46CVZ();
4860
+ init_chunk_X2Y6VH3Q();
4836
4861
  init_cborg();
4837
4862
  init_ed25519();
4838
4863
  init_sha2();
@@ -4858,6 +4883,26 @@ var EvidenceGraph = (() => {
4858
4883
  const trimmed = fraction.replace(/0+$/u, "");
4859
4884
  return `${parsed.toISOString().slice(0, 19)}${trimmed === "" ? "" : `.${trimmed}`}Z`;
4860
4885
  };
4886
+ isRfc3339 = (value) => {
4887
+ const match = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.(\d+))?(Z|[+-]\d\d:\d\d)$/u.exec(
4888
+ value
4889
+ );
4890
+ if (match === null) return false;
4891
+ const [year, month, day, hour, minute, second] = match.slice(1, 7).map(Number);
4892
+ const date = /* @__PURE__ */ new Date(0);
4893
+ date.setUTCFullYear(year, month - 1, day);
4894
+ if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !== day || hour > 23 || minute > 59 || second > 59)
4895
+ return false;
4896
+ try {
4897
+ formatTime(
4898
+ `${value.slice(0, 19)}${match[7] === void 0 ? "" : `.${match[7].slice(0, 9)}`}${match[8]}`
4899
+ );
4900
+ return true;
4901
+ } catch {
4902
+ return false;
4903
+ }
4904
+ };
4905
+ signatureMessage = (items) => encodeCanonical(["Signature1", items[0], new Uint8Array(), items[2]]);
4861
4906
  ({ Point } = ed25519);
4862
4907
  littleEndian = (bytes) => {
4863
4908
  let value = 0n;
@@ -4874,6 +4919,7 @@ var EvidenceGraph = (() => {
4874
4919
  CHECKPOINT_CONTENT_TYPE: () => CHECKPOINT_CONTENT_TYPE,
4875
4920
  MmrTree: () => MmrTree2,
4876
4921
  checkpointMetadata: () => checkpointMetadata,
4922
+ checkpointRejectionField: () => checkpointRejectionField,
4877
4923
  commitmentObject: () => commitmentObject,
4878
4924
  consistencyProof: () => consistencyProof,
4879
4925
  inclusionProof: () => inclusionProof,
@@ -4937,12 +4983,12 @@ var EvidenceGraph = (() => {
4937
4983
  h.forEach((word, i) => outView.setUint32(i * 4, word));
4938
4984
  return out;
4939
4985
  }
4940
- var K2, H02, rotr3, join, hash, MmrTree2, rootFromPeaks2, verifyInclusionValue2, verifyHexInclusion2, verifyConsistency2, verifyRange2, checkpointCrypto, verifyCheckpoint, checkpointMetadata;
4986
+ var K2, H02, rotr3, join, hash, MmrTree2, rootFromPeaks2, verifyInclusionValue2, verifyHexInclusion2, verifyConsistency2, verifyRange2, checkpointCrypto, checkpointRejectionField, verifyCheckpoint, checkpointMetadata;
4941
4987
  var init_browser = __esm({
4942
4988
  "node_modules/@action-state-group/cll/dist/browser.js"() {
4943
- init_chunk_YQXOEEBD();
4989
+ init_chunk_L6ZLKNEI();
4944
4990
  init_chunk_JR35ZH2C();
4945
- init_chunk_FSX46CVZ();
4991
+ init_chunk_X2Y6VH3Q();
4946
4992
  K2 = new Uint32Array([
4947
4993
  1116352408,
4948
4994
  1899447441,
@@ -5049,6 +5095,7 @@ var EvidenceGraph = (() => {
5049
5095
  hash,
5050
5096
  verifyEd25519: async (publicKey, message, signature2) => verifyEd25519(publicKey, message, signature2)
5051
5097
  };
5098
+ checkpointRejectionField = (cose) => checkpointRejectionFieldWith(checkpointCrypto, cose);
5052
5099
  verifyCheckpoint = (cose) => verifyCheckpointWith(checkpointCrypto, cose);
5053
5100
  checkpointMetadata = (cose) => checkpointMetadataWith(checkpointCrypto, cose);
5054
5101
  }
@@ -17689,16 +17736,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17689
17736
  }
17690
17737
  function builtCommit() {
17691
17738
  if (false) return void 0;
17692
- return commitPrefix("d9acdea4c629e3ae42db08872d96da9e982c589a");
17739
+ return commitPrefix("25886484a7054bf7ec926c60917c5f995c90361e");
17693
17740
  }
17694
17741
  var commit = builtCommit();
17695
17742
  var unreleased = false;
17696
17743
  var VIEWER_BUILD = {
17697
17744
  viewer: "@action-state-group/capsule-viewer",
17698
- viewerVersion: "0.18.3",
17745
+ viewerVersion: "0.19.1",
17699
17746
  verifier: "@action-state-group/agent-action-capsule",
17700
17747
  verifierVersion: "0.14.0",
17701
- cllVersion: "0.3.0",
17748
+ cllVersion: "0.4.0",
17702
17749
  ...commit === void 0 ? {} : { commit },
17703
17750
  ...unreleased ? { unreleased: true } : {}
17704
17751
  };
@@ -18221,6 +18268,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18221
18268
  "card.wording.refused.fit": "it does not fit this card's words",
18222
18269
  "front.mock": "Verdicts are from a mock judge and are placeholders.",
18223
18270
  "front.agg.evaluated": "{evaluations} of {requirements}",
18271
+ "front.agg.imported": "Imported: the records behind this result were all backfilled after the fact; none was recorded at the time.",
18224
18272
  "front.agg.evaluations.one": "{n} evaluation",
18225
18273
  "front.agg.evaluations.other": "{n} evaluations",
18226
18274
  "front.agg.requirements.one": "{n} requirement",
@@ -18232,10 +18280,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18232
18280
  "front.agg.later.one": "{n} evaluation not yet in force",
18233
18281
  "front.agg.later.other": "{n} evaluations not yet in force",
18234
18282
  "front.agg.mismatch": "count mismatch: the claims give {recomputed}",
18235
- "front.agg.as-of": "In force as of {date}.",
18236
- "front.agg.copied.both": "The dates and the out-of-scope switch are copied from the contract, not re-checked here.",
18237
- "front.agg.copied.dates": "The dates are copied from the contract, not re-checked here.",
18238
- "front.agg.copied.switch": "The out-of-scope switch is copied from the contract, not re-checked here.",
18283
+ "lines.later.readiness": "readiness only",
18284
+ "applicability.as_of": "In force as of {date}.",
18285
+ "applicability.not_yet_in_force.title": "Not yet in force",
18286
+ "applicability.not_yet_in_force.note": "Readiness only: these requirements apply from a later date, which the producer copied from the contract. They are in none of the met, not met or could not decide counts above, and a result here is never a violation.",
18287
+ "contract_fact.note": "Dates and the out-of-scope switch are the producer's copy of the contract, not re-checked by this page.",
18239
18288
  "prov.brief.judge.partial": "judge pinned for some results",
18240
18289
  "front.agg.excluded": "{excluded} excluded as not applicable",
18241
18290
  "front.agg.bucket.met": "Met",
@@ -18831,6 +18880,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18831
18880
  "card.wording.refused.fit": "it does not fit this card's words",
18832
18881
  "front.mock": "Verdicts are from a mock judge and are placeholders.",
18833
18882
  "front.agg.evaluated": "{evaluations} of {requirements}",
18883
+ "front.agg.imported": "Imported: the records behind this result were all backfilled after the fact; none was recorded at the time.",
18834
18884
  "front.agg.evaluations.one": "{n} evaluation",
18835
18885
  "front.agg.evaluations.other": "{n} evaluations",
18836
18886
  "front.agg.requirements.one": "{n} requirement",
@@ -18842,10 +18892,10 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
18842
18892
  "front.agg.later.one": "{n} evaluation not yet in force",
18843
18893
  "front.agg.later.other": "{n} evaluations not yet in force",
18844
18894
  "front.agg.mismatch": "count mismatch: the claims give {recomputed}",
18845
- "front.agg.as-of": "In force as of {date}.",
18846
- "front.agg.copied.both": "The dates and the out-of-scope switch are copied from the contract, not re-checked here.",
18847
- "front.agg.copied.dates": "The dates are copied from the contract, not re-checked here.",
18848
- "front.agg.copied.switch": "The out-of-scope switch is copied from the contract, not re-checked here.",
18895
+ "applicability.as_of": "In force as of {date}.",
18896
+ "applicability.not_yet_in_force.title": "Not yet in force",
18897
+ "applicability.not_yet_in_force.note": "Readiness only: these requirements apply from a later date, which the producer copied from the contract. They are in none of the met, not met or could not decide counts above, and a result here is never a violation.",
18898
+ "contract_fact.note": "Dates and the out-of-scope switch are the producer's copy of the contract, not re-checked by this page.",
18849
18899
  "prov.brief.judge.partial": "judge pinned for some results",
18850
18900
  "front.agg.excluded": "{excluded} excluded as not applicable",
18851
18901
  "front.agg.bucket.met": "Met",
@@ -19261,6 +19311,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19261
19311
  "card.wording.refused.fit": "it does not fit this card's words",
19262
19312
  "front.mock": "Verdicts are from a mock judge and are placeholders.",
19263
19313
  "front.agg.evaluated": "{evaluations} of {requirements}",
19314
+ "front.agg.imported": "Imported: the records behind this result were all backfilled after the fact; none was recorded at the time.",
19264
19315
  "front.agg.evaluations.one": "{n} evaluation",
19265
19316
  "front.agg.evaluations.other": "{n} evaluations",
19266
19317
  "front.agg.requirements.one": "{n} requirement",
@@ -19272,10 +19323,8 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19272
19323
  "front.agg.later.one": "{n} evaluation not yet in force",
19273
19324
  "front.agg.later.other": "{n} evaluations not yet in force",
19274
19325
  "front.agg.mismatch": "count mismatch: the claims give {recomputed}",
19275
- "front.agg.as-of": "In force as of {date}.",
19276
- "front.agg.copied.both": "The dates and the out-of-scope switch are copied from the contract, not re-checked here.",
19277
- "front.agg.copied.dates": "The dates are copied from the contract, not re-checked here.",
19278
- "front.agg.copied.switch": "The out-of-scope switch is copied from the contract, not re-checked here.",
19326
+ "applicability.as_of": "In force as of {date}.",
19327
+ "contract_fact.note": "Dates and the out-of-scope switch are the producer's copy of the contract, not re-checked by this page.",
19279
19328
  "prov.brief.judge.partial": "judge pinned for some results",
19280
19329
  "front.agg.excluded": "{excluded} excluded as not applicable",
19281
19330
  "front.agg.bucket.met": "Met",
@@ -19568,6 +19617,11 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19568
19617
  throw new WordingPackError(
19569
19618
  `wording pack is not an ${WORDING_PACK_VERSION} object`
19570
19619
  );
19620
+ const reserved = Object.keys(entries).find((k) => k.startsWith("core."));
19621
+ if (reserved !== void 0)
19622
+ throw new WordingPackError(
19623
+ `wording pack carries the reserved key ${JSON.stringify(reserved)}`
19624
+ );
19571
19625
  return {
19572
19626
  id: p.id,
19573
19627
  locale: p.locale,
@@ -20007,13 +20061,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
20007
20061
  // aggregate's unknown count is, what the page and the bundle carry, and
20008
20062
  // the producer's findings label.
20009
20063
  "front.mock",
20064
+ "front.agg.imported",
20010
20065
  "front.agg.unknown.one",
20011
20066
  "front.agg.unknown.other",
20012
20067
  "front.agg.mismatch",
20013
- "front.agg.as-of",
20014
- "front.agg.copied.both",
20015
- "front.agg.copied.dates",
20016
- "front.agg.copied.switch",
20068
+ // Module spec section 2, "Copied facts": a pack cannot make a date or a
20069
+ // switch copied from the contract read as checked here, and cannot
20070
+ // make a later claim read as in force.
20071
+ "applicability.as_of",
20072
+ "applicability.not_yet_in_force.note",
20073
+ "contract_fact.note",
20017
20074
  // The record page, the lowest level (record-page.ts): what each proof
20018
20075
  // proves and does not, what a status means, and what this page did not
20019
20076
  // run. A pack cannot make a rung read as proving more than it does.
@@ -20590,9 +20647,9 @@ ${key}`);
20590
20647
  return problems.map((p) => `${pack.id}: ${p}`);
20591
20648
  }
20592
20649
  var DEFAULT_PACK_SHA256 = Object.freeze({
20593
- lines: "80b1373cd923bbf0fcf5ffaa2499d851f6f0907bca1263948cbea502f62df3b7",
20594
- groups: "004c1c663a60e8c0248219c6be9b2c91aa89108c648d30144d141137cd02ea99",
20595
- generic: "10e802539747ebff6fc92b1947d083609c99ab33ad4b3579ed4e1d66425defa0"
20650
+ lines: "4a03428e884337321754bd6657df0ebb6d5441821378a3b1ff17f2a625021cc5",
20651
+ groups: "76acc9598202663738d7d2903ca1a042d9b7ca21799297946e4da39ea77d5250",
20652
+ generic: "6c7570711462e9a9af94faac45f56414fd97a1681608be03299f6fa756eaa41c"
20596
20653
  });
20597
20654
  function fill(key, text2, vars) {
20598
20655
  return text2.replace(PLACEHOLDER, (whole, name) => {
@@ -22425,6 +22482,52 @@ ${key}`);
22425
22482
  }
22426
22483
  host.append(section);
22427
22484
  }
22485
+ function renderNotYetInForce(host, model, w) {
22486
+ const entries = [
22487
+ ...model.conversations.map((c) => ({ c, later: c.notYetInForce })),
22488
+ ...model.notYetInForce.map((c) => ({ c, later: c.notYetInForce }))
22489
+ ].filter((e) => e.later.length > 0);
22490
+ if (entries.length === 0) return;
22491
+ const total = entries.reduce((sum, e) => sum + e.later.length, 0);
22492
+ const section = el8("section", "sec");
22493
+ section.dataset.section = "not-yet-in-force";
22494
+ section.dataset.count = String(total);
22495
+ section.append(
22496
+ el8(
22497
+ "h2",
22498
+ "",
22499
+ w.t("applicability.not_yet_in_force.title", { n: fmtCount(total) })
22500
+ ),
22501
+ el8("p", "lede", w.t("applicability.not_yet_in_force.note"))
22502
+ );
22503
+ const list2 = el8("ul", "later-list");
22504
+ for (const { c, later } of entries) {
22505
+ for (const cr of later) {
22506
+ const label = criterionLabel(model, cr.checkId, cr.criterionId, w);
22507
+ const item = el8("li", "later-item");
22508
+ item.dataset.conversation = c.conversationId;
22509
+ item.dataset.rule = `${cr.checkId}.${cr.criterionId}`;
22510
+ item.append(
22511
+ el8("b", "", label.label),
22512
+ document.createTextNode(` \xB7 ${c.conversationId} \xB7 `),
22513
+ el8(
22514
+ "span",
22515
+ "readiness",
22516
+ `${w.t("lines.later.readiness")}: ${w.enumWord("verdict", cr.verdict)}`
22517
+ )
22518
+ );
22519
+ if (cr.claim !== void 0) {
22520
+ const [, line, data] = assuranceRow(cr.claim, w);
22521
+ const assurance = el8("small", "assurance", ` \xB7 ${line}`);
22522
+ Object.assign(assurance.dataset, data);
22523
+ item.append(assurance);
22524
+ }
22525
+ list2.append(item);
22526
+ }
22527
+ }
22528
+ section.append(list2);
22529
+ host.append(section);
22530
+ }
22428
22531
  function renderRules(host, model, runInfo, result3, w) {
22429
22532
  const tierOf = model.gating?.tierOf;
22430
22533
  const section = el8("section", "sec");
@@ -22472,11 +22575,19 @@ ${key}`);
22472
22575
  const claim = model.conversations.flatMap((c) => c.criteria).find((c) => `${c.checkId}.${c.criterionId}` === ref && c.claim)?.claim;
22473
22576
  return tierOf(claim?.contractRef, ref);
22474
22577
  };
22578
+ const inForceRefs = new Set(
22579
+ model.conversations.flatMap(
22580
+ (c) => c.criteria.map((cr) => `${cr.checkId}.${cr.criterionId}`)
22581
+ )
22582
+ );
22583
+ const whollyLater = new Set(
22584
+ [...model.conversations, ...model.notYetInForce].flatMap((c) => c.notYetInForce).map((cr) => `${cr.checkId}.${cr.criterionId}`).filter((ref) => !inForceRefs.has(ref))
22585
+ );
22475
22586
  const tiers = /* @__PURE__ */ new Map();
22476
22587
  for (const check of model.terms.checks)
22477
22588
  for (const criterion2 of check.criteria) {
22478
22589
  const ref = `${check.id}.${criterion2.id}`;
22479
- tiers.set(ref, ruleTier(ref));
22590
+ if (!whollyLater.has(ref)) tiers.set(ref, ruleTier(ref));
22480
22591
  }
22481
22592
  const sections = tierOf === void 0 ? [void 0] : ROW_TIERS.filter((tier) => [...tiers.values()].includes(tier));
22482
22593
  for (const tier of sections) {
@@ -22495,7 +22606,7 @@ ${key}`);
22495
22606
  }
22496
22607
  for (const check of model.terms.checks) {
22497
22608
  const criteria = check.criteria.filter(
22498
- (criterion2) => tiers.get(`${check.id}.${criterion2.id}`) === tier
22609
+ (criterion2) => tiers.has(`${check.id}.${criterion2.id}`) && tiers.get(`${check.id}.${criterion2.id}`) === tier
22499
22610
  );
22500
22611
  if (criteria.length === 0) continue;
22501
22612
  const group = el8("tr", "grp");
@@ -23184,6 +23295,7 @@ ${key}`);
23184
23295
  if (subject !== void 0) levels.L0.append(subject);
23185
23296
  }
23186
23297
  renderRules(levels.L1, model, runInfo, result3, w);
23298
+ renderNotYetInForce(levels.L1, model, w);
23187
23299
  leadWithProvenance(
23188
23300
  levels.L1,
23189
23301
  levels.L1.querySelector('[data-section="rules"]'),
@@ -23559,10 +23671,13 @@ ${key}`);
23559
23671
  model.sessions.flatMap((s) => s.tests).find((t) => t.criterionId === row2.criterionId && t.claim)?.claim?.contractRef,
23560
23672
  row2.criterionId
23561
23673
  );
23562
- const allRows = model.obligations.flatMap((o) => o.rows);
23674
+ const allRows = model.obligations.flatMap(
23675
+ (o) => o.rows.filter((r) => !allLater(r))
23676
+ );
23677
+ const laterRows = model.obligations.flatMap((o) => o.rows.filter(allLater));
23563
23678
  const sections = tierOf === void 0 ? [void 0] : ROW_TIERS.filter((tier) => allRows.some((r) => tierOfRow(r) === tier));
23564
- for (const tier of sections) {
23565
- if (tier !== void 0) {
23679
+ const drawSection = (tier, later) => {
23680
+ if (tier !== void 0 && !later) {
23566
23681
  const head2 = document.createElement("tbody");
23567
23682
  head2.dataset.requirementTier = tier;
23568
23683
  const tr = el9("tr", "tier");
@@ -23584,7 +23699,12 @@ ${key}`);
23584
23699
  table3.append(head2);
23585
23700
  }
23586
23701
  for (const given of model.obligations) {
23587
- const obligation = tier === void 0 ? given : { ...given, rows: given.rows.filter((r) => tierOfRow(r) === tier) };
23702
+ const obligation = {
23703
+ ...given,
23704
+ rows: given.rows.filter(
23705
+ (r) => allLater(r) === later && (tier === void 0 || tierOfRow(r) === tier)
23706
+ )
23707
+ };
23588
23708
  if (obligation.rows.length === 0) continue;
23589
23709
  const tbody = document.createElement("tbody");
23590
23710
  tbody.dataset.obligationGroup = obligation.key;
@@ -23631,7 +23751,7 @@ ${key}`);
23631
23751
  );
23632
23752
  return body;
23633
23753
  },
23634
- tier === void 0 ? `ob-${obligation.key}` : `ob-${obligation.key}-${tier}`,
23754
+ later ? `ob-${obligation.key}-later` : tier === void 0 ? `ob-${obligation.key}` : `ob-${obligation.key}-${tier}`,
23635
23755
  true
23636
23756
  );
23637
23757
  tbody.append(about);
@@ -23649,10 +23769,11 @@ ${key}`);
23649
23769
  const head2 = el9("div", "tnh");
23650
23770
  const testName = rowName2(w, "b", "", test);
23651
23771
  head2.append(testName, tierBadge(test.tier, w));
23652
- if (tier !== void 0) {
23653
- tr.dataset.requirementTier = tier;
23654
- const chip = el9("span", "rtier", w.t(`requirement_tier.${tier}`));
23655
- chip.dataset.requirementTier = tier;
23772
+ const rowTier2 = tier ?? (later ? tierOfRow(test) : void 0);
23773
+ if (rowTier2 !== void 0) {
23774
+ tr.dataset.requirementTier = rowTier2;
23775
+ const chip = el9("span", "rtier", w.t(`requirement_tier.${rowTier2}`));
23776
+ chip.dataset.requirementTier = rowTier2;
23656
23777
  head2.append(chip);
23657
23778
  }
23658
23779
  nameCell.append(head2);
@@ -23688,7 +23809,7 @@ ${key}`);
23688
23809
  testName,
23689
23810
  drillRow,
23690
23811
  () => renderSessionList(sessionIds, model, presentation, w),
23691
- `test-${obligation.key}-${test.criterionId}`
23812
+ `test-${obligation.key}-${test.criterionId}${later ? "-later" : ""}`
23692
23813
  );
23693
23814
  toggle.dataset.records = "sessions";
23694
23815
  toggle.dataset.drill = test.criterionId;
@@ -23698,6 +23819,28 @@ ${key}`);
23698
23819
  }
23699
23820
  table3.append(tbody);
23700
23821
  }
23822
+ };
23823
+ for (const tier of sections) drawSection(tier, false);
23824
+ if (laterRows.length > 0) {
23825
+ const head2 = document.createElement("tbody");
23826
+ head2.dataset.section = "not-yet-in-force";
23827
+ const tr = el9("tr", "tier later");
23828
+ const cell2 = el9("td", "");
23829
+ cell2.setAttribute("colspan", "3");
23830
+ cell2.append(
23831
+ el9(
23832
+ "b",
23833
+ "",
23834
+ w.t("applicability.not_yet_in_force.title", {
23835
+ n: fmt4(laterRows.length)
23836
+ })
23837
+ ),
23838
+ el9("small", "", w.t("applicability.not_yet_in_force.note"))
23839
+ );
23840
+ tr.append(cell2);
23841
+ head2.append(tr);
23842
+ table3.append(head2);
23843
+ drawSection(void 0, true);
23701
23844
  }
23702
23845
  section.append(table3);
23703
23846
  const notes = el9("aside", "footnotes");
@@ -25610,30 +25753,37 @@ ${key}`);
25610
25753
  el12("span", "agg-of", of)
25611
25754
  );
25612
25755
  box.append(caption);
25756
+ if (verdict2 === "out_of_scope") {
25757
+ const fact = el12("div", "agg-fact", contractFactNote(w));
25758
+ fact.dataset.contractFact = "out-of-scope";
25759
+ box.append(fact);
25760
+ }
25613
25761
  const marker = mismatchMarker(figure, field, w);
25614
25762
  if (marker !== void 0) box.append(marker);
25615
25763
  buckets.append(box);
25616
25764
  }
25617
25765
  out.append(buckets);
25618
25766
  const dated = result3.claims.some((claim) => claim.appliesFrom !== void 0);
25619
- const switched = result3.buckets.outOfScope !== void 0;
25620
- if (dated || switched) {
25767
+ if (dated) {
25621
25768
  const copied = el12("p", "agg-note");
25622
25769
  if (dated) {
25623
25770
  const date = utcDateOf(result3.generatedAt) ?? result3.generatedAt;
25624
- copied.append(w.t("front.agg.as-of", { date }), " ");
25771
+ const word = w.section3("applicability.as_of");
25772
+ copied.append(
25773
+ word !== void 0 && word.split("{date}").length === 2 ? word.replace("{date}", date) : date,
25774
+ " "
25775
+ );
25625
25776
  copied.dataset.asOf = date;
25626
25777
  }
25627
- copied.append(
25628
- w.t(
25629
- dated && switched ? "front.agg.copied.both" : dated ? "front.agg.copied.dates" : "front.agg.copied.switch"
25630
- )
25631
- );
25778
+ copied.append(contractFactNote(w));
25632
25779
  copied.dataset.copiedFacts = "contract";
25633
25780
  out.append(copied);
25634
25781
  }
25635
25782
  return out;
25636
25783
  }
25784
+ function contractFactNote(w) {
25785
+ return w.section3("contract_fact.note") ?? DEFAULT_PACKS.lines.entries["contract_fact.note"];
25786
+ }
25637
25787
  var shortDigest = (digest2) => digest2.length > 12 ? `${digest2.slice(0, 4)}\u2026${digest2.slice(-4)}` : digest2;
25638
25788
  function renderCoreIdentity(model) {
25639
25789
  const { result: result3, words: w } = model;
@@ -25676,10 +25826,33 @@ ${key}`);
25676
25826
  block.append(top, rest);
25677
25827
  return block;
25678
25828
  }
25679
- async function coreStripModel(result3, words) {
25829
+ function backfillOnly(document2) {
25830
+ const isObj5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
25831
+ if (!isObj5(document2) || !isObj5(document2["coverage_report"])) return false;
25832
+ const requirements = document2["coverage_report"]["requirements"];
25833
+ if (!Array.isArray(requirements)) return false;
25834
+ let records = 0;
25835
+ for (const requirement of requirements) {
25836
+ if (!isObj5(requirement)) return false;
25837
+ const list2 = requirement["sources"];
25838
+ if (list2 === void 0) continue;
25839
+ if (!Array.isArray(list2)) return false;
25840
+ for (const source of list2) {
25841
+ if (!isObj5(source)) return false;
25842
+ const { contemporaneous_count: live, backfilled_count: back } = source;
25843
+ const total = source["record_count"];
25844
+ if (live !== 0 || !Number.isSafeInteger(total) || total < 0 || back !== total)
25845
+ return false;
25846
+ records += total;
25847
+ }
25848
+ }
25849
+ return records > 0;
25850
+ }
25851
+ async function coreStripModel(result3, words, document2) {
25680
25852
  const tally2 = await tallyJudges(result3.records, result3.claims);
25681
25853
  return {
25682
25854
  result: result3,
25855
+ imported: backfillOnly(document2),
25683
25856
  words,
25684
25857
  mock: judgedByMock(tally2),
25685
25858
  pins: tally2.pins.map((pin) => pin.digest)
@@ -25697,6 +25870,14 @@ ${key}`);
25697
25870
  mark.dataset.section = "mock-judge";
25698
25871
  strip.append(mark);
25699
25872
  }
25873
+ if (model.imported) {
25874
+ const note = tagSource(
25875
+ el12("p", "agg-note imported", model.words.t("front.agg.imported")),
25876
+ "core"
25877
+ );
25878
+ note.dataset.imported = "";
25879
+ strip.append(note);
25880
+ }
25700
25881
  strip.append(renderCoreIdentity(model));
25701
25882
  strip.append(renderAggregate(model.result, model.words));
25702
25883
  return strip;
@@ -28343,7 +28524,12 @@ ${pad.repeat(depth)}`;
28343
28524
  const words = result3 === void 0 && !charted ? void 0 : await contractReportWords(grouping, options.wording, {
28344
28525
  singleContract: result3 !== void 0 && citesOneContract(result3)
28345
28526
  });
28346
- if (result3 !== void 0) strip = await coreStripModel(result3, words);
28527
+ if (result3 !== void 0)
28528
+ strip = await coreStripModel(
28529
+ result3,
28530
+ words,
28531
+ resultDocument2(context, result3)
28532
+ );
28347
28533
  if (charted)
28348
28534
  chartsNode = await drawCharts(
28349
28535
  context,
@@ -30358,6 +30544,7 @@ ${pad.repeat(depth)}`;
30358
30544
  .cvh-seal-title{font-weight:700}.cvh-checked summary{cursor:pointer;font-weight:700;color:var(--cvh-navy)}
30359
30545
  .cvh-check[data-status=fail]{color:var(--cvh-bad)}.cvh-check[data-status=pass]{color:var(--cvh-ok)}
30360
30546
  .cvh-main,.cvh-side{display:grid;gap:16px;align-content:start}.cvh-refused{border:1px solid var(--cvh-bad);color:var(--cvh-bad);padding:8px 12px;border-radius:8px}
30547
+ @media screen and (prefers-color-scheme:dark){.cv-history{--cvh-ink:#e8eaee;--cvh-slate:#a3a9b3;--cvh-line:#33373e;--cvh-cream:#22262d;--cvh-navy:#c3d0e8;--cvh-ok:#5fcf90;--cvh-bad:#ff8f84;background:#16181c;color-scheme:dark}.cvh-badge[data-audience=private]{background:#3a2f1a;border-color:#e6b85c}}
30361
30548
  @media (min-width:900px){.cv-history{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}.cvh-header{grid-column:1/-1}}
30362
30549
  @media print{.cv-history{max-width:none;grid-template-columns:1fr}.cvh-proof code{display:block}}
30363
30550
  `;