@action-state-group/capsule-viewer 0.19.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +6 -0
  2. package/dist/alias-interpreters.js +11 -3
  3. package/dist/alias-interpreters.js.map +1 -1
  4. package/dist/browser.d.ts +1 -0
  5. package/dist/browser.js +4 -0
  6. package/dist/browser.js.map +1 -1
  7. package/dist/card-registered.d.ts +46 -0
  8. package/dist/card-registered.js +104 -0
  9. package/dist/card-registered.js.map +1 -0
  10. package/dist/claim-reasons.d.ts +25 -0
  11. package/dist/claim-reasons.js +42 -0
  12. package/dist/claim-reasons.js.map +1 -0
  13. package/dist/compliance-presentation.d.ts +31 -3
  14. package/dist/compliance-presentation.js +39 -11
  15. package/dist/compliance-presentation.js.map +1 -1
  16. package/dist/compliance-view.js +13 -7
  17. package/dist/compliance-view.js.map +1 -1
  18. package/dist/compliance.d.ts +5 -2
  19. package/dist/compliance.js +10 -4
  20. package/dist/compliance.js.map +1 -1
  21. package/dist/contract-report-wording.d.ts +2 -0
  22. package/dist/contract-report-wording.js +14 -2
  23. package/dist/contract-report-wording.js.map +1 -1
  24. package/dist/contract-report.d.ts +5 -1
  25. package/dist/contract-report.js +4 -1
  26. package/dist/contract-report.js.map +1 -1
  27. package/dist/evidence-graph-view.js +5 -1
  28. package/dist/evidence-graph-view.js.map +1 -1
  29. package/dist/evidence-graph.iife.js +410 -118
  30. package/dist/generic-report-view.d.ts +5 -1
  31. package/dist/generic-report-view.js +57 -13
  32. package/dist/generic-report-view.js.map +1 -1
  33. package/dist/presentation-registry.js +2 -2
  34. package/dist/presentation-registry.js.map +1 -1
  35. package/dist/viewer-build.js +2 -2
  36. package/dist/wording/contract-report-eu-ai-act.en.json +2 -0
  37. package/dist/wording/contract-report-generic.en.json +9 -0
  38. package/package.json +2 -2
package/README.md CHANGED
@@ -29,6 +29,12 @@ agent-action-capsule's `checkAnchorWitnessed`) and `readerWitnessPolicy` and
29
29
  page's memory only). The History card's signature line asks
30
30
  `readerCardSignature`, which reads the context's own strict verdict for the
31
31
  card's record and names the key it is signed with on a pass.
32
+ The card statements a block carries in `card_statements` (the holder's
33
+ registration of the card on a transparency service, agent-action-capsule
34
+ `spec/standard-history-v0.md` section 13) go to `readerCardRegistered`, which
35
+ runs agent-action-capsule's `checkCardRegistered` under the reader's own list
36
+ for the key the card is signed with. It shows existence at a time and nothing
37
+ else; `anchor_inclusion` stays not checked.
32
38
 
33
39
  The code moved here from agent-action-capsule (agent-action-capsule#281) and
34
40
  keeps its BSD-3-Clause license (`LICENSE-BSD-3-Clause`); the rest of the
@@ -7,7 +7,7 @@
7
7
  // (its spec/REGISTRY.md section 14). Removed with the alias path in the
8
8
  // follow-up (agent-action-capsule#379, PR C2).
9
9
  import { EXTENSION_SHOWN, } from "@action-state-group/agent-action-capsule";
10
- import { readCompliancePresentation } from "./compliance-presentation.js";
10
+ import { COMPLIANCE_KEY_V1, COMPLIANCE_KEY_V2, readComplianceBlock, } from "./compliance-presentation.js";
11
11
  import { readOutcomeReportPresentation } from "./outcome-report-presentation.js";
12
12
  // AAC 0.7.0 extension-interpreters.ts, the two removed entries.
13
13
  const ALIAS_INTERPRETERS = Object.freeze({
@@ -15,9 +15,17 @@ const ALIAS_INTERPRETERS = Object.freeze({
15
15
  id: "outcome-report-card",
16
16
  accepts: (bundle) => readOutcomeReportPresentation(bundle) !== undefined,
17
17
  },
18
- "eu-ai-act-compliance/v1": {
18
+ [COMPLIANCE_KEY_V1]: {
19
19
  id: "compliance-card",
20
- accepts: (bundle) => readCompliancePresentation(bundle) !== undefined,
20
+ // The card draws the v2 block when it accepts one, so the v1 block is
21
+ // read only when no v2 block is accepted.
22
+ accepts: (bundle) => readComplianceBlock(bundle, COMPLIANCE_KEY_V1) !== undefined &&
23
+ readComplianceBlock(bundle, COMPLIANCE_KEY_V2) === undefined,
24
+ },
25
+ // The v2 name of the same card (findings state what was observed).
26
+ [COMPLIANCE_KEY_V2]: {
27
+ id: "compliance-card",
28
+ accepts: (bundle) => readComplianceBlock(bundle, COMPLIANCE_KEY_V2) !== undefined,
21
29
  },
22
30
  });
23
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"alias-interpreters.js","sourceRoot":"","sources":["../src/alias-interpreters.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,8DAA8D;AAC9D,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,+CAA+C;AAC/C,OAAO,EACL,eAAe,GAGhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAajF,gEAAgE;AAChE,MAAM,kBAAkB,GAKpB,MAAM,CAAC,MAAM,CAAC;IAChB,mBAAmB,EAAE;QACnB,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,6BAA6B,CAAC,MAAM,CAAC,KAAK,SAAS;KACzE;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,iBAAiB;QACrB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,0BAA0B,CAAC,MAAM,CAAC,KAAK,SAAS;KACtE;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,IAA6B,EAC7B,OAAuC;IAEvC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAoB,EAAE;QACxC,IACE,GAAG,CAAC,WAAW,KAAK,SAAS;YAC7B,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,GAAG,CAAC,EAAE,CAAC;YAE1C,OAAO,GAAG,CAAC;QACb,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;QAChD,IAAI,CAAC,WAAW,CAAC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C,CAAC,YAAY,CAAC;SAC1E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,EAAqB,EAA4B,EAAE,CAClE,EAAE,KAAK,qBAAqB,IAAI,EAAE,KAAK,iBAAiB,CAAC;AAE3D,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAC7B,OAAuC;IAEvC,OAAO,IAAI,GAAG,CACZ,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CACxE,CAAC;AACJ,CAAC"}
package/dist/browser.d.ts CHANGED
@@ -8,5 +8,6 @@ export { buildResultRoot, buildVerifiedBundleContext, disclosureOf, ed25519Avail
8
8
  export { readerAnchorWitness, readerWitnessPolicy, setReaderWitnessPolicy, } from "./reader-witnesses.js";
9
9
  export { paymentPreimageCheck } from "./payment-preimage.js";
10
10
  export { readerCadenceWitness } from "./cadence-witness.js";
11
+ export { readerCardRegistered } from "./card-registered.js";
11
12
  export { readerCardSignature } from "./card-signature.js";
12
13
  export { historyViewHtml, historyViewStyles, renderHistoryView, } from "./history-view.js";
package/dist/browser.js CHANGED
@@ -37,6 +37,10 @@ export { readerAnchorWitness, readerWitnessPolicy, setReaderWitnessPolicy, } fro
37
37
  // agent-action-capsule's JCS and receipt check; the module verifies nothing.
38
38
  export { paymentPreimageCheck } from "./payment-preimage.js";
39
39
  export { readerCadenceWitness } from "./cadence-witness.js";
40
+ // The History card's card_registered (capsule-viewer#342; standard-history-v0
41
+ // section 13): AAC's checkCardRegistered over the card statements the block
42
+ // carries, under the reader's own witness list. Existence at a time only.
43
+ export { readerCardRegistered } from "./card-registered.js";
40
44
  // The History card's signature (capsule-viewer#211; rule F4.7): the context's
41
45
  // own strict verdict for the root record, which the module draws and does
42
46
  // not decide.
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"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AC3D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /** The most card statements one card is checked with (not SH's limit, which
2
+ * is on Receipts inside one statement). More is NOT_CHECKED. */
3
+ export declare const MAX_CARD_STATEMENTS = 64;
4
+ /** A card statement is at most 10,485,760 octets (SH 13.1). */
5
+ export declare const MAX_STATEMENT_HEX: number;
6
+ /** One statement's standing, as AAC's CardStatementReport. */
7
+ export interface ReaderCardStatement {
8
+ readonly status: "PASS" | "FAIL" | "NOT_CHECKED";
9
+ readonly service: string | null;
10
+ readonly registration_time: number | null;
11
+ }
12
+ /** What {@link readerCardRegistered} says about the statements beside a card. */
13
+ export interface ReaderCardRegistered {
14
+ /** AAC's card_registered over the statements: `NOT_PRESENT` with none. */
15
+ readonly status: "PASS" | "FAIL" | "NOT_PRESENT" | "NOT_CHECKED";
16
+ /** The service and registration time of one passing statement (always the
17
+ * same Receipt's), else null. The time is null when the Receipt has none. */
18
+ readonly service: string | null;
19
+ readonly registration_time: number | null;
20
+ /** One entry per statement, in the order received. */
21
+ readonly statements: readonly ReaderCardStatement[];
22
+ /** The key the statements were checked under (the root record's verified
23
+ * key), else null. */
24
+ readonly key_id: string | null;
25
+ }
26
+ /**
27
+ * SH 13.3 over `statements` (lowercase hex, one card statement each) beside
28
+ * `card` (the card's octets), under the key identifier `key`, the anchor
29
+ * `anchor` and `policy`: AAC's checkCardRegistered, whose report (the
30
+ * aggregate and each statement's own result) is passed through unchanged. An
31
+ * entry that is not hex, or is over the size of SH 13.1, stands for octets
32
+ * that are not in that form, which SH 13.3 step 1 fails and which takes
33
+ * nothing from a statement that passes. The vectors run through this;
34
+ * {@link readerCardRegistered} supplies its inputs.
35
+ */
36
+ export declare function cardRegisteredUnder(card: Uint8Array, key: string, anchor: string, statements: readonly string[], policy: unknown): Promise<ReaderCardRegistered>;
37
+ /**
38
+ * The card statements' standing for a presentation module: `statements`
39
+ * (lowercase hex, one card statement each, as received beside the card) for
40
+ * the root record's card (`agent_input.payload`, its octets the UTF-8 JCS of
41
+ * the card, SH 4), under the reader's own list. Never throws; a check this
42
+ * page cannot run is `NOT_CHECKED`, never a pass. An entry that is not hex is
43
+ * a statement that is not in the form of SH 13.1, which is a failing
44
+ * statement (SH 13.3 step 1) and changes nothing about the card.
45
+ */
46
+ export declare function readerCardRegistered(context: unknown, statements: readonly string[] | null): Promise<ReaderCardRegistered>;
@@ -0,0 +1,104 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // The History card's card_registered standing (capsule-viewer#342;
3
+ // agent-action-capsule spec/standard-history-v0.md section 13, cited as SH),
4
+ // for a presentation module, which verifies nothing itself (presentation-
5
+ // contract-v0 section 3).
6
+ //
7
+ // A card statement travels beside the card (SH 13.3): the module hands this
8
+ // the statements the block carries, as lowercase hex, and the context. The
9
+ // check is AAC's checkCardRegistered, unchanged, under the reader's own
10
+ // transparency-service list (readerWitnessPolicy), never one the bundle names.
11
+ // What it shows is existence at a time (SH 13): never that the counts are
12
+ // right, never anchor_inclusion, never that this is the holder's only card.
13
+ //
14
+ // The viewer has no envelope. SH 13.3 checks a statement's `iss` against the
15
+ // envelope's `responder` and its `sub` against the envelope's `anchor.digest`;
16
+ // here the key is the one the context's strict verdict names for the root
17
+ // record (the key readerCardSignature returns; nothing says whose it is) and
18
+ // the anchor is the card's own `anchor`. So a PASS says that key registered
19
+ // this card, and a record with no verified signature has no key to check
20
+ // against: NOT_CHECKED, never FAIL.
21
+ import { isVerifiedBundleContext, jcs, } from "@action-state-group/agent-action-capsule";
22
+ import { checkCardRegistered } from "@action-state-group/agent-action-capsule/witness";
23
+ import { readerCardSignature } from "./card-signature.js";
24
+ import { readerWitnessPolicy } from "./reader-witnesses.js";
25
+ /** The most card statements one card is checked with (not SH's limit, which
26
+ * is on Receipts inside one statement). More is NOT_CHECKED. */
27
+ export const MAX_CARD_STATEMENTS = 64;
28
+ /** A card statement is at most 10,485,760 octets (SH 13.1). */
29
+ export const MAX_STATEMENT_HEX = 2 * 10_485_760;
30
+ const HEX = /^(?:[0-9a-f]{2})+$/u;
31
+ const ANCHOR = /^[0-9a-f]{64}$/u;
32
+ const none = (status, statements = [], keyId = null) => ({
33
+ status,
34
+ service: null,
35
+ registration_time: null,
36
+ statements,
37
+ key_id: keyId,
38
+ });
39
+ const fromHex = (hex) => {
40
+ const out = new Uint8Array(new ArrayBuffer(hex.length / 2));
41
+ for (let i = 0; i < out.length; i += 1)
42
+ out[i] = Number.parseInt(hex.slice(2 * i, 2 * i + 2), 16);
43
+ return out;
44
+ };
45
+ /**
46
+ * SH 13.3 over `statements` (lowercase hex, one card statement each) beside
47
+ * `card` (the card's octets), under the key identifier `key`, the anchor
48
+ * `anchor` and `policy`: AAC's checkCardRegistered, whose report (the
49
+ * aggregate and each statement's own result) is passed through unchanged. An
50
+ * entry that is not hex, or is over the size of SH 13.1, stands for octets
51
+ * that are not in that form, which SH 13.3 step 1 fails and which takes
52
+ * nothing from a statement that passes. The vectors run through this;
53
+ * {@link readerCardRegistered} supplies its inputs.
54
+ */
55
+ export async function cardRegisteredUnder(card, key, anchor, statements, policy) {
56
+ const report = await checkCardRegistered(card, key, anchor, statements.map((s) => HEX.test(s) && s.length <= MAX_STATEMENT_HEX
57
+ ? fromHex(s)
58
+ : new Uint8Array(0)), policy);
59
+ return {
60
+ status: report.status,
61
+ service: report.service,
62
+ registration_time: report.registration_time,
63
+ statements: report.statements,
64
+ key_id: key,
65
+ };
66
+ }
67
+ /**
68
+ * The card statements' standing for a presentation module: `statements`
69
+ * (lowercase hex, one card statement each, as received beside the card) for
70
+ * the root record's card (`agent_input.payload`, its octets the UTF-8 JCS of
71
+ * the card, SH 4), under the reader's own list. Never throws; a check this
72
+ * page cannot run is `NOT_CHECKED`, never a pass. An entry that is not hex is
73
+ * a statement that is not in the form of SH 13.1, which is a failing
74
+ * statement (SH 13.3 step 1) and changes nothing about the card.
75
+ */
76
+ export async function readerCardRegistered(context, statements) {
77
+ if (statements === null || statements.length === 0)
78
+ return none("NOT_PRESENT");
79
+ try {
80
+ if (statements.length > MAX_CARD_STATEMENTS ||
81
+ statements.some((s) => typeof s !== "string"))
82
+ return none("NOT_CHECKED");
83
+ if (!isVerifiedBundleContext(context))
84
+ return none("NOT_CHECKED");
85
+ const signature = await readerCardSignature(context);
86
+ const disclosed = context.root
87
+ ? context.resolvedDisclosures.get(context.root)?.agent_input
88
+ : undefined;
89
+ if (signature.status !== "PASS" ||
90
+ signature.key_id === null ||
91
+ disclosed === undefined ||
92
+ disclosed.state !== "disclosed")
93
+ return none("NOT_CHECKED");
94
+ const card = disclosed.payload;
95
+ const anchor = card !== null && typeof card === "object" ? card.anchor : undefined;
96
+ if (typeof anchor !== "string" || !ANCHOR.test(anchor))
97
+ return none("NOT_CHECKED");
98
+ return await cardRegisteredUnder(jcs(card), signature.key_id, anchor, statements, readerWitnessPolicy());
99
+ }
100
+ catch {
101
+ return none("NOT_CHECKED");
102
+ }
103
+ }
104
+ //# sourceMappingURL=card-registered.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-registered.js","sourceRoot":"","sources":["../src/card-registered.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,mEAAmE;AACnE,6EAA6E;AAC7E,0EAA0E;AAC1E,0BAA0B;AAC1B,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,wEAAwE;AACxE,+EAA+E;AAC/E,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,oCAAoC;AACpC,OAAO,EACL,uBAAuB,EACvB,GAAG,GACJ,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,M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AAC,CAAC;QAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,OAAsC,CAAC;QAC9D,MAAM,MAAM,GACV,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACtE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YACpD,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,MAAM,mBAAmB,CAC9B,GAAG,CAAC,IAAI,CAAC,EACT,SAAS,CAAC,MAAM,EAChB,MAAM,EACN,UAAU,EACV,mBAAmB,EAAE,CACtB,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { ResultClaim } from "@action-state-group/agent-action-capsule";
2
+ /**
3
+ * The registered tokens the core words itself (`generic.reason.token.<code>`):
4
+ * ER section 4.4 gives each one meaning for every producer, so a page with no
5
+ * pack word still says what it means. Any other token is shown raw.
6
+ */
7
+ export declare const CORE_REASON_CODES: ReadonlySet<string>;
8
+ export interface ClaimReason {
9
+ readonly code: string;
10
+ /** `finding` is drawn in the warning tone; `setting` and `unregistered` neutrally (section 4.4). */
11
+ readonly kind: "finding" | "setting" | "unregistered";
12
+ /**
13
+ * True when a pack may word the code (`row.<ref>.reason.<code>`): a
14
+ * registered token that is not a reserved row suffix. An unregistered token
15
+ * is always shown raw (section 4.4).
16
+ */
17
+ readonly keyable: boolean;
18
+ /** True when the core has words for the code. */
19
+ readonly core: boolean;
20
+ }
21
+ /**
22
+ * The reasons of `claims`, by claim id. A claim that failed verification
23
+ * gets none: its row says it failed, not why it was unavailable.
24
+ */
25
+ export declare function claimReasons(claims: readonly ResultClaim[]): ReadonlyMap<string, ClaimReason>;
@@ -0,0 +1,42 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ /**
3
+ * Codes that would make `row.<ref>.reason.<code>` the same key as another
4
+ * row key of a requirement named `<ref>.reason` (`row.<ref>.reason.label`,
5
+ * `.detail`, `.not_evaluable`): never worded, shown as the raw code.
6
+ */
7
+ const RESERVED = new Set([
8
+ "label",
9
+ "detail",
10
+ "not_evaluable",
11
+ ]);
12
+ /**
13
+ * The registered tokens the core words itself (`generic.reason.token.<code>`):
14
+ * ER section 4.4 gives each one meaning for every producer, so a page with no
15
+ * pack word still says what it means. Any other token is shown raw.
16
+ */
17
+ export const CORE_REASON_CODES = new Set([
18
+ "capsule_signature_did_not_verify",
19
+ "capsule_signer_not_trusted",
20
+ "counterparty_leg_signature_did_not_verify",
21
+ "counterparty_leg_signer_not_trusted",
22
+ ]);
23
+ /**
24
+ * The reasons of `claims`, by claim id. A claim that failed verification
25
+ * gets none: its row says it failed, not why it was unavailable.
26
+ */
27
+ export function claimReasons(claims) {
28
+ const out = new Map();
29
+ for (const claim of claims) {
30
+ if (claim.failed || claim.reason === undefined)
31
+ continue;
32
+ const kind = claim.reasonKind ?? "unregistered";
33
+ out.set(claim.id, {
34
+ code: claim.reason,
35
+ kind,
36
+ keyable: kind !== "unregistered" && !RESERVED.has(claim.reason),
37
+ core: CORE_REASON_CODES.has(claim.reason),
38
+ });
39
+ }
40
+ return out;
41
+ }
42
+ //# sourceMappingURL=claim-reasons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim-reasons.js","sourceRoot":"","sources":["../src/claim-reasons.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAWxC;;;;GAIG;AACH,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC;IAC5C,OAAO;IACP,QAAQ;IACR,eAAe;CAChB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IAC5D,kCAAkC;IAClC,4BAA4B;IAC5B,2CAA2C;IAC3C,qCAAqC;CACtC,CAAC,CAAC;AAgBH;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,MAA8B;IAE9B,MAAM,GAAG,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC3C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,SAAS;QACzD,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,IAAI,cAAc,CAAC;QAChD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE;YAChB,IAAI,EAAE,KAAK,CAAC,MAAM;YAClB,IAAI;YACJ,OAAO,EAAE,IAAI,KAAK,cAAc,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;YAC/D,IAAI,EAAE,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;SAC1C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,22 +1,38 @@
1
1
  /**
2
- * `eu-ai-act-compliance/v1` typed extension: opts a verified Result v0
2
+ * `eu-ai-act-obligations-report/v2` (and its earlier name
3
+ * `eu-ai-act-compliance/v1`, still read for reports already sealed) typed
4
+ * extension: opts a verified Result v0
3
5
  * bundle into the EU AI Act obligations-report card, read only after the
4
6
  * bundle verified, and carries the producer's REGULATORY MAPPING for it:
5
7
  * per obligation its article, title, plain-language summary, applicability
6
8
  * and method; per test its short label, an optional not-evaluable note and
7
- * an optional finding template (severity, recommendation, owner).
9
+ * an optional finding template. A v1 template carries severity,
10
+ * recommendation and owner; a v2 template carries what was observed and the
11
+ * owner, never a grade or advice.
8
12
  *
9
13
  * Everything read here is presentation, outside the signed records, and the
10
14
  * card labels it so. Which obligations and tests exist, every verdict and
11
15
  * count, each test's wording and tier, and the pack come from the sealed
12
16
  * claims and reports (compliance.ts), never from this block.
13
17
  */
14
- export interface ComplianceFinding {
18
+ /** The v1 finding template: the producer's grade and advice, and the owner. */
19
+ export interface ComplianceFindingV1 {
15
20
  readonly id: string;
16
21
  readonly severity: string;
17
22
  readonly recommendation: string;
18
23
  readonly ownerDue: string;
19
24
  }
25
+ /** The v2 finding template: what was observed, and the owner. No grade, no advice. */
26
+ export interface ComplianceFindingV2 {
27
+ readonly id: string;
28
+ readonly observed: string;
29
+ readonly ownerDue: string;
30
+ }
31
+ export type ComplianceFinding = ComplianceFindingV1 | ComplianceFindingV2;
32
+ /** The extension key a block of this version sits under. */
33
+ export declare const COMPLIANCE_KEY_V1 = "eu-ai-act-compliance/v1";
34
+ export declare const COMPLIANCE_KEY_V2 = "eu-ai-act-obligations-report/v2";
35
+ type ComplianceKey = typeof COMPLIANCE_KEY_V1 | typeof COMPLIANCE_KEY_V2;
20
36
  export interface ComplianceRow {
21
37
  readonly criterionId: string;
22
38
  readonly name: string;
@@ -44,8 +60,20 @@ export interface ComplianceQualityProtocol {
44
60
  }
45
61
  export interface CompliancePresentation {
46
62
  readonly enabled: boolean;
63
+ /** Which template's block this was read from: 1 for `eu-ai-act-compliance/v1`, 2 for `eu-ai-act-obligations-report/v2`. */
64
+ readonly version: 1 | 2;
47
65
  readonly regulation: string;
48
66
  readonly obligations: readonly ComplianceObligation[];
49
67
  readonly qualityProtocol?: ComplianceQualityProtocol;
50
68
  }
69
+ /**
70
+ * The block under one key, read as that key's version and no other: the
71
+ * engaged test of each extension kind (a block its reader declines is absent).
72
+ */
73
+ export declare function readComplianceBlock(bundle: unknown, key: ComplianceKey): CompliancePresentation | undefined;
74
+ /**
75
+ * The block the card draws: the v2 block when its reader accepts it, else the
76
+ * v1 block of a report sealed before the rename.
77
+ */
51
78
  export declare function readCompliancePresentation(bundle: unknown): CompliancePresentation | undefined;
79
+ export {};
@@ -1,11 +1,15 @@
1
1
  // SPDX-License-Identifier: BSD-3-Clause
2
2
  /**
3
- * `eu-ai-act-compliance/v1` typed extension: opts a verified Result v0
3
+ * `eu-ai-act-obligations-report/v2` (and its earlier name
4
+ * `eu-ai-act-compliance/v1`, still read for reports already sealed) typed
5
+ * extension: opts a verified Result v0
4
6
  * bundle into the EU AI Act obligations-report card, read only after the
5
7
  * bundle verified, and carries the producer's REGULATORY MAPPING for it:
6
8
  * per obligation its article, title, plain-language summary, applicability
7
9
  * and method; per test its short label, an optional not-evaluable note and
8
- * an optional finding template (severity, recommendation, owner).
10
+ * an optional finding template. A v1 template carries severity,
11
+ * recommendation and owner; a v2 template carries what was observed and the
12
+ * owner, never a grade or advice.
9
13
  *
10
14
  * Everything read here is presentation, outside the signed records, and the
11
15
  * card labels it so. Which obligations and tests exist, every verdict and
@@ -25,12 +29,23 @@ function strArray(value) {
25
29
  ? value.filter((v) => typeof v === "string")
26
30
  : [];
27
31
  }
28
- function readFinding(value) {
32
+ /** The extension key a block of this version sits under. */
33
+ export const COMPLIANCE_KEY_V1 = "eu-ai-act-compliance/v1";
34
+ export const COMPLIANCE_KEY_V2 = "eu-ai-act-obligations-report/v2";
35
+ function readFinding(value, key) {
29
36
  const obj = object(value);
30
37
  const id = str(obj?.id);
38
+ const ownerDue = str(obj?.owner_due);
39
+ if (key === COMPLIANCE_KEY_V2) {
40
+ // A v2 finding states what was observed. A severity or recommendation a
41
+ // producer still writes there is not read: a v2 report draws no grade.
42
+ const observed = str(obj?.observed);
43
+ if (id === undefined || observed === undefined || ownerDue === undefined)
44
+ return undefined;
45
+ return { id, observed, ownerDue };
46
+ }
31
47
  const severity = str(obj?.severity);
32
48
  const recommendation = str(obj?.recommendation);
33
- const ownerDue = str(obj?.owner_due);
34
49
  if (id === undefined ||
35
50
  severity === undefined ||
36
51
  recommendation === undefined ||
@@ -38,14 +53,14 @@ function readFinding(value) {
38
53
  return undefined;
39
54
  return { id, severity, recommendation, ownerDue };
40
55
  }
41
- function readRow(value) {
56
+ function readRow(value, key) {
42
57
  const obj = object(value);
43
58
  const criterionId = str(obj?.criterion_id);
44
59
  const name = str(obj?.name);
45
60
  if (criterionId === undefined || name === undefined)
46
61
  return undefined;
47
62
  const notEvaluableNote = str(obj?.not_evaluable_note);
48
- const finding = obj?.finding === undefined ? undefined : readFinding(obj.finding);
63
+ const finding = obj?.finding === undefined ? undefined : readFinding(obj.finding, key);
49
64
  return {
50
65
  criterionId,
51
66
  name,
@@ -63,7 +78,7 @@ function readApplicability(value) {
63
78
  return undefined;
64
79
  return { status, note };
65
80
  }
66
- function readObligation(value) {
81
+ function readObligation(value, extension) {
67
82
  const obj = object(value);
68
83
  const key = str(obj?.key);
69
84
  const article = str(obj?.article);
@@ -80,7 +95,7 @@ function readObligation(value) {
80
95
  return undefined;
81
96
  const rows = Array.isArray(obj?.rows)
82
97
  ? obj.rows.flatMap((r) => {
83
- const row = readRow(r);
98
+ const row = readRow(r, extension);
84
99
  return row === undefined ? [] : [row];
85
100
  })
86
101
  : [];
@@ -110,16 +125,20 @@ function readQualityProtocol(value) {
110
125
  ...(note === undefined ? {} : { note }),
111
126
  };
112
127
  }
113
- export function readCompliancePresentation(bundle) {
128
+ /**
129
+ * The block under one key, read as that key's version and no other: the
130
+ * engaged test of each extension kind (a block its reader declines is absent).
131
+ */
132
+ export function readComplianceBlock(bundle, key) {
114
133
  const top = object(bundle);
115
134
  const extensions = object(top?.extensions);
116
- const block = object(extensions?.["eu-ai-act-compliance/v1"]);
135
+ const block = object(extensions?.[key]);
117
136
  if (block === undefined || block.enabled !== true)
118
137
  return undefined;
119
138
  const regulation = str(block.regulation) ?? "Regulation (EU) 2024/1689";
120
139
  const obligations = Array.isArray(block.obligations)
121
140
  ? block.obligations.flatMap((o) => {
122
- const obligation = readObligation(o);
141
+ const obligation = readObligation(o, key);
123
142
  return obligation === undefined ? [] : [obligation];
124
143
  })
125
144
  : [];
@@ -132,9 +151,18 @@ export function readCompliancePresentation(bundle) {
132
151
  const qualityProtocol = readQualityProtocol(block.quality_protocol);
133
152
  return {
134
153
  enabled: true,
154
+ version: key === COMPLIANCE_KEY_V2 ? 2 : 1,
135
155
  regulation,
136
156
  obligations,
137
157
  ...(qualityProtocol === undefined ? {} : { qualityProtocol }),
138
158
  };
139
159
  }
160
+ /**
161
+ * The block the card draws: the v2 block when its reader accepts it, else the
162
+ * v1 block of a report sealed before the rename.
163
+ */
164
+ export function readCompliancePresentation(bundle) {
165
+ return (readComplianceBlock(bundle, COMPLIANCE_KEY_V2) ??
166
+ readComplianceBlock(bundle, COMPLIANCE_KEY_V1));
167
+ }
140
168
  //# sourceMappingURL=compliance-presentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compliance-presentation.js","sourceRoot":"","sources":["../src/compliance-presentation.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC;;;;;;;;;;;;GAYG;AAEH,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,GAAG,CAAC,KAAc;IACzB,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;QACzD,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AA6CD,SAAS,WAAW,CAAC,KAAc;IACjC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACxB,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACpC,MAAM,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7 +15,7 @@ import { buildVerificationPageModel } from "@action-state-group/agent-action-cap
15
15
  * report read as requirement groups and the tests under each. The EU AI Act
16
16
  * Results are this grouping with the EU AI Act wording pack; every word on
17
17
  * it is the pack's (`w`). Drawn by the module in place of `renderResultPage`
18
- * when the bundle's `eu-ai-act-compliance/v1` extension opts in, after the same verify-first
18
+ * when the bundle's `eu-ai-act-obligations-report/v2` (or earlier `eu-ai-act-compliance/v1`) extension opts in, after the same verify-first
19
19
  * gate every other root family goes through -- nothing here ever runs on a
20
20
  * bundle that did not verify. See compliance.ts for where every value on the
21
21
  * page comes from: counts, verdicts, test wording, tiers and the pack from
@@ -44,7 +44,7 @@ function el(tag, className, text) {
44
44
  return value;
45
45
  }
46
46
  /**
47
- * Producer text: the eu-ai-act-compliance/v1 mapping, carried beside the
47
+ * Producer text: the eu-ai-act-obligations-report/v2 (or v1) mapping, carried beside the
48
48
  * signed records and signed by no one. Set in italics (`<i>`, the browser's
49
49
  * own style) and tagged `data-source="producer"`, so it never reads as a
50
50
  * sealed finding; the summary's basis line says what the italics mean.
@@ -643,9 +643,9 @@ function renderSummary(host, model, presentation, result, w, tierOf) {
643
643
  section.append(table);
644
644
  const notes = el("aside", "footnotes");
645
645
  notes.dataset.section = "footnotes";
646
- const basis = el("p", "", w.t(packTitlesOnPage(model, w)
646
+ const basis = el("p", "", w.t((packTitlesOnPage(model, w)
647
647
  ? "groups.summary.basis.pack-titles"
648
- : "groups.summary.basis"));
648
+ : "groups.summary.basis") + (presentation.version === 2 ? ".v2" : "")));
649
649
  basis.dataset.basis = "terms";
650
650
  notes.append(basis);
651
651
  section.append(notes);
@@ -675,7 +675,8 @@ function renderCanvasNotes(host, model, bundle, w, tiered) {
675
675
  host.append(notes);
676
676
  }
677
677
  /**
678
- * The producer's findings (severity, recommendation), in one block under a
678
+ * The producer's findings (v2: what was observed and the owner; v1: severity,
679
+ * recommendation), in one block under a
679
680
  * fixed label: presentation text, not evidence (presentation contract
680
681
  * section 6). Each finding's session count is the claims'; nothing here
681
682
  * tallies the findings themselves.
@@ -695,9 +696,14 @@ function renderFinding(finding, w) {
695
696
  const box = el("div", "fnd");
696
697
  box.dataset.finding = finding.id;
697
698
  const fh = el("div", "fh");
698
- fh.append(maybeProducer(w, "b", "", w.t("groups.finding", { id: finding.id }), true), severityPill(finding.severity, w), element("span", count(w, "session", finding.sessionIds.length)));
699
+ fh.append(maybeProducer(w, "b", "", w.t("groups.finding", { id: finding.id }), true), ...(finding.severity === undefined
700
+ ? []
701
+ : [severityPill(finding.severity, w)]), element("span", count(w, "session", finding.sessionIds.length)));
699
702
  box.append(fh);
700
- box.append(maybeProducer(w, "div", "rec", finding.recommendation, true));
703
+ // v1 draws the producer's advice; v2 draws what was observed, in the same place.
704
+ const statement = finding.observed ?? finding.recommendation;
705
+ if (statement !== undefined)
706
+ box.append(maybeProducer(w, "div", "rec", statement, true));
701
707
  const own = el("div", "own", w.t("groups.finding.owner"));
702
708
  own.append(producerText(w, finding.ownerDue));
703
709
  box.append(own);