@intentius/behold 0.30.1 → 0.31.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 (129) hide show
  1. package/AGENTS.md +475 -16
  2. package/README.md +25 -19
  3. package/demos.json +14 -9
  4. package/dist/cli.js +54900 -26771
  5. package/example-carve/README.md +19 -23
  6. package/example-carve/app/package.json +1 -1
  7. package/example-carve/app/src/carved.ts +3 -3
  8. package/example-carve/carve-report.json +1 -1
  9. package/example-carve/{legacy-tf → tf-root}/terraform.tfstate +1 -1
  10. package/example-choudoufu-estate/README.md +7 -0
  11. package/example-choudoufu-estate/chant.workspace.json +1 -1
  12. package/example-choudoufu-estate/scripts/choudoufu-down.sh +2 -1
  13. package/example-choudoufu-estate/scripts/choudoufu-up.sh +10 -3
  14. package/example-terraform-estate/README.md +32 -5
  15. package/example-terraform-estate/chant.workspace.json +1 -1
  16. package/example-terraform-estate/recorded/adoption/platform.json +72 -0
  17. package/example-terraform-estate/recorded/adoption/prod.json +224 -0
  18. package/example-terralith/README.md +1 -1
  19. package/example-three-cloud/README.md +111 -18
  20. package/example-three-cloud/aws/Pulumi.yaml +15 -0
  21. package/example-three-cloud/aws/index.ts +174 -0
  22. package/example-three-cloud/aws/package-lock.json +2725 -0
  23. package/example-three-cloud/aws/package.json +14 -0
  24. package/example-three-cloud/aws/tsconfig.json +17 -0
  25. package/example-three-cloud/azure/main.tf +48 -0
  26. package/example-three-cloud/azure/site.tf +104 -0
  27. package/example-three-cloud/chant.config.json +9 -0
  28. package/example-three-cloud/chant.workspace.json +30 -4
  29. package/example-three-cloud/dns/chant.config.ts +26 -1
  30. package/example-three-cloud/dns/src/records.component.ts +32 -6
  31. package/example-three-cloud/package-lock.json +48 -27
  32. package/example-three-cloud/package.json +8 -6
  33. package/example-three-cloud/scripts/emulators-up.sh +28 -1
  34. package/example-three-cloud/scripts/front-door.ts +679 -86
  35. package/package.json +13 -6
  36. package/web/adopt-pulumi.js +114 -0
  37. package/web/adopt-pulumi.test.js +28 -0
  38. package/web/adopt.js +203 -0
  39. package/web/adopt.test.js +27 -0
  40. package/web/app.js +614 -19
  41. package/web/carve-steps.js +1 -1
  42. package/web/carve-steps.test.js +2 -2
  43. package/web/change-set-overlay.js +12 -5
  44. package/web/change-set-overlay.test.js +22 -0
  45. package/web/drift-stream.js +241 -0
  46. package/web/drift-stream.test.js +146 -0
  47. package/web/edge-weight.d.ts +1 -1
  48. package/web/edge-weight.js +5 -1
  49. package/web/edge-weight.test.js +19 -0
  50. package/web/embed.js +2 -2
  51. package/web/event-help-modal.js +18 -12
  52. package/web/event-help-modal.test.js +28 -1
  53. package/web/graph-query.js +180 -0
  54. package/web/graph-query.test.js +49 -0
  55. package/web/graph.html +107 -0
  56. package/web/index-diff.js +109 -0
  57. package/web/index-diff.test.js +39 -0
  58. package/web/index.html +55 -0
  59. package/web/kiosk-ask-layout.js +85 -0
  60. package/web/kiosk-ask-layout.test.js +83 -0
  61. package/web/kiosk-ask-tips.js +477 -0
  62. package/web/kiosk-ask-tips.test.js +372 -0
  63. package/web/kiosk-ask.js +774 -0
  64. package/web/kiosk-ask.test.js +593 -0
  65. package/web/kiosk-banner.js +108 -0
  66. package/web/kiosk-banner.test.js +72 -0
  67. package/web/kiosk-center-cards.test.js +110 -0
  68. package/web/kiosk-estate-scene.js +267 -0
  69. package/web/kiosk-estate-scene.test.js +21 -0
  70. package/web/kiosk-event-help.js +4 -1
  71. package/web/kiosk-graph-pane.js +63 -0
  72. package/web/kiosk-graph-pane.test.js +105 -0
  73. package/web/kiosk-light-frame.js +197 -0
  74. package/web/kiosk-light.js +547 -0
  75. package/web/kiosk-light.test.js +297 -0
  76. package/web/kiosk-member-kind.test.js +140 -0
  77. package/web/kiosk-metrics.js +7 -4
  78. package/web/kiosk-modal-sticky.test.js +2 -1
  79. package/web/kiosk-popover.js +4 -1
  80. package/web/kiosk-refit.test.js +81 -0
  81. package/web/kiosk-reset.js +49 -0
  82. package/web/kiosk-reset.test.js +11 -0
  83. package/web/kiosk-shot.js +40 -2
  84. package/web/kiosk-shot.test.js +23 -1
  85. package/web/kiosk-side.js +296 -0
  86. package/web/kiosk-side.test.js +249 -0
  87. package/web/kiosk-vendor.js +85 -7
  88. package/web/kiosk-vendor.test.js +9 -9
  89. package/web/kiosk-watch.js +20 -4
  90. package/web/kiosk-watch.test.js +15 -1
  91. package/web/kiosk.html +153 -1
  92. package/web/kiosk.js +252 -27
  93. package/web/kiosk.test.js +25 -1
  94. package/web/member-kind.js +31 -0
  95. package/web/small-stage.test.js +4 -0
  96. package/web/template-apps.js +245 -0
  97. package/web/template-apps.test.js +252 -0
  98. package/web/templates.js +285 -0
  99. package/web/templates.test.js +155 -0
  100. package/web/terragucci-change.js +30 -13
  101. package/web/terragucci-lifecycle.js +112 -62
  102. package/web/terragucci-lifecycle.test.js +29 -1
  103. package/web/terragucci-timeline.js +39 -2
  104. package/web/terragucci-timeline.test.js +42 -1
  105. package/web/tool-mark.js +4 -4
  106. package/web/tool-mark.test.js +1 -1
  107. package/web/vendors/atmos.svg +1 -0
  108. package/web/vendors/chant.svg +1 -0
  109. package/web/vendors/choudoufu.svg +1 -0
  110. package/web/vendors/terragrunt.svg +9 -0
  111. package/web/vendors/terragucci.svg +1 -0
  112. package/example-three-cloud/aws/chant.config.ts +0 -8
  113. package/example-three-cloud/aws/site.component.ts +0 -13
  114. package/example-three-cloud/aws/src/site.ts +0 -27
  115. package/example-three-cloud/azure/chant.config.ts +0 -1
  116. package/example-three-cloud/azure/src/site.component.ts +0 -13
  117. package/example-three-cloud/azure/src/site.ts +0 -18
  118. package/web/vendors/choudoufu-128.png +0 -0
  119. package/web/vendors/choudoufu-64.png +0 -0
  120. /package/example-carve/{legacy-tf → tf-root}/cdn.tf +0 -0
  121. /package/example-carve/{legacy-tf → tf-root}/compute.tf +0 -0
  122. /package/example-carve/{legacy-tf → tf-root}/floci-override.tf.disabled +0 -0
  123. /package/example-carve/{legacy-tf → tf-root}/modules/cdn/main.tf +0 -0
  124. /package/example-carve/{legacy-tf → tf-root}/naming.tf +0 -0
  125. /package/example-carve/{legacy-tf → tf-root}/network.tf +0 -0
  126. /package/example-carve/{legacy-tf → tf-root}/observability.tf +0 -0
  127. /package/example-carve/{legacy-tf → tf-root}/outputs.tf +0 -0
  128. /package/example-carve/{legacy-tf → tf-root}/storage.tf +0 -0
  129. /package/example-carve/{legacy-tf → tf-root}/versions.tf +0 -0
