Repository navigation
refactor: split internal/delegate/run.go into topical files (pure declaration moves) - #742
Merged
Merged
Conversation
… moves Moves declarations of the 8302-line run.go into run_types.go, run_runner.go, run_placements.go, run_capacity.go, run_wait.go, run_replace.go, run_retry.go, run_localseat.go, run_deal.go, run_remote.go, run_dispatch.go, run_accept.go and run_probe.go; run.go keeps the tunables, entry points, attempt/runLocal and the delegation log. Census (declaration hashes, comments stripped) before vs after: identical, 682 declarations. Docs naming moved functions repointed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merged
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.
Intent
Desloppify backlog ("god files"): internal/delegate/run.go was 8302 lines. It is split into topical files of the same package by pure declaration moves; identical behaviour.
Scope
internal/delegate only (run.go plus 13 new run_*.go files), the fragment, and three one-line pointer updates in docs/systems (delegation-client.md, fleet-node.md, pair-workloads.md). No test changed; no declaration renamed or edited.
What changed
run_types.go 548, run_runner.go 551, run_placements.go 343, run_capacity.go 937, run_wait.go 572, run_replace.go 465, run_retry.go 775, run_localseat.go 457, run_deal.go 714, run_remote.go 595, run_dispatch.go 356, run_accept.go 169, run_probe.go 541 lines; run.go 8302 -> 1473 (it keeps the tunables, attempt, runLocal, record and the delegation log, because four source-scanning tests key on that file by name).
The real run and its output
Declaration census (go/ast hash of every top-level declaration, comments stripped) before and after: 682 declarations, diff empty, run by the builder and again by an independent verifier in a throwaway worktree of origin/main. go build ./... ok; go vet ./internal/delegate ok; gofmt clean on every new file; 18 named delegate tests plus the fleetnode, ledger and root changelog/lint tests that read run.go by name: ok. A second read-only audit ran every test that reads internal/delegate/run.go by name (TestNoNewBareHTTPClient, TestEverySiteThatGradesAResultRecordsTheAuthorityToo, TestJobWaitCapStaysBelowTheDelegatorsPollRequestTimeout, TestEveryWriterOfALedgerRowIsKnown): all pass and none went blind.
Blast radius
None at runtime; file layout of one package.
Risk
Low. Tier: no_review (ordinary change (consequential 0.09, blast 1.05))
Follow-ups (not in this PR)
🤖 Generated with Claude Code