Skip to content

feat(cli): tree export-graph + demo recording for mindmap M1 (Refs ST-6) - #426

Open
serenakeyitan wants to merge 1 commit into
devfrom
feat/st-9-export-graph-demo
Open

feat(cli): tree export-graph + demo recording for mindmap M1 (Refs ST-6)#426
serenakeyitan wants to merge 1 commit into
devfrom
feat/st-9-export-graph-demo

Conversation

@serenakeyitan

Copy link
Copy Markdown
Contributor

Summary

Lands M1: Data export + demo recording for the live mindmap (parent: ST-4, engineer brief: ST-6, milestone: ST-9).

  • New CLI: first-tree tree export-graph [--out graph.json] [--root .] [--repo owner/repo] — walks a Context Tree, parses NODE.md frontmatter (title / owners / tags / kind / soft_links), emits the v1 graph schema from ST-4 §2.1.
  • Parent edges derive from the path hierarchy; link edges come from soft_links frontmatter and are dropped when the target node does not exist.
  • Bundled demo at `apps/doc-website/public/demo/` (mirrored at `docs/public/demo/` so VitePress actually serves it):
    • `graph.json` (24 nodes, 26 edges — 4 domains, decisions, constraints)
    • `trace.jsonl` (128 navigation events, 4 agents, ~60s loop, matches the live-event shape in ST-4 §2.2)
    • `index.html` — standalone canvas + d3-force renderer; no live trace yet, no polish, as scoped for M1.
  • Demo content is hand-crafted while the canonical demo tree (ST-7 PM deliverable) is in flight; regenerate with `apps/cli/scripts/generate-demo-{graph,trace}.mjs`.

Refs ST-6, ST-9.

Acceptance (from ST-9)

  • `first-tree tree export-graph --out graph.json` ships at `apps/cli/src/commands/tree/export-graph.ts` with unit tests
  • Output matches schema in ST-4 §2.1 (version, repo, nodes[], edges[])
  • Bundled demo JSONL recording exists at `apps/doc-website/public/demo/trace.jsonl` (~60s loop, 4 agents, ≥120 events — actual: 128)
  • Static graph renders in a throwaway page from `graph.json` (no live yet, no polish)
  • PR opened against `dev` and links `Refs ST-6`

Test plan

  • `pnpm --filter first-tree typecheck` clean
  • `pnpm --filter first-tree test` — 125 passing (5 new `export-graph` tests)
  • `pnpm --filter @first-tree/github-scan test` — 498 passing (unchanged)
  • CLI smoke test: `node apps/cli/dist/index.js tree export-graph --help` shows the new options
  • CLI smoke test: `node apps/cli/dist/index.js tree export-graph --root . --out /tmp/g.json` produces valid JSON against this very repo (39 nodes, 0 edges — expected, since this source repo is not itself a Context Tree)
  • Open `apps/doc-website/docs/public/demo/index.html` in a browser via `pnpm --filter doc-website docs:dev` and confirm the static graph renders

Adds `first-tree tree export-graph --out graph.json` that walks a Context
Tree, parses NODE.md frontmatter (title/owners/tags/kind/soft_links), and
emits the v1 graph schema from ST-4 §2.1 (version, repo, generated_at,
nodes[], edges[]). Parent edges derive from the path hierarchy; link edges
come from soft_links frontmatter.

Bundles a hand-crafted demo for the throwaway mindmap page at
`apps/doc-website/public/demo/` (mirrored at `docs/public/demo/` so
VitePress serves it):
- graph.json (24 nodes / 26 edges, 4 domains + decisions + constraints)
- trace.jsonl (128 navigation events, 4 agents, ~60s loop)
- index.html (standalone canvas/d3-force renderer, no live yet)

Demo content is hand-crafted while the canonical demo tree (ST-7 PM
deliverable) is in flight; assets are regenerated by
`apps/cli/scripts/generate-demo-{graph,trace}.mjs`.

Refs ST-6, ST-9
@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
first-tree-doc-website Ready Ready Preview, Comment May 12, 2026 10:54pm

Request Review

@serenakeyitan serenakeyitan added github-scan:wip github-scan: work in progress github-scan:done github-scan: handled and removed github-scan:wip github-scan: work in progress labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github-scan:done github-scan: handled

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant