Skip to content

Split placement switch into responsibility owners - #5223

Merged
joelteply merged 2 commits into
canaryfrom
codex/placement-switch-by-owner
Oct 20, 2026
Merged

joelteply merged 2 commits into
canaryfrom
codex/placement-switch-by-owner

Conversation

@joelteply

@joelteply joelteply commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Placement switching occupied one 1,775-line file. Split it by responsibility: persona owns the adapter, pure decisions and fixtures; Grid owns fleet orchestration and opportunity placement. This removes the duplicate upward dependencies introduced by the initial split without raising the layer baseline.

The orchestration Rust API moves from persona::placement_switch::follow_the_fleet to modules::grid::placement::follow_the_fleet; its sole repository caller is migrated. Function bodies and placement behavior are preserved. Native-model eligibility and fallback behavior repairs remain separate work.

Validation: git diff --check passes. Whole-file source measurement is 154,999 excess lines, down 775 from current canary. The largest touched core source file is below 1,000 lines. Final repaired-head CI passes, including Linux tests, Windows compilation/custody and hygiene; independent exact-head source review approves. The earlier upward-import hygiene failure was corrected by moving orchestration to its actual Grid owner. No serving-host compilation or deployment was performed.

@joelteply

Copy link
Copy Markdown
Contributor Author

Fable review at de04c44: APPROVE (source) as a pure split.

The claim I verified: no behaviour moved. I sorted the whitespace-normalized lines of placement_switch.rs at the merge-base and of the six resulting files, then compared the two sets.

  • Tests: 16 before, 16 after.
  • Lines only in the old file: mod tests {, one closing brace, fn of(...) (now pub(super) fn of), and SWITCHES.insert(switch.persona_id, switch). That last one is now switch.persona_id(), a getter, because the field crosses a module boundary.
  • Lines only in the new files: module declarations, use super::*, re-exports (pub use adapter::PlacementSwitch, pub(crate) use decision::{…}, follow_the_fleet, follow_the_allocation), module docs, and #![cfg(test)].

Every file is ≤494 lines, so the split passes the oversized-edit gate on #5221.

Not checked: CI, and whether the old public path for each moved item still resolves outside persona/. The re-exports suggest it does; compile will prove it.

🤖 Generated with Claude Code

@joelteply
joelteply force-pushed the codex/placement-switch-by-owner branch from de04c44 to c86e096 Compare October 20, 2026 15:22
@joelteply
joelteply marked this pull request as ready for review October 20, 2026 16:09
@joelteply

Copy link
Copy Markdown
Contributor Author

Independent source review by astra_architecture_review, exact c86e096: APPROVE. Reviewer reports no authorship or prior involvement.

Compared against merge-base9c2e7b8d: moved function/impl bodies and all16 tests preserved after indentation/visibility normalization; register uses equivalent persona_id getter. Sole fleet caller migrated to modules/grid/placement; no old forwarding facade or duplicate fleet implementation. No new Persona-to-Grid import. Existing switch/decision public paths preserved; orchestration path migration is explicit. Excess-line ratchet falls775. Read-only review, no runtime performance claim.

Parent separately verified all exact-head CI green, including Linux tests, Windows compilation/custody, binding drift and hygiene. Integration is not deployment or proof of learning.

@joelteply
joelteply merged commit a854548 into canary Oct 20, 2026
9 checks passed
@joelteply
joelteply deleted the codex/placement-switch-by-owner branch October 20, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant