@intentius/behold 0.29.9 → 0.29.11
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/cli.js +1 -0
- package/package.json +1 -1
- package/web/kiosk-annotations.js +9 -9
- package/web/kiosk-approval.js +2 -2
- package/web/kiosk-popover.js +2 -2
- package/web/kiosk-popover.test.js +3 -3
- package/web/kiosk.html +3 -0
- package/web/kiosk.js +19 -14
- package/web/kiosk.test.js +1 -1
package/dist/cli.js
CHANGED
|
@@ -21775,6 +21775,7 @@ function watchSource(projectDir, onChange, debounceMs = 200) {
|
|
|
21775
21775
|
clearTimeout(timer);
|
|
21776
21776
|
timer = setTimeout(onChange, debounceMs);
|
|
21777
21777
|
});
|
|
21778
|
+
watcher.on("error", (e) => console.warn(`behold: watching ${dir}: ${e.message}`));
|
|
21778
21779
|
return () => {
|
|
21779
21780
|
clearTimeout(timer);
|
|
21780
21781
|
watcher.close();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/behold",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.11",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "behold — a live control plane on chant. See your whole estate (every substrate in one graph), coloured by drift; act through delegated, gated Ops.",
|
package/web/kiosk-annotations.js
CHANGED
|
@@ -123,7 +123,7 @@ export const ANNOTATIONS = [
|
|
|
123
123
|
{
|
|
124
124
|
id: "T12", product: "chant", feature: "Waiting for approval",
|
|
125
125
|
pattern: String.raw`^Nothing in wave \d+ or after it ran\. (?:Read the plans, then|It waits on .+\.) approve: (chant approve \S+ \S+ --plan \S+) \(with --resume, the approval also starts this job again\)$`,
|
|
126
|
-
note: "The job
|
|
126
|
+
note: "The job ends at this wave; the printed chant approve command records the approval and can restart the job.",
|
|
127
127
|
docs: { product: "chant", path: "/guide/op-waves/#resume-the-waiting-job" },
|
|
128
128
|
source: "chant:packages/core/src/op/op-waves-run.ts:1587",
|
|
129
129
|
sample: "Nothing in wave 2 or after it ran. Read the plans, then approve: chant approve tf-apply wave-2 --plan jcs1-sha256:95b79f4946fffd67b2d3da8971084852c4182623d8223b4a307f7067375fe37a (with --resume, the approval also starts this job again)",
|
|
@@ -163,7 +163,7 @@ export const ANNOTATIONS = [
|
|
|
163
163
|
{
|
|
164
164
|
id: "T17", product: "terragucci", feature: "Changed after approval",
|
|
165
165
|
pattern: String.raw`^wave \d+ changed after it was approved, so nothing in it was applied\. approved: (\S+); planned now: (\S+)\. `,
|
|
166
|
-
note: "The wave planned to a different digest than the one approved
|
|
166
|
+
note: "The wave planned to a different digest than the one approved; the new plan needs its own approval.",
|
|
167
167
|
docs: { product: "terragucci", path: "/guides/fix-a-refused-wave/" },
|
|
168
168
|
source: "terragucci:packages/terragucci/src/apply.ts:2983",
|
|
169
169
|
sample: "wave 1 changed after it was approved, so nothing in it was applied. approved: jcs1-sha256:c7d57fcf0bf559242e2104f4d0ed562888f6bd99ed8c5af350db462771169877; planned now: jcs1-sha256:0be8353d2143e463577e05eca00b62cabd51791aaa383051930e384340812052. Read the new plan, then approve it: terragucci approve wave-1 --plan jcs1-sha256:0be8353d2143e463577e05eca00b62cabd51791aaa383051930e384340812052",
|
|
@@ -171,7 +171,7 @@ export const ANNOTATIONS = [
|
|
|
171
171
|
{
|
|
172
172
|
id: "T18", product: "terragucci", feature: "Changed after approval",
|
|
173
173
|
pattern: String.raw`^wave \d+ of \d+: approved by (\S+), but these roots planned differently since: (.+)$`,
|
|
174
|
-
note: "Names the roots whose plans differ from the approved ones,
|
|
174
|
+
note: "Names the roots whose plans differ from the approved ones, so the wave needs a new approval.",
|
|
175
175
|
docs: { product: "terragucci", path: "/tutorial/changed-wave/" },
|
|
176
176
|
source: "terragucci:packages/terragucci/src/apply.ts:2984",
|
|
177
177
|
sample: "wave 1 of 3: approved by terragucci-admin, but these roots planned differently since: network",
|
|
@@ -187,7 +187,7 @@ export const ANNOTATIONS = [
|
|
|
187
187
|
{
|
|
188
188
|
id: "T20", product: "terragucci", feature: "Unreviewed outputs",
|
|
189
189
|
pattern: String.raw`^wave \d+ of \d+: nobody reviewed the plan it made on those outputs, so it waits for an approval of it(?: although gate is \S+)?$`,
|
|
190
|
-
note: "This wave planned on outputs
|
|
190
|
+
note: "This wave planned on outputs that got their values during the apply, so a person approves it even when its gate would let it through.",
|
|
191
191
|
docs: { product: "terragucci", path: "/concepts/waves-and-approvals/#linked-roots" },
|
|
192
192
|
source: "terragucci:packages/terragucci/src/apply.ts:2562",
|
|
193
193
|
sample: "wave 1 of 3: nobody reviewed the plan it made on those outputs, so it waits for an approval of it although gate is on-destructive",
|
|
@@ -203,7 +203,7 @@ export const ANNOTATIONS = [
|
|
|
203
203
|
{
|
|
204
204
|
id: "T22", product: "terragucci", feature: "Unreviewed outputs",
|
|
205
205
|
pattern: String.raw`^wave \d+ of \d+: (\S+) reads? no output of (\S+) that (.+) left unknown$`,
|
|
206
|
-
note: "Every output this root reads was
|
|
206
|
+
note: "Every output this root reads was known when it was planned, so its plan holds only reviewed values.",
|
|
207
207
|
docs: { product: "terragucci", path: "/concepts/waves-and-approvals/#linked-roots" },
|
|
208
208
|
source: "terragucci:packages/terragucci/src/unknown-reads.ts:142",
|
|
209
209
|
sample: "wave 2 of 3: app reads no output of network that wave 1's plan of network in this push (2026/10/e8863ee426177316d84499a5b8401c4b6adfb546/tf-apply-wave-1) left unknown",
|
|
@@ -235,7 +235,7 @@ export const ANNOTATIONS = [
|
|
|
235
235
|
{
|
|
236
236
|
id: "T26", product: "terragucci", feature: "Unreviewed outputs",
|
|
237
237
|
pattern: String.raw`^wave \d+ of \d+: (\S+) reads (.+), unknown at plan time and computed in this apply$`,
|
|
238
|
-
note: "Inside a composed run this root reads a value
|
|
238
|
+
note: "Inside a composed run this root reads a value computed during the apply.",
|
|
239
239
|
docs: { product: "terragucci", path: "/concepts/waves-and-approvals/#approval" },
|
|
240
240
|
source: "terragucci:packages/terragucci/src/apply.ts:2022",
|
|
241
241
|
sample: "wave 1 of 3: app reads subnet_id of network, unknown at plan time and computed in this apply",
|
|
@@ -275,7 +275,7 @@ export const ANNOTATIONS = [
|
|
|
275
275
|
{
|
|
276
276
|
id: "T31", product: "chant", feature: "Apply failed",
|
|
277
277
|
pattern: String.raw`^wave \d+ \(([^)]+)\): apply failed, so none of (.+) counts as applied$`,
|
|
278
|
-
note: "The wave's apply failed.
|
|
278
|
+
note: "The wave's apply failed. Its roots and the later waves wait for a re-run.",
|
|
279
279
|
docs: { product: "terragucci", path: "/reference/responses/#apply-failed" },
|
|
280
280
|
source: "chant:packages/core/src/op/op-waves-run.ts:2092",
|
|
281
281
|
sample: "wave 2 (wave-2): apply failed, so none of app counts as applied",
|
|
@@ -379,7 +379,7 @@ export const ANNOTATIONS = [
|
|
|
379
379
|
{
|
|
380
380
|
id: "T44", product: "terragucci", feature: "Eligible approvers",
|
|
381
381
|
pattern: String.raw`^wave \d+ of \d+: (\S+) (.+), so \1's (approval|review) doesn't count$`,
|
|
382
|
-
note: "This person
|
|
382
|
+
note: "This person worked on the change, so the gate counts approvals from someone else.",
|
|
383
383
|
docs: { product: "terragucci", path: "/guides/approve-a-wave/#eligible-approvers" },
|
|
384
384
|
source: "terragucci:packages/terragucci/src/involved.ts:175",
|
|
385
385
|
sample: "wave 2 of 3: demo-author opened pull request 1086, so demo-author's review doesn't count", // made from the source, no run printed it yet
|
|
@@ -387,7 +387,7 @@ export const ANNOTATIONS = [
|
|
|
387
387
|
{
|
|
388
388
|
id: "T45", product: "terragucci", feature: "Eligible approvers",
|
|
389
389
|
pattern: String.raw`^wave \d+ of \d+: an approval counts only from someone who had no hand in the change, so not from (.+)$`,
|
|
390
|
-
note: "
|
|
390
|
+
note: "The people named here worked on the change, so the gate counts approvals from someone else.",
|
|
391
391
|
docs: { product: "terragucci", path: "/guides/approve-a-wave/#eligible-approvers" },
|
|
392
392
|
source: "terragucci:packages/terragucci/src/apply.ts:3001",
|
|
393
393
|
sample: "wave 2 of 3: an approval counts only from someone who had no hand in the change, so not from demo-author", // made from the source, no run printed it yet
|
package/web/kiosk-approval.js
CHANGED
|
@@ -123,7 +123,7 @@ export function approvalModel({ demo, runs = [], history = null, lifecycle = nul
|
|
|
123
123
|
commit: requested && requested.source ? requested.source.commit || null : null,
|
|
124
124
|
line: reqLine,
|
|
125
125
|
});
|
|
126
|
-
} else Object.assign(reqRow, { state: "dim", text: `Wave ${wave}
|
|
126
|
+
} else Object.assign(reqRow, { state: "dim", text: `Wave ${wave} asks for an approval when it reaches its gate.` });
|
|
127
127
|
|
|
128
128
|
// Approved.
|
|
129
129
|
const apRow = { id: "approved", label: "Approved" };
|
|
@@ -159,7 +159,7 @@ export function approvalModel({ demo, runs = [], history = null, lifecycle = nul
|
|
|
159
159
|
line: start2 ? { run: resume.id, ...start2 } : found,
|
|
160
160
|
});
|
|
161
161
|
} else if (resume) {
|
|
162
|
-
Object.assign(rsRow, { state: "going", text: `/terragucci apply started the waves again; wave ${wave}
|
|
162
|
+
Object.assign(rsRow, { state: "going", text: `/terragucci apply started the waves again; wave ${wave} reaches its gate next.`, at: resume.started_at || resume.created_at, runId: resume.id, line: start2 ? { run: resume.id, ...start2 } : null });
|
|
163
163
|
} else {
|
|
164
164
|
Object.assign(rsRow, { state: "dim", text: driver && driver.comment ? `Then a comment of ${driver.comment} on ${driver.on} starts the waves again.` : "A comment of /terragucci apply starts the waves again." });
|
|
165
165
|
}
|
package/web/kiosk-popover.js
CHANGED
|
@@ -31,9 +31,9 @@ export const ACTION_HEAD = {
|
|
|
31
31
|
|
|
32
32
|
export const WORDS = {
|
|
33
33
|
same: "The plan leaves this resource as it is.",
|
|
34
|
-
untouched: "This plan
|
|
34
|
+
untouched: "This plan leaves its root as it is.",
|
|
35
35
|
noPlan: "No plan yet for this resource.",
|
|
36
|
-
unknown: "known after apply
|
|
36
|
+
unknown: "known after apply",
|
|
37
37
|
long: "too long to show here",
|
|
38
38
|
noneYet: "none yet",
|
|
39
39
|
gone: "gone",
|
|
@@ -49,11 +49,11 @@ describe("what the popover says about a resource (behold#571)", () => {
|
|
|
49
49
|
expect(p.applied).toBeNull();
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
it("says an attribute known only after apply in the unknown tone
|
|
52
|
+
it("says an attribute known only after apply in the unknown tone", () => {
|
|
53
53
|
const p = resourcePopover(answer(), "repo/app/terraform_data.listener_port");
|
|
54
54
|
expect(p.unknown).toBe(true);
|
|
55
|
-
expect(p.lines).toEqual([{ text: "input: 8070 -> known after apply
|
|
56
|
-
expect(attributeLine({ path: "input", unknown: true })).toEqual({ text: "input: known after apply
|
|
55
|
+
expect(p.lines).toEqual([{ text: "input: 8070 -> known after apply", tone: "unknown" }]);
|
|
56
|
+
expect(attributeLine({ path: "input", unknown: true })).toEqual({ text: "input: known after apply", tone: "unknown" });
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it("says no change for a card the plan leaves alone, and that a root the plan does not hold is untouched", () => {
|
package/web/kiosk.html
CHANGED
|
@@ -137,6 +137,7 @@
|
|
|
137
137
|
.k-box.k-more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.3em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.3em), transparent); }
|
|
138
138
|
.k-box.k-more-above { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 1.3em), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 1.3em), transparent); }
|
|
139
139
|
.k-box.k-more-above.k-more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 1.3em, #000 calc(100% - 1.3em), transparent); mask-image: linear-gradient(to bottom, transparent, #000 1.3em, #000 calc(100% - 1.3em), transparent); }
|
|
140
|
+
.k-box-empty { background: transparent; }
|
|
140
141
|
.k-box-title { background: transparent; padding: 0.1em 0.1em 0; overflow: hidden; }
|
|
141
142
|
/* behold#571: between scenarios the card's box carries what the demo is about. */
|
|
142
143
|
.k-intro { margin: 0; font-size: 1.12em; line-height: 1.4; color: var(--fg); }
|
|
@@ -217,6 +218,8 @@
|
|
|
217
218
|
border-radius: 8px; box-shadow: 0 6px 24px color-mix(in srgb, var(--shadow) 70%, transparent); font-size: 1.15em; line-height: 1.45; }
|
|
218
219
|
#k-what-pop[hidden] { display: none; }
|
|
219
220
|
#k-what-pop p { margin: 0; }
|
|
221
|
+
#k-what-pop .k-what-more { margin-top: 0.5em; }
|
|
222
|
+
#k-what-pop a { color: var(--focus); }
|
|
220
223
|
.k-menu summary { cursor: pointer; color: var(--muted); list-style: none; }
|
|
221
224
|
.k-menu summary::-webkit-details-marker { display: none; }
|
|
222
225
|
.k-menu summary::after { content: " ▾"; }
|
package/web/kiosk.js
CHANGED
|
@@ -137,7 +137,7 @@ export function countdownWords(secs) {
|
|
|
137
137
|
|
|
138
138
|
/** The driver's next action, as the kiosk says it. */
|
|
139
139
|
export function nextWords(demo, now = new Date()) {
|
|
140
|
-
if (!demo.next) return { action: "
|
|
140
|
+
if (!demo.next) return { action: "reset and start the next cycle", when: "the driver stalled; it resets and starts the next cycle", secs: null };
|
|
141
141
|
const secs = secondsUntil(demo.next.at, now);
|
|
142
142
|
return {
|
|
143
143
|
action: demo.next.action,
|
|
@@ -198,9 +198,9 @@ export function runPanel(demo, answer, progress) {
|
|
|
198
198
|
if (run) return { stage: "apply", run };
|
|
199
199
|
if (pr) return { stage: "pull-request", pr };
|
|
200
200
|
if (stage === "pull-request") {
|
|
201
|
-
return { stage: "pull-request", note: demo.pull === null ? "The pull request
|
|
201
|
+
return { stage: "pull-request", note: demo.pull === null ? "The pull request opens next." : `The pipeline is planning pull request #${demo.pull}.` };
|
|
202
202
|
}
|
|
203
|
-
return { stage: "apply", note: demo.commit ? `The run view of ${demo.commit.slice(0, 8)}
|
|
203
|
+
return { stage: "apply", note: demo.commit ? `The pipeline writes the run view of ${demo.commit.slice(0, 8)} as the waves start.` : "The first run starts next." };
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/** The pull request's waves and reads, when the panel shows its plan. */
|
|
@@ -584,6 +584,8 @@ function drawBar(bar, s, now, foot) {
|
|
|
584
584
|
if (panel.note) holdBox.appendChild(elRoots("p", "k-note", panel.note, s));
|
|
585
585
|
else if (panel.stage === "pull-request") for (const u of unreviewedLines(s.answer)) holdBox.appendChild(elRoots("p", "k-note k-unknown", u, s));
|
|
586
586
|
}
|
|
587
|
+
// behold#571: render what's present: an empty hold keeps its place (nothing moves when one comes) but draws no box.
|
|
588
|
+
if (!holdBox.children.length) holdBox.className += " k-box-empty";
|
|
587
589
|
right.appendChild(holdBox);
|
|
588
590
|
bar.appendChild(right);
|
|
589
591
|
|
|
@@ -642,7 +644,7 @@ export function approvalPanel(model, s = {}) {
|
|
|
642
644
|
}
|
|
643
645
|
|
|
644
646
|
/** behold#571: the header's line when this behold serves another repo than the page's. */
|
|
645
|
-
export const NO_GRAPH_WORDS = "This page shows the runs and their logs
|
|
647
|
+
export const NO_GRAPH_WORDS = "This page shows the runs and their logs.";
|
|
646
648
|
|
|
647
649
|
/** behold#571: a tool's name, and its logo where its owner allows one, linking to its official site. */
|
|
648
650
|
function brandEl(vendor) {
|
|
@@ -689,10 +691,11 @@ export const APPROVAL_POLL_MS = 4_000;
|
|
|
689
691
|
export const LEDGER_POLL_MS = 10_000;
|
|
690
692
|
|
|
691
693
|
/** behold#571: the approval panel's words for the approval the driver gives next, over its command. */
|
|
692
|
-
export const DRIVER_SIGNS = "Next the driver plays a reviewer
|
|
694
|
+
export const DRIVER_SIGNS = "Next the driver plays a reviewer outside the change and signs this plan with that reviewer's key:";
|
|
693
695
|
|
|
694
|
-
/** behold#571: "What is this?"
|
|
695
|
-
export const
|
|
696
|
+
/** behold#571: "What is this?" says what behold is; the demo's own intro stays on the card between scenarios. */
|
|
697
|
+
export const WHAT_TEXT = "This is behold, a live view of infrastructure. It draws the setup as a graph and shows its pipeline runs, their logs and the approvals they wait for, as they happen. Here it watches a demo pipeline that runs one change through several Terraform states in a loop.";
|
|
698
|
+
export const WHAT_DOCS = { text: "behold's documentation", url: "https://intentius.io/behold/" };
|
|
696
699
|
|
|
697
700
|
/** behold#571: a fade at a box's edge where its text goes on past it. */
|
|
698
701
|
function fade(b) {
|
|
@@ -959,14 +962,16 @@ export function startKiosk({ bar, frame, foot, side, main, views, tools = null }
|
|
|
959
962
|
};
|
|
960
963
|
if (tools && tools.runsToggle) tools.runsToggle.addEventListener("click", () => setRunsOpen(!document.body.classList.contains("k-runs-open")));
|
|
961
964
|
|
|
962
|
-
// behold#571: "What is this?" opens
|
|
965
|
+
// behold#571: "What is this?" opens what behold is over the page (no layout moves); a click elsewhere or Escape closes it.
|
|
963
966
|
const whatText = () => {
|
|
964
|
-
if (!tools || !tools.pop) return;
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
967
|
+
if (!tools || !tools.pop || tools.pop.firstElementChild) return;
|
|
968
|
+
const docs = el("a", null, WHAT_DOCS.text);
|
|
969
|
+
docs.href = WHAT_DOCS.url;
|
|
970
|
+
docs.target = "_blank";
|
|
971
|
+
docs.rel = "noopener";
|
|
972
|
+
const more = el("p", "k-what-more");
|
|
973
|
+
more.append(docs);
|
|
974
|
+
tools.pop.replaceChildren(el("p", null, WHAT_TEXT), more);
|
|
970
975
|
};
|
|
971
976
|
if (tools && tools.what && tools.pop) {
|
|
972
977
|
const setWhat = (open) => {
|
package/web/kiosk.test.js
CHANGED
|
@@ -81,7 +81,7 @@ describe("before the merge, no other cycle's plan (#569)", () => {
|
|
|
81
81
|
expect(matchingPull(ours, now(step))).toBe(ours.pull_request);
|
|
82
82
|
expect(focusRoots(now(step), older, null)).toBe(null);
|
|
83
83
|
expect(factLines(now(step), older)).toEqual([]);
|
|
84
|
-
expect(runPanel(now(step), older, null).note).toBe("The
|
|
84
|
+
expect(runPanel(now(step), older, null).note).toBe("The pipeline is planning pull request #989.");
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
it("from the merge on, takes the plan by its number: demo.json's commit is the merge's", () => {
|