Repository navigation
refactor(dashboard): delete two private constants nothing reads - #20836
Conversation
display_verdicts._project_fn and change_cards._CLOSED_STATUSES were each bound once at module scope and never read: no code, test, doc or string in the tree names either one. Removing them changes no behaviour.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 9e10ee5 Description read[DESCRIPTION-READ] c15968962b2b8a6490d954bd257f245d2e776632ad1672fd2c84416f3446f653 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (2 items) — 2 justifiedIntent: Remove dead private names that make the dashboard code look like it has hooks and card classes it doesn't have. This is a FIX (subtraction only).
[FIRST-PRINCIPLES-REVIEWED] 9e10ee5 Description read[DESCRIPTION-READ] 1b4325d4e96ca63684da1ca77dabf46dbead2554aee4b85b846a6c13441cd044 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: refactor (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: deletes two private module constants (_CLOSED_STATUSES in change_cards.py, _project_fn in display_verdicts.py) that have no reader in the repository; no behaviour change.
Problem / Motivation
Goal: Delete two private dashboard constants that no code reads, with no change in behaviour.
A scan for the two mechanical kinds #16523 lists in scope, shadowing in-function imports and chained ternaries, found no actionable site tree-wide on
mainwhen this branch was cut. A scan for private module-level names that appear only where they are defined found two indashboard/, both dead since the commit that added them:display_verdicts._project_fn = None(added in perf(dashboard): store display-redaction verdicts on write #19753)change_cards._CLOSED_STATUSES = frozenset({STATUS_CANCELLED, STATUS_EXPIRED, STATUS_UNDONE})(added in feat: let crewmates propose changes the user confirms as cards #18448)Why it matters
Nothing is broken today. A dead name reads like part of the design:
_project_fnsits among the projection worker's globals and suggests a swappable projection hook that does not exist, and_CLOSED_STATUSESsits among the status sets thatchange_cards.pydoes use and suggests a "closed" class of cards that no code checks for.Not a goal
change_cards.pyuses (FINISHED_STATUSES,REPORTED_STATUSES,_ALL_STATUSES,_PRE_APPLY_STATUSES), or how the projection worker runs.display_verdicts._sweep: its only caller istest_display_verdicts.py, so it is not dead.What changed (motivation → approach → change)
Two lines are deleted, one per file. Nothing else changes.
dashboard/display_verdicts.py_project_fn = None_run_workercallsproject(...)directly; noglobal _project_fnstatement exists, so no function ever assigns itdashboard/change_cards.py_CLOSED_STATUSES = frozenset({...})STATUS_*constant, never this setNeither name appears anywhere else in the tree: not in
src/,test/,docs/,scripts/orwebsite/src/, not as agetattr/monkeypatchstring, and not in an__all__(neither module defines one).Backwards compatibility
Compatible: both names are private, module-level, and read by nothing, so no caller can observe their absence.
Removes nothing: the two deleted names had no reader on any entry point; a tree-wide search of
origin/mainfinds each only on its own definition line.Tests
dashboard.display_verdictsordashboard.change_cards: 1037 passed.check_black_formatting.py,check_subprocess_encoding.py,check_comment_history.py,check_brand_name.py,check_harness_parity.py,docs_lint.py --test,docs-lint.sh,check_per_file_coverage.py --test,check_file_line_cap.py,check_feature_map.py,verify_vendor_manifest.py, the flake-pattern ratchet, and the ratchet scripts Fast Gate and CI's Backend Lint job run, each with the merge-base as its base ref and, where it has one, its--testself-test.scripts/scrub-lint.shis not in the checkout; that scan is CI'sinternal-content-scanjob. semgrep is not installed here, so CI's SAST job is the only run ofsemgrep/.check_integration_route_coverage.pyneeds the route hits an integration-suite run records (CI's Integration job); this run recorded none. The frontend build and tests did not run: the diff touches nothing underwebsite/,.github/orscripts/.code-review.ymlgreps, behaviour, names and imports, keystone and boot path, claim accuracy, and local mirrors of the Opus and GPT lanes, the GPT one on a Claude model since no GPT model is available locally) found no behaviour change: each module's AST at the base equals its AST here with the one deleted assignment removed, and every remaining simple module-level value and every function's bytecode match the base. Two independent adjudicators confirmed two wording fixes to this body and refuted two body suggestions, dropped: adding theContribution License Agreementheading, and a sentence on the campaign's out-of-repo keystone list.Manual verification
N/A — unit coverage sufficient: the change deletes two names nothing reads, and the gates and related tests show nothing depended on them.
Screenshots / video
Why no screenshot: backend-only refactor; nothing renders differently.
Related Issues
Part of #16523
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)