Skip to content

Delete board_from_cache's dead state field (#597) - #600

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/597
Aug 27, 2026
Merged

Delete board_from_cache's dead state field (#597)#600
fdaviddpt merged 2 commits into
mainfrom
fix/597

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

What

board_from_cache in scripts/statusline.py computed a state field (unknown/partial/measured) that nothing downstream ever read -- _board_field, the renderer, reads prs/issues/issues_external/checks directly and renders ? per missing value regardless of what state said. #595 had just added a rule to state (a cache with issues but no issues_external is partial) that, for the same reason, could never affect anything a maintainer sees.

#597 named two directions and deliberately chose neither: give state a reader (the render), or delete it. This takes the delete path.

Why delete rather than wire a reader

The render is the most-visible field on the line and a design change there (a partial board rendering differently from a measured one) needs its own argument about what it costs in width and reader attention -- and, on inspection, state was never even a complete summary of what the render already shows: it only ever considered prs/issues/issues_external, never checks. A reader added for it would have inherited that gap. Each of the three counts state summarized already carries its own missing/present distinction (None vs an int), which is exactly what _board_field already renders as ? vs a number. A summary that can disagree with the values it summarizes -- and, in this case, was already known to be inert -- is a second copy of the same fact rather than new information.

Verified the premise

Grepped board_from_cache and ["state"]/.get("state") across scripts/, commands/, hooks/: the only production caller of board_from_cache is gather() (scripts/statusline.py:1479), which never reads board["state"]; the board dict only reaches _board_field, which reads the four other keys via .get(). No other caller anywhere in the repo reads this field. Confirmed by both spawned reviews independently.

Tests

Red: tests/test_statusline_state_deleted_597.py::test_board_from_cache_carries_no_state_key failed before the fix (state was present). Green after. Positive control in the same file (test_the_per_field_questionmarks_still_distinguish_every_case_state_used_to_name) proves the per-field ?/int distinction alone still recovers every case state used to name, including the must-fire zero-vs-missing control for issues_external. Three existing test files (test_statusline_479.py, test_statusline_board_external_595.py) had their board["state"] assertions removed as a deliberate contract change, not an oversight -- state is deleted, so there is no contract left to assert.

Full suite: 3766 passed, 7 skipped (pre-existing, unrelated), coverage 89.34%.

Docs

README.md does not document the board field format at all (confirmed, matches the issue's own note) -- no change needed. .oss/statusline.py, the owned vendored copy, is rendered from scripts/statusline.py at scaffold time (scaffold.py::_owned_statusline), not hand-maintained -- it will carry this fix at the next re-scaffold, noted in the changelog fragment.

Closes #597

fdaviddpt and others added 2 commits August 27, 2026 12:42
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…), fixing CI on PR #600

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@fdaviddpt
fdaviddpt merged commit 885fb08 into main Aug 27, 2026
14 checks passed
@fdaviddpt
fdaviddpt deleted the fix/597 branch August 27, 2026 11:07
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.

board_from_cache computes a three-state state that nothing reads, so every guard written into it is decorative

1 participant