Skip to content

Replace remaining constant_subtype_answer flags and exact_key_set dispatch with polymorphism - #2240

Merged
trissim merged 1 commit into
mainfrom
toad-qt/nra-slop-sweep-32
Nov 24, 2026
Merged

trissim merged 1 commit into
mainfrom
toad-qt/nra-slop-sweep-32

Conversation

@trissim

@trissim trissim commented Nov 24, 2026

Copy link
Copy Markdown

Batch 32 NRA structural slop sweep:

  • PlanStatus / CompletedPlanStatus: delete .complete, add polymorphic newly_complete(), style_qt_label(), and present_textual()
  • ToolCallStatus / CompletedToolCallStatus: polymorphic project_output()
  • Settlement / Ready: delete .ready, add polymorphic placed()
  • FilterState / ActiveFilter: delete .active, add polymorphic request_older() and prepare_edges()
  • CommitClaim / RetainedBlockClaim: polymorphic retiring(block)
  • CategorizedMount.mount: explicit before=None, after=None replacing **kwargs exact-key-set check

Verified:

  • tools/qt_inherit_ratchet.py: 0/0/0/0/0
  • tools/shadow_check.py: 0
  • tools/guarded_imports.py: 0
  • pytest tests/guards/ --ignore=tests/guards/test_client_imports_without_textual.py: 137 passed
  • NRA cached raw findings: 443 -> 438 (constant_subtype_answer: 6 -> 1, exact_key_set: 1 -> 0)

…patch with polymorphism

Batch 32 NRA structural slop sweep:
- PlanStatus / CompletedPlanStatus: delete constant .complete flag; own newly_complete(), style_qt_label(), and present_textual() polymorphically (src/toad/plan.py, src/toad/qt/plan_panel.py, src/toad/widgets/plan.py)
- ToolCallStatus / CompletedToolCallStatus: own project_output() polymorphically instead of branching on .completed (src/toad/acp/status.py)
- Settlement / Ready: delete constant .ready flag; own placed() polymorphically (src/toad/client/reader_position.py)
- FilterState / ActiveFilter: delete constant .active flag; own request_older() and prepare_edges() polymorphically (src/toad/transcript_filter.py, src/toad/client/history_pager.py, src/toad/widgets/transcript_history.py)
- CommitClaim / RetainedBlockClaim: own retiring(block) polymorphically instead of branching on .retires (src/toad/commit_claims.py, src/toad/transcript_publication.py)
- CategorizedMount.mount: accept explicit before=None, after=None instead of **kwargs exact-key-set dispatch (src/toad/widgets/conversation.py)

Drives NRA constant_subtype_answer from 6 to 1, exact_key_set to 0, total raw findings 443 -> 438.
@trissim
trissim merged commit 38be887 into main Nov 24, 2026
1 of 2 checks passed
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.

1 participant