Repository navigation
fix(install): --frozen refuses a dropped target before any write (#4517) - #4519
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits intoNov 20, 2026
Merged
Conversation
…re fix) Co-authored-by: Copilot App <[email protected]>
enforce_frozen now refuses, before the pipeline, a lock that still records files of a target apm.yml no longer declares, naming the target, its files and the FROZEN_TARGET_DROPPED remedy. The dropped-target predicate is shared with the contraction owner (manifest_reconcile._dropped_target_of). New baseline audit check lockfile-targets-current fails the same state through the same owner, so apm audit --ci agrees with --frozen (I3). apm-spec-waiver: frozen refusal ordering only; no OpenAPM-observable lock format change. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 21:38
Co-authored-by: Copilot App <[email protected]>
This was referenced Nov 20, 2026
Daniel Meppiel (danielmeppiel)
merged commit Nov 20, 2026
a9a0700
into
train/0.37-final-2
3 checks passed
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: Copilot App <[email protected]>
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.
Fixes #4517 (scope record: #4517 (comment))
Description
When
apm.ymldrops a target butapm.lock.yamlstill records that target's files,apm install --frozenused to delete those files and then exit 1 ("files recorded in apm.lock.yaml are missing"). A failed command changed bytes on disk. Meanwhileapm audit --cipassed the same state, so the two disagreed (I3).The contract the steward approved: no deletion before the gate passes, and
--frozennever writes when it refuses.install/manifest_reconcile._dropped_target_ofis the dropped-target classifier. The target-contraction owner (reconcile_target_deployed_files) now uses it too, so there are no parallel copies.dropped_target_files(project_root, lock)exposes it.InstallService.enforce_frozencalls_refuse_frozen_dropped_targetsbefore the pipeline. It exits 1 naming the target and each recorded file, with the catalog remedyFROZEN_TARGET_DROPPED: "Run 'apm install' to retire the dropped target and update apm.lock.yaml (without --frozen, ...), then commit apm.lock.yaml."lockfile-targets-currentruns afterno-orphaned-packages. It uses the same owner and the same remedy.Issue and approved scope
Issue: Fixes #4517
Human scope-approval comment: #4517 (comment)
This PR completes the issue. Out of scope, per the record: passing
--frozenwhen only the dropped target's files are missing (rejected), and changes to non-frozen retirement.Type of change
Testing
New installed-CLI cell:
tests/integration/test_frozen_dropped_target_lifecycle.py::test_frozen_refuses_a_dropped_target_with_zero_writes_and_its_remedy_runs(lifecycle_smoke). It steps through:--frozenandaudit --ciboth pass and change no bytes.claude.--frozenexits 1 and the project tree (lock, deployed files,apm_modules) is byte-identical. The output names the target and.claude/rules/one.md (target claude)and prints the remedy exactly once.audit --ciexits 1 with no writes.apm installretires the claude file and its lock row, after which--frozenandaudit --ciboth pass byte-stably.Fails-before evidence (APM_BINARY_PATH = this worktree's
.venv/bin/apm,--version=0.37.0):dfd327c2e7(test only, on train-2b7bd508b3c), RED:AssertionError: a refused --frozen install changed files-- the snapshot lost.claude/rules/one.md(Right contains 1 more item: {'.claude/rules/one.md': ...}).f9d904000d(fix), GREEN: the node passes, along with tests/unit/policy/test_ci_checks.py. In tests/unit/test_audit_policy_command.py one test fails,TestCiWithPolicyFlag::test_ci_with_policy_json_output. That failure is PRE-EXISTING on baseb7bd508b3c(same JSONDecodeError with base src): an integrity advisory on stdout ahead of the JSON, emitted by commands/audit.py, which this PR does not touch.Lint (touched files):
uvx [email protected] checkandformat --check,scripts/lint-auth-signals.sh, and the complexity ratchet are clean. The architecture linter and pylint were not run locally because of the host emergency; CI covers them.Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)