@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.
- package/dist/backfill-timeline.d.ts +66 -0
- package/dist/backfill-timeline.js +401 -0
- package/dist/backfill-timeline.js.map +1 -0
- package/dist/chart-dataset.d.ts +35 -0
- package/dist/chart-dataset.js +16 -1
- package/dist/chart-dataset.js.map +1 -1
- package/dist/compliance-view.js +65 -14
- package/dist/compliance-view.js.map +1 -1
- package/dist/contract-report-wording.d.ts +3 -1
- package/dist/contract-report-wording.js +43 -10
- package/dist/contract-report-wording.js.map +1 -1
- package/dist/contract-report.d.ts +23 -1
- package/dist/contract-report.js +83 -3
- package/dist/contract-report.js.map +1 -1
- package/dist/core-strip.d.ts +19 -3
- package/dist/core-strip.js +76 -11
- package/dist/core-strip.js.map +1 -1
- package/dist/evidence-graph-view.d.ts +3 -0
- package/dist/evidence-graph-view.js +46 -2
- package/dist/evidence-graph-view.js.map +1 -1
- package/dist/evidence-graph.iife.js +1037 -448
- package/dist/history-view.d.ts +2 -2
- package/dist/history-view.iife.js +1 -0
- package/dist/history-view.iife.js.sha256 +1 -1
- package/dist/history-view.js +2 -1
- package/dist/history-view.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/outcome-report-view.js +134 -6
- package/dist/outcome-report-view.js.map +1 -1
- package/dist/report-front.d.ts +2 -1
- package/dist/report-front.js.map +1 -1
- package/dist/studio-card.d.ts +79 -0
- package/dist/studio-card.js +383 -0
- package/dist/studio-card.js.map +1 -0
- package/dist/studio-pack.d.ts +10 -0
- package/dist/studio-pack.js +27 -0
- package/dist/studio-pack.js.map +1 -0
- package/dist/studio-view.d.ts +56 -0
- package/dist/studio-view.js +431 -0
- package/dist/studio-view.js.map +1 -0
- package/dist/subject-history.d.ts +10 -1
- package/dist/subject-history.js +19 -7
- package/dist/subject-history.js.map +1 -1
- package/dist/viewer-build.js +2 -2
- package/dist/wording/backfill-timeline.en.json +52 -0
- package/dist/wording/contract-report-eu-ai-act.en.json +38 -27
- package/dist/wording/contract-report-generic.en.json +8 -4
- package/dist/wording/contract-report-outcomes.en.json +25 -5
- package/dist/wording/studio-card.en.json +66 -0
- package/dist/wording/studio-view.en.json +39 -0
- package/package.json +2 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const BACKFILL_IMPORT = "backfill-import/v0";
|
|
2
|
+
export declare const BACKFILL_TIMELINE_WORDING: {
|
|
3
|
+
wording_pack_version: string;
|
|
4
|
+
id: string;
|
|
5
|
+
locale: string;
|
|
6
|
+
entries: {
|
|
7
|
+
title: string;
|
|
8
|
+
"form.rehearsal": string;
|
|
9
|
+
"form.record": string;
|
|
10
|
+
imported_label: string;
|
|
11
|
+
"pass.imported_at": string;
|
|
12
|
+
"pass.batch": string;
|
|
13
|
+
"pass.first": string;
|
|
14
|
+
"pass.previous": string;
|
|
15
|
+
"pass.span": string;
|
|
16
|
+
"pass.rows_read": string;
|
|
17
|
+
"pass.limits": string;
|
|
18
|
+
"rows.title": string;
|
|
19
|
+
"rows.cursor": string;
|
|
20
|
+
"rows.id": string;
|
|
21
|
+
"rows.source_says": string;
|
|
22
|
+
"rows.imported_at": string;
|
|
23
|
+
"rows.retained": string;
|
|
24
|
+
"horizon.limited": string;
|
|
25
|
+
"kept.title": string;
|
|
26
|
+
"kept.retrospective": string;
|
|
27
|
+
"notes.title": string;
|
|
28
|
+
"cannot_see.title": string;
|
|
29
|
+
"rows.yes": string;
|
|
30
|
+
"window.none": string;
|
|
31
|
+
"gaps.to": string;
|
|
32
|
+
"gaps.unknown": string;
|
|
33
|
+
"rows.none": string;
|
|
34
|
+
"window.title": string;
|
|
35
|
+
"window.after": string;
|
|
36
|
+
"window.through": string;
|
|
37
|
+
"horizon.oldest": string;
|
|
38
|
+
"gaps.title": string;
|
|
39
|
+
"gaps.none": string;
|
|
40
|
+
"gaps.named": string;
|
|
41
|
+
"gaps.cursors": string;
|
|
42
|
+
"gaps.unread": string;
|
|
43
|
+
"gaps.note": string;
|
|
44
|
+
"late.title": string;
|
|
45
|
+
"anomalies.title": string;
|
|
46
|
+
"anomalies.passed": string;
|
|
47
|
+
"refused.title": string;
|
|
48
|
+
"checkpoints.title": string;
|
|
49
|
+
"checkpoints.none": string;
|
|
50
|
+
"checkpoints.size": string;
|
|
51
|
+
"checkpoints.cut_at": string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare class BackfillTimelineRefused extends Error {
|
|
55
|
+
readonly reasons: readonly string[];
|
|
56
|
+
constructor(reasons: readonly string[]);
|
|
57
|
+
}
|
|
58
|
+
export type BackfillForm = "rehearsal" | "record";
|
|
59
|
+
/**
|
|
60
|
+
* One pass as an HTML fragment. `record` is the `backfill-import/v0` object
|
|
61
|
+
* the book holds; `checkpoints` (optional) are the ones that cover the pass.
|
|
62
|
+
* Throws BackfillTimelineRefused on a refused input.
|
|
63
|
+
*/
|
|
64
|
+
export declare function backfillTimelineHtml(record: unknown, checkpoints?: unknown, form?: BackfillForm): string;
|
|
65
|
+
/** Throws BackfillTimelineRefused when the record or checkpoints would be refused; draws nothing. */
|
|
66
|
+
export declare function checkBackfillTimeline(record: unknown, checkpoints?: unknown): void;
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* A timeline per backfill import (capsule-viewer#302, Terms Pack Studio PRD v5
|
|
4
|
+
* section 8): for one `backfill-import/v0` record (evidencebook
|
|
5
|
+
* capsulectl/BACKFILL.md, "The pass and its import record"), each row's
|
|
6
|
+
* `at` (the source says) against the pass's `imported_at` (we imported it),
|
|
7
|
+
* the declared gaps, a late pass, anomalies, refused rows and the checkpoints
|
|
8
|
+
* that cover the pass.
|
|
9
|
+
*
|
|
10
|
+
* It draws what the record holds and never verifies it or fetches anything.
|
|
11
|
+
* A gap is drawn and named, and never stops the page. Rows are labelled as
|
|
12
|
+
* imported in both forms (rehearsal and on the record). The checkpoint list is
|
|
13
|
+
* caller input (BACKFILL.md names no checkpoint record shape): `{digest, size,
|
|
14
|
+
* at}` per checkpoint that covers the pass. Unknown members are refused and
|
|
15
|
+
* caller text is only ever text.
|
|
16
|
+
*/
|
|
17
|
+
import PACK from "./wording/backfill-timeline.en.json" with { type: "json" };
|
|
18
|
+
export const BACKFILL_IMPORT = "backfill-import/v0";
|
|
19
|
+
export const BACKFILL_TIMELINE_WORDING = PACK;
|
|
20
|
+
export class BackfillTimelineRefused extends Error {
|
|
21
|
+
reasons;
|
|
22
|
+
constructor(reasons) {
|
|
23
|
+
super(`backfill-timeline refused: ${reasons.join("; ")}`);
|
|
24
|
+
this.name = "BackfillTimelineRefused";
|
|
25
|
+
this.reasons = reasons;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
29
|
+
const RECORD_MEMBERS = [
|
|
30
|
+
"schema",
|
|
31
|
+
"import_batch",
|
|
32
|
+
"imported_at",
|
|
33
|
+
"first_pass",
|
|
34
|
+
"previous_pass",
|
|
35
|
+
"late",
|
|
36
|
+
"window",
|
|
37
|
+
"source_time_span",
|
|
38
|
+
"horizons",
|
|
39
|
+
"promote_around",
|
|
40
|
+
"rows_read",
|
|
41
|
+
"reread_verified",
|
|
42
|
+
"already_retained",
|
|
43
|
+
"tier_a",
|
|
44
|
+
"retained",
|
|
45
|
+
"refused",
|
|
46
|
+
"anomalies",
|
|
47
|
+
"gaps",
|
|
48
|
+
"notes",
|
|
49
|
+
"scope",
|
|
50
|
+
"limits",
|
|
51
|
+
"cannot_see",
|
|
52
|
+
];
|
|
53
|
+
class Reader {
|
|
54
|
+
reasons = [];
|
|
55
|
+
refuse(path, why) {
|
|
56
|
+
this.reasons.push(`${path}: ${why}`);
|
|
57
|
+
}
|
|
58
|
+
obj(v, path, allowed, required) {
|
|
59
|
+
if (!isObj(v)) {
|
|
60
|
+
this.refuse(path, "is not an object");
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
for (const k of Object.keys(v))
|
|
64
|
+
if (!allowed.includes(k))
|
|
65
|
+
this.refuse(`${path}.${k}`, "is not a member of backfill-import/v0");
|
|
66
|
+
for (const k of required)
|
|
67
|
+
if (!(k in v))
|
|
68
|
+
this.refuse(`${path}.${k}`, "is missing");
|
|
69
|
+
return v;
|
|
70
|
+
}
|
|
71
|
+
str(v, path, max = 2000) {
|
|
72
|
+
if (typeof v !== "string" || v.length === 0 || v.length > max) {
|
|
73
|
+
this.refuse(path, `is not a string of 1 to ${max} characters`);
|
|
74
|
+
return "";
|
|
75
|
+
}
|
|
76
|
+
return v;
|
|
77
|
+
}
|
|
78
|
+
time(v, path) {
|
|
79
|
+
const s = this.str(v, path, 100);
|
|
80
|
+
if (s !== "" &&
|
|
81
|
+
(!/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(Z|[+-]\d\d:\d\d)$/u.test(s) ||
|
|
82
|
+
Number.isNaN(Date.parse(s))))
|
|
83
|
+
this.refuse(path, "is not an RFC 3339 time");
|
|
84
|
+
return s;
|
|
85
|
+
}
|
|
86
|
+
nat(v, path) {
|
|
87
|
+
if (typeof v !== "number" || !Number.isSafeInteger(v) || v < 0) {
|
|
88
|
+
this.refuse(path, "is not a count");
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
return v;
|
|
92
|
+
}
|
|
93
|
+
/** A Go nil slice is JSON `null`; it is an empty list. */
|
|
94
|
+
list(v, path) {
|
|
95
|
+
if (v === null)
|
|
96
|
+
return [];
|
|
97
|
+
if (!Array.isArray(v)) {
|
|
98
|
+
this.refuse(path, "is not a list");
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
return v;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function readEntries(r, raw, path, allowed) {
|
|
105
|
+
const out = [];
|
|
106
|
+
r.list(raw, path).forEach((e, i) => {
|
|
107
|
+
const p = `${path}[${i}]`;
|
|
108
|
+
const o = r.obj(e, p, allowed, ["source", "id", "reason"]);
|
|
109
|
+
if (o === null)
|
|
110
|
+
return;
|
|
111
|
+
out.push({
|
|
112
|
+
source: r.str(o["source"], `${p}.source`, 200),
|
|
113
|
+
id: r.str(o["id"], `${p}.id`, 400),
|
|
114
|
+
reason: r.str(o["reason"], `${p}.reason`),
|
|
115
|
+
...("cursor" in o ? { cursor: r.nat(o["cursor"], `${p}.cursor`) } : {}),
|
|
116
|
+
...("passed_cursor" in o
|
|
117
|
+
? { passed_cursor: r.nat(o["passed_cursor"], `${p}.passed_cursor`) }
|
|
118
|
+
: {}),
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
123
|
+
function read(record, checkpointsRaw) {
|
|
124
|
+
const r = new Reader();
|
|
125
|
+
const top = r.obj(record, "record", RECORD_MEMBERS, [
|
|
126
|
+
"schema",
|
|
127
|
+
"import_batch",
|
|
128
|
+
"imported_at",
|
|
129
|
+
"window",
|
|
130
|
+
"tier_a",
|
|
131
|
+
"gaps",
|
|
132
|
+
"limits",
|
|
133
|
+
]);
|
|
134
|
+
if (top === null)
|
|
135
|
+
throw new BackfillTimelineRefused(r.reasons);
|
|
136
|
+
if (top["schema"] !== BACKFILL_IMPORT)
|
|
137
|
+
r.refuse("record.schema", `is not ${BACKFILL_IMPORT}`);
|
|
138
|
+
// No prototype: a source named `constructor` or `__proto__` is only a name.
|
|
139
|
+
const window = Object.create(null);
|
|
140
|
+
if (isObj(top["window"]))
|
|
141
|
+
for (const [src, c] of Object.entries(top["window"])) {
|
|
142
|
+
const o = r.obj(c, `record.window.${src}`, ["after", "through"], []);
|
|
143
|
+
const cur = (v, k) => v === null || v === undefined
|
|
144
|
+
? null
|
|
145
|
+
: r.nat(v, `record.window.${src}.${k}`);
|
|
146
|
+
if (o !== null)
|
|
147
|
+
window[src] = {
|
|
148
|
+
after: cur(o["after"], "after"),
|
|
149
|
+
through: cur(o["through"], "through"),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
else
|
|
153
|
+
r.refuse("record.window", "is not an object");
|
|
154
|
+
const horizons = Object.create(null);
|
|
155
|
+
if (top["horizons"] !== undefined && top["horizons"] !== null) {
|
|
156
|
+
if (!isObj(top["horizons"]))
|
|
157
|
+
r.refuse("record.horizons", "is not an object");
|
|
158
|
+
else
|
|
159
|
+
for (const [src, h] of Object.entries(top["horizons"])) {
|
|
160
|
+
const o = r.obj(h, `record.horizons.${src}`, ["oldest_cursor", "oldest_at", "limited"], ["oldest_cursor", "oldest_at"]);
|
|
161
|
+
if (o !== null)
|
|
162
|
+
horizons[src] = {
|
|
163
|
+
oldest_cursor: r.nat(o["oldest_cursor"], `record.horizons.${src}.oldest_cursor`),
|
|
164
|
+
oldest_at: r.time(o["oldest_at"], `record.horizons.${src}.oldest_at`),
|
|
165
|
+
limited: o["limited"] === true,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const tier_a = [];
|
|
170
|
+
r.list(top["tier_a"], "record.tier_a").forEach((e, i) => {
|
|
171
|
+
const p = `record.tier_a[${i}]`;
|
|
172
|
+
const o = r.obj(e, p, ["source", "cursor", "id", "at", "digest"], ["source", "cursor", "id", "at"]);
|
|
173
|
+
if (o === null)
|
|
174
|
+
return;
|
|
175
|
+
tier_a.push({
|
|
176
|
+
source: r.str(o["source"], `${p}.source`, 200),
|
|
177
|
+
cursor: r.nat(o["cursor"], `${p}.cursor`),
|
|
178
|
+
id: r.str(o["id"], `${p}.id`, 400),
|
|
179
|
+
at: r.time(o["at"], `${p}.at`),
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
const gaps = [];
|
|
183
|
+
r.list(top["gaps"], "record.gaps").forEach((e, i) => {
|
|
184
|
+
const p = `record.gaps[${i}]`;
|
|
185
|
+
const o = r.obj(e, p, ["source", "from_cursor", "to_cursor", "reason"], ["source", "reason"]);
|
|
186
|
+
if (o === null)
|
|
187
|
+
return;
|
|
188
|
+
gaps.push({
|
|
189
|
+
source: r.str(o["source"], `${p}.source`, 200),
|
|
190
|
+
reason: r.str(o["reason"], `${p}.reason`),
|
|
191
|
+
...("from_cursor" in o
|
|
192
|
+
? { from_cursor: r.nat(o["from_cursor"], `${p}.from_cursor`) }
|
|
193
|
+
: {}),
|
|
194
|
+
...("to_cursor" in o
|
|
195
|
+
? { to_cursor: r.nat(o["to_cursor"], `${p}.to_cursor`) }
|
|
196
|
+
: {}),
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
const retained = [];
|
|
200
|
+
if (top["retained"] !== undefined && top["retained"] !== null)
|
|
201
|
+
r.list(top["retained"], "record.retained").forEach((e, i) => {
|
|
202
|
+
const p = `record.retained[${i}]`;
|
|
203
|
+
const o = r.obj(e, p, [
|
|
204
|
+
"capsule_id",
|
|
205
|
+
"source_digest",
|
|
206
|
+
"action_id",
|
|
207
|
+
"pinned_by",
|
|
208
|
+
"retrospective",
|
|
209
|
+
], ["action_id"]);
|
|
210
|
+
if (o !== null)
|
|
211
|
+
retained.push({
|
|
212
|
+
action_id: r.str(o["action_id"], `${p}.action_id`, 600),
|
|
213
|
+
retrospective: o["retrospective"] === true,
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
const optList = (k, allowed) => top[k] === undefined || top[k] === null
|
|
217
|
+
? []
|
|
218
|
+
: readEntries(r, top[k], `record.${k}`, allowed);
|
|
219
|
+
const refused = optList("refused", [
|
|
220
|
+
"source",
|
|
221
|
+
"id",
|
|
222
|
+
"reason",
|
|
223
|
+
"digest",
|
|
224
|
+
"tier_a_digest",
|
|
225
|
+
]);
|
|
226
|
+
const anomalies = optList("anomalies", [
|
|
227
|
+
"source",
|
|
228
|
+
"id",
|
|
229
|
+
"reason",
|
|
230
|
+
"cursor",
|
|
231
|
+
"passed_cursor",
|
|
232
|
+
]);
|
|
233
|
+
let previous = null;
|
|
234
|
+
if (top["previous_pass"] !== undefined && top["previous_pass"] !== null) {
|
|
235
|
+
const o = r.obj(top["previous_pass"], "record.previous_pass", ["import_batch", "imported_at"], ["import_batch", "imported_at"]);
|
|
236
|
+
if (o !== null)
|
|
237
|
+
previous = {
|
|
238
|
+
import_batch: r.str(o["import_batch"], "record.previous_pass.import_batch", 400),
|
|
239
|
+
imported_at: r.time(o["imported_at"], "record.previous_pass.imported_at"),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
let span = null;
|
|
243
|
+
if (top["source_time_span"] !== undefined &&
|
|
244
|
+
top["source_time_span"] !== null) {
|
|
245
|
+
const o = r.obj(top["source_time_span"], "record.source_time_span", ["earliest", "latest"], ["earliest", "latest"]);
|
|
246
|
+
if (o !== null)
|
|
247
|
+
span = {
|
|
248
|
+
earliest: r.time(o["earliest"], "record.source_time_span.earliest"),
|
|
249
|
+
latest: r.time(o["latest"], "record.source_time_span.latest"),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const checkpoints = [];
|
|
253
|
+
if (checkpointsRaw !== undefined)
|
|
254
|
+
r.list(checkpointsRaw, "checkpoints").forEach((e, i) => {
|
|
255
|
+
const p = `checkpoints[${i}]`;
|
|
256
|
+
const o = r.obj(e, p, ["digest", "size", "at"], ["digest", "size", "at"]);
|
|
257
|
+
if (o === null)
|
|
258
|
+
return;
|
|
259
|
+
checkpoints.push({
|
|
260
|
+
digest: r.str(o["digest"], `${p}.digest`, 200),
|
|
261
|
+
size: r.nat(o["size"], `${p}.size`),
|
|
262
|
+
at: r.time(o["at"], `${p}.at`),
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
if ("first_pass" in top && typeof top["first_pass"] !== "boolean")
|
|
266
|
+
r.refuse("record.first_pass", "is not true or false");
|
|
267
|
+
const first_pass = top["first_pass"] === true;
|
|
268
|
+
const strs = (k) => top[k] === undefined || top[k] === null
|
|
269
|
+
? []
|
|
270
|
+
: r
|
|
271
|
+
.list(top[k], `record.${k}`)
|
|
272
|
+
.map((x, i) => r.str(x, `record.${k}[${i}]`));
|
|
273
|
+
const cannot_see = strs("cannot_see");
|
|
274
|
+
const notes = strs("notes");
|
|
275
|
+
const imported_at = r.time(top["imported_at"], "record.imported_at");
|
|
276
|
+
const import_batch = r.str(top["import_batch"], "record.import_batch", 400);
|
|
277
|
+
const limits = r.str(top["limits"], "record.limits");
|
|
278
|
+
const late = top["late"] === undefined || top["late"] === null
|
|
279
|
+
? null
|
|
280
|
+
: r.str(top["late"], "record.late");
|
|
281
|
+
const rows_read = top["rows_read"] === undefined
|
|
282
|
+
? null
|
|
283
|
+
: r.nat(top["rows_read"], "record.rows_read");
|
|
284
|
+
if (r.reasons.length > 0)
|
|
285
|
+
throw new BackfillTimelineRefused(r.reasons);
|
|
286
|
+
return {
|
|
287
|
+
import_batch,
|
|
288
|
+
imported_at,
|
|
289
|
+
first_pass,
|
|
290
|
+
previous_pass: previous,
|
|
291
|
+
late,
|
|
292
|
+
window,
|
|
293
|
+
horizons,
|
|
294
|
+
span,
|
|
295
|
+
rows_read,
|
|
296
|
+
tier_a,
|
|
297
|
+
retained,
|
|
298
|
+
refused,
|
|
299
|
+
anomalies,
|
|
300
|
+
gaps,
|
|
301
|
+
limits,
|
|
302
|
+
cannot_see,
|
|
303
|
+
notes,
|
|
304
|
+
checkpoints,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
// --- writing the drawing ---------------------------------------------------
|
|
308
|
+
const W = PACK.entries;
|
|
309
|
+
const word = (key) => {
|
|
310
|
+
const w = W[key];
|
|
311
|
+
if (w === undefined)
|
|
312
|
+
throw new Error(`backfill-timeline: no word ${key}`);
|
|
313
|
+
return w;
|
|
314
|
+
};
|
|
315
|
+
function esc(text) {
|
|
316
|
+
return text.replace(/[&<>"']/gu, (c) => c === "&"
|
|
317
|
+
? "&"
|
|
318
|
+
: c === "<"
|
|
319
|
+
? "<"
|
|
320
|
+
: c === ">"
|
|
321
|
+
? ">"
|
|
322
|
+
: c === '"'
|
|
323
|
+
? """
|
|
324
|
+
: "'");
|
|
325
|
+
}
|
|
326
|
+
const cursors = (g) => g.from_cursor === undefined && g.to_cursor === undefined
|
|
327
|
+
? word("gaps.unread")
|
|
328
|
+
: `${word("gaps.cursors")} ${g.from_cursor ?? word("gaps.unknown")} ${word("gaps.to")} ${g.to_cursor ?? word("gaps.unknown")}`;
|
|
329
|
+
function draw(p, form) {
|
|
330
|
+
const sources = [
|
|
331
|
+
...new Set([
|
|
332
|
+
...Object.keys(p.window),
|
|
333
|
+
...Object.keys(p.horizons),
|
|
334
|
+
...p.tier_a.map((r) => r.source),
|
|
335
|
+
]),
|
|
336
|
+
].sort();
|
|
337
|
+
const keptIds = new Set(p.retained.map((k) => k.action_id));
|
|
338
|
+
const drawnIds = new Set(p.tier_a.map((r) => `${r.source}/${r.id}`));
|
|
339
|
+
// A retrospective capsule is pinned by an earlier pass's row, so it need
|
|
340
|
+
// not be among this pass's rows; it is still a record the pass kept.
|
|
341
|
+
const keptElsewhere = p.retained.filter((k) => !drawnIds.has(k.action_id));
|
|
342
|
+
const label = `<p data-imported-label><strong>${esc(word("imported_label"))}</strong> · ${esc(word(`form.${form}`))}</p>`;
|
|
343
|
+
const head = `<p>${esc(word("pass.batch"))} <code>${esc(p.import_batch)}</code> · ${esc(word("pass.imported_at"))} <time data-imported-at datetime="${esc(p.imported_at)}">${esc(p.imported_at)}</time>${p.first_pass ? ` · ${esc(word("pass.first"))}` : ""}${p.previous_pass === null ? "" : ` · ${esc(word("pass.previous"))} <code>${esc(p.previous_pass.import_batch)}</code> <time datetime="${esc(p.previous_pass.imported_at)}">${esc(p.previous_pass.imported_at)}</time>`}${p.span === null ? "" : ` · ${esc(word("pass.span"))} <time>${esc(p.span.earliest)}</time> ${esc(word("gaps.to"))} <time>${esc(p.span.latest)}</time>`}${p.rows_read === null ? "" : ` · ${esc(word("pass.rows_read"))} ${p.rows_read}`}</p>`;
|
|
344
|
+
const perSource = sources
|
|
345
|
+
.map((src) => {
|
|
346
|
+
const w = p.window[src];
|
|
347
|
+
const h = p.horizons[src];
|
|
348
|
+
const rows = p.tier_a
|
|
349
|
+
.filter((r) => r.source === src)
|
|
350
|
+
.sort((a, b) => a.cursor - b.cursor)
|
|
351
|
+
.map((r) => `<tr data-row="${esc(r.id)}" data-imported="true"${keptIds.has(`${src}/${r.id}`) ? ' data-retained="true"' : ""}><td>${r.cursor}</td><td><code>${esc(r.id)}</code></td><td><time data-source-says datetime="${esc(r.at)}">${esc(r.at)}</time></td><td><time data-imported-at datetime="${esc(p.imported_at)}">${esc(p.imported_at)}</time></td><td>${keptIds.has(`${src}/${r.id}`) ? esc(word("rows.yes")) : ""}</td></tr>`)
|
|
352
|
+
.join("");
|
|
353
|
+
const table = rows === ""
|
|
354
|
+
? `<p>${esc(word("rows.none"))}</p>`
|
|
355
|
+
: `<div class="cv-scroll"><table><thead><tr><th>${esc(word("rows.cursor"))}</th><th>${esc(word("rows.id"))}</th><th>${esc(word("rows.source_says"))}</th><th>${esc(word("rows.imported_at"))}</th><th>${esc(word("rows.retained"))}</th></tr></thead><tbody>${rows}</tbody></table></div>`;
|
|
356
|
+
return `<section data-source="${esc(src)}"><h4>${esc(src)}</h4><p>${w === undefined ? "" : `${esc(word("window.title"))}: ${esc(word("window.after"))} ${w.after ?? word("window.none")}, ${esc(word("window.through"))} ${w.through ?? word("window.none")}`}${h === undefined ? "" : `${w === undefined ? "" : " · "}${esc(word("horizon.oldest"))}: ${h.oldest_cursor} (<time>${esc(h.oldest_at)}</time>)${h.limited ? ` · ${esc(word("horizon.limited"))}` : ""}`}</p>${table}</section>`;
|
|
357
|
+
})
|
|
358
|
+
.join("");
|
|
359
|
+
const gaps = p.gaps.length === 0
|
|
360
|
+
? `<p data-gaps="none">${esc(word("gaps.none"))}</p>`
|
|
361
|
+
: `<ul data-gaps="declared">${p.gaps
|
|
362
|
+
.map((g) => `<li data-gap data-source="${esc(g.source)}"><strong>${esc(word("gaps.named"))}</strong> ${esc(g.source)}: ${esc(cursors(g))}. ${esc(g.reason)}</li>`)
|
|
363
|
+
.join("")}</ul><p><small>${esc(word("gaps.note"))}</small></p>`;
|
|
364
|
+
const late = p.late === null
|
|
365
|
+
? ""
|
|
366
|
+
: `<section data-late><h3>${esc(word("late.title"))}</h3><p>${esc(p.late)}</p></section>`;
|
|
367
|
+
const list = (items, key, token) => items.length === 0
|
|
368
|
+
? ""
|
|
369
|
+
: `<section data-${token}><h3>${esc(word(key))}</h3><ul>${items
|
|
370
|
+
.map((e) => `<li>${esc(e.source)}/<code>${esc(e.id)}</code>${e.cursor === undefined ? "" : ` ${esc(word("rows.cursor"))} ${e.cursor}`}${e.passed_cursor === undefined ? "" : ` (${esc(word("anomalies.passed"))} ${e.passed_cursor})`}: ${esc(e.reason)}</li>`)
|
|
371
|
+
.join("")}</ul></section>`;
|
|
372
|
+
const kept = keptElsewhere.length === 0
|
|
373
|
+
? ""
|
|
374
|
+
: `<section data-kept-elsewhere><h3>${esc(word("kept.title"))}</h3><ul>${keptElsewhere
|
|
375
|
+
.map((k) => `<li><code>${esc(k.action_id)}</code>${k.retrospective ? ` · ${esc(word("kept.retrospective"))}` : ""}</li>`)
|
|
376
|
+
.join("")}</ul></section>`;
|
|
377
|
+
const words = (items, key, token) => items.length === 0
|
|
378
|
+
? ""
|
|
379
|
+
: `<section data-${token}><h3>${esc(word(key))}</h3><ul>${items.map((x) => `<li>${esc(x)}</li>`).join("")}</ul></section>`;
|
|
380
|
+
const cps = p.checkpoints.length === 0
|
|
381
|
+
? `<p data-checkpoints="none">${esc(word("checkpoints.none"))}</p>`
|
|
382
|
+
: `<ul data-checkpoints="covering">${p.checkpoints
|
|
383
|
+
.map((c) => `<li data-checkpoint><code>${esc(c.digest)}</code> · ${esc(word("checkpoints.size"))} ${c.size} · ${esc(word("checkpoints.cut_at"))} <time datetime="${esc(c.at)}">${esc(c.at)}</time></li>`)
|
|
384
|
+
.join("")}</ul>`;
|
|
385
|
+
return `<section data-view="backfill-timeline" data-form="${form}" data-pass="${esc(p.import_batch)}"><h2>${esc(word("title"))}</h2>${label}${head}<h3>${esc(word("rows.title"))}</h3>${perSource}<h3>${esc(word("gaps.title"))}</h3>${gaps}${late}${list(p.anomalies, "anomalies.title", "anomalies")}${list(p.refused, "refused.title", "refused")}${kept}<h3>${esc(word("checkpoints.title"))}</h3>${cps}${words(p.notes, "notes.title", "notes")}<p><small>${esc(word("pass.limits"))}: ${esc(p.limits)}</small></p>${words(p.cannot_see, "cannot_see.title", "cannot-see")}</section>`;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* One pass as an HTML fragment. `record` is the `backfill-import/v0` object
|
|
389
|
+
* the book holds; `checkpoints` (optional) are the ones that cover the pass.
|
|
390
|
+
* Throws BackfillTimelineRefused on a refused input.
|
|
391
|
+
*/
|
|
392
|
+
export function backfillTimelineHtml(record, checkpoints, form = "record") {
|
|
393
|
+
if (form !== "record" && form !== "rehearsal")
|
|
394
|
+
throw new BackfillTimelineRefused(["form: is not record or rehearsal"]);
|
|
395
|
+
return draw(read(record, checkpoints), form);
|
|
396
|
+
}
|
|
397
|
+
/** Throws BackfillTimelineRefused when the record or checkpoints would be refused; draws nothing. */
|
|
398
|
+
export function checkBackfillTimeline(record, checkpoints) {
|
|
399
|
+
read(record, checkpoints);
|
|
400
|
+
}
|
|
401
|
+
//# sourceMappingURL=backfill-timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backfill-timeline.js","sourceRoot":"","sources":["../src/backfill-timeline.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;GAcG;AACH,OAAO,IAAI,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE7E,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,OAAO,CAAoB;IACpC,YAAY,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AAQ,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,QAAQ,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC;AAC9jB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAe,EACf,WAAqB,EACrB,IAAI,GAAiB,QAAQ;IAE7B,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,WAAW;QAC3C,MAAM,IAAI,uBAAuB,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,qBAAqB,CACnC,MAAe,EACf,WAAqB;IAErB,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAC5B,CAAC"}
|
package/dist/chart-dataset.d.ts
CHANGED
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
import { type ResultRoot, type VerifiedBundleContext } from "@action-state-group/agent-action-capsule";
|
|
2
2
|
import { ChartRefusal, type ChartDataset } from "./chart-spec.js";
|
|
3
|
+
/**
|
|
4
|
+
* The sealed dataset a report's charts are checked against, read from a
|
|
5
|
+
* verified bundle (docs/design/chart-spec.md section 4).
|
|
6
|
+
*
|
|
7
|
+
* The Result names its dataset plan and dataset by digest, `plan_ref` and
|
|
8
|
+
* `dataset_ref` (agent-action-capsule spec/evidence-result-v0.md §7.3). Both
|
|
9
|
+
* are documents of their own, which a bundle discloses or withholds like any
|
|
10
|
+
* other: this reader takes any disclosed member, or the `statement` of a
|
|
11
|
+
* disclosed evidence-book record header, whose JCS SHA-256 is the digest. A
|
|
12
|
+
* row names a record header by the digest of its JCS (evidence-plan-ir-v0
|
|
13
|
+
* §6.2). The bundle carries that header either as the record's disclosed
|
|
14
|
+
* `agent_input`, whose digest the record commits to and the bundle verifier
|
|
15
|
+
* checked, or inline in the record's `evidence_record_header` member, which
|
|
16
|
+
* `capsule_id` covers. A row whose header the bundle does not disclose is
|
|
17
|
+
* kept without one, and the checker refuses the chart for it.
|
|
18
|
+
*
|
|
19
|
+
* This reader does not run the plan again: that needs every header of the
|
|
20
|
+
* population, which a bundle that withholds any of them cannot give (§6.2
|
|
21
|
+
* there). It checks what the bundle can show: both digests, the dataset's
|
|
22
|
+
* own `plan_ref`, and each disclosed row's `seq` and `record_type` against
|
|
23
|
+
* its header.
|
|
24
|
+
*/
|
|
25
|
+
type Obj = Record<string, unknown>;
|
|
3
26
|
/** evidencebook's member through which a caller-sealed capsule carries its own header. */
|
|
4
27
|
export declare const RECORD_HEADER_MEMBER = "evidence_record_header";
|
|
28
|
+
/** The Result document the root carries: the member itself, or a book header's statement. */
|
|
29
|
+
export declare function resultDocument(context: VerifiedBundleContext, result: ResultRoot): Obj | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The plan and dataset digests a report's Result names (Result spec section
|
|
32
|
+
* 7.3: both or neither), as 64-hex; undefined when it names none. Throws a
|
|
33
|
+
* {@link ChartRefusal} for a member that is not a SHA-256 digest ref.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resultDatasetRefs(context: VerifiedBundleContext, result: ResultRoot): {
|
|
36
|
+
plan_ref: string;
|
|
37
|
+
dataset_ref: string;
|
|
38
|
+
} | undefined;
|
|
5
39
|
/**
|
|
6
40
|
* The dataset a report's Result names, as the chart checker reads it; or
|
|
7
41
|
* undefined when the Result names none or the bundle does not disclose its
|
|
@@ -21,3 +55,4 @@ export interface ChartBuildCheck {
|
|
|
21
55
|
* root is not an Evidence Result, has no dataset to check against.
|
|
22
56
|
*/
|
|
23
57
|
export declare function checkChartsAgainst(context: VerifiedBundleContext, charts: readonly unknown[]): Promise<ChartBuildCheck[]>;
|
|
58
|
+
export {};
|
package/dist/chart-dataset.js
CHANGED
|
@@ -22,7 +22,7 @@ function digestRef(value, what) {
|
|
|
22
22
|
return value.digest;
|
|
23
23
|
}
|
|
24
24
|
/** The Result document the root carries: the member itself, or a book header's statement. */
|
|
25
|
-
function resultDocument(context, result) {
|
|
25
|
+
export function resultDocument(context, result) {
|
|
26
26
|
const member = disclosureOf(context, result.capsuleId, result.member);
|
|
27
27
|
if (member.state !== "disclosed" || !isObj(member.payload))
|
|
28
28
|
return undefined;
|
|
@@ -94,6 +94,21 @@ async function headersByDigest(context) {
|
|
|
94
94
|
}
|
|
95
95
|
return found;
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* The plan and dataset digests a report's Result names (Result spec section
|
|
99
|
+
* 7.3: both or neither), as 64-hex; undefined when it names none. Throws a
|
|
100
|
+
* {@link ChartRefusal} for a member that is not a SHA-256 digest ref.
|
|
101
|
+
*/
|
|
102
|
+
export function resultDatasetRefs(context, result) {
|
|
103
|
+
const document = resultDocument(context, result);
|
|
104
|
+
if (document === undefined)
|
|
105
|
+
return undefined;
|
|
106
|
+
const plan = digestRef(document.plan_ref, "the Result's plan_ref");
|
|
107
|
+
const dataset = digestRef(document.dataset_ref, "the Result's dataset_ref");
|
|
108
|
+
return plan === undefined || dataset === undefined
|
|
109
|
+
? undefined
|
|
110
|
+
: { plan_ref: plan, dataset_ref: dataset };
|
|
111
|
+
}
|
|
97
112
|
/**
|
|
98
113
|
* The dataset a report's Result names, as the chart checker reads it; or
|
|
99
114
|
* undefined when the Result names none or the bundle does not disclose its
|
|
@@ -1 +1 @@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