@@ -22,8 +22,9 @@ function fakeDoc() {
22
22
  n.children.push(c);
23
23
  return c;
24
24
  },
25
- replaceChildren() {
25
+ replaceChildren(...kids) {
26
26
  n.children = [];
27
+ for (const k of kids) n.appendChild(k);
27
28
  },
28
29
  setAttribute(k, v) {
29
30
  n.attrs[k] = String(v);
@@ -129,6 +130,32 @@ describe("event-help modal: narrated and replayed modals never write", () => {
129
130
  });
130
131
  });
131
132
 
133
+ describe("event-help modal: the close button", () => {
134
+ it("is the same element on every redraw, so a press that spans a redraw still clicks it", () => {
135
+ const doc = fakeDoc();
136
+ const c = clock();
137
+ const m = openEventModal(doc.body, { mode: "narrated", kind: "tip", data: { title: "t", lines: [{ text: "b" }] }, doc, ...c });
138
+ const box = doc.body.children[0].children[0];
139
+ const first = box.children[0];
140
+ expect(first.className).toBe("eh-modal-close");
141
+ c.advance(1_000);
142
+ expect(box.children[0]).toBe(first);
143
+ expect(box.children.filter((n) => n.className === "eh-modal-close")).toHaveLength(1);
144
+ first.handlers.click[0]();
145
+ expect(m.state.closedBy).toBe("viewer");
146
+ });
147
+ it("dismiss() closes it as the viewer, close() as the page", () => {
148
+ const doc = fakeDoc();
149
+ const c = clock();
150
+ const a = openEventModal(doc.body, { mode: "narrated", kind: "tip", data: { title: "t" }, doc, ...c });
151
+ a.dismiss();
152
+ expect(a.state.closedBy).toBe("viewer");
153
+ const b = openEventModal(doc.body, { mode: "narrated", kind: "tip", data: { title: "t" }, doc, ...c });
154
+ b.close();
155
+ expect(b.state.closedBy).toBe("page");
156
+ });
157
+ });
158
+
132
159
  describe("event-help modal: live mode", () => {
133
160
  it("clears an Op's gate only through the route the app already calls", async () => {
134
161
  expect(approveRoute({ kind: "converge", op: "fountain-apply", gate: "rollout-gate", approve: { path: "/api/operator/approve/fountain-apply/rollout-gate" } })).toEqual({ method: "POST", path: "/api/operator/approve/fountain-apply/rollout-gate" });
@@ -0,0 +1,180 @@
1
+ /**
2
+ * behold#1027: the graph pane's page logic (web/graph.html).
3
+ *
4
+ * A Cypher box over GET /api/graphdb/query, a resolve box over
5
+ * GET /api/graphdb/resolve with the templates that apply to the node it lands
6
+ * on, and a small drawing of each answer: its nodes and the REF edges among
7
+ * them, derived edges dashed and labelled with their rule. Every answer shows
8
+ * when each source was read. The page only reads: every request it makes is a
9
+ * GET.
10
+ *
11
+ * The pure helpers are exported for web/graph-query.test.js; `initGraphPane`
12
+ * wires them to the page.
13
+ */
14
+
15
+ /** The route URL for a Cypher query and its parameters. */
16
+ export function queryUrl(cypher, params) {
17
+ const q = new URLSearchParams({ cypher });
18
+ if (params && Object.keys(params).length) q.set("params", JSON.stringify(params));
19
+ return `/api/graphdb/query?${q}`;
20
+ }
21
+
22
+ /** The route URL for resolving a resource. */
23
+ export function resolveUrl(ref) {
24
+ return `/api/graphdb/resolve?${new URLSearchParams({ ref })}`;
25
+ }
26
+
27
+ /** The route URL for one template on one node. */
28
+ export function templateUrl(name, node, inputs = {}) {
29
+ const q = new URLSearchParams({ name, node });
30
+ for (const [k, v] of Object.entries(inputs)) q.set(`in.${k}`, v);
31
+ return `/api/graphdb/template?${q}`;
32
+ }
33
+
34
+ /** One line per source: what it is and when it was read ("declared" when nothing was read live). */
35
+ export function sourceLines(sources) {
36
+ return (sources ?? []).map((s) => {
37
+ const what = `${s.member ? `${s.member}: ` : ""}${s.name}${s.version ? ` ${s.version}` : ""} (${s.source}, ${s.scopeKey})`;
38
+ const when = s.observedAt ? `observed ${s.observedAt}` : "declared source, not observed";
39
+ return `${what}: ${when}; loaded ${s.readAt}; ${s.nodes} nodes, ${s.edges} edges`;
40
+ });
41
+ }
42
+
43
+ /** Node positions on a circle, in answer order; small answers get a readable radius. */
44
+ export function circleLayout(nodes, size = 520) {
45
+ const n = nodes.length;
46
+ const r = n <= 1 ? 0 : Math.min(size / 2 - 60, 40 + n * 14);
47
+ const c = size / 2;
48
+ const at = {};
49
+ nodes.forEach((node, i) => {
50
+ const a = (2 * Math.PI * i) / Math.max(n, 1) - Math.PI / 2;
51
+ at[node.key] = { x: Math.round(c + r * Math.cos(a)), y: Math.round(c + r * Math.sin(a)) };
52
+ });
53
+ return at;
54
+ }
55
+
56
+ const esc = (s) => String(s).replace(/[&<>"']/g, (ch) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[ch]);
57
+
58
+ /** The answer's drawing as SVG text. */
59
+ export function drawSvg(draw, size = 520) {
60
+ const nodes = draw?.nodes ?? [];
61
+ if (!nodes.length) return "";
62
+ const at = circleLayout(nodes, size);
63
+ const edges = (draw.edges ?? [])
64
+ .filter((e) => at[e.from] && at[e.to])
65
+ .map((e) => {
66
+ const a = at[e.from];
67
+ const b = at[e.to];
68
+ const derived = e.origin === "derived";
69
+ const title = `${e.from} -> ${e.to}${e.viaAttr ? ` via ${e.viaAttr}` : ""}${derived ? ` (derived: ${e.rule})` : ""}`;
70
+ return `<line class="g-edge${derived ? " derived" : ""}" x1="${a.x}" y1="${a.y}" x2="${b.x}" y2="${b.y}" marker-end="url(#g-arrow)"><title>${esc(title)}</title></line>`;
71
+ })
72
+ .join("");
73
+ const dots = nodes
74
+ .map((n) => {
75
+ const p = at[n.key];
76
+ const label = n.name || n.key;
77
+ return `<g class="g-node ${esc(n.source)}"><circle cx="${p.x}" cy="${p.y}" r="7"><title>${esc(`${n.key} (${n.kind}, ${n.scopeKey})`)}</title></circle><text x="${p.x + 10}" y="${p.y + 4}">${esc(label.length > 32 ? `${label.slice(0, 29)}...` : label)}</text></g>`;
78
+ })
79
+ .join("");
80
+ return `<svg viewBox="0 0 ${size} ${size}" role="img" aria-label="answer graph"><defs><marker id="g-arrow" viewBox="0 0 10 10" refX="16" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" class="g-arrowhead"/></marker></defs>${edges}${dots}</svg>`;
81
+ }
82
+
83
+ /** A table of the answer's rows as HTML text. */
84
+ export function rowsTable(columns, rows) {
85
+ if (!rows?.length) return "<p class=\"g-muted\">No rows.</p>";
86
+ const cell = (v) => esc(typeof v === "string" ? v : JSON.stringify(v));
87
+ const head = columns.map((c) => `<th>${esc(c)}</th>`).join("");
88
+ const body = rows.map((r) => `<tr>${columns.map((c) => `<td>${cell(r[c])}</td>`).join("")}</tr>`).join("");
89
+ return `<table><thead><tr>${head}</tr></thead><tbody>${body}</tbody></table>`;
90
+ }
91
+
92
+ /** The refusal text a failed answer shows: the error, and the install line when the peer is missing. */
93
+ export function refusalText(body) {
94
+ if (!body) return "No answer.";
95
+ const lines = [body.error ?? "Refused."];
96
+ if (body.code === "graph-peer-missing") lines.push(`Install: ${body.install}`, ...(body.stillWorks ?? []).map((w) => `Still works: ${w}`));
97
+ else if (body.remedy) lines.push(body.remedy);
98
+ return lines.join("\n");
99
+ }
100
+
101
+ /* c8 ignore start: the DOM half, driven by the page */
102
+ export function initGraphPane(doc = document, fetchJson = (u) => fetch(u, { headers: { accept: "application/json" } }).then(async (r) => ({ status: r.status, body: await r.json().catch(() => ({})) }))) {
103
+ const $ = (id) => doc.getElementById(id);
104
+ const show = (answer) => {
105
+ const { status, body } = answer;
106
+ $("g-error").textContent = status === 200 ? "" : refusalText(body);
107
+ $("g-draw").innerHTML = status === 200 ? drawSvg(body.draw) : "";
108
+ $("g-rows").innerHTML = status === 200 && body.columns ? rowsTable(body.columns, body.rows) : "";
109
+ $("g-sources").textContent = sourceLines(body.sources).join("\n");
110
+ const link = $("g-link");
111
+ if (status === 200 && body.link) {
112
+ link.href = body.link;
113
+ link.hidden = false;
114
+ } else link.hidden = true;
115
+ };
116
+ const status = async () => {
117
+ const s = await fetchJson("/api/graphdb");
118
+ if (s.status !== 200) return show(s);
119
+ const peer = s.body.peer;
120
+ $("g-peer").textContent = peer?.available ? `LadybugDB ${peer.version ?? ""}`.trim() : refusalText(peer?.refusal);
121
+ $("g-counts").textContent = `${s.body.counts.resources} resources, ${s.body.counts.refs} edges (${s.body.counts.derived} derived), ${s.body.counts.cloudIds} cloud ids`;
122
+ $("g-sources").textContent = sourceLines(s.body.sources).join("\n");
123
+ $("g-notes").textContent = (s.body.notes ?? []).join("\n");
124
+ };
125
+ $("g-cypher-form").addEventListener("submit", async (ev) => {
126
+ ev.preventDefault();
127
+ let params;
128
+ const raw = $("g-params").value.trim();
129
+ if (raw) {
130
+ try {
131
+ params = JSON.parse(raw);
132
+ } catch {
133
+ $("g-error").textContent = "Parameters are a JSON object.";
134
+ return;
135
+ }
136
+ }
137
+ show(await fetchJson(queryUrl($("g-cypher").value, params)));
138
+ });
139
+ $("g-resolve-form").addEventListener("submit", async (ev) => {
140
+ ev.preventDefault();
141
+ const r = await fetchJson(resolveUrl($("g-ref").value));
142
+ show(r);
143
+ const list = $("g-candidates");
144
+ list.innerHTML = "";
145
+ if (r.status !== 200) return;
146
+ for (const c of r.body.candidates) {
147
+ const li = doc.createElement("li");
148
+ li.textContent = `${c.key} (${c.kind}, ${c.source}, matched by ${c.matchedBy})`;
149
+ list.append(li);
150
+ }
151
+ const menu = $("g-templates");
152
+ menu.innerHTML = "";
153
+ const node = r.body.resolved ? r.body.candidates[0].key : null;
154
+ for (const t of r.body.templates ?? []) {
155
+ const b = doc.createElement("button");
156
+ b.type = "button";
157
+ b.textContent = `${t.title}${t.language === "cypher" ? " (Cypher)" : ""}`;
158
+ b.disabled = !t.available;
159
+ if (!t.available) b.title = `${t.refusal} ${t.install}`;
160
+ b.addEventListener("click", async () => {
161
+ const inputs = {};
162
+ for (const i of t.inputs) {
163
+ const v = globalThis.prompt?.(`${t.title}: ${i.description}`);
164
+ if (!v) return;
165
+ inputs[i.name] = v;
166
+ }
167
+ const a = await fetchJson(templateUrl(t.name, node, inputs));
168
+ if (a.status === 200 && a.body.search) {
169
+ // A search template draws in behold's own view, through the q key.
170
+ globalThis.location.href = a.body.link;
171
+ return;
172
+ }
173
+ show(a);
174
+ });
175
+ menu.append(b);
176
+ }
177
+ });
178
+ status();
179
+ }
180
+ /* c8 ignore stop */
@@ -0,0 +1,49 @@
1
+ // behold#1027: the graph pane page's pure helpers.
2
+ import { describe, expect, it } from "vitest";
3
+ import { circleLayout, drawSvg, queryUrl, refusalText, resolveUrl, rowsTable, sourceLines, templateUrl } from "./graph-query.js";
4
+
5
+ describe("the routes the page asks", () => {
6
+ it("are GETs with the query in the URL", () => {
7
+ expect(queryUrl("MATCH (r) RETURN r", { k: "x" })).toBe(`/api/graphdb/query?${new URLSearchParams({ cypher: "MATCH (r) RETURN r", params: '{"k":"x"}' })}`);
8
+ expect(queryUrl("MATCH (r) RETURN r")).not.toContain("params");
9
+ expect(resolveUrl("arn:aws:s3:::b")).toBe("/api/graphdb/resolve?ref=arn%3Aaws%3As3%3A%3A%3Ab");
10
+ expect(templateUrl("paths-to-kind", "web/a", { kind: "aws_vpc" })).toBe("/api/graphdb/template?name=paths-to-kind&node=web%2Fa&in.kind=aws_vpc");
11
+ });
12
+ });
13
+
14
+ describe("what an answer shows", () => {
15
+ it("one line per source, saying when it was observed or that it is declared", () => {
16
+ const lines = sourceLines([
17
+ { scopeKey: "chant/web", source: "chant", name: "chant", member: "web", observedAt: null, readAt: "r", nodes: 2, edges: 1 },
18
+ { scopeKey: "engine/choudoufu/web", source: "engine", name: "choudoufu", version: "0.33.0", observedAt: "2026-10-26T12:00:00Z", readAt: "r", nodes: 6, edges: 2 },
19
+ ]);
20
+ expect(lines[0]).toMatch(/^web: chant .*declared source, not observed/);
21
+ expect(lines[1]).toMatch(/choudoufu 0.33.0 .*observed 2026-10-26T12:00:00Z/);
22
+ });
23
+
24
+ it("draws nodes and the edges among them, derived edges dashed with their rule", () => {
25
+ const svg = drawSvg({
26
+ nodes: [
27
+ { key: "a", kind: "k", name: "a", source: "chant", scopeKey: "chant/x" },
28
+ { key: "b", kind: "k", name: "b", source: "engine", scopeKey: "engine/y" },
29
+ ],
30
+ edges: [{ from: "a", to: "b", viaAttr: "arn", origin: "derived", rule: "identity:arn" }],
31
+ });
32
+ expect(svg).toContain('class="g-edge derived"');
33
+ expect(svg).toContain("identity:arn");
34
+ expect(svg.match(/<circle/g)).toHaveLength(2);
35
+ expect(drawSvg({ nodes: [], edges: [] })).toBe("");
36
+ expect(Object.keys(circleLayout([{ key: "a" }, { key: "b" }, { key: "c" }]))).toEqual(["a", "b", "c"]);
37
+ });
38
+
39
+ it("escapes what it draws", () => {
40
+ expect(rowsTable(["k"], [{ k: "<script>" }])).toContain("&lt;script&gt;");
41
+ expect(drawSvg({ nodes: [{ key: "<x>", kind: "k", name: "<x>", source: "chant", scopeKey: "s" }], edges: [] })).not.toContain("<x>");
42
+ });
43
+
44
+ it("a refusal without the peer shows the install line and what still works", () => {
45
+ const t = refusalText({ error: "needs the peer", code: "graph-peer-missing", install: "npm i -g @ladybugdb/core", stillWorks: ["chant search"] });
46
+ expect(t).toContain("Install: npm i -g @ladybugdb/core");
47
+ expect(t).toContain("Still works: chant search");
48
+ });
49
+ });
package/web/graph.html ADDED
@@ -0,0 +1,107 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>behold · graph</title>
7
+ <style>
8
+ /* behold#1027: the graph pane. Box's tokens (theme.js KIOSK_THEME) as the fallback, as terralith.html does. */
9
+ :root {
10
+ --bg: #141d2b; --panel: #213027; --line: #2e3d2a; --fg: #9fef00; --muted: #7d9e5a; --edge: #40601d;
11
+ --managed: #19cb00; --foreign: #cecb00; --pending: #0d73cc; --degraded: #cc0403; --runtime: #0dcdcd;
12
+ --well: #070f1c; --surface-box: #20242a; --surface-pane-a: #262a30;
13
+ --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
14
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
15
+ }
16
+ @media (prefers-color-scheme: light) {
17
+ :root { --bg: #f6f7f4; --panel: #ffffff; --line: #d5dacb; --fg: #1d2a12; --muted: #5d6b4f; --edge: #8aa06a; --well: #eef1e8; --surface-box: #ffffff; --surface-pane-a: #f0f2ec; }
18
+ }
19
+ * { box-sizing: border-box; }
20
+ html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font-ui); }
21
+ main { max-width: 1400px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
22
+ @media (max-width: 900px) { main { grid-template-columns: minmax(0, 1fr); } }
23
+ header { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
24
+ h1 { font-size: 18px; margin: 0; }
25
+ section { background: var(--surface-pane-a); border-radius: 8px; padding: 12px 14px; min-width: 0; }
26
+ h2 { font-size: 14px; margin: 0 0 8px; }
27
+ textarea, input { width: 100%; background: var(--well); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: 13px/1.4 var(--font-mono); }
28
+ textarea { min-height: 7em; resize: vertical; }
29
+ button { background: var(--surface-box); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; margin: 6px 6px 0 0; font: inherit; cursor: pointer; }
30
+ button:disabled { opacity: 0.5; cursor: not-allowed; }
31
+ pre { white-space: pre-wrap; font: 12px/1.4 var(--font-mono); margin: 6px 0 0; color: var(--muted); }
32
+ #g-error { color: var(--degraded); }
33
+ .g-muted { color: var(--muted); }
34
+ table { border-collapse: collapse; width: 100%; font: 12px/1.35 var(--font-mono); display: block; overflow-x: auto; }
35
+ th, td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
36
+ svg { width: 100%; height: auto; max-height: 560px; }
37
+ .g-edge { stroke: var(--edge); stroke-width: 1.4; }
38
+ .g-edge.derived { stroke-dasharray: 5 4; stroke: var(--foreign); }
39
+ .g-arrowhead { fill: var(--edge); }
40
+ .g-node circle { fill: var(--managed); }
41
+ .g-node.engine circle { fill: var(--runtime); }
42
+ .g-node.index circle, .g-node.cloud circle { fill: var(--pending); }
43
+ .g-node text { fill: var(--fg); font: 11px var(--font-mono); }
44
+ /* behold#1028: the index diff overlay. Not observed is never drawn as removed. */
45
+ .g-node.d-added circle { fill: var(--managed); }
46
+ .g-node.d-removed circle { fill: var(--degraded); }
47
+ .g-node.d-changed circle { fill: var(--foreign); }
48
+ .g-node.d-not-observed circle { fill: none; stroke: var(--muted); stroke-dasharray: 3 2; }
49
+ .g-node.d-same circle { fill: var(--edge); }
50
+ .g-edge.d-added { stroke: var(--managed); }
51
+ .g-edge.d-removed { stroke: var(--degraded); }
52
+ .g-edge.d-not-observed { stroke: var(--muted); stroke-dasharray: 3 3; }
53
+ select { background: var(--well); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 4px; font: 12px var(--font-mono); max-width: 100%; }
54
+ ul { margin: 6px 0 0; padding-left: 18px; font: 12px/1.4 var(--font-mono); }
55
+ a { color: var(--runtime); }
56
+ </style>
57
+ </head>
58
+ <body>
59
+ <main>
60
+ <header>
61
+ <h1>Graph</h1>
62
+ <span id="g-peer" class="g-muted"></span>
63
+ <span id="g-counts" class="g-muted"></span>
64
+ <a href="/">Back to the estate</a>
65
+ </header>
66
+ <section>
67
+ <h2>Cypher</h2>
68
+ <form id="g-cypher-form">
69
+ <textarea id="g-cypher" spellcheck="false" aria-label="Cypher query">MATCH (a:Resource)-[:KNOWN_AS]->(c:CloudId)&lt;-[:KNOWN_AS]-(b:Resource) WHERE a.scopeKey &lt;&gt; b.scopeKey RETURN a.key, b.key, c.value LIMIT 50</textarea>
70
+ <input id="g-params" placeholder='Parameters as JSON, such as {"k": "aws_s3_bucket"}' aria-label="Parameters" />
71
+ <button type="submit">Ask</button>
72
+ </form>
73
+ <h2 style="margin-top: 14px">Start from a resource</h2>
74
+ <form id="g-resolve-form">
75
+ <input id="g-ref" placeholder="A name, an IR id, a block address or a cloud id" aria-label="Resource" />
76
+ <button type="submit">Resolve</button>
77
+ </form>
78
+ <ul id="g-candidates"></ul>
79
+ <div id="g-templates"></div>
80
+ <pre id="g-error"></pre>
81
+ <h2 style="margin-top: 14px">What changed between two reads</h2>
82
+ <form id="d-form">
83
+ <label>Scope <select id="d-scope" aria-label="Index scope"></select></label>
84
+ <label>From <select id="d-from" aria-label="Earlier version"></select></label>
85
+ <label>To <select id="d-to" aria-label="Later version"></select></label>
86
+ <button type="submit">Diff</button>
87
+ </form>
88
+ <p id="d-hint" class="g-muted"></p>
89
+ <pre id="d-summary"></pre>
90
+ <h2 style="margin-top: 14px">Sources, and when each was read</h2>
91
+ <pre id="g-sources"></pre>
92
+ <pre id="g-notes"></pre>
93
+ </section>
94
+ <section>
95
+ <h2>Answer <a id="g-link" hidden>open in the estate view</a></h2>
96
+ <div id="g-draw"></div>
97
+ <div id="g-rows"></div>
98
+ </section>
99
+ </main>
100
+ <script type="module">
101
+ import { initGraphPane } from "./graph-query.js";
102
+ import { initIndexDiff } from "./index-diff.js";
103
+ initGraphPane();
104
+ initIndexDiff();
105
+ </script>
106
+ </body>
107
+ </html>
@@ -0,0 +1,109 @@
1
+ /**
2
+ * behold#1028: the index diff overlay on the graph pane (web/graph.html).
3
+ *
4
+ * Picks a scope and two of its versions from GET /api/graphdb/index-versions,
5
+ * asks GET /api/graphdb/index-diff, and draws the answer's overlay: added
6
+ * nodes and edges green, removed red, changed amber with the changed paths
7
+ * in the tooltip, and not-observed grey and dashed (an unobserved type is
8
+ * never drawn as removed). Both reads' stamps are shown above the drawing.
9
+ * Every request is a GET.
10
+ *
11
+ * The pure helpers are exported for web/index-diff.test.js.
12
+ */
13
+ import { circleLayout } from "./graph-query.js";
14
+
15
+ /** The diff route for a scope and two versions; empty arguments are left to the server's defaults. */
16
+ export function diffUrl(scope, from, to) {
17
+ const q = new URLSearchParams();
18
+ if (scope) q.set("scope", scope);
19
+ if (from) q.set("from", from);
20
+ if (to) q.set("to", to);
21
+ const s = q.toString();
22
+ return `/api/graphdb/index-diff${s ? `?${s}` : ""}`;
23
+ }
24
+
25
+ /** The two stamps and the counts, as lines. */
26
+ export function diffSummary(diff) {
27
+ if (!diff) return [];
28
+ const stamp = (s) => `${s.version ?? "?"}: observed ${s.observedAt}${s.completedAt ? ` to ${s.completedAt}` : ""}, digest ${String(s.digest).slice(0, 12)}`;
29
+ const c = diff.counts;
30
+ const lines = [`scope ${diff.scopeKey}`, `from ${stamp(diff.from)}`, `to ${stamp(diff.to)}`];
31
+ if (diff.unchanged) lines.push("unchanged: both reads have the same digest");
32
+ else {
33
+ lines.push(`${c.added} added, ${c.removed} removed, ${c.changed} changed (${c.properties} properties), ${c.notObserved} not observed in one read`);
34
+ lines.push(`edges: ${c.edgesAdded} added, ${c.edgesRemoved} removed, ${c.edgesNotObserved} not observed`);
35
+ }
36
+ for (const n of diff.nodes?.changed ?? []) for (const p of n.properties) lines.push(` ${n.key} ${p.path}: ${JSON.stringify(p.before)} -> ${JSON.stringify(p.after)}`);
37
+ for (const k of diff.coverage ?? []) lines.push(` coverage ${k.listedType} in ${k.location}: ${k.before ?? "absent"} -> ${k.after ?? "absent"}`);
38
+ return lines;
39
+ }
40
+
41
+ const esc = (s) => String(s).replace(/[&<>"']/g, (ch) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[ch]);
42
+
43
+ /** The overlay as SVG text. Each node and edge carries its change as a class: d-added, d-removed, d-changed, d-not-observed, d-same. */
44
+ export function drawOverlaySvg(draw, size = 520) {
45
+ const nodes = draw?.nodes ?? [];
46
+ if (!nodes.length) return "";
47
+ const at = circleLayout(nodes, size);
48
+ const edges = (draw.edges ?? [])
49
+ .filter((e) => at[e.from] && at[e.to])
50
+ .map((e) => {
51
+ const a = at[e.from];
52
+ const b = at[e.to];
53
+ return `<line class="g-edge d-${esc(e.change)}" x1="${a.x}" y1="${a.y}" x2="${b.x}" y2="${b.y}" marker-end="url(#g-arrow)"><title>${esc(`${e.from} -> ${e.to}${e.viaAttr ? ` via ${e.viaAttr}` : ""}: ${e.change}`)}</title></line>`;
54
+ })
55
+ .join("");
56
+ const dots = nodes
57
+ .map((n) => {
58
+ const p = at[n.key];
59
+ const label = n.name || n.key;
60
+ const title = `${n.key} (${n.kind}): ${n.change}${n.detail ? `, ${n.detail}` : ""}`;
61
+ return `<g class="g-node d-${esc(n.change)}"><circle cx="${p.x}" cy="${p.y}" r="7"><title>${esc(title)}</title></circle><text x="${p.x + 10}" y="${p.y + 4}">${esc(label.length > 32 ? `${label.slice(0, 29)}...` : label)}</text></g>`;
62
+ })
63
+ .join("");
64
+ return `<svg viewBox="0 0 ${size} ${size}" role="img" aria-label="index diff overlay"><defs><marker id="g-arrow" viewBox="0 0 10 10" refX="16" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" class="g-arrowhead"/></marker></defs>${edges}${dots}</svg>`;
65
+ }
66
+
67
+ /* c8 ignore start: the DOM half, driven by the page */
68
+ export function initIndexDiff(doc = document, fetchJson = (u) => fetch(u, { headers: { accept: "application/json" } }).then(async (r) => ({ status: r.status, body: await r.json().catch(() => ({})) }))) {
69
+ const $ = (id) => doc.getElementById(id);
70
+ if (!$("d-form")) return;
71
+ let scopes = [];
72
+ const fill = (sel, items, pick) => {
73
+ sel.innerHTML = "";
74
+ for (const v of items) {
75
+ const o = doc.createElement("option");
76
+ o.value = v;
77
+ o.textContent = v;
78
+ sel.append(o);
79
+ }
80
+ if (pick !== undefined) sel.value = pick;
81
+ };
82
+ const versionsFor = () => {
83
+ const s = scopes.find((x) => x.scopeKey === $("d-scope").value);
84
+ const vs = (s?.versions ?? []).map((v) => v.version);
85
+ fill($("d-from"), vs, vs[vs.length - 2]);
86
+ fill($("d-to"), vs, vs[vs.length - 1]);
87
+ };
88
+ fetchJson("/api/graphdb/index-versions").then((r) => {
89
+ if (r.status !== 200) return;
90
+ scopes = r.body.scopes ?? [];
91
+ fill($("d-scope"), scopes.map((s) => s.scopeKey));
92
+ versionsFor();
93
+ $("d-hint").textContent = scopes.length ? "" : "No index versions yet: run behold index <substrate> twice on one scope.";
94
+ });
95
+ $("d-scope").addEventListener("change", versionsFor);
96
+ $("d-form").addEventListener("submit", async (ev) => {
97
+ ev.preventDefault();
98
+ const r = await fetchJson(diffUrl($("d-scope").value, $("d-from").value, $("d-to").value));
99
+ if (r.status !== 200) {
100
+ $("g-error").textContent = `${r.body.error ?? "Refused."}${r.body.code ? ` (${r.body.code})` : ""}`;
101
+ return;
102
+ }
103
+ $("g-error").textContent = "";
104
+ $("g-rows").innerHTML = "";
105
+ $("g-draw").innerHTML = drawOverlaySvg(r.body.draw);
106
+ $("d-summary").textContent = [...diffSummary(r.body.diff), r.body.chantStore ? `read through chant's ${r.body.chantStore.kind} store` : "", r.body.draw.omitted ? `${r.body.draw.omitted} unchanged nodes not drawn` : ""].filter(Boolean).join("\n");
107
+ });
108
+ }
109
+ /* c8 ignore stop */
@@ -0,0 +1,39 @@
1
+ // behold#1028: the index diff overlay's pure helpers.
2
+ import { describe, expect, it } from "vitest";
3
+ import { diffSummary, diffUrl, drawOverlaySvg } from "./index-diff.js";
4
+
5
+ describe("the overlay", () => {
6
+ it("asks a GET with only the arguments given", () => {
7
+ expect(diffUrl()).toBe("/api/graphdb/index-diff");
8
+ expect(diffUrl("cloud/aws/1/abc", "a.json", "")).toBe("/api/graphdb/index-diff?scope=cloud%2Faws%2F1%2Fabc&from=a.json");
9
+ });
10
+
11
+ it("draws each change as a class, and not observed is never drawn as removed", () => {
12
+ const svg = drawOverlaySvg({
13
+ nodes: [
14
+ { key: "a", kind: "k", name: "a", change: "changed", detail: "attrs.x" },
15
+ { key: "b", kind: "k", name: "b", change: "not-observed" },
16
+ ],
17
+ edges: [{ from: "a", to: "b", change: "not-observed" }],
18
+ });
19
+ expect(svg).toContain('class="g-node d-changed"');
20
+ expect(svg).toContain('class="g-node d-not-observed"');
21
+ expect(svg).toContain('class="g-edge d-not-observed"');
22
+ expect(svg).not.toContain("d-removed");
23
+ });
24
+
25
+ it("shows both stamps and each changed property", () => {
26
+ const lines = diffSummary({
27
+ scopeKey: "cloud/aws/1/abc",
28
+ from: { version: "v1", observedAt: "t1", digest: "a".repeat(64) },
29
+ to: { version: "v2", observedAt: "t2", digest: "b".repeat(64) },
30
+ unchanged: false,
31
+ counts: { added: 0, removed: 0, changed: 1, properties: 1, notObserved: 0, edgesAdded: 0, edgesRemoved: 0, edgesNotObserved: 0 },
32
+ nodes: { changed: [{ key: "n", properties: [{ path: "attrs.x", before: 1, after: 2 }] }] },
33
+ coverage: [],
34
+ });
35
+ expect(lines[1]).toMatch(/^from v1: observed t1/);
36
+ expect(lines[2]).toMatch(/^to {3}v2: observed t2/);
37
+ expect(lines).toContain(" n attrs.x: 1 -> 2");
38
+ });
39
+ });
package/web/index.html CHANGED
@@ -10,6 +10,9 @@
10
10
  applies that record when it belongs to the stored theme. A blocked or
11
11
  empty store leaves the default as it is. -->
12
12
  <script>
13
+ // The kiosk's frame (?bare=1) paints nothing until its theme is applied, so the kiosk's own ground shows through:
14
+ // the stylesheet's default --bg is white, and a first load with no stored paint flashed it over a dark pane.
15
+ try { if (/[?&]bare=1(&|$)/.test(location.search)) document.documentElement.style.setProperty("--bg", "transparent"); } catch (e) { /* the default paints */ }
13
16
  try {
14
17
  var beholdTheme = localStorage.getItem("behold.theme");
15
18
  var beholdPaint = beholdTheme && JSON.parse(localStorage.getItem("behold.theme.paint") || "null");
@@ -339,6 +342,39 @@
339
342
  #tab-trunk a { color: inherit; }
340
343
  #tab-trunk .lane-change-set { color: var(--pending); }
341
344
  /* behold#685: a plan run locally, beside CI's, in the runs pane's run view (web/kiosk-runs.js renderRun; kiosk.html's rules, scoped). */
345
+ #panel-body #tab-adopt.active { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-caption); }
346
+ #tab-adopt h3 { margin: var(--s3) 0 0; font-size: var(--t-caption); overflow-wrap: anywhere; }
347
+ #tab-adopt .tg-legend { color: var(--muted); overflow-wrap: anywhere; }
348
+ #tab-adopt .tg-refusal { color: var(--degraded); font-weight: 600; overflow-wrap: anywhere; }
349
+ #tab-adopt .ad-card { border-top: 1px solid var(--rule); padding-top: var(--s2); display: flex; flex-direction: column; gap: var(--s1); }
350
+ #tab-adopt .ad-label { font-weight: 600; margin-top: var(--s2); }
351
+ #tab-adopt .ad-list { margin: 0; padding-left: 1.2em; }
352
+ #tab-adopt .ad-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
353
+ #tab-adopt .ad-cmd { font-family: var(--font-mono); overflow-wrap: anywhere; cursor: copy; }
354
+ #tab-adopt .ad-recorded { font-style: italic; }
355
+ #tab-adopt .ad-out { font: 0.95em/1.45 var(--font-mono); white-space: pre-wrap; max-height: 12em; overflow-y: auto; }
356
+ #tab-adopt .ad-table { border-collapse: collapse; width: 100%; }
357
+ #tab-adopt .ad-table td, #tab-adopt .ad-table th { text-align: left; padding: 2px var(--s2) 2px 0; vertical-align: top; border-top: 1px solid var(--rule); }
358
+ #tab-adopt .ad-addr { font-family: var(--font-mono); overflow-wrap: anywhere; }
359
+ #tab-adopt .ad-claimed .ad-status { color: var(--managed); } #tab-adopt .ad-left-out .ad-status { color: var(--foreign); } #tab-adopt .ad-unknown .ad-status { color: var(--degraded); }
360
+ #tab-adopt .ad-refused { color: var(--degraded); }
361
+ /* behold#1035: the Templates tab (web/templates.js), drawn like Adopt. */
362
+ #panel-body #tab-templates.active { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-caption); }
363
+ #tab-templates h3 { margin: var(--s3) 0 0; font-size: var(--t-caption); overflow-wrap: anywhere; }
364
+ #tab-templates .tg-legend { color: var(--muted); overflow-wrap: anywhere; }
365
+ #tab-templates .tg-refusal { color: var(--degraded); font-weight: 600; overflow-wrap: anywhere; }
366
+ #tab-templates .ad-card { border-top: 1px solid var(--rule); padding-top: var(--s2); display: flex; flex-direction: column; gap: var(--s1); }
367
+ #tab-templates .ad-label { font-weight: 600; margin-top: var(--s2); }
368
+ #tab-templates .ad-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
369
+ #tab-templates .tp-form { display: flex; flex-direction: column; gap: 2px; }
370
+ #tab-templates .tp-form input[type="text"], #tab-templates .tp-form input[type="number"], #tab-templates .tp-form textarea { font: inherit; max-width: 100%; }
371
+ #tab-templates .tp-form textarea { min-height: 4em; font-family: var(--font-mono); }
372
+ #tab-templates .tp-request { align-self: flex-start; }
373
+ #tab-templates .tp-all { align-self: flex-start; }
374
+ /* behold#1036: an app's part of the inspect pane (web/template-apps.js). */
375
+ #inspect-body .tpl-app .tpl-app-fact { margin: 2px 0; overflow-wrap: anywhere; }
376
+ #inspect-body .tpl-app .tpl-app-buttons { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
377
+ #inspect-body .tpl-app .tpl-app-result { overflow-wrap: anywhere; }
342
378
  #panel-body #tab-local-runs.active { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-caption); }
343
379
  #tab-local-runs h3 { margin: var(--s3) 0 0; font-size: var(--t-caption); }
344
380
  #tab-local-runs .tg-legend { color: var(--muted); overflow-wrap: anywhere; }
@@ -982,6 +1018,10 @@
982
1018
  filled — the fill is the status channel and this card has no status yet,
983
1019
  so colouring it would claim an observation behold has not made. */
984
1020
  #graph [data-pending-read] { opacity: 0.55; }
1021
+ /* behold#998: a card a started drift read has not reported yet. Not a
1022
+ status, so the fill is left as it was; the stream's record paints it. */
1023
+ #graph [data-drift-reading] { opacity: 0.6; }
1024
+ #graph [data-drift-reading] rect { stroke-dasharray: 3 3; }
985
1025
  #graph [data-pending-read] rect { stroke-dasharray: 4 3; }
986
1026
  @media (prefers-reduced-motion: no-preference) {
987
1027
  #graph [data-pending-read] { animation: pending-breathe calc(var(--beat) * 2) ease-in-out infinite; }
@@ -1056,6 +1096,21 @@
1056
1096
  #graph [data-node-id][data-q="lit"] rect:first-of-type { stroke: var(--pending); stroke-width: 3; }
1057
1097
  #graph [data-node-id][data-q="path"] rect:first-of-type { stroke: var(--pending); stroke-width: 1.5; }
1058
1098
  #graph g[data-edge-from][data-q="path"] path:first-of-type { stroke: var(--pending); stroke-width: 2.5; }
1099
+ /* behold#937: a demo step's lighting (web/kiosk-light-frame.js), the look of the query's lit and dimmed under its own marks. */
1100
+ /* behold#940: ask mode shows the graph and the prompt alone: no trace button between prompts, no zoom rail. */
1101
+ html.kiosk-ask #view-toggles, html.kiosk-ask .dots-rail { display: none !important; }
1102
+ /* behold#942: and no hint line ("cards shrinking to dots"), tooltip or text strip over the graph. */
1103
+ html.kiosk-ask .dots-caption, html.kiosk-ask .dots-tip, html.kiosk-ask #b-tip, html.kiosk-ask #nowline, html.kiosk-ask #export-note { display: none !important; }
1104
+ /* The card tags ("~ plan · 4d") sit where the slots go, and an edge that is not lit crosses boxes to nowhere a viewer reads. */
1105
+ html.kiosk-ask #graph [data-tg-mark], html.kiosk-ask #graph g[data-edge-from]:not([data-kl="path"]) { display: none !important; }
1106
+ #graph [data-kl="dim"] { opacity: .22; transition: opacity .15s; }
1107
+ #graph [data-node-id][data-kl="lit"] rect:first-of-type { stroke: var(--pending); stroke-width: 3; }
1108
+ #graph g[data-edge-from][data-kl="path"] path:first-of-type { stroke: var(--pending); stroke-width: 3; }
1109
+ #graph line[data-kl="path"] { stroke-width: 3.5; }
1110
+ @keyframes kl-pulse { 0% { opacity: 1; } 35% { opacity: .35; } 70% { opacity: 1; } 100% { opacity: 1; } }
1111
+ #graph [data-node-id][data-kl-pulse] { animation: kl-pulse .9s ease-in-out 1; }
1112
+ @keyframes kl-strike { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
1113
+ #graph .kl-strike { stroke-dasharray: 1; stroke-dashoffset: 1; animation: kl-strike .7s ease-out 1.4s forwards; }
1059
1114
  #graph [data-node-id][data-q-near] { opacity: .6; }
1060
1115
  #graph [data-node-id][data-q-near] rect:first-of-type { stroke: var(--ink2); stroke-width: 1.5; stroke-dasharray: 3 2; }
1061
1116
  #graph [data-node-id][data-q-unobserved] rect:first-of-type { stroke: var(--degraded); stroke-dasharray: 5 3; }