Repository navigation
fix(frozen): withdraw unrecorded deployments before refusing (#4309) - #4394
Merged
Daniel Meppiel (danielmeppiel) merged 9 commits intoNov 21, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 9 commits into
Daniel Meppiel (danielmeppiel) merged 9 commits into
Conversation
A refused apm install --frozen that deployed files apm.lock.yaml does not record left them on disk, so the lock no longer matched the disk (I7). The frozen owner now removes exactly the unrecorded files this install wrote, proven by this installation's deployment receipts, through the cleanup owner, then refuses. A file without that proof is kept and named. The installed-CLI test asserts exit 1, the named diagnostic and a byte-identical project; the spine's strict cell spine-cell-frozen-underrecording is removed; a ledger row is added. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 16:02
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Frozen-install withdrawal can delete pre-existing or committed skill files because it relies on historical receipts and overly broad recursive cleanup instead of limiting removal to writes from the current invocation.
4 open issues
What changed in this PR
This PR addresses #4309 by adding receipt-based cleanup before apm install --frozen refuses unrecorded deployments. It connects frozen-install enforcement to the existing deletion owner while keeping the lockfile unchanged.
Changes:
- Adds deployment withdrawal and kept-path reporting to frozen-install refusal.
- Strengthens lifecycle snapshot assertions and removes the known-failure exception.
- Updates recovery documentation, the regression ledger, and the changelog.
| File | Description |
|---|---|
tests/quality/test_taxonomy_baseline.json |
Removes the regression test’s taxonomy exception. |
tests/lifecycle/machines/test_m_spine.py |
Stops expecting the frozen-underrecording failure. |
tests/lifecycle/machines/_spine_kit.py |
Removes the known-failure allowance. |
tests/integration/test_frozen_no_rewrite_e2e.py |
Adds deployment-removal and unchanged-snapshot assertions. |
tests/fixtures/lifecycle_bug_ledger.json |
Records #4309 and its regression test. |
src/apm_cli/install/service.py |
Invokes withdrawal before refusing unrecorded deployments. |
src/apm_cli/install/frozen_withdrawal.py |
Implements receipt-based cleanup and refusal reporting. |
packages/apm-guide/.apm/skills/apm-usage/commands.md |
Updates the frozen-install command guidance. |
docs/src/content/docs/reference/cli/install.md |
Documents withdrawal and distinguishes hash-drift recovery. |
CHANGELOG.md |
Adds the user-facing frozen-install fix entry. |
Review effort: Balanced
…l cannot prove it wrote Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This was referenced Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…e refusing (#4309) Co-authored-by: Copilot App <[email protected]> # Conflicts: # tests/fixtures/lifecycle_bug_ledger.json
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
#4258 makes kept a required keyword (explicit kept=() at non-install callers); #4394's frozen_withdrawal caller predates that and relied on the old default. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…e refusing (#4309) Co-authored-by: Copilot App <[email protected]>
…4309) Review fold on #4394: - A journal taken before the pipeline (this installation's receipts and the existing target directories) scopes withdrawal to files whose receipt is new or changed in this invocation; an older receipt never authorizes it. - Files the committed lock records are protected, even under a new directory claim. - Only directories this invocation created are removed. - Each kept file names its reason (adopted, edited, could not be removed) with a runnable next step. Component tests pin each tightening. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…(AQ004) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…e refusing (#4309) Co-authored-by: Copilot App <[email protected]> # Conflicts: # src/apm_cli/install/frozen_withdrawal.py # src/apm_cli/integration/cleanup.py
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…e refusing (#4309) Co-authored-by: Copilot App <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
3 of 7 tasks
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-frozen-unrecorded-rollback-4309
branch
November 21, 2026 05:24
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.


Description
A refused
apm install --frozenthat had deployed filesapm.lock.yamldoes not record (for example a new local skill) exited 1 but left those files on disk. As a result, the lock no longer matched the disk, which breaks I1 and I7. Before refusing, the frozen owner (InstallService._enforce_frozen_no_rewrite) now calls the newinstall/frozen_withdrawal.py:remove_stale_deployed_files, which also retires those receipts. Parent directories the removal empties are removed too.kept <path>: no receipt proves this install wrote it). That covers a user file the install adopted, or a file edited since.apm.lock.yamlis unchanged.The refusal stays post-deploy. Refusing before the first write would need path-level deploy plans that the pipeline does not have. Native target files sit outside the install transaction, so rollback could not undo them either.
Issue and approved scope
Issue: Fixes #4309
Human scope-approval comment: #4309 (comment)
Does this PR complete the issue, or what remains? It completes it: a refused frozen install leaves disk and lock byte-identical, and the spine's strict cell
spine-cell-frozen-underrecordingis removed.Type of change
Testing
What changed in the tests:
tests/integration/test_frozen_no_rewrite_e2e.py(installed CLI,lifecycle_smoke) used to pin the deployed file; that assertion failed before this fix. It now asserts exit 1, the named diagnostic, the new tip, that the deployed path is absent, and a byte-identical project snapshot (assert_snapshot_set_unchanged). It carries the tm006 markerse2eandpromise("P-INV-I7", "P-LAW-lockfile.frozen_preserves_bytes", "req-lk-006").spine-cell-frozen-underrecordingis removed from_spine_kit.pyandtest_m_spine.py.tests/fixtures/lifecycle_bug_ledger.json.Static gates, all green: ruff on the changed files,
scripts/lint_architecture_boundaries.py, the complexity ratchet, andpython -m tests.lifecycle.generator --check.service.pyis at 997 of its 1000-line budget.Changelog
## [Unreleased]inCHANGELOG.md(Fixed).Spec conformance (OpenAPM v0.1)