vscode: builder row legibility — phase prefix + gate-specific icons - #941
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIR Review: VSCode builder row legibility — phase prefix + gate-specific icons
Fixes #810
Summary
The Builders tree now leads each row with the coarse protocol phase (
[plan]/[implement]/[review]) immediately after the icon, and dispatches a gate-specific codicon for blocked builders (book / checklist / play / git-pull-request / verified, with abellfallback) while keeping the warning-yellow color uniform. Both changes make protocol state legible at a glance — phase across all three row states (not just active rows, where it was previously a truncation-prone trailing suffix), and gate type via icon shape (previously a single generic bell for every gate). A newprotocolPhasewire field was added so the prefix shows the true high-level phase instead of the low-level plan sub-phase id that the collapsedphasefield carries.Preview
Files Changed
packages/vscode/src/views/builder-row.ts(+90 / -0) — new pure, vscode-free module:gateIconFor,builderRowLabel,timeSincepackages/vscode/src/views/builders.ts(+7 / -21) —makeBuilderRowdelegates to the helpers; localtimeSinceremovedpackages/vscode/src/__tests__/builder-row.test.ts(+134 / -0) — new unit suite (label states, empty-phase edge, sub-phase→implement, gate mapping, regression guards)packages/types/src/api.ts(+15 / -0) —OverviewBuilder.protocolPhasefield + docspackages/codev/src/agent-farm/servers/overview.ts(+18 / -0) — populateprotocolPhaseat the 3 push sites; add it to the localBuilderOverviewinterfacepackages/dashboard/__tests__/BuilderCard.test.tsx(+1 / -0) — fixture fieldpackages/dashboard/__tests__/NeedsAttentionList.test.tsx(+1 / -0) — fixture fieldpackages/codev/src/agent-farm/__tests__/e2e/spec-823-builder-attribution.test.ts(+1 / -0) — mock fieldcodev/resources/lessons-learned.md— dual-type footgun entry (see Lessons Learned)codev/plans/810-vscode-builder-row-legibility.md,codev/state/pir-810_thread.md— plan + threadCommits
82aeff84[PIR vscode: builder row legibility — phase prefix + gate-specific icons for at-a-glance protocol/state visibility #810] Phase prefix + gate-specific icons for builder rows1535e4c2[PIR vscode: builder row legibility — phase prefix + gate-specific icons for at-a-glance protocol/state visibility #810] Show coarse protocolPhase in row prefix, not plan sub-phase ida77a4b4a[PIR vscode: builder row legibility — phase prefix + gate-specific icons for at-a-glance protocol/state visibility #810] Lead the row label with the phase prefix, before the issue id8e69aa48[PIR vscode: builder row legibility — phase prefix + gate-specific icons for at-a-glance protocol/state visibility #810] Add protocolPhase to the local BuilderOverview interfaceTest Results
pnpm --filter @cluesmith/codev build✓; vscodecheck-types✓,lint✓,esbuild✓pnpm test:unit(vscode): ✓ 123 passed (10 new inbuilder-row.test.ts)pnpm test(dashboard): 314 passed, 1 pre-existing unrelated failure (scrollController.test.ts, Issue Bug: Terminal scroll-to-top caused by xterm parsing errors and WebGL context loss #630) — see Flaky Testsdev-approvalgate): ran the worktree dev server, confirmed phase prefix renders the coarse phase and gate icons dispatch per gate. The reviewer drove two design refinements during this gate (see Things to Look At).Architecture Updates
No
arch.mdchanges needed.arch.mddocumentsstatus.yamlfields (current_plan_phase) but not the/api/overviewprojection shape, so the newprotocolPhasefield doesn't intersect any documented architectural boundary or pattern — it's an additive field on an existing wire type, not a structural change.Lessons Learned Updates
Added one entry to
codev/resources/lessons-learned.md(Architecture): the builder-overview shape is defined twice — theOverviewBuilderwire type and a hand-synced localBuilderOverviewinterface inoverview.ts— and the codev package has nocheck-typesscript, so a field added only to the wire type passes client type-checks but breaks the codev build at the server push sites, invisible until a fullpnpm build. This bit this PR directly (the dev-approval build error). Recording it so the next person touching the overview projection builds the codev package, not just the client type-check.Things to Look At During PR Review
protocolPhasevsphase(the core design decision). The issue assumed the prefix could useb.phase, butphaseis collapsed inoverview.ts— it preferscurrent_plan_phase(a free-form plan sub-phase id likephase_0_rebase_onto_ci) over the protocol phase, because the dashboard matches that id againstplanPhasesto render sub-phase progress (BuilderCard.tsx:23). So the prefix would have leaked low-level slugs. The fix exposes the protocol phase as its own field (protocolPhase = parsed.phase), leavingphaseuntouched so the dashboard is unaffected. A rejected alternative — a vscode-only heuristic mappingphase→implementwhen it matches aplanPhasesid — was discarded because it encodes an unproven protocol invariant in the view layer. Verify the dashboard's(1/4)progress still readsphaseand is unchanged.[<phase>] #<id> <title>), not the issue's written "immediately after the issue number." This was a deliberate reviewer call at the dev-approval gate: phase-first pins the phase bracket to a fixed offset after the icon so the phase column scans straight down (issue ids vary in width, which would otherwise make it jiggle). Noted that the "icon represents phase" rationale only strictly holds for blocked rows (active/idle icons are generic).b.blockedGate, notb.blocked.b.blockedis a human-readable label ("plan review");b.blockedGateis the canonical gate name ("plan-approval"). Keying off the label would silently no-op (every row → bell). There's a regression test assertinggateIconFor('plan review') === 'bell'. Theverify-approvalgate (Needs Attention: surface PRs via the universal pr gate; delete gateless builder-derived fallbacks #927) was added to the map (the issue's draft omitted it).builderRowLabeltakesisIdleas a parameter rather than importingisIdleWaitingfrom codev-core, so the unit suite runs under vitest against source without needing codev-core built. The caller already computesisIdle.How to Test Locally
pir-810→ View Diffafx dev pir-810(reload the VSCode window after a rebuild to pick up the extension)[<protocol-phase>]right after the icon —plan/implement/review, never aphase_*slugcomment-discussion) and active (circle-filled) icons unchanged#<id> <title>with no stray[](n/m)(thephasefield is untouched)Flaky Tests
packages/dashboard/__tests__/scrollController.test.ts— "warns on unexpected scroll-to-top but does not auto-correct (Issue Bug: Terminal scroll-to-top caused by xterm parsing errors and WebGL context loss #630)" fails on this branch. Pre-existing and unrelated: it fails identically with this PR's entire diff stashed on a clean tree, and touches nothing in this change (scroll behavior /console.warnspying, noOverviewBuilderusage). Not skipped or modified — left as-is per PIR's out-of-scope guidance. Porch'stestscheck runs the codev package only (not the dashboard suite), so it is unaffected.