Repository navigation
refactor(runner, run_ledger): split the ledger loop into steps, no behaviour change - #62
Merged
Merged
Conversation
…haviour change runner.rs (4322 lines) becomes src/runner/: the loop and its state (ledger_loop), the owner escalation (escalation), one attempt and its check (attempt), lanes, goals, seams, briefing and stop, re-exported so every crate::runner:: path is unchanged. work_the_ledger is a LedgerLoop whose rounds are named steps; run_lanes_if_useful is four steps. cli::run_ledger::run is split into preflight, agent resolution, backends, planning and worker steps; the lane workers move to run_ledger/lanes.rs. The only edge into Done is still verify::verify exiting zero. Co-Authored-By: Claude <noreply@anthropic.com>
…n API The last owner answer riding the next card, spend ranked heaviest-first with ties by name and idle agents left out, a pool that declines leaving the run sequential, and lanes asked for review on a branch ahead of origin being merged here without the forge being asked. Each also passes on the pre-split runner.rs. Co-Authored-By: Claude <noreply@anthropic.com>
…heir items Comments only, from the independent review of #62. The split left four comments describing the old single file: attempt.rs said the two failure exits were arms "several hundred lines apart" (both now go through LedgerLoop::failed), lanes.rs pointed at "the sequential loop below" and ledger_loop.rs at "the push site", and lanes.rs/goals.rs linked OwnerChannel, RoadmapGoals and WorkJournal by names those modules do not import. Four were wrong before the split and moved with it: goals.rs linked a non-existent unreached_goals, seams.rs a non-existent run_with_replans, NoOwner's description sat on MAX_REPLANS, and TaskWorker's sat on Handoff in briefing.rs. Each now names what it means.
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.
Answers code-auditor findings 79ce9b9f808ee2a9, 7d477b9f9a609a95, ced02a72539a97d3, 79fed3ed553bd1f3 (runner.rs) and 12bc90cd8e17bb58, fcb5e284ad185b32, dc399e1d872b2641 (run_ledger.rs). No behaviour change.
What moved
src/runner.rs(4322 lines) is nowsrc/runner/, with everycrate::runner::path re-exported unchanged:mod.rsrun→run_watchedladder,unanswered_questions, re-exportsledger_loop.rswork_the_ledgeras aLedgerLoop(the state carried between rounds) whoseroundis named steps: cancel, budget, lanes, pick,drained, claimescalation.rsattempt.rsverify::verifydecides:passed/failed/ learn-and-replanlanes.rsrun_lanes_if_usefulas four steps (batch_worth_running,landing_for,settle_lane,remember_unmerged)goals.rs,seams.rs,briefing.rs,stop.rstests.rs,lane_tests.rs,owner_tests.rs,attribution_tests.rscli::run_ledger::run(324 lines, cc 29) is split intoledger_for_run/may_start,RunAgents::resolve,RunBackends(build,planner,into_worker),plan_ledger,LiveReplanner::for_run,CliLaneWorkers::for_run; the lane workers and their test move tocli/run_ledger/lanes.rs. Side effects keep their order.The gate
The only edge into
Doneis stillLedgerLoop::passed, reached only with aVerifiedfromverify::verify(exit zero). The worker's report stays a labelled claim.Evidence
run_ledger::run, 91), no complexity over 20, no file over 1000; only fan-out remains.runner.rs(checked on fedb944): the last owner answer rides the next card; spend is ranked heaviest-first, ties by name, idle agents left out; a declining pool leaves the run sequential; lanes asked for review on a branch ahead of origin are merged here and the forge is never asked. Five unit tests cover the extracted helpers.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test: lib 2289 passed / 10 ignored (was 2280 / 10 on fedb944); the wiring ratchet holds.#[allow(clippy::too_many_arguments)]: 3 → 1. The one left is on the existing publicrun_watched.Co-Authored-By: Claude noreply@anthropic.com