Repository navigation
fix(install): frozen judges lock sync only from copies that match the lock - #4401
Merged
Daniel Meppiel (danielmeppiel) merged 22 commits intoNov 21, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 22 commits into
Daniel Meppiel (danielmeppiel) merged 22 commits into
Conversation
…' into danielmeppiel-cache-integrity-parity-4356
…pdate The audit --ci replay reads locked git sources through the same persistent cache as install, --frozen and update (attach_persistent_git_cache), so both commands recompute content_hash over the same bytes and reach one verdict. A re-fetch of an existing apm_modules copy is staged with the install transaction, so a refused install leaves apm_modules as it was. update reports a refusal through the [x] error line. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
… probes and ledger Adds the install-deployment-locked-source-cache closed-world guard and its mutation case, installed-CLI paired audit --ci / install --frozen probes and an update refusal probe, ledger rows and a CHANGELOG line. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ntegrity-parity-4356
…omission cell to #4389 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
… lock The frozen preflight defers an apm_modules copy that differs from its locked content_hash to the strict post-restoration check, so install --frozen and audit --ci reach one verdict on an edited copy whose locked source is intact. The MCP-omission lifecycle test now pairs audit --ci and install --frozen on that state. 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:17
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The audit --ci replay attaches the persistent git cache read-only: it serves an existing checkout for the locked commit and never creates, evicts or records cache entries; any miss falls back to a fresh clone. Updates the integrate re-download unit test for the staged copy. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
A nested copy staged before its parent no longer occupies the parent's backup path; both staging orders roll back byte for byte. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ozen-verified-copy-4389 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
Daniel Meppiel (danielmeppiel)
changed the base branch from
danielmeppiel-cache-integrity-parity-4356
to
main
November 20, 2026 16:56
…verified-copy-4389
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The locked-source-cache mutation test uses an outdated fragment missing read_only=True, so its verbatim-match assertion fails before the guard can test the boundary.
1 open issue
What changed in this PR
This follow-up to #4385 addresses #4389 by making frozen installs judge lock sync from verified package copies, aligning their verdict with apm audit --ci when local copies have been edited.
Changes:
- Defers frozen MCP preflight checks for mismatched copies until verified restoration.
- Builds on shared Git-cache access and transactional preservation of copies during re-fetches.
- Expands parity and rollback regression coverage, architecture guards, and issue tracking.
| File | Description |
|---|---|
tests/unit/scripts/test_architecture_runner.py |
Adds the shared-cache guard to the expected inventory. |
tests/unit/install/test_resolution_staging_relocate.py |
Covers nested staging and rollback in either order. |
tests/unit/install/test_integrate_orchestration.py |
Verifies rollback restores a mismatched package copy. |
tests/quality/generated_obligations.json |
Refreshes lifecycle coverage and known-issue mappings. |
tests/lifecycle/security/test_integrity.py |
Makes resolved integrity scenarios required checks. |
tests/integration/test_mcp_omission_lifecycle.py |
Checks audit/frozen parity, restoration, and unchanged deployed bytes. |
tests/integration/test_locked_source_cache_parity_lifecycle.py |
Adds shared-cache refusal and state-preservation scenarios. |
tests/integration/test_architecture_owner_rule_mutations.py |
Adds a shared-cache boundary mutation case. |
tests/fixtures/lifecycle_bug_ledger.json |
Records fixes and their regression tests. |
src/apm_cli/integration/mcp_config_view.py |
Defers declarations from copies that contradict the lock. |
src/apm_cli/install/transaction.py |
Adds transactional preservation of existing copies. |
src/apm_cli/install/sources.py |
Stages existing copies before sequential re-fetches. |
src/apm_cli/install/resolution_staging.py |
Uses isolated backup slots for nested packages. |
src/apm_cli/install/phases/resolve.py |
Uses the shared cache-attachment helper. |
src/apm_cli/install/phases/integrate.py |
Stages mismatched copies instead of deleting them. |
src/apm_cli/install/phases/download.py |
Stages copies before parallel re-fetches. |
src/apm_cli/install/drift.py |
Uses read-only shared-cache access during audit replay. |
src/apm_cli/commands/update.py |
Routes dependency and integration failures through error logging. |
src/apm_cli/commands/outdated.py |
Reuses shared cache attachment. |
src/apm_cli/cache/paths.py |
Allows cache-root lookup without directory creation. |
src/apm_cli/cache/git_cache.py |
Adds read-only lookups and centralized cache attachment. |
scripts/architecture_linter/checks/install_locked_source_cache.py |
Guards shared-cache, staging, and frozen-verdict routing. |
scripts/architecture_linter/checks/install_locked_content_verdict.py |
Permits the MCP view to call the shared verdict owner. |
scripts/architecture_linter/checks/install_deployment_analyzers.py |
Registers the shared-cache architecture guard. |
CHANGELOG.md |
Documents frozen parity and stacked integrity fixes. |
.apm/architecture/owners/install-deployment.json |
Records cache and staging ownership and the new guard. |
Review effort: Balanced
apm-spec-waiver: frozen lock sync now reads only package copies that match the lock; req-lk-015 and req-lk-006 behavior is unchanged Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…lay cache Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…rity-4356' into danielmeppiel-frozen-verified-copy-4389
… re-fetch A content hash refusal can only reject a row that records content_hash, so only those copies are staged with the install transaction; rows without one re-fetch in place as before. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…rity-4356' into danielmeppiel-frozen-verified-copy-4389
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…pies that match the lock Co-authored-by: Copilot App <[email protected]> # Conflicts: # tests/fixtures/lifecycle_bug_ledger.json # tests/quality/generated_obligations.json
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…pies that match the lock Co-authored-by: Copilot App <[email protected]>
…names unhashed rows Under require_hashes both readers refuse and name the row; by default both accept it alike. The dependency-content-hashes audit check names the rows. apm-spec-waiver: aligns which local package copy install, --frozen, update and audit --ci read; req-lk-015 refusal and diagnostic unchanged Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…rity-4356' into danielmeppiel-frozen-verified-copy-4389
5 of 10 tasks
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-frozen-verified-copy-4389
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
Trust and integrity consistency:
apm install --frozenchecks lock sync against package copies that match the lock. On an editedapm_modulescopy whose locked source is intact, it therefore reaches the same verdict asapm audit --ci.Builds on #4385, whose commits this branch includes until #4385 lands.
integration/mcp_config_view.py: in the frozen preflight (allow_pending), a remote package copy that differs from its lockedcontent_hashis deferred like a missing copy. The verdict comes from the sharedsource_helpers.locked_content_mismatchowner, through_copy_contradicts_lock. The strict post-restoration check (enforce_hydrated_mcp) then judges that package's declarations from the verified copy frozen restores.install-deployment-locked-source-cachenow requires the view to route through that verdict.install-deployment-locked-content-verdictadmits the view as a verdict caller.tests/integration/test_mcp_omission_lifecycle.py::test_skills_only_preserves_admitted_baseline_and_real_drift[False]is no longer a strict known cell. The[False]branch now runs a pairedaudit --ci/install --only apm --frozenprobe on each edited-copy state (changed or removed MCP declaration, deleted synthesized manifest). It asserts:.mcp.jsonand deployed files are byte-identical;The
[True]root-declared branch still asserts reported drift.Issue and approved scope
Issue: Fixes #4389
Human scope-approval comment: tracked by the 0.37 security stream lead (follow-up to #4356 on the steward-approved I3 re-anchor from #4271).
Does this PR complete the issue, or what remains? It completes the issue.
Type of change
Testing
uv run --frozen --extra dev ruff check/ruff format --check(CI paths)uv run --frozen --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 ...bash scripts/lint-auth-signals.sh;bash scripts/lint-architecture-boundaries.shuv run --frozen --extra dev python scripts/check_complexity_ratchet.py --base-ref origin/mainAPM_BINARY_PATH=.venv/bin/apm uv run --frozen --extra dev pytest tests/integration/test_mcp_omission_lifecycle.pyChangelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)
apm-spec-waiver: frozen lock sync now reads only package copies that match the lock; req-lk-015 and req-lk-006 behavior is unchanged