Repository navigation
fix(audit): name a local dependency whose content changed since the lock - #4474
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits intoNov 21, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
Daniel Meppiel (danielmeppiel) merged 4 commits into
Conversation
The local-dependency content verdict install --frozen applies moves to one owner (install/local_content_verdict.py); the audit --ci content-integrity check reports the same dependencies, so both commands reach one verdict. apm-spec-waiver: audit --ci reports local dependency content drift through the verdict install --frozen already applies; no normative change 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 18:52
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
User-workspace audits read the manifest from the wrong root, the mutation test targets outdated code, and local-content failures can disappear from SARIF alerts when combined with other violations.
3 open issues
What changed in this PR
This PR addresses #4447 by sharing the local-dependency content verdict between apm audit --ci and apm install --frozen, so audit can name dependencies that changed since their locked snapshot.
Changes:
- Extracts frozen-install verification into a shared helper and adds its diagnostics to audit.
- Redirects architecture guards to the extracted helper.
- Adds lifecycle regression coverage, promotes the affected security cell to required coverage, and records the fix.
| File | Description |
|---|---|
src/apm_cli/install/local_content_verdict.py |
Extracts the shared local-content verdict. |
src/apm_cli/install/service.py |
Delegates frozen verification to the shared helper. |
src/apm_cli/policy/ci_checks.py |
Includes local-content drift in audit integrity checks. |
scripts/architecture_linter/checks/install_single_file.py |
Redirects the materialization guard to the helper. |
scripts/architecture_linter/checks/install_package_content_hash.py |
Updates the guarded hash-verification location. |
tests/integration/test_local_dependency_content_parity_lifecycle.py |
Checks matching refusals and unchanged project state. |
tests/lifecycle/security/gate_slices/native.py |
Removes the affected cell's known-failure exemption. |
tests/quality/generated_obligations.json |
Refreshes required security and journey witnesses. |
tests/fixtures/lifecycle_bug_ledger.json |
Records #4447 and its regression coverage. |
CHANGELOG.md |
Documents the audit diagnostic improvement. |
Review effort: Balanced
| "read_local_package_source": {"virtual_file_subdirectory", "load_frontmatter"}, | ||
| }, | ||
| SERVICE: {"_verify_frozen_local_content": {"compute_local_package_hash"}}, | ||
| LOCAL_VERDICT: {"local_content_reasons": {"compute_local_package_hash"}}, |
| project_root, lock, targets | ||
| ) | ||
| staged_drift = lock.staged_hash_drift(project_root) | ||
| local_drift = _local_content_drift(project_root, lock) |
| remedies.extend(restore_drifted_files_remedy(bundle=bundle) for bundle in sorted(owners)) | ||
| if local_drift: | ||
| # install --frozen refuses the same local dependencies (#4447). | ||
| parts.extend(local_drift) |
apm-spec-waiver: audit --ci reports local dependency content drift through the verdict install --frozen already applies; no normative change Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…changed since the lock Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-audit-local-dep-parity-4447
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 audit --cinames a local dependency whose content changed since the lock, asapm install --frozendoes. Both commands reach one verdict on the same tree.install/local_content_verdict.pylocal_content_reasonsis now the one local-dependency content verdict. It holds the logic that was insideInstallService._verify_frozen_local_content, which now calls it and still raises the sameFrozenInstallError.policy/ci_checks.py_check_content_integrityreports the same dependencies (local dependency '<path>' content differs from its locked snapshot). Thecontent-integritycheck fails, and the drift replay still runs and reports its own findings.install-deployment-package-content-hashandinstall-deployment-single-file-materializationguards now point at the new owner.G|audit-ci|definition-changed|nativeis no longer a strict known cell. fix(install): policy-blocked install names a runnable next step #4418 tags it with audit --ci passes a local dependency whose content changed since the lock, which install --frozen refuses #4447.Issue and approved scope
Issue: Fixes #4447
Human scope-approval comment: #4447 (comment)
Does this PR complete the issue, or what remains? It completes the issue.
Type of change
Testing
New test:
tests/integration/test_local_dependency_content_parity_lifecycle.py::test_audit_ci_and_frozen_refuse_alike_a_changed_local_dependency. It drives the installed CLI and runs a pairedaudit --ci/install --frozenprobe on one state: both exit 1 and name the dependency, and the project and lockfile are unchanged. TheG|audit-ci|definition-changed|nativelifecycle cell now runs as a required cell.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-architecture-boundaries.shuv run --frozen --extra dev python scripts/check_complexity_ratchet.py --base-ref origin/mainuv run --frozen --extra dev python -m tests.lifecycle.witnessesAPM_BINARY_PATH=.venv/bin/apm uv run --frozen --extra dev pytest -n 2on the new test, 25 local/replacement/audit-replay integration modules, unit policy, frozen and architecture tests, the ledger and the flipped cellChangelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)
apm-spec-waiver: audit --ci reports local dependency content drift through the verdict install --frozen already applies; no normative change