Skip to content

feat: estate-read batch 3, SVG, the GitHub Action, graph.json, MCP view, Grafana, Headlamp, viewer (#1061 #1062 #1071 #1073 #1075 #1084 #1070) - #1092

Merged
lex00 merged 8 commits into
mainfrom
estate/int-behold-3
Nov 15, 2026
Merged

lex00 merged 8 commits into
mainfrom
estate/int-behold-3

Conversation

@lex00

@lex00 lex00 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Closes #1061
Closes #1071
Closes #1073
Closes #1075
Closes #1084
Part of #1062 (real runs in a test repository, behold-action, and the @intentius/behold-graph publish are maintainer steps)
Part of #1070 (the CI build step waits on INTENTIUS/pinhole#133 and pinhole 0.6.0)

Batch 3 of the estate-read work in behold (INTENTIUS/chant#5105, epic #1049). Batch 2 was squash-merged, so this branch was rebuilt on main from each issue's own changes.

#1061: SVG written to a file

  • behold graph example-terraform-estate --svg -o out.svg is byte-identical to Separate the painter from Node so renderGraph bundles for a browser (behold, pinhole) #1069's /api/graph snapshot.
  • grep -c 'href="http' prints 0, and there is no foreignObject.
  • --theme dark and --theme light differ, and dark is the default.
  • A flat layout over 400 cards is refused with exit 1, and boxes or a cut are suggested instead. Measured paint time: 400 cards take 10.5 s, 500 take 36 s.
  • Sizes: example-terraform-estate is 127 KB, and kubernetes/k8s.io's infra/ (609 cards, boxed) is 1.54 MB in 31 s. Both are well under the 10 MB image limit.

The painter shows a plan's change. It does not show a cut's seed, which the docs say.

#1062: the GitHub Action (in action/)

  • The job summary carries the count line, the Mermaid block and artifact links (action/test/action.test.ts, on a temp git repo read through the real Terraform reader).
  • One comment, found by its marker across pages and edited on each push. Above budget it becomes a per-root table under 60,000 characters.
  • SVG and JSON artifacts (upload-artifact pinned to the v7 sha, archive: false).
  • A fork run makes no API call and still writes the summary and artifacts. A mode: post-comment workflow posts the comment, refusing a stale head sha, a bad pull request number, a missing marker or an oversize body.
  • Real runs in a test repository, behold-action and the publish of @intentius/behold-graph. Maintainer steps. action/README.md lists what moves to behold-action.

action.yml is a composite action, not node24, so it can call upload-artifact without bundling the artifact toolkit. The fixtures follow the REST docs, and nothing was posted anywhere.

#1071: export writes graph.json

  • behold export example-terraform-estate --out x writes a valid x/graph.json (37 nodes), validated against the schema.
  • Its node count equals the opening view's snapshot IR. For an estate this is the alike=0 snapshot (37), not the stacked view (30), so the document drops no resource.
  • --no-source drops the source text.
  • graph.json is listed in manifest.json and carried in each --publish folder.
  • The multi-file export is unchanged.
  • behold.html from file:// and --single-file on the 49-root folder. The seam (src/single-file.ts) is tested with a fake viewer. Waiting on Single-file viewer build: data by message, layout in a worker, size budget #1070's viewer build, which waits on pinhole 0.6.0.

#1073: MCP returns a visual view

  • In Claude Code, a call returns a summary, Mermaid and a link under 10,000 tokens. On the 49-root infra/ it is about 1,100 tokens, as the roots table.
  • MCP Inspector lists ui://behold/viewer with MIME text/html;profile=mcp-app.
  • A test asserts that the model-facing content holds no node list.
  • The view inline in Claude Desktop or VS Code Copilot. It serves Single-file viewer build: data by message, layout in a worker, size budget #1070's viewer once that is built, and a screenshot needs a person in a real host.

#1075: Grafana recipe

  • The hand check is recorded on Grafana recipe: node graph panel and Infinity reading graph.json #1075: Grafana 13.0.2 with Infinity 4.1.6. The Default parser works, and hex color is accepted as it is.
  • The dashboard draws example-terraform-estate from graph.json over http (37 nodes, 31 edges).
  • A click opens the viewer on that node.
  • More than 200 nodes: the page points at a smaller file, one root's export or behold graph --around.

#1084: Headlamp plugin

  • A role node is linked to its ServiceAccount in Headlamp's Resource Map. The "Outside the cluster" section on the ServiceAccount page shows the role (e2e/headlamp-e2e.sh against a scratch k3d cluster, on Headlamp's web image).
  • The tarball checksum matches artifacthub-pkg.yml. scripts/package.mjs packs it reproducibly.
  • Listed on Artifact Hub. Maintainer steps are numbered in surfaces/headlamp-behold/README.md.

#1070 (code): single-file viewer

  • Sizes are 134.5 KB (48.2 KB gzipped) per script and 406 KB for the directory, all under budget.
  • It draws from file://, and fed by message under default-src 'none'; script-src 'self', with no violation. No EventSource or WebSocket is used.
  • First paint on kubernetes/k8s.io infra/ (609 cards): 688 ms, with layout in a worker.
  • The CI build step waits on pinhole 0.6.0. It stays on estate/1070-single-file-viewer, and three browser tests skip until then.

Gates on this branch

  • just check: 365 files passed. The one failure was graph-changed.test.ts's leak check, which read the shared temp folder and caught another run's behold-rev-* directory. It now gives each test a temp root of its own, and all 13 pass.
  • npx vitest run action/test: 17 passed.

…tion (estate/1062-action, which merged estate/1061-svg-file)
…nt with no server (#1070)

npm run build:viewer writes dist/behold-viewer: index.html with no inline
script, viewer.js as a classic script and viewer.mjs as an ES module,
viewer.css, a stand-in graph.js, and viewer.html with everything inlined.

The document comes from a behold:graph message, from graph.js setting
window.__BEHOLD_GRAPH__, or from a same-origin ?src=. It is turned back into
the graph IR and drawn with the renderGraph and box badges /api/graph uses.
Options come from the query string and from window.__BEHOLD_VIEWER__. Three
transports: a parent page (postMessage, origin checked), a VS Code webview
(acquireVsCodeApi) and an MCP Apps view (JSON-RPC over postMessage). Out:
behold:select {id, kind, file}.

The layout runs in a Web Worker started from the viewer's own script, and on
the page when no worker starts. A document with no boxes above 300 cards is
refused, from measurement on the kubernetes/k8s.io infra/ document.

The vendored icon table stays out of the build. A host hands over the icons
its document uses (graphScript and documentIcons write and find them), and an
icon it did not hand over falls through to pinhole's keyword glyph. The build
prints its sizes and fails above 300 KB minified or 100 KB gzipped per
script, above 1 MB for the directory, on a Node built-in, and on EventSource
or WebSocket in viewer.js.

Part of #1070
@lex00
lex00 merged commit d466d06 into main Nov 15, 2026
3 checks passed
@lex00
lex00 deleted the estate/int-behold-3 branch November 15, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant