Skip to content

refactor(dashboard): delete two private constants nothing reads - #20836

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/simplify-dashboard
Oct 15, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/simplify-dashboard

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

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 main when this branch was cut. A scan for private module-level names that appear only where they are defined found two in dashboard/, both dead since the commit that added them:

Why it matters

Nothing is broken today. A dead name reads like part of the design: _project_fn sits among the projection worker's globals and suggests a swappable projection hook that does not exist, and _CLOSED_STATUSES sits among the status sets that change_cards.py does use and suggests a "closed" class of cards that no code checks for.

Not a goal

  • Changing any status set change_cards.py uses (FINISHED_STATUSES, REPORTED_STATUSES, _ALL_STATUSES, _PRE_APPLY_STATUSES), or how the projection worker runs.
  • Removing display_verdicts._sweep: its only caller is test_display_verdicts.py, so it is not dead.
  • Touching any file other than these two, or any line other than the two definitions.

What changed (motivation → approach → change)

Two lines are deleted, one per file. Nothing else changes.

File Deleted line Why it is dead
dashboard/display_verdicts.py _project_fn = None _run_worker calls project(...) directly; no global _project_fn statement exists, so no function ever assigns it
dashboard/change_cards.py _CLOSED_STATUSES = frozenset({...}) the file's status checks use the sets that stay, an inline tuple or one STATUS_* constant, never this set

Neither name appears anywhere else in the tree: not in src/, test/, docs/, scripts/ or website/src/, not as a getattr/monkeypatch string, 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/main finds each only on its own definition line.

Tests

  • No test change. Nothing reads either name, so no test can observe the deletion; a test that pinned their absence would be a test of the deletion itself.
  • Related tests. 20 test files, among them every one of the 15 that import dashboard.display_verdicts or dashboard.change_cards: 1037 passed.
  • Static gates (Python 3.12). All exit 0: flake8, isort, mypy, 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 --test self-test.
  • Not run locally. scripts/scrub-lint.sh is not in the checkout; that scan is CI's internal-content-scan job. semgrep is not installed here, so CI's SAST job is the only run of semgrep/. check_integration_route_coverage.py needs 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 under website/, .github/ or scripts/.
  • Pre-PR review. Seven read-only reviewers (AUTOSDE rules and the code-review.yml greps, 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 the Contribution License Agreement heading, 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

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.
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 15, 2026 13:31
@bolichen97
bolichen97 requested a review from CrysisDeu October 15, 2026 13:31
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (2 items) — 2 justified

Intent: 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).

  1. Deleted the unused display_verdicts._project_fn global (grep for _project_fn at HEAD: 0 matches) — justified
  2. Deleted the unused change_cards._CLOSED_STATUSES set (grep for _CLOSED_STATUSES at HEAD: 0 matches) — justified

[FIRST-PRINCIPLES-REVIEWED] 9e10ee5

Description read

[DESCRIPTION-READ] 1b4325d4e96ca63684da1ca77dabf46dbead2554aee4b85b846a6c13441cd044

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9e10ee5

Verdict parsed from the review's SHA-scoped output markers for commit 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9e10ee5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9e10ee562fefdbb41c5c080c736a32e5e45a7e7f: <one-sentence reason>

@bolichen97
bolichen97 enabled auto-merge (squash) October 15, 2026 13:35
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 15, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit 9e4eb2d into main Oct 15, 2026
102 checks passed
@bolichen97
bolichen97 deleted the refactor/simplify-dashboard branch October 15, 2026 15:07
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 15, 2026
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.

2 participants