Repository navigation
metrics: split sandbox/worker.rs into one module per metric family (pure move) - #565
Merged
Merged
Conversation
ac-pplx
force-pushed
the
ac/split-metrics-sandbox-worker
branch
from
October 16, 2026 06:43
cdafdd4 to
15f86d6
Compare
…ure move) sandbox/worker.rs is keyed by emitter: every sandbox-manager feature appends its metric family here. Move each family into its own child module: guest_bridge, route_authorization, net_gateway, teardown_suspend, auto_lifecycle, cleanup, quarantine_recovery, inventory, health and ingress. New families then get a module of their own instead of growing this file. Generated by scripts/split_rust_module.py (#562) from the spec in the pull request. Items move verbatim. The only edits keep each item's reach: 10 private items, fields or methods become pub(super). The parent re-exports the moved items, so no caller changes.
ac-pplx
force-pushed
the
ac/split-metrics-sandbox-worker
branch
from
October 16, 2026 06:46
15f86d6 to
33c0668
Compare
ac-pplx
marked this pull request as ready for review
October 16, 2026 14:49
Collaborator
ReviewNo findings. Verified against What I ran:
What I didn't check: whether the grouping is the right one. That's a design call, and I took the body's word for it. I also didn't rebuild or retest the crate; CI is green on this head. |
the-gigi-pplx
approved these changes
Oct 16, 2026
the-gigi-pplx
left a comment
Collaborator
There was a problem hiding this comment.
Approved. No findings; details in the review comment above.
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
crates/libs/metrics/src/sandbox/worker.rs(1,406 code lines) is keyed by emitter: every sandbox-manager feature appends its metric family here. This moves each family into its own module, so new families get a module of their own instead of growing this file.worker.rsdrops to 66 code lines; the largest new file isroute_authorization.rsat 239.This is a pure move, generated by
scripts/split_rust_module.py(#562) from the spec below and proved by itsverify. It is part of splitting the largest production modules into smaller ones with one job each.What moved where
guest_bridgeroute_authorizationnet_gatewayteardown_suspendauto_lifecyclecleanupquarantine_recoveryinventoryhealthingressworker.rs(parent)execution_release_decisionfamily, which has no caller (a separate deletion)How to check it
The spec (item names, not lines):
The tool is
scripts/split_rust_module.pyfrom #562 (not on main yet).b9fc395e0, runsplit_rust_module.py apply spec.toml && cargo fmt --all. This reproduces the first commit.split_rust_module.py verify origin/main→regenerated and compared 11 files from 1 split parents: identical.verifyderives the spec from the diff, regenerates the split from the merge base, and requires HEAD's Rust files to equal the rustfmt'd result byte for byte.pub(super). Each keeps the reach the item had: one module deeper,pub(super)reaches exactly the old module.Observable changes
Log targets: none change; no moved event or span lacks an explicit
target:.Diagnostics name new locations:
std::any::type_nameof a moved type names its new module;The reviews found nothing in the repository that depends on these.
Validation
Run on a Linux development machine at the PR head:
cargo check --workspace --all-targets --all-features --locked: pass, no warnings.run_clippy_checkswith-D warnings: pass.cargo check -p pplx-space-metrics --no-default-features --all-targets: pass.cargo nextest run -p pplx-space-metrics --all-features: 9/9 passed; the package needs no Postgres or privileges.file_sizeentry below.pplx_space_metrics::sandbox::worker::Xpaths. The re-exports keep all of them, and the workspace check covers them.Interactions
No open pull request touches
sandbox/worker.rs. Theexecution_release_decisionfamily left in the parent has had no caller since #254, so a separate PR can delete it.Follow-ups, kept out of this PR because
verifyallows no other Rust edits: the parent's//!doc still describes families that moved (ingress, activation environment); and the unusedexecution_release_decisionfamily can be deleted.The archcheck
file_sizebaseline entry for this file is now stale (an advisory finding). Split PRs leave that table alone, so they don't conflict with each other there; one follow-up prunes the stale entries after they land.Rollback
Revert the commit(s). No data, configuration, wire or public API change.
🤖 Generated with Claude Code