Skip to content

docs(flow): decomposition plan for the largest files - #1497

Merged
abrichr merged 3 commits into
mainfrom
refactor/decomposition-design
Oct 24, 2026
Merged

abrichr merged 3 commits into
mainfrom
refactor/decomposition-design

Conversation

@abrichr

@abrichr abrichr commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Docs only. packages/flow/docs/design/DECOMPOSITION.md is a measured plan to split runtime/replayer.py (18,258 lines), __main__.py, qualification.py, ir.py and Desktop dispatch.py without changing behavior. REPLAYER_DECOMPOSITION.md is marked superseded: its mixin mechanism (self: "Replayer") fails mypy, and the new doc shows a Protocol-typed replacement that passes the strict flags.

What the doc finds:

  • replayer.py is one class: 260 methods and 109 attributes, 88 of them written outside __init__. 14 methods are over 200 lines.
  • _run_step_on_active_surface (1,316 lines) is already a pipeline; the API and GUI paths repeat effect setup, the identity refusal and handling of a delivery whose outcome is unknown.
  • 56 isinstance(self.backend, ...) capability checks; 27 inline refusals whose order is a safety property.
  • The 85% safety-path coverage floor is defined only in a workflow that doesn't run in the monorepo.

The plan: five behavior-preserving pull requests by module group, each made of move commits proven by AST equality and seam commits read in full. Section 9 records the review decisions. The size ratchet lands with PR 1, the safety net.

Test plan

  • Docs only; links and the budget table checked locally

🤖 Generated with Claude Code

abrichr and others added 3 commits October 24, 2026 12:21
…size ratchet

DECOMPOSITION.md maps replayer.py (one 17.5k-line class, 260 methods,
88 attributes written mid-run), proposes a step pipeline with mechanism,
action-executor, check and delivery-gate seams, names the invariants and
how each PR proves them, and orders small move-only PRs. It supersedes
REPLAYER_DECOMPOSITION.md, whose self-annotated mixins mypy rejects.

scripts/check_file_size_ratchet.py fails when a listed file grows past
the budget table in the doc; tests/test_file_size_ratchet.py runs it in
Python CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each pull request is made of move commits, proven by AST equality, and
seam commits read in full. Coordination table refreshed against the open
pull requests (#1500, #1501 and #1504 added).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five pull requests by module group, ratchet budgets set when PR 1 merges
and raised in-diff by growing PRs, coverage reported then floored at the
measured value, one resolution ladder. The ratchet script and test leave
this docs-only PR and land with the safety net.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abrichr abrichr changed the title docs(flow): decomposition plan for the largest files, and a size ratchet docs(flow): decomposition plan for the largest files Oct 24, 2026
@abrichr
abrichr marked this pull request as ready for review October 24, 2026 18:44
@abrichr
abrichr enabled auto-merge October 24, 2026 19:00
@abrichr
abrichr added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit ecc162e Oct 24, 2026
38 checks passed
@abrichr
abrichr deleted the refactor/decomposition-design branch October 24, 2026 21:48
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