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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/backfill-timeline.d.ts +66 -0
  2. package/dist/backfill-timeline.js +401 -0
  3. package/dist/backfill-timeline.js.map +1 -0
  4. package/dist/chart-dataset.d.ts +35 -0
  5. package/dist/chart-dataset.js +16 -1
  6. package/dist/chart-dataset.js.map +1 -1
  7. package/dist/compliance-view.js +65 -14
  8. package/dist/compliance-view.js.map +1 -1
  9. package/dist/contract-report-wording.d.ts +3 -1
  10. package/dist/contract-report-wording.js +43 -10
  11. package/dist/contract-report-wording.js.map +1 -1
  12. package/dist/contract-report.d.ts +23 -1
  13. package/dist/contract-report.js +83 -3
  14. package/dist/contract-report.js.map +1 -1
  15. package/dist/core-strip.d.ts +19 -3
  16. package/dist/core-strip.js +76 -11
  17. package/dist/core-strip.js.map +1 -1
  18. package/dist/evidence-graph-view.d.ts +3 -0
  19. package/dist/evidence-graph-view.js +46 -2
  20. package/dist/evidence-graph-view.js.map +1 -1
  21. package/dist/evidence-graph.iife.js +1037 -448
  22. package/dist/history-view.d.ts +2 -2
  23. package/dist/history-view.iife.js +1 -0
  24. package/dist/history-view.iife.js.sha256 +1 -1
  25. package/dist/history-view.js +2 -1
  26. package/dist/history-view.js.map +1 -1
  27. package/dist/index.d.ts +4 -0
  28. package/dist/index.js +4 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/outcome-report-view.js +134 -6
  31. package/dist/outcome-report-view.js.map +1 -1
  32. package/dist/report-front.d.ts +2 -1
  33. package/dist/report-front.js.map +1 -1
  34. package/dist/studio-card.d.ts +79 -0
  35. package/dist/studio-card.js +383 -0
  36. package/dist/studio-card.js.map +1 -0
  37. package/dist/studio-pack.d.ts +10 -0
  38. package/dist/studio-pack.js +27 -0
  39. package/dist/studio-pack.js.map +1 -0
  40. package/dist/studio-view.d.ts +56 -0
  41. package/dist/studio-view.js +431 -0
  42. package/dist/studio-view.js.map +1 -0
  43. package/dist/subject-history.d.ts +10 -1
  44. package/dist/subject-history.js +19 -7
  45. package/dist/subject-history.js.map +1 -1
  46. package/dist/viewer-build.js +2 -2
  47. package/dist/wording/backfill-timeline.en.json +52 -0
  48. package/dist/wording/contract-report-eu-ai-act.en.json +38 -27
  49. package/dist/wording/contract-report-generic.en.json +8 -4
  50. package/dist/wording/contract-report-outcomes.en.json +25 -5
  51. package/dist/wording/studio-card.en.json +66 -0
  52. package/dist/wording/studio-view.en.json +39 -0
  53. package/package.json +2 -2
@@ -0,0 +1,431 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * The Studio home (docs/design/studio-page.md, capsule-viewer#291): the loop
4
+ * diagram, the readiness table (the desk), a term map of one pack on request,
5
+ * and the switch between packs' report pages, drawn from a `studio-view/v0`
6
+ * input the caller builds from the workspace files `terms` writes.
7
+ *
8
+ * The page is static HTML: no script, no network. It carries its input in a
9
+ * `<script type="application/json">` with that JSON's SHA-256 beside it and
10
+ * says the snapshot is workspace data, not sealed evidence. A page rebuilt
11
+ * from its own embedded JSON is byte-identical. Like the History view it
12
+ * draws and never fetches or verifies; unknown members are refused, and
13
+ * caller text is only ever text.
14
+ */
15
+ import { jcs, sha256Hex } from "@action-state-group/agent-action-capsule";
16
+ import { BackfillTimelineRefused, backfillTimelineHtml, checkBackfillTimeline, } from "./backfill-timeline.js";
17
+ import PACK from "./wording/studio-view.en.json" with { type: "json" };
18
+ export const STUDIO_VIEW = "studio-view/v0";
19
+ export const STUDIO_VIEW_WORDING = PACK;
20
+ /** The five readiness statuses (evidencebook-skills scripts/studio/readiness.py STATUSES). */
21
+ export const READINESS_STATUSES = [
22
+ "checkable now",
23
+ "needs examples",
24
+ "needs a field",
25
+ "needs the other side",
26
+ "not this pack's concern",
27
+ ];
28
+ /** The packagings that carry the bundle; `static` drops it and is not for sending. */
29
+ const PAGE_FORMATS = ["html", "embedded"];
30
+ export class StudioViewRefused extends Error {
31
+ reasons;
32
+ constructor(reasons) {
33
+ super(`studio-view refused: ${reasons.join("; ")}`);
34
+ this.name = "StudioViewRefused";
35
+ this.reasons = reasons;
36
+ }
37
+ }
38
+ const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
39
+ class Reader {
40
+ /** A string that may be empty (a term's detail). */
41
+ text(v, path) {
42
+ if (typeof v !== "string" || v.length > 2000) {
43
+ this.refuse(path, "is not a string of at most 2000 characters");
44
+ return "";
45
+ }
46
+ return v;
47
+ }
48
+ reasons = [];
49
+ refuse(path, why) {
50
+ this.reasons.push(`${path}: ${why}`);
51
+ }
52
+ obj(v, path, allowed, required) {
53
+ if (!isObj(v)) {
54
+ this.refuse(path, "is not an object");
55
+ return null;
56
+ }
57
+ for (const k of Object.keys(v))
58
+ if (!allowed.includes(k))
59
+ this.refuse(`${path}.${k}`, "is not a member of studio-view/v0");
60
+ for (const k of required)
61
+ if (!(k in v))
62
+ this.refuse(`${path}.${k}`, "is missing");
63
+ return v;
64
+ }
65
+ str(v, path, max = 2000) {
66
+ if (typeof v !== "string" || v.length === 0 || v.length > max) {
67
+ this.refuse(path, `is not a string of 1 to ${max} characters`);
68
+ return "";
69
+ }
70
+ return v;
71
+ }
72
+ hex(v, path) {
73
+ if (typeof v !== "string" || !/^[0-9a-f]{64}$/u.test(v)) {
74
+ this.refuse(path, "is not 64 lowercase hex characters");
75
+ return "";
76
+ }
77
+ return v;
78
+ }
79
+ nat(v, path) {
80
+ if (typeof v !== "number" || !Number.isSafeInteger(v) || v < 0) {
81
+ this.refuse(path, "is not a count");
82
+ return 0;
83
+ }
84
+ return v;
85
+ }
86
+ strs(v, path) {
87
+ if (!Array.isArray(v)) {
88
+ this.refuse(path, "is not a list");
89
+ return [];
90
+ }
91
+ return v.map((x, i) => this.str(x, `${path}[${i}]`));
92
+ }
93
+ }
94
+ /** A relative path to a sibling page: no scheme, no leading slash, no `..`. */
95
+ const PAGE_PATH = /^[A-Za-z0-9_-][A-Za-z0-9._/-]*\.html$/u;
96
+ function read(input) {
97
+ const r = new Reader();
98
+ const top = r.obj(input, "input", ["schema", "active", "packs", "readiness", "history", "backfill"], ["schema", "active", "packs", "readiness", "history"]);
99
+ if (top === null)
100
+ throw new StudioViewRefused(r.reasons);
101
+ if (top["schema"] !== STUDIO_VIEW)
102
+ r.refuse("input.schema", `is not ${STUDIO_VIEW}`);
103
+ const packs = [];
104
+ if (!Array.isArray(top["packs"]) || top["packs"].length === 0)
105
+ r.refuse("input.packs", "is not a non-empty list");
106
+ else
107
+ top["packs"].forEach((raw, i) => {
108
+ const p = `input.packs[${i}]`;
109
+ const o = r.obj(raw, p, [
110
+ "pack_id",
111
+ "title",
112
+ "pack_digest",
113
+ "judge",
114
+ "page",
115
+ "format",
116
+ "bundle_digest",
117
+ "shared",
118
+ ], ["pack_id", "pack_digest", "page", "bundle_digest"]);
119
+ if (o === null)
120
+ return;
121
+ const page = r.str(o["page"], `${p}.page`, 200);
122
+ if (page !== "" && (!PAGE_PATH.test(page) || page.includes("..")))
123
+ r.refuse(`${p}.page`, "is not a relative .html path");
124
+ const format = "format" in o ? o["format"] : "html";
125
+ if (!PAGE_FORMATS.includes(format))
126
+ r.refuse(`${p}.format`, `is not one of ${PAGE_FORMATS.join(", ")} (a static page drops the bundle and is not offered for sending)`);
127
+ const shared = "shared" in o
128
+ ? r.obj(o["shared"], `${p}.shared`, ["dataset_ref", "plan_ref"], ["dataset_ref", "plan_ref"])
129
+ : null;
130
+ packs.push({
131
+ pack_id: r.str(o["pack_id"], `${p}.pack_id`, 200),
132
+ ...("title" in o
133
+ ? { title: r.str(o["title"], `${p}.title`, 200) }
134
+ : {}),
135
+ pack_digest: r.hex(o["pack_digest"], `${p}.pack_digest`),
136
+ ...("judge" in o
137
+ ? { judge: r.str(o["judge"], `${p}.judge`, 200) }
138
+ : {}),
139
+ page,
140
+ format: format,
141
+ bundle_digest: r.hex(o["bundle_digest"], `${p}.bundle_digest`),
142
+ ...(shared === null
143
+ ? {}
144
+ : {
145
+ shared: {
146
+ dataset_ref: r.hex(shared["dataset_ref"], `${p}.shared.dataset_ref`),
147
+ plan_ref: r.hex(shared["plan_ref"], `${p}.shared.plan_ref`),
148
+ },
149
+ }),
150
+ });
151
+ });
152
+ const ids = packs.map((p) => p.pack_id);
153
+ if (new Set(ids).size !== ids.length)
154
+ r.refuse("input.packs", "has a pack_id twice");
155
+ const active = r.str(top["active"], "input.active", 200);
156
+ if (packs.length > 0 && !packs.some((p) => p.pack_id === active))
157
+ r.refuse("input.active", "is not a pack_id in packs");
158
+ const ready = r.obj(top["readiness"], "input.readiness", ["pack_id", "pack_version", "records", "terms", "counts"], ["pack_id", "pack_version", "records", "terms", "counts"]);
159
+ const terms = [];
160
+ let counts = {};
161
+ if (ready !== null) {
162
+ if (ready["pack_id"] !== active)
163
+ r.refuse("input.readiness.pack_id", "is not the active pack");
164
+ if (!Array.isArray(ready["terms"]))
165
+ r.refuse("input.readiness.terms", "is not a list");
166
+ else
167
+ ready["terms"].forEach((raw, i) => {
168
+ const p = `input.readiness.terms[${i}]`;
169
+ const o = r.obj(raw, p, [
170
+ "term",
171
+ "statement",
172
+ "in_pack",
173
+ "status",
174
+ "detail",
175
+ "reads",
176
+ "missing_fields",
177
+ "filled_rate",
178
+ ], [
179
+ "term",
180
+ "statement",
181
+ "in_pack",
182
+ "status",
183
+ "detail",
184
+ "reads",
185
+ "missing_fields",
186
+ ]);
187
+ if (o === null)
188
+ return;
189
+ if (!READINESS_STATUSES.includes(o["status"]))
190
+ r.refuse(`${p}.status`, "is not one of the five readiness statuses");
191
+ if (typeof o["in_pack"] !== "boolean")
192
+ r.refuse(`${p}.in_pack`, "is not true or false");
193
+ terms.push({
194
+ term: r.str(o["term"], `${p}.term`, 200),
195
+ statement: r.str(o["statement"], `${p}.statement`),
196
+ in_pack: o["in_pack"] === true,
197
+ status: o["status"],
198
+ detail: r.text(o["detail"], `${p}.detail`),
199
+ reads: r.strs(o["reads"], `${p}.reads`),
200
+ missing_fields: r.strs(o["missing_fields"], `${p}.missing_fields`),
201
+ });
202
+ });
203
+ const c = r.obj(ready["counts"], "input.readiness.counts", READINESS_STATUSES, []);
204
+ if (c !== null)
205
+ counts = Object.fromEntries(Object.entries(c).map(([k, v]) => [
206
+ k,
207
+ r.nat(v, `input.readiness.counts.${k}`),
208
+ ]));
209
+ r.nat(ready["records"], "input.readiness.records");
210
+ for (const status of READINESS_STATUSES) {
211
+ const have = terms.filter((t) => t.status === status).length;
212
+ if (counts[status] !== have)
213
+ r.refuse(`input.readiness.counts.${status}`, `is ${String(counts[status])} but the terms hold ${String(have)}`);
214
+ }
215
+ }
216
+ const history = [];
217
+ if (!Array.isArray(top["history"]))
218
+ r.refuse("input.history", "is not a list");
219
+ else
220
+ top["history"].forEach((raw, i) => {
221
+ const p = `input.history[${i}]`;
222
+ const o = r.obj(raw, p, [
223
+ "digest",
224
+ "version",
225
+ "first_at",
226
+ "last_at",
227
+ "run",
228
+ "rehearsal",
229
+ "in_force",
230
+ "published",
231
+ ], ["digest", "version", "first_at", "last_at"]);
232
+ if (o === null)
233
+ return;
234
+ const rehearsal = (v, path) => {
235
+ if (v === undefined || v === null || typeof v === "boolean")
236
+ return v ?? null;
237
+ r.refuse(path, "is not true, false or null");
238
+ return null;
239
+ };
240
+ const opt = (k) => o[k] === null || o[k] === undefined ? null : r.str(o[k], `${p}.${k}`);
241
+ history.push({
242
+ digest: r.hex(o["digest"], `${p}.digest`),
243
+ version: r.str(o["version"], `${p}.version`, 200),
244
+ first_at: r.str(o["first_at"], `${p}.first_at`, 200),
245
+ last_at: r.str(o["last_at"], `${p}.last_at`, 200),
246
+ run: opt("run"),
247
+ rehearsal: rehearsal(o["rehearsal"], `${p}.rehearsal`),
248
+ in_force: rehearsal(o["in_force"], `${p}.in_force`),
249
+ published: opt("published"),
250
+ });
251
+ });
252
+ const backfill = [];
253
+ if (top["backfill"] !== undefined) {
254
+ if (!Array.isArray(top["backfill"]))
255
+ r.refuse("input.backfill", "is not a list");
256
+ else
257
+ top["backfill"].forEach((raw, i) => {
258
+ const p = `input.backfill[${i}]`;
259
+ const o = r.obj(raw, p, ["record", "checkpoints", "form"], ["record"]);
260
+ if (o === null)
261
+ return;
262
+ const form = "form" in o ? o["form"] : "record";
263
+ if (form !== "record" && form !== "rehearsal")
264
+ r.refuse(`${p}.form`, "is not record or rehearsal");
265
+ try {
266
+ checkBackfillTimeline(o["record"], o["checkpoints"]);
267
+ }
268
+ catch (e) {
269
+ if (!(e instanceof BackfillTimelineRefused))
270
+ throw e;
271
+ for (const why of e.reasons)
272
+ r.reasons.push(`${p}.${why}`);
273
+ }
274
+ backfill.push({
275
+ record: o["record"],
276
+ ...("checkpoints" in o ? { checkpoints: o["checkpoints"] } : {}),
277
+ form: form,
278
+ });
279
+ });
280
+ }
281
+ const packVersion = ready === null
282
+ ? ""
283
+ : r.str(ready["pack_version"], "input.readiness.pack_version", 200);
284
+ if (r.reasons.length > 0)
285
+ throw new StudioViewRefused(r.reasons);
286
+ return {
287
+ schema: STUDIO_VIEW,
288
+ active,
289
+ packs,
290
+ readiness: {
291
+ pack_id: ready["pack_id"],
292
+ pack_version: packVersion,
293
+ records: ready["records"],
294
+ terms,
295
+ counts,
296
+ },
297
+ history,
298
+ ...(backfill.length === 0 ? {} : { backfill }),
299
+ };
300
+ }
301
+ // --- writing the page ------------------------------------------------------
302
+ const W = PACK.entries;
303
+ const word = (key) => {
304
+ const w = W[key];
305
+ if (w === undefined)
306
+ throw new Error(`studio-view: no word ${key}`);
307
+ return w;
308
+ };
309
+ function esc(text) {
310
+ return text.replace(/[&<>"']/gu, (c) => c === "&"
311
+ ? "&amp;"
312
+ : c === "<"
313
+ ? "&lt;"
314
+ : c === ">"
315
+ ? "&gt;"
316
+ : c === '"'
317
+ ? "&quot;"
318
+ : "&#39;");
319
+ }
320
+ const STATUS_TOKEN = {
321
+ "checkable now": "checkable",
322
+ "needs examples": "examples",
323
+ "needs a field": "field",
324
+ "needs the other side": "other-side",
325
+ "not this pack's concern": "not-concern",
326
+ };
327
+ const STAGE_WORD = {
328
+ done: "loop.done",
329
+ "not-yet": "loop.not_yet",
330
+ "not-recorded": "loop.not_recorded",
331
+ };
332
+ function loop(input) {
333
+ // Only the lines for the digest the active pack has now: an edit makes a
334
+ // new digest, and the earlier digest's run says nothing about it.
335
+ const digest = input.packs.find((p) => p.pack_id === input.active).pack_digest;
336
+ const entries = input.history.filter((e) => e.digest === digest);
337
+ const tried = entries.some((e) => e.run !== null);
338
+ const published = entries.some((e) => e.published !== null);
339
+ // Publishing writes the pack out; the terms check actions only once they are
340
+ // installed on the profile (skills/terms-pack-author SKILL.md, `terms
341
+ // publish` answers `in_force: false`). The workspace does not record the
342
+ // install, so "switched on" is drawn only from a line that says so, and
343
+ // reads "not recorded" when no line does.
344
+ const forced = entries.filter((e) => e.in_force !== null);
345
+ const inForce = !published
346
+ ? "not-yet"
347
+ : forced.some((e) => e.in_force === true)
348
+ ? "done"
349
+ : forced.length > 0
350
+ ? "not-yet"
351
+ : "not-recorded";
352
+ const stages = [
353
+ [
354
+ "terms",
355
+ input.readiness.terms.some((t) => t.in_pack) ? "done" : "not-yet",
356
+ ],
357
+ ["tried", tried ? "done" : "not-yet"],
358
+ ["published", published ? "done" : "not-yet"],
359
+ ["switched_on", inForce],
360
+ ];
361
+ const items = stages
362
+ .map(([id, state]) => `<li data-stage="${id}" data-state="${state}"><strong>${esc(word(`loop.${id}`))}</strong> <span>${esc(word(STAGE_WORD[state]))}</span></li>`)
363
+ .join("");
364
+ const note = published && inForce !== "done"
365
+ ? `<p data-loop-note>${esc(word("loop.published_note"))}</p>`
366
+ : "";
367
+ return `<section data-view="loop"><h2>${esc(word("loop.title"))}</h2><ol class="cv-studio-loop">${items}</ol>${note}</section>`;
368
+ }
369
+ function desk(input) {
370
+ const { terms } = input.readiness;
371
+ const rows = terms
372
+ .map((t) => `<tr data-term="${esc(t.term)}" data-status="${STATUS_TOKEN[t.status]}" data-in-pack="${String(t.in_pack)}"><td>${esc(t.statement)}${t.in_pack ? "" : ` <em>${esc(word("desk.idea"))}</em>`}</td><td><span class="cv-chip">${esc(word(`status.${STATUS_TOKEN[t.status]}`))}</span></td><td>${esc(t.detail)}</td><td>${esc(t.reads.join(", "))}</td><td>${esc(t.missing_fields.join(", "))}</td></tr>`)
373
+ .join("");
374
+ const line = READINESS_STATUSES.map((s) => `${esc(word(`status.${STATUS_TOKEN[s]}`))} ${terms.filter((t) => t.status === s).length}`).join(" · ");
375
+ return `<section data-view="readiness"><h2>${esc(word("desk.title"))}</h2><p data-counts>${line}</p><div class="cv-scroll"><table><thead><tr><th>${esc(word("desk.term"))}</th><th>${esc(word("desk.status"))}</th><th>${esc(word("desk.detail"))}</th><th>${esc(word("desk.reads"))}</th><th>${esc(word("desk.lacks"))}</th></tr></thead><tbody>${rows}</tbody></table></div></section>`;
376
+ }
377
+ function termMap(input) {
378
+ const groups = READINESS_STATUSES.map((s) => {
379
+ const ts = input.readiness.terms.filter((t) => t.status === s);
380
+ if (ts.length === 0)
381
+ return "";
382
+ const items = ts
383
+ .map((t) => `<li data-term="${esc(t.term)}" data-in-pack="${String(t.in_pack)}">${esc(t.statement)}${t.in_pack ? "" : ` <em>${esc(word("desk.idea"))}</em>`} <small>${esc(word("map.reads"))} ${esc(t.reads.join(", "))}</small></li>`)
384
+ .join("");
385
+ return `<details data-status="${STATUS_TOKEN[s]}"><summary>${esc(word(`status.${STATUS_TOKEN[s]}`))} (${ts.length})</summary><ul>${items}</ul></details>`;
386
+ }).join("");
387
+ return `<section data-view="term-map" data-pack="${esc(input.active)}"><h2>${esc(word("map.title"))}</h2>${groups}</section>`;
388
+ }
389
+ function switcher(input) {
390
+ const items = input.packs
391
+ .map((p) => {
392
+ const here = p.pack_id === input.active;
393
+ const label = esc(p.title ?? p.pack_id);
394
+ const link = here
395
+ ? `<strong>${label}</strong>`
396
+ : `<a href="${esc(p.page)}">${label}</a>`;
397
+ return `<li data-pack="${esc(p.pack_id)}" data-format="${p.format}"${here ? ' aria-current="page"' : ""}>${link} <small>${esc(word("switch.pack_digest"))} <code>${p.pack_digest}</code> · ${esc(word("switch.bundle_digest"))} <code>${p.bundle_digest}</code>${p.judge === undefined ? "" : ` · ${esc(word("switch.judge"))} ${esc(p.judge)}`} ${p.shared === undefined
398
+ ? ""
399
+ : ` · ${esc(word("switch.dataset_ref"))} <code>${p.shared.dataset_ref}</code> · ${esc(word("switch.plan_ref"))} <code>${p.shared.plan_ref}</code>`}</small> <a href="${esc(p.page)}">${esc(word("switch.report"))}</a></li>`;
400
+ })
401
+ .join("");
402
+ return `<nav data-view="switch"><h2>${esc(word("switch.title"))}</h2><ul>${items}</ul></nav>`;
403
+ }
404
+ export const studioViewStyles = `.cv-studio{font:16px/1.45 system-ui,sans-serif;max-width:1120px;margin:0 auto;padding:16px;display:grid;gap:16px;color:#1f2733}
405
+ .cv-studio table{border-collapse:collapse;width:100%}.cv-studio td,.cv-studio th{border-bottom:1px solid #e3ded3;padding:6px 8px;text-align:left;vertical-align:top}
406
+ .cv-chip{display:inline-block;border:1px solid #e3ded3;border-radius:6px;padding:1px 8px;font-size:13px}
407
+ [data-status=checkable] .cv-chip{background:#e3f1ea}[data-status=field] .cv-chip{background:#fbefd9}
408
+ .cv-studio-loop{display:flex;flex-wrap:wrap;gap:16px;list-style:none;padding:0}.cv-studio-loop li{border:1px solid #e3ded3;border-radius:8px;padding:8px 12px}
409
+ .cv-studio-loop [data-state=not-yet]{color:#6b7482}.cv-snapshot{color:#6b7482;font-size:13px}
410
+ code{overflow-wrap:anywhere}.cv-snapshot{padding:0 16px 16px}.cv-scroll{overflow-x:auto}.cv-studio main,.cv-studio section,.cv-studio nav{min-width:0}
411
+ @media print{.cv-studio{max-width:none}.cv-scroll{overflow:visible}}
412
+ `;
413
+ /** The Studio home as an HTML fragment; throws StudioViewRefused on a refused input. */
414
+ export function studioViewHtml(input) {
415
+ const v = read(input);
416
+ return `<main class="cv-studio" data-studio="home">${loop(v)}${switcher(v)}${desk(v)}${termMap(v)}${(v.backfill ?? []).map((b) => backfillTimelineHtml(b.record, b.checkpoints, b.form)).join("")}</main>`;
417
+ }
418
+ /**
419
+ * A whole static page: the home, the input it was drawn from in a JSON
420
+ * script, and that JSON's SHA-256, labelled as workspace data that is not
421
+ * sealed evidence. Rebuilding from the embedded JSON gives the same bytes.
422
+ */
423
+ export async function studioViewDocument(input) {
424
+ const v = read(input);
425
+ const bytes = jcs(v);
426
+ const json = new TextDecoder().decode(bytes).replace(/</gu, "\\u003c");
427
+ const digest = await sha256Hex(new TextEncoder().encode(json));
428
+ const snapshot = `<footer class="cv-snapshot" data-snapshot><p>${esc(word("snapshot.label"))} <code data-snapshot-digest>${digest}</code></p><script type="application/json" data-studio-input>${json}</script></footer>`;
429
+ return `<!doctype html>\n<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${esc(word("page.title"))}</title><style>${studioViewStyles}</style></head><body>${studioViewHtml(v)}${snapshot}</body></html>\n`;
430
+ }
431
+ //# sourceMappingURL=studio-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"studio-view.js","sourceRoot":"","sources":["../src/studio-view.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,IAAI,MAAM,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEvE,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,yBAAyB;CACjB,CAAC;AAG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C,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC;AAC7M,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAAc;IACrD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,gDAAgD,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,+BAA+B,MAAM,gEAAgE,IAAI,oBAAoB,CAAC;IAC1N,OAAO,0IAA0I,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,kBAAkB,gBAAgB,wBAAwB,cAAc,CAAC,CAAC,CAAC,GAAG,QAAQ,kBAAkB,CAAC;AACnR,CAAC"}
@@ -46,6 +46,12 @@ export interface SubjectConversation {
46
46
  /** `HH:MM` as the record states it, when it states one. */
47
47
  readonly time?: string;
48
48
  readonly status: "resolved" | "missed" | "unverified" | "undecided" | "nothing-applied";
49
+ /**
50
+ * With `nothing-applied`: the contract keeps some of this conversation's
51
+ * rules out of its answer (informational) and none is left to count. Those
52
+ * rules may have applied, so the page cannot say that none did.
53
+ */
54
+ readonly keptOut?: boolean;
49
55
  readonly outcome: {
50
56
  readonly word: string;
51
57
  readonly tone: Tone;
@@ -74,7 +80,10 @@ export declare const shortHandle: (handle: string) => string;
74
80
  * conversation's request, band and halves. Undefined when nothing is drawn.
75
81
  * `rows` are the Result's conversations as the Outcomes grouping reads them;
76
82
  * `reportTotal` is how many the Result holds, the denominator of every slice.
83
+ * `tiered` is true when the contract given states a tier for some rule
84
+ * (contract-report/v1 section 2): `rows` are then already read over the rules
85
+ * the contract counts, and the tile captions and gap line say so.
77
86
  */
78
- export declare function renderSubjectHistory(rows: readonly SubjectConversation[], history: SubjectHistory, reportTotal: number, w: Words): HTMLElement | undefined;
87
+ export declare function renderSubjectHistory(rows: readonly SubjectConversation[], history: SubjectHistory, reportTotal: number, w: Words, tiered?: boolean): HTMLElement | undefined;
79
88
  /** The section's stylesheet, part of the outcome report's. */
80
89
  export declare const SUBJECT_HISTORY_CSS = "\n.oi .sh{max-width:1080px;margin:16px auto;padding:22px 24px;background:#fff;border:1px solid var(--line);border-radius:var(--r)}\n.oi .sh-title{font-family:Georgia,\"Iowan Old Style\",Cambria,serif;font-size:22px;margin:0 0 10px}\n.oi .sh-slice{background:var(--gold-l);border:1px solid #F0D7A8;border-radius:8px;padding:8px 12px;font-size:13px;margin:0 0 14px}\n.oi .sh-cust{margin:0 0 22px;padding:14px 0 0;border-top:1px solid var(--line)}\n.oi .sh-core{font-family:ui-monospace,Menlo,monospace;font-size:12px;color:var(--slate);margin:0 0 10px;overflow-wrap:anywhere}\n.oi .sh-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:0 0 12px}\n.oi .sh-tile{display:flex;flex-direction:column;gap:4px;background:var(--cream);border-radius:10px;padding:10px 14px}\n.oi .sh-tile b{font-family:Georgia,\"Iowan Old Style\",Cambria,serif;font-size:28px;line-height:1.1;font-variant-numeric:tabular-nums}\n.oi .sh-tile span{font-size:12.5px;color:var(--slate)}\n.oi .sh-tile.ok b{color:var(--ok)}.oi .sh-tile.bad b{color:var(--bad)}\n.oi .sh-head{font-family:Georgia,\"Iowan Old Style\",Cambria,serif;font-size:18px;margin:16px 0 8px}\n.oi .sh-lede,.oi .sh-note,.oi .sh-gap{font-size:13px;color:var(--slate);margin:6px 0}\n.oi .sh-track{position:relative;height:34px;margin:8px 12px 4px;border-bottom:2px solid var(--line)}\n.oi .sh-dot{position:absolute;bottom:-7px;left:var(--at);width:12px;height:12px;margin-left:-6px;border-radius:50%;border:2px solid var(--slate);background:#fff}\n.oi .sh-dot.ok{border-color:var(--ok)}.oi .sh-dot.bad{border-color:var(--bad)}\n.oi .sh-link{position:absolute;bottom:2px;left:var(--from);width:calc(var(--to) - var(--from));border-top:2px dashed var(--bad);text-align:center}\n.oi .sh-link em{position:relative;top:-20px;font-size:11px;font-style:normal;color:var(--slate);white-space:nowrap}\n.oi .sh-steps{margin:10px 0 0;padding-left:18px;font-size:13px}\n.oi .sh-row{display:grid;grid-template-columns:minmax(110px,1fr) minmax(110px,1.4fr) minmax(130px,2fr) minmax(70px,.8fr) minmax(60px,.7fr) minmax(80px,.8fr);gap:8px;align-items:center;font-size:13px}\n.oi .sh-thead{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--slate);border-bottom:2px solid var(--ink);padding:6px 0}\n.oi .sh-conv{border-bottom:1px solid var(--line)}\n.oi .sh-conv>summary{padding:8px 0;cursor:pointer;list-style:none}\n.oi .sh-sq{display:inline-flex;gap:3px;flex-wrap:wrap}\n.oi .sq{display:inline-block;width:14px;height:14px;border:1px solid var(--slate);border-radius:3px;background:#fff}\n.oi .sq.ok{background:var(--ok-l);border-color:var(--ok)}.oi .sq.bad{background:var(--bad-l);border-color:var(--bad)}.oi .sq.ne,.oi .sq.na{background:#ECEAE4}\n.oi .sh-band{font-family:ui-monospace,Menlo,monospace}\n.oi .sh-card{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:4px 0 10px;padding:12px 14px;background:var(--cream);border:1px solid var(--line);border-radius:8px;font-size:13px}\n.oi .sh-h{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--slate);margin:0 0 6px}\n.oi .sh-term{font-weight:600;margin:0}.oi .sh-sub{margin:0 0 6px;color:var(--slate)}\n.oi .sh-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12px;color:var(--slate);margin:10px 0 0}\n.oi .sh-key{display:inline-flex;gap:6px;align-items:center}\n@media (max-width:640px){.oi .sh{padding:16px}.oi .sh-row{grid-template-columns:1fr 1fr}.oi .sh-thead{display:none}}\n";
@@ -223,7 +223,7 @@ function tile(className, big, caption) {
223
223
  return box;
224
224
  }
225
225
  /** One customer's block: the line of identity, four tiles, the timeline, the table and its legend. */
226
- function customerBlock(handle, rows, history, reportTotal, w) {
226
+ function customerBlock(handle, rows, history, reportTotal, w, tiered) {
227
227
  const block = el("article", "sh-cust");
228
228
  block.dataset.handle = handle;
229
229
  const n = rows.length;
@@ -259,11 +259,12 @@ function customerBlock(handle, rows, history, reportTotal, w) {
259
259
  first: dateWords(dates[0], w),
260
260
  last: dateWords(dates[dates.length - 1], w),
261
261
  total: fmt(reportTotal),
262
- })), tile("ok", of(count("resolved")), w.t("lines.subject.tile.resolved")), tile("bad", of(count("missed")), w.t("lines.subject.tile.missed")), tile("ne", of(count("undecided")), w.t("lines.subject.tile.undecided")));
262
+ })), tile("ok", of(count("resolved")), w.t(`lines.subject.tile.resolved${tiered ? ".tiered" : ""}`)), tile("bad", of(count("missed")), w.t(`lines.subject.tile.missed${tiered ? ".tiered" : ""}`)), tile("ne", of(count("undecided")), w.t("lines.subject.tile.undecided")));
263
263
  block.append(tiles);
264
264
  const unverified = count("unverified");
265
- const nothing = count("nothing-applied");
266
- if (unverified + nothing > 0) {
265
+ const keptOut = rows.filter((r) => r.status === "nothing-applied" && r.keptOut === true).length;
266
+ const nothing = count("nothing-applied") - keptOut;
267
+ if (unverified + nothing + keptOut > 0) {
267
268
  const rest = [
268
269
  ...(unverified > 0
269
270
  ? [
@@ -281,6 +282,14 @@ function customerBlock(handle, rows, history, reportTotal, w) {
281
282
  }),
282
283
  ]
283
284
  : []),
285
+ ...(keptOut > 0
286
+ ? [
287
+ w.t("lines.subject.note.none-counted", {
288
+ n: fmt(keptOut),
289
+ total: fmt(n),
290
+ }),
291
+ ]
292
+ : []),
284
293
  ];
285
294
  block.append(el("p", "sh-note", rest.join(" ")));
286
295
  }
@@ -374,8 +383,11 @@ function table(rows, history, w) {
374
383
  * conversation's request, band and halves. Undefined when nothing is drawn.
375
384
  * `rows` are the Result's conversations as the Outcomes grouping reads them;
376
385
  * `reportTotal` is how many the Result holds, the denominator of every slice.
386
+ * `tiered` is true when the contract given states a tier for some rule
387
+ * (contract-report/v1 section 2): `rows` are then already read over the rules
388
+ * the contract counts, and the tile captions and gap line say so.
377
389
  */
378
- export function renderSubjectHistory(rows, history, reportTotal, w) {
390
+ export function renderSubjectHistory(rows, history, reportTotal, w, tiered = false) {
379
391
  const drawn = rows
380
392
  .filter((r) => history.entries.has(r.id))
381
393
  .sort((a, b) => a.date === b.date ? (a.id < b.id ? -1 : 1) : a.date < b.date ? -1 : 1);
@@ -401,13 +413,13 @@ export function renderSubjectHistory(rows, history, reportTotal, w) {
401
413
  section.append(el("p", "sh-lede", w.t("lines.subject.none")));
402
414
  repeat.sort((a, b) => b[1].length - a[1].length || (a[0] < b[0] ? -1 : 1));
403
415
  for (const [handle, list] of repeat)
404
- section.append(customerBlock(handle, list, history, reportTotal, w));
416
+ section.append(customerBlock(handle, list, history, reportTotal, w, tiered));
405
417
  }
406
418
  else {
407
419
  section.append(el("p", "sh-slice", w.t("lines.subject.slice.shared")));
408
420
  section.append(table(drawn, history, w));
409
421
  }
410
- section.append(el("p", "sh-gap", w.t("lines.subject.gap")));
422
+ section.append(el("p", "sh-gap", w.t(`lines.subject.gap${tiered ? ".tiered" : ""}`)));
411
423
  return section;
412
424
  }
413
425
  /** The section's stylesheet, part of the outcome report's. */