You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three files have grown large enough to be both hard to navigate and, per AGENTS.md, an active merge hazard:
crates/sandboxwich-worker/src/provider.rs — 3,978 lines (tests were already extracted into provider/tests.rs in a prior pass, so this is all implementation).
crates/sandboxwich-core/src/lib.rs — 2,402 lines of shared typed contracts.
AGENTS.md's "Landing PRs" section already names crates/sandboxwich-worker/src/provider.rs as one of the shared hot files that produced semantic merge conflicts during the 2026-07-09 audit wave (three incidents: #96×#98, #97×#99, #97/#99×#100) and instructs auditing all call sites after merging anything that touches it. The file's size is a direct contributor to why merges collide there.
Evidence
crates/sandboxwich-worker/src/provider.rs: 3,978 lines (wc -l), named explicitly in AGENTS.md under "Landing PRs" as a shared hot file requiring post-merge call-site audits.
Apply the same #110-style split used for the API crate:
provider.rs: separate by concern, e.g. Kubernetes manifest construction (Pod/PVC/Service/NetworkPolicy/VolumeSnapshot builders), the dry-run vs apply-mode branching, reconciliation, and the kubectl-invocation plumbing (run_kubectl_command_with_stdin and friends) into their own modules under provider/.
crates/sandboxwich-core/src/lib.rs: split typed request/response/event contracts by resource family (sandboxes, jobs/leases, snapshots, workers, runtime resources) into submodules, re-exported from lib.rs.
crates/sandboxwich-worker/src/main.rs: separate the CLI arg parsing/entrypoint from the work loop (work_loop, handle_lease, claim, heartbeat/registration/drain helpers), mirroring the "thin entrypoint, logic in modules" convention AGENTS.md already establishes for the API crate.
Smaller, concern-scoped modules reduce the odds of two PRs touching the same lines and reduce the blast radius AGENTS.md asks reviewers to audit after every merge.
Problem
Three files have grown large enough to be both hard to navigate and, per
AGENTS.md, an active merge hazard:crates/sandboxwich-worker/src/provider.rs— 3,978 lines (tests were already extracted intoprovider/tests.rsin a prior pass, so this is all implementation).crates/sandboxwich-core/src/lib.rs— 2,402 lines of shared typed contracts.crates/sandboxwich-worker/src/main.rs— 2,110 lines.AGENTS.md's "Landing PRs" section already namescrates/sandboxwich-worker/src/provider.rsas one of the shared hot files that produced semantic merge conflicts during the 2026-07-09 audit wave (three incidents: #96×#98, #97×#99, #97/#99×#100) and instructs auditing all call sites after merging anything that touches it. The file's size is a direct contributor to why merges collide there.Evidence
crates/sandboxwich-worker/src/provider.rs: 3,978 lines (wc -l), named explicitly inAGENTS.mdunder "Landing PRs" as a shared hot file requiring post-merge call-site audits.crates/sandboxwich-core/src/lib.rs: 2,402 lines (wc -l).crates/sandboxwich-worker/src/main.rs: 2,110 lines (wc -l).crates/sandboxwich-api/src/main.rswas already split this way in Split sandboxwich-api main.rs and http_contract.rs into modules #110 intohandlers/by resource family,db.rs,auth.rs,scheduler.rs,cleanup.rs, etc., perAGENTS.md's "Layout" section.Suggested approach
Apply the same #110-style split used for the API crate:
provider.rs: separate by concern, e.g. Kubernetes manifest construction (Pod/PVC/Service/NetworkPolicy/VolumeSnapshot builders), the dry-run vs apply-mode branching, reconciliation, and thekubectl-invocation plumbing (run_kubectl_command_with_stdinand friends) into their own modules underprovider/.crates/sandboxwich-core/src/lib.rs: split typed request/response/event contracts by resource family (sandboxes, jobs/leases, snapshots, workers, runtime resources) into submodules, re-exported fromlib.rs.crates/sandboxwich-worker/src/main.rs: separate the CLI arg parsing/entrypoint from the work loop (work_loop,handle_lease,claim, heartbeat/registration/drain helpers), mirroring the "thin entrypoint, logic in modules" conventionAGENTS.mdalready establishes for the API crate.Smaller, concern-scoped modules reduce the odds of two PRs touching the same lines and reduce the blast radius
AGENTS.mdasks reviewers to audit after every merge.