Repository navigation
Closed
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:1Wave 1 of an epic's rollout: can start once earlier waves land
Description
chant workspace graph reads a repository only when it has a chant.workspace.json. Any tool that wants the graph of a plain infrastructure repo must write a declaration first. behold does that today, for Terraform only, in its temp directory. --discover runs the kinds' probes under a directory and composes what they find as if a declaration listed it, and writes nothing inside the directory. Part of #5094 and INTENTIUS/behold#1049, phase 1.
Today
- With no declaration,
locateWorkspace(packages/core/src/workspace/which-chant.ts) fails withdeclaration-missing. - The pieces exist.
resolveKind(packages/core/src/workspace/kinds.ts) picks a directory's kind by probe and precedence and reports ties. Reader projects are written outside the workspace (kind-readers.ts), and the member cache lives in the user's cache directory (graph-cache.ts). loadKindRegistry(pins, workspaceRoot)takes its pins from the declaration.- The
terraformprobe matches any*.tffile, so it would also claim a local module directory. - behold's workaround writes
behold-tf-<hash>andbehold-tfws-<hash>under the OS temp directory (beholdsrc/terraform-member.ts). It reads 49 roots in 2.1 s.
Change
- Add
--discover. Walk<dir>, skipping.gitandnode_modules, resolve each directory withresolveKind, and compose through the same path as a declared read.--member,--detailand--no-cachekeep working. - Name each member from its path relative to
<dir>, so names stay stable across revisions. Member names cannot hold/. - A directory that a root calls through a local
sourceis a module and does not become a member. - Add an additive
discoveredlist giving each member's directory, kind and probe, plus every tie. - Decisions for the implementer: which installed packages supply kinds, whether
--atis supported, and what happens when a declaration exists.
Done when
- Fixture
fx/:infra/net/main.tf(a provider and a resource, calling../modules/vpc),infra/modules/vpc/main.tf, andargo/app.yaml(an Application).chant workspace graph fx --discoverprints a contract-1 document with membersinfra/netandargo, and none for the module. - A file listing and content hash of
fx/are identical before and after the run. - A directory claimed by two kinds of equal precedence appears in
discoveredwith both kinds and is not read. - With no declaration, the command without
--discoverstill fails withdeclaration-missing. - The output validates against
packages/core/src/workspace/graph.schema.json.
Depends on
Nothing.
Not in this issue
Switching behold's reader to --discover, which is a behold issue.
Metadata
Metadata
Assignees
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:1Wave 1 of an epic's rollout: can start once earlier waves land
Activity
feat: estate-read batch 1, discover, manifests kind, reference catalo…