Commit bcc8b64
refactor(engine): bundle apply_plan args into ApplyContext struct (#54)
apply_plan reached 9 positional parameters in M3 (5 adapters + plan
+ snapper config + 2 paths) and was carrying clippy::too_many_arguments
allows on both itself and record_apply_failure. Per the M3 retrospective
"Actions for M4" item 2, fold the system-side wiring into a borrow-only
struct so future apply-time additions (e.g. ADR-0012 nix bootstrap
preflight wiring) extend the struct rather than the call surface.
- New `ApplyContext<'a>` struct in pearlite-engine::apply with eight
borrowed fields (5 trait-object adapters, snapper_config, state_path,
failures_dir). Re-exported from pearlite_engine.
- `apply_plan(&self, plan, &ApplyContext)` — drops to 3 args.
- `record_apply_failure` likewise takes the context, dropping from 9
to 6 args and removing its too_many_arguments allow.
- CLI dispatch.rs constructs the context from its existing per-call
values; no behavior change.
- Test sites use a `make_ctx` helper for the standard mock set; the
three injected-failure tests (FailingHm, FailingSnapper,
FailingRestart) construct ApplyContext literals inline.
Tests: 303 passing (no change). Clippy clean. fmt clean. audit clean.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8cd539c commit bcc8b64
3 files changed
Lines changed: 303 additions & 248 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
0 commit comments