Repository navigation
Merged
Conversation
…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
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.
Closes #1181
Closes #1226
#1226 -- statusline's comma-name undercount
scripts/statusline.py's_gh_unlabelled_issue_countsbuilt 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 undercountingno_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 (tojsonserver-side,json.loadsclient-side), a delimiter no label name can contain -- ported from the identical, already-reviewed fix inDigital-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.pyinherited that reading.scripts/statusline.py's exact-membership test excluded it, so a correctlylane-other-tagged issue rendered as untriaged in the status line'snlcount forever -- triaging an issue correctly made the number go up, and it could never be driven to zero.select_issues.pyalready 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.lanespluslabels.lane_otherwhen declared, deduplicated).scripts/statusline.py(vendored standalone into every managed repo, so it cannot importoss_config) mirrors the same logic locally inrefresh().select_issues.py'sselect_fleet()now calls the shared helper instead of re-deriving it a fourth way.doctor.pygains a new check module (scripts/doctor_check_lane_other_label.py, per the repo's per-check module convention) reporting whether a declaredlabels.lane_otherspelling 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 madeselect_issues.pyfind zerolane-othercandidates 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 FINDINGSacross its four-class checklist. Explore found one real issue: the vendoredstatusline.pycopy ofeffective_lane_labels's logic did not filter non-stringlabels.lanesentries the way the shared helper does, so a malformed config (an int inlabels.lanes, whichoss_config.validatecurrently permits) could still produce a divergent answer betweenstatusline.pyandselect_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]