Skip to content

fix: consolidate lane-other's four disagreeing readers, close the comma-name undercount (#1181, #1226) - #1283

Merged
fdaviddpt merged 3 commits into
mainfrom
fix/1181
Sep 7, 2026
Merged

fdaviddpt merged 3 commits into
mainfrom
fix/1181

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closes #1181
Closes #1226

#1226 -- statusline's comma-name undercount

scripts/statusline.py's _gh_unlabelled_issue_counts built one line per open issue as "L:" + join(",") over label names and split it back apart in Python. A label name containing a literal comma split into two names, one of which could coincidentally match a real declared lane, silently undercounting no_lane/no_priority (the opposite of this function's own documented convention: never undercount). The wire format is now one JSON array of label names per line (tojson server-side, json.loads client-side), a delimiter no label name can contain -- ported from the identical, already-reviewed fix in Digital-Process-Tools/claude-remember#623.

#1181 -- lane-other had four readers and no two agreed

labels.lane_other (#1130) had four independent readers disagreeing on whether a declared spelling counts as "this issue is triaged into a lane":

  • oss_config.classify_labels's prefix regex read it as a lane.
  • doctor.py inherited that reading.
  • scripts/statusline.py's exact-membership test excluded it, so a correctly lane-other-tagged issue rendered as untriaged in the status line's nl count forever -- triaging an issue correctly made the number go up, and it could never be driven to zero.
  • select_issues.py already treated it as a real, dispatchable sixth lane on its own, via its own inline derivation.

Fix: oss_config.effective_lane_labels(config) is now the one place a caller holding a loaded config derives the answer (labels.lanes plus labels.lane_other when declared, deduplicated). scripts/statusline.py (vendored standalone into every managed repo, so it cannot import oss_config) mirrors the same logic locally in refresh(). select_issues.py's select_fleet() now calls the shared helper instead of re-deriving it a fourth way.

doctor.py gains a new check module (scripts/doctor_check_lane_other_label.py, per the repo's per-check module convention) reporting whether a declared labels.lane_other spelling actually exists as a label on the forge, in the same four-state shape (declared-and-present / declared-and-absent / not-declared / could-not-tell) labels.filed_by_loop's own check already has -- nothing checked that before, so a declared spelling with no matching label made select_issues.py find zero lane-other candidates forever, indistinguishable from a lane that fills correctly and simply has none today.

Self-review

Two reviewer spawns ran against the committed diff (Explore + oss:auditor). The auditor returned NO FINDINGS across its four-class checklist. Explore found one real issue: the vendored statusline.py copy of effective_lane_labels's logic did not filter non-string labels.lanes entries the way the shared helper does, so a malformed config (an int in labels.lanes, which oss_config.validate currently permits) could still produce a divergent answer between statusline.py and select_issues.py -- the exact class of defect this PR closes. Fixed in a second commit with a red/green test proving the divergence and the fix.

Tests

New: tests/test_statusline_gh_unlabelled_issue_counts_1226.py, tests/test_effective_lane_labels_1181.py, tests/test_statusline_lane_other_no_lane_1181.py, tests/test_doctor_lane_other_label_1181.py. Updated in place: tests/test_statusline_479.py (old comma-joined wire-format fixtures switched to the new JSON array format).

🤖 Generated with Claude Code

[AI-generated]

fdaviddpt and others added 3 commits September 8, 2026 01:15
…ma-name undercount (#1181, #1226)

`_gh_unlabelled_issue_counts` in scripts/statusline.py built one line per
open issue as "L:" + join(",") over label names and split it back apart in
Python -- a label name containing a literal comma split into two names, one
of which could coincidentally match a real declared lane, silently
undercounting no_lane/no_priority. The wire format is now one JSON array of
label names per line (tojson server-side, json.loads client-side), ported
from the identical fix already reviewed in
Digital-Process-Tools/claude-remember#623 (#1226).

labels.lane_other (#1130) had four independent readers disagreeing on
whether a declared spelling counts as "this issue is triaged into a lane":
oss_config.classify_labels's prefix regex read it as a lane, doctor.py
inherited that, statusline.py's exact-membership test excluded it (so a
correctly lane-other-tagged issue rendered as untriaged in the status
line's nl count forever, and the count could never be driven to zero by
triaging correctly), and select_issues.py treated it as a real,
dispatchable sixth lane on its own. oss_config.effective_lane_labels is now
the one place a caller holding a loaded config derives the answer
(labels.lanes plus labels.lane_other when declared); statusline.py
(vendored standalone, cannot import oss_config) mirrors the same result
locally, and select_issues.py now calls the shared helper instead of
re-deriving it a fourth way.

doctor.py gains a new check (scripts/doctor_check_lane_other_label.py, per
the per-check module convention) reporting whether a declared
labels.lane_other spelling actually exists as a label on the forge, in the
same declared-and-present / declared-and-absent / not-declared /
could-not-tell shape labels.filed_by_loop's own check already has --
nothing checked that before, so a declared spelling with no matching label
made select_issues.py find zero lane-other candidates forever,
indistinguishable from a lane that fills correctly and simply has none
today (#1181).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcWCnjquYw5WYq8xPBewqc
…lane_labels copy (#1181 self-review)

Self-review finding from the Explore reviewer spawn: statusline.py's
refresh() claimed to be "a vendored copy of oss_config.effective_lane_
labels's own logic", but effective_lane_labels filters labels.lanes down
to string entries before appending lane_other while this copy only
type-checked the list itself, not its elements. oss_config.validate
checks labels.lanes is a list but never that every element is a string,
so a malformed config (e.g. a stray integer) could carry a non-string
entry through validation and produce divergent "is this a lane" answers
between statusline.py (which would keep it, later stringified by
_gh_unlabelled_issue_counts) and select_issues.py/effective_lane_labels
(which drops it) -- reopening the exact "readers disagree" defect #1181
fixed. Closed by filtering to string entries here too, with a red/green
test proving the divergence and the fix.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcWCnjquYw5WYq8xPBewqc
….lane_other_label_state (#1181 CI fix)

CI's lint leg failed on PR #1283: `scripts/doctor.py` imports
`lane_other_label_state` from `doctor_check_lane_other_label` but never
calls it directly. This is not a real defect -- it is the same deliberate,
already-established pattern every sibling `*_state` function in doctor.py's
per-check modules follows (branch_protection_state, clone_head_state,
codeql_scan_state, and ~15 others already sit in
scripts/ruff_ratchet_baseline.txt for the identical reason): the import
makes the function reachable as doctor.lane_other_label_state so tests can
`monkeypatch.setattr(doctor, ...)` and call it that way --
tests/test_doctor_lane_other_label_1181.py::test_lane_other_label_state_four_states_directly
does exactly that, matching e.g. tests/test_doctor_branch_protection_759.py's
own doctor.branch_protection_state(...) calls for the sibling check.
Confirmed nothing calls it inside main() either, the same as every other
sibling *_state function -- only its check_* wrapper is wired into main().

Regenerated via `python3 scripts/ruff_ratchet.py --write-baseline`, per that
script's own documented rule for a deliberate, argued addition -- the diff
is the single expected line, in sorted position, and a re-run reports
"OK: 98 finding(s), none new against the baseline snapshot."

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcWCnjquYw5WYq8xPBewqc
@fdaviddpt
fdaviddpt merged commit bcededf into main Sep 7, 2026
10 checks passed
@fdaviddpt
fdaviddpt deleted the fix/1181 branch September 7, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant