Repository navigation
Closed
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:2Wave 2 of an epic's rollout: can start once earlier waves land
Description
A cut that keeps one resource, or every resource in one root, plus its neighbours to a given depth, upstream, downstream or both. The Backstage tab, the MCP tool and the Grafana recipe all need it. Part of #1049, phase 2.
Today
- chant has the lens
blast:<id>with--upand--down(packages/core/src/graph-lens.tsin chant), a transitive closure with no depth limit. On the scoping slice it kept 13 of 342 nodes around one GKE cluster. The generic walk ispackages/core/src/graph-walk.ts. chant workspace graphhas no--lens, and behold sends lens reads to the member's ownchant graph(workspaceGraphTakes,src/workspace.ts:297).- A static export draws only views captured at export time.
- Cut: changed between two revisions, plus neighbours #1059 adds the other cut, changed between two revisions.
Change
cutAround(doc, ids, { depth = 1, up = true, down = true })over abehold-graph/1document: a walk bounded by depth, keeping every kept node's box, marking the seeds, and settingcut: { kind: "around", ids, depth, direction }.- An id may name a box (a Terraform root). That seeds the cut with every node in the box, which is the slice the Backstage tab asks for.
- Keep an edge only when both ends are kept. Count dropped neighbours per box in
notes. - The module imports nothing from
node:*, so a browser host can call it on a fetched document. A test checks its module graph, as Move the graph pipeline out of server.ts into a library with no Hono and no global state #1057 does for Hono. behold graph --around <id>[,<id>...] [--depth n] [--up | --down]. An unknown id exits non-zero and names it.
Done when
- On
example-terraform-estate,behold graph --around <resource id> --depth 1 --json | jq '.nodes | length'prints the count a test fixes by hand for that resource and its direct neighbours. - On a three-node chain,
--upkeeps only what the seed depends on and--downonly what depends on it (test). --around <root box id>keeps every node of that root.--around no-such-idexits non-zero and prints the id.- The no-
node:import test passes.
Depends on
"behold-graph/1 document and schema". The --around flag waits on #1058. The function itself can be written against the document types before #1057 applies.
Not in this issue
The changed cut (#1059). A cut inside today's exported app, which reads captured snapshots only.
Metadata
Metadata
Assignees
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:2Wave 2 of an epic's rollout: can start once earlier waves land
Activity
lex00 commentedon Nov 15, 2026
The browser cut keyed by Kubernetes identity is filed separately for phase 4 and can start with no dependencies. The two share one walk: whichever applies second wraps the first, so there is one
cutAroundin the codebase.feat: estate-read batch 1, readGraph, graph document, contract kinds,…
feat(graph): behold graph --changed <base>..<head>, a cut of what cha…
Merge behold#1059: cut of what changed between two revisions, plus ne…
feat: estate-read batch 2, behold graph CLI and package, changed and …