Repository navigation
test(lifecycle): W3c engine cells: kill mid-commit recovery, decide-mode cache stats - #4916
Conversation
…cache stats R1: kill the applying engine (SIGKILL via a sitecustomize hook chained after the network guard) after the first package publish, after the first file link and inside the services render; the next plain install must equal a full install in tree, lock, receipts and modes, with no staging left. R2: decide-mode declines and hits stat every cache path (size, mtime_ns), roots included, so a write, utime, eviction or created root is visible. Co-authored-by: Copilot App <[email protected]>
…uard Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
An unguarded SIGKILL lookup breaks Windows test collection, and writable-cache tests fail to verify the claimed read-only-cache behavior.
2 open issues
What changed in this PR
This test-only PR extends the lifecycle parity suite from #4849 with recovery and cache-immutability checks for the locked-install engine in #4893.
Changes:
- Adds three SIGKILL injection points and checks that a subsequent install recovers to full-install state.
- Adds cache metadata checks for declined decisions and no-op/warm-locked hits.
- Allows either supported decline reason for the escaped-Unicode hook case while retaining full-run parity checks.
| File | Description |
|---|---|
tests/lifecycle/scenarios/test_engine_parity.py |
Adds recovery cells, cache-stat assertions, shared fault-hook setup, and broader Unicode decline expectations. |
Review effort: Balanced
…commit_package, _write, _render) Co-authored-by: Copilot App <[email protected]>
|
Evidence at #4893 head fb32632. One serial host_guard run with the engine driver, in an evidence worktree at fb32632 with this PR's test files (head 765012e) overlaid:
At main (this branch), the touched set is |
There was a problem hiding this comment.
🟡 Changes recommended
An unguarded signal.SIGKILL reference breaks Windows test collection, while the new scenarios fail to exercise genuinely read-only caches or recovery after partial service-configuration writes.
3 open issues
Review effort: Balanced
|
Evidence at the final #4893 head a8e519d (
At fb32632, R1 was red (leaked install snapshots). The fix is in a8e519d. |
…s for decide hits - New crash point after the first durable service write (run_services + write seam hooks); the fixture deletes the MCP configs so services must rewrite them. - Decide-mode hits run with every cache write bit dropped and compare mode bits. - SIGKILL lookup tolerates Windows collection. Co-authored-by: Copilot App <[email protected]>
… relaxed escape reason) Identical to #4916 head 78eabdf, so the two PRs merge cleanly in either order. Co-authored-by: Copilot App <[email protected]>
…e full pipeline HeldOutput.release raises a broken-pipe OSError on a warm-locked apply: the command exits non-zero, no second pipeline runs, at most one decision line, and the tree equals a full install. Co-authored-by: Copilot App <[email protected]>
|
Evidence at #4893 head 2f7ae30 (no-clobber publish; non-directory or symlink package paths decline). One serial host_guard run with the engine driver; this PR's test files (head 703f3ca) are overlaid:
New cell
|
…#4916 703f3ca cells into the lane C train Co-authored-by: Copilot App <[email protected]>
- The decline invariant digests raw bytes, raw symlink targets, directories and full lstat modes (no <ROOT> normalization). - The escaped-unicode hook cell requires the approve step itself to succeed. Co-authored-by: Copilot App <[email protected]>
The W3c cells follow the same family split: kill-mid-commit, decide-mode hits and the output-failure cell join test_engine_parity_invariants.py; their measured per-cell durations join the seed. Co-authored-by: Copilot App <[email protected]>
… judges its targets The install judges its effective targets (auto-detect included) against the org compilation-target policy, while audit judges only declared targets; the engine now runs that same check (run_dependency_policy_checks with the effective target decision) and declines on any finding. The lost-race cell races the platform's no-replace primitive (rename on Windows). Adopts #4916's split engine parity modules and measured CI durations byte-identical. Co-authored-by: Copilot App <[email protected]>
…ing deployed file after a no-op hit Co-authored-by: Copilot App <[email protected]>
…diff-apply exists Co-authored-by: Copilot App <[email protected]>
Union: the #4849 oracle (receipt_history, receipt directory and mode, HOME mode parity, s/m/h policy age, main merges) plus the W3c cells; one new seed entry. Co-authored-by: Copilot App <[email protected]>
e634b5c) The oracle compares receipt history only between same-history twins (receipt_history=False by default), so an incremental install's prior-write history no longer fails W4's incremental == fresh deploy cell. Co-authored-by: Copilot App <[email protected]>
…rf-engine-parity-w3c
…eyed separately) Co-authored-by: Copilot App <[email protected]>
Parity kit and CI durations stay byte-identical to #4916 5a473a7, which already contains this main. Co-authored-by: Copilot App <[email protected]>
…-w3c # Conflicts: # .github/ci-durations/linux-x86_64.json


Description
W3c cells for the lane C engine train (#4893), stacked on #4849 (frozen at 905d3d0). They use the same kit and the same red-first
KnownFailure(#4770)signature.test_kill_mid_commit_then_install_equals_the_full_world[after-first-package-published | after-first-file-linked | inside-services-render].sitecustomizehook, chained after the world's network guard, SIGKILLs the applying engine at a namedapm_cli.install.diff_applyhook (_publish/_write/_render_services).apm installmust equal a full install: tree, lockfile text, receipts and file modes, with no.apm-resolution-stagingleft.test_declined_fast_path_writes_nothing[*]now also stats every cache path (size, mtime_ns), with roots included. The newtest_decide_mode_hit_leaves_caches_untouched[noop | warm-locked]does the same for hits under read-only caches.non-ASCII deployed contentorno matching package record); it still requires FULL with parity.Retargets to
mainonce #4849 lands.Issue and approved scope
Issue: Refs #4770
Human scope-approval comment: Lane C build plan (perf org), VP ruling for the W3c cells; test-only, no product code.
Does this PR complete the issue, or what remains? No. It adds gate cells; the engine lands in #4893.
Type of change
Testing
Local at main, engine driver, through host_guard:
pytest tests/lifecycle/scenarios/test_engine_parity.py -k "kill_mid_commit or decide_mode_hit or writes_nothing or write_fault" -n 0->47 deselected, 18 xfailed. Every cell is known-red on the missing-decision signature, and there are no unexpected failures. Evidence at the #4893 head will be posted as a comment.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)