Skip to content

fix(claude): statusline says "not built" at a built workspace root - #851

Draft
hr1juldey wants to merge 1 commit into
trailhq:mainfrom
hr1juldey:fix/817-workspace-statusline
Draft

hr1juldey wants to merge 1 commit into
trailhq:mainfrom
hr1juldey:fix/817-workspace-statusline

Conversation

@hr1juldey

Copy link
Copy Markdown

Fixes #817.

Problem

trail build at a workspace parent splits the map into the child repos and leaves only workspace.json there, but resolveStats() in src/claude/statusline.ts reads only the parent's own stats.json / wiring.json — both absent at the parent — so the statusline rendered not built forever and sent people off to rebuild a built workspace.

Fix

resolveStats falls back to the workspace index and sums the built children:

  • Read directly (resolveContextDir(dir) + workspace.json, {version: 1, children: [...]} schema from graph/workspace.ts) — no graph/workspace.js import, so the statusline stays the pure read it is today.
  • Children whose stats are missing or empty are skipped; a workspace with no built children still reads as "not built".
  • Cache → wiring → workspace precedence: existing single-repo behavior is untouched.

Tests

Two regression tests in the existing test/claude-statusline.test.ts: a parent with two built children sums to 22 nodes / 44 edges; a workspace with no built children stays null. Full suite: 4550 tests, the only delta is these two — the six failures present on clean main (49d36b7) are unchanged and pre-date this branch.

resolveStats only read the project dir's own cache and graph, but a
workspace build splits the map into the child repos and leaves only
workspace.json at the parent, so the parent rendered "not built" no
matter how often it was rebuilt. Fall back to the workspace index and
sum the built children, read directly to keep the statusline a pure
read; children without stats are skipped, none built still reads as
not built.

Fixes trailhq#817
@github-actions

Copy link
Copy Markdown
Contributor

🌱 graft blast radius

Nothing outside this diff depends on it. 1 area changed; no indexed dependents at depth 2.
Tests: 1 area updated its tests.
Tag: @anirudhkumar-nanonets — Workspace Status Display · @shhdwi — Workspace Status Display

Who knows this code — 2 people across 1 area
Area Who knows it
Workspace Status Display · changed @anirudhkumar-nanonets — 2 commits, last 11d ago · @shhdwi — 3 commits, last 4mo ago

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

Test signal per changed area — 1 ✓

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • ✓ Workspace Status Display — 1 of 2 reached · 1 test file changed here: test/claude-statusline.test.ts
    • not reached: workspaceStats

graft blast · origin/main...HEAD · depth 2 · 2 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Statusline always shows "not built" at a workspace root, even after a successful build

1 participant