Repository navigation
Conversation
The safety net for the decomposition plan (DECOMPOSITION.md, PR 1): - scripts/check_file_size_ratchet.py keeps the ten largest files from growing past the budget table in the plan; - scripts/verify_moved_code.py proves a move commit only relocates code (identical ASTs, new code limited to imports, re-exports and protocol stubs) and lists test patches a move would make stale; - tests/test_import_surface.py pins the names replayer, __main__, qualification and ir provide, and Replayer's methods. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each flow-unit shard keeps its coverage data; flow-coverage combines them and writes the safety-path number to the job summary. It is not in packages-gate: the floor is set at the measured value once known. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nine scenarios replay one committed MockMed triage bundle under different drifts through the real Replayer and PlaywrightBackend: clean passes (with and without the structural rung), identity halts (missing, look-alike, growth, sort), a modal postcondition halt, the irreversible-step risk gate and theme healing. Each compares the normalized report, the hash of every file the run wrote, the backend action trace and the live app state with a baseline. Writing a baseline runs the scenario twice and refuses values that differ between identical runs. Baselines are Linux results generated in the flow-critical job; unit shards skip the scenarios. CODEOWNERS covers the packages the plan adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverted once the baselines from this run are committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Baselines and the recorded MockMed triage bundle come from the flow-critical job of CI run 40123224669 (write mode, each scenario run twice and identical). Ruff skips the bundle's generated workflow.py, which is part of the bundle digest. Ratchet budgets reset to origin/main ecc162e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The baselines are committed; golden runs now compare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 4 tasks
…larations A protocol attribute such as Optional[dict[str, Any]] was read as an assignment because its dump contains 'value='. Statements now record whether they only declare (an annotation with no value, or a docstring) when they are parsed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode reads A moved method reads module-level names from its new module, so a test that patches old_module.name (an import such as resolve, or a constant) no longer reaches it. The verifier now tracks the names each moved function reads and flags a test that patches one through the old module without also patching it where the moved code reads it. Found by the first large replayer move, where a scroll-readiness test patched runtime.replayer.resolve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in packages.yml: keep main's xdist shards, fast lane and single critical e2e run; re-add the golden-runs step, the per-shard coverage data and the non-gating flow-coverage job on top.
Budgets are each file's line count on main at 213f3d9. The snapshot adds the names and Replayer methods main gained (276 methods); none were removed.
They were written against main of October 24. CI regenerates them, bundle included, from the merged tree in the next commits.
Reverted once the baselines from this run are committed.
Written by Packages run 41704998213 (workflow_dispatch, flow core critical, OPENADAPT_GOLDEN_WRITE=1, Playwright 1.61.0). In write mode each scenario ran twice and the two results were equal before the baseline was written. Copied unchanged from the flow-golden-runs artifact.
This reverts commit 3881357.
…selines flow-coverage now installs coverage 7.15.1 (the version packages/flow/uv.lock pins) from .github/ci-tools/uv.lock with hashes, as tests/test_ci_locked_installs.py requires. public-artifacts.json lists the committed golden baselines (regenerated with --write-public-artifact-inventory).
With --cov in every flow-unit shard, the full lane's shard 2 hit its 40-minute limit at 99% (Packages run 41715793206): coverage slows the suite by about a third. Pull requests and main's post-merge run now collect none; a schedule or a dispatch collects it, with a 60-minute limit, and flow-coverage reports it.
abrichr
marked this pull request as ready for review
November 4, 2026 00:46
Conflict in packages/flow/pyproject.toml: take main's comment about the benchmark harness and keep tests/golden_runs/baselines in extend-exclude.
replayer.py grew to 19524, __main__.py to 12915, ir.py to 6352, recorder.py to 4823 and playwright_backend.py to 5199 on main while this waited. The snapshot adds the 4 names main added; none were removed.
… merge Three files grew on main since the budgets were set (replayer.py +5, __main__.py +320, playwright_backend.py +83); section 6 sets each budget to main's size when this PR merges. The import-surface snapshot drops _refuse_rollback_durable, which #1772 removed on main with no remaining references, and adds the names #1772 added.
This branch has not been deployed
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.
Summary
This is PR 1 of the decomposition plan (
packages/flow/docs/design/DECOMPOSITION.md, section 4.3). It adds the safety net that every later move is checked against. It changes no production code.scripts/check_file_size_ratchet.pyruns in Python CI throughtests/test_file_size_ratchet.py. It fails when a listed file grows past its budget in the plan's table. A PR that adds net lines raises the budget in its own diff, with a one-line reason. The table and section 6 came from docs(flow): decomposition plan for the largest files #1497. This PR adds the script and the test; there is only one ratchet.scripts/verify_moved_code.pychecks that a move commit only relocates code. Every function, method and statement in the base must exist with an identical AST in the head. New code may only be imports, re-exports and protocol stubs. It also lists test patches that a move would make stale.packages/flow/tests/test_import_surface.pypins the names thatreplayer,__main__,qualificationandirprovide. It also pins the 276 methods ofReplayer.packages/flow/tests/golden_runs/runs nine scenarios with the realReplayerandPlaywrightBackendagainst MockMed. Each run's normalized report, file hashes, backend action trace and live app state must match the baseline.flow-coveragejob combines the unit shards' coverage data and reports safety-path coverage in the job summary.This round
packages.yml. Main's xdist shards, fast lane and single critical e2e run are kept. The golden-runs step and the coverage job are added on top.workflow_dispatchPackages run (41704998213) then recompiled the MockMed bundle and wrote all nine baselines on Linux with Playwright 1.61.0. Write mode runs each scenario twice and refuses results that differ; all nine matched. The baselines were copied unchanged from theflow-golden-runsartifact, and the temporary commit was reverted. Two later runs in compare mode reproduced all nine: 41715793206 and 41733145873, the second at the current head. No baseline was edited by hand.replayer.pyis at 19,303 lines. Main keeps changing these files, so re-runpython scripts/check_file_size_ratchet.pyjust before merging and update any number it reports.Replayermethods, up from 260. No name was removed.flow-coverageinstalls coverage 7.15.1 from a newcoveragegroup in.github/ci-tools/uv.lock, with hashes. That is the versionpackages/flow/uv.lockpins. The earlier unhashedpip installfailedtests/test_ci_locked_installs.py.packages/flow/public-artifacts.jsonnow lists the baseline files.Merge with main, round 2 (head 5daa5b9)
packages.yml, in the flow-unit job. Main now picks shard files withscripts/ci/flow_shards.pyand runs-n logical. The merge keeps both, plus this PR's golden-runs exclusion from the shard list, theCOVERAGE_*env, the upload step and theflow-coveragejob. actionlint passes.replayer.pyby 5 lines (to 19,529),__main__.pyby 320 (to 13,235) andplaywright_backend.pyby 83 (to 5,282). This PR leaves all three unchanged from main. The other seven budgets already matched.OPENADAPT_WRITE_IMPORT_SURFACE=1._refuse_rollback_durableis dropped from the__main__pins because Rollback on durable runs, and after a crash (#1699) #1772 removed it on main and nothing references it any more. The five names Rollback on durable runs, and after a crash (#1699) #1772 added are now pinned.src/screens/Stops.test.tsxfailed in the Desktop frontend job ("answers the current stop with one key"). This PR doesn't touchpackages/desktop. The same timing flake is what desktop: prepare review card input before paint #1825 fixes.Tested at this head:
python scripts/check_file_size_ratchet.pypasses; rootpytest testsgives 805 passed, 14 skipped; flowtests/test_import_surface.pygives 6 passed andtests/golden_runsgives 5 passed, 9 skipped (the Linux-only scenarios); ruff passes on the golden-runs tests.Notes for review
generate/verify_contract.py(4,157 lines) is now larger thanterminal_verification_v2.py(3,663), which is in the table. The table keeps the ten files from docs(flow): decomposition plan for the largest files #1497. Swapping one in is a separate choice.src/screens/NeedsYou.test.tsxfailed in the Desktop frontend job. This PR does not touchpackages/desktop, so the failure is outside it.Test plan
pytest tests/test_file_size_ratchet.py tests/test_verify_moved_code.py(13 passed)test_ci_locked_installs,test_ci_required_check,test_nightly,test_packages_concurrency,test_newest_green(52 passed)