Repository navigation
Trust and integrity consistency: audit --ci and install --frozen agree on locked content hashes - #4271
Merged
Daniel Meppiel (danielmeppiel) merged 21 commits intoNov 20, 2026
Conversation
… audit --ci apm audit --ci now asks the same owner as apm install (and --frozen) whether package bytes at the locked commit match the lock row's content_hash: warm copy checks, reused live copies and scratch downloads all route through install/source_helpers.locked_content_mismatch. Adds the install-deployment-locked-content-verdict architecture guard, its mutation case, and a lifecycle test pairing audit --ci with install --frozen on the same lockfile state (#4187). Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…fix (#4187) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…rdict (#4187) 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]>
…--frozen - One owner line names the entry, the locked content_hash and the observed value; install, install --frozen and the audit --ci replay all use it. - audit --ci reports an apm_modules copy that contradicts the lock before verifying from the locked source, and includes the line when the locked source cannot be reached. - Re-anchor two audit tests to the frozen/audit agreement: a cache copy that contradicts the lock gets one verdict from both commands, and an unverifiable one fails closed in both. Spec: req-lk-015 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
marked this pull request as ready for review
November 20, 2026 11:49
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 11:49
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical issues leave conformance assertions unreliable, allow registry audit replay to accept edited content hashes, and reject valid bare SHA-256 hashes.
3 open issues
What changed in this PR
This PR aims to align apm audit --ci and apm install --frozen on locked package content hashes, addressing stale-cache false drift reports while preserving audit's read-only behavior.
Changes:
- Introduces a shared content-hash verdict and consistent mismatch diagnostics.
- Checks cached and freshly downloaded Git content during audit replay.
- Adds lifecycle and conformance coverage, plus an architecture guard for shared verification.
| File | Description |
|---|---|
tests/unit/scripts/test_architecture_runner.py |
Registers the new guard in the expected inventory. |
tests/unit/install/test_architecture_invariants.py |
Updates the replay module's size allowance. |
tests/spec_conformance/test_lockfile_reqs.py |
Adds audit hash checks for both lockfile streams. |
tests/integration/test_virtual_skill_audit_e2e.py |
Covers stale-copy recovery and unreachable sources. |
tests/integration/test_unrecorded_drift_lifecycle_e2e.py |
Updates drift expectations for verified replay content. |
tests/integration/test_locked_package_hash_parity_lifecycle.py |
Adds warm/cold audit and frozen-install parity probes. |
tests/integration/test_architecture_owner_rule_mutations.py |
Adds a mutation case for bypassing verification. |
tests/fixtures/lifecycle_bug_ledger.json |
Records the hash-parity regression coverage. |
src/apm_cli/install/sources.py |
Routes fresh-install checks through the shared verdict. |
src/apm_cli/install/source_helpers.py |
Defines shared verification and diagnostic helpers. |
src/apm_cli/install/phases/integrate.py |
Reports expected and observed hashes before refreshing. |
src/apm_cli/install/drift.py |
Checks cached copies and fresh Git replay content. |
src/apm_cli/install/audit_replay.py |
Detects stale content and reports replay mismatches. |
scripts/architecture_linter/checks/install_locked_content_verdict.py |
Guards shared verification call paths. |
scripts/architecture_linter/checks/install_deployment_analyzers.py |
Registers the verification guard. |
CONFORMANCE.md |
Updates the displayed conformance test count. |
CONFORMANCE.json |
Records the new parameterized conformance cases. |
CHANGELOG.md |
Documents the intended audit/install consistency fix. |
.apm/architecture/owners/install-deployment.json |
Extends content-hash ownership and guard references. |
Review effort: Balanced
…ownloading install --frozen reports the shared locked-content line (entry, expected, observed) for an apm_modules copy whose bytes contradict the lock, before it verifies from the locked source. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> # Conflicts: # tests/fixtures/lifecycle_bug_ledger.json
…dict guard; adapt spec test to the new return shape Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> # Conflicts: # tests/fixtures/lifecycle_bug_ledger.json
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…locked source A cached copy that contradicts the lock is named with the entry, the expected and the observed envelope, verified from the locked source, and the command then passes with the lockfile and deployed files unchanged. Steward-approved I3 re-anchor (#4271). Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…it-frozen-hash-parity
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The package-content-hash owner compares a bare hex content_hash and a sha256: envelope as the same digest (req-lk-016); the cached, fresh and legacy-plugin checks of the shared locked-content verdict use it. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The audit --ci scratch replay now checks a registry package against its locked content_hash through the same verdict as git packages, so warm and cold audit replay agree with install --frozen on registry rows. Adds the registry warm/cold paired probe and re-anchors the guard's mutation case. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…it-frozen-hash-parity
…y ratchet Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-s13-audit-frozen-hash-parity
branch
November 20, 2026 14:00
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Main's #4271 replay content check adds a free-text 'apm install' tip; it now renders replay-cache-content-stale. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
6 of 10 tasks
Merged
5 of 10 tasks
This was referenced Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Fold [Unreleased] into the untagged [0.37.0] - 2026-11-20 block. Contributor, CI and test-only lines are dropped per the cut-release DROP list; exact duplicate lines from parallel merges are removed; the #4126/#4276 plugin-type lines are merged; the #4187 placeholder now names #4271. pyproject.toml is already 0.37.0. Refreshed again on the final release train; its train merge on main is the RC SHA. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Fold [Unreleased] into the untagged [0.37.0] - 2026-11-20 block on the final release train. Contributor, CI and test-only lines are dropped per the cut-release DROP list; exact duplicates from parallel merges are removed; the #4126/#4276 plugin-type lines are merged; the #4187 placeholder names #4271. pyproject.toml is already 0.37.0. The train merge on main is the RC SHA. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
Fold [Unreleased] into the untagged [0.37.0] block on the final release train. Contributor, CI and test-only lines are dropped per the cut-release DROP list; exact duplicates from parallel merges are removed; the #4126/#4276 plugin-type lines are merged; the #4187 placeholder names #4271. pyproject.toml is already 0.37.0. The train merge on main is the RC SHA. 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.

Description
Trust and integrity consistency:
apm audit --ciandapm install --frozenreach the same verdict on locked package content hashes. Audit's locked-copy replay uses the shared content-hash verdict from the package-content-hash / locked-copy-validity owner, in both directions (an edited lock hash and a stale replay copy).Draft: the lane is finishing tests, guard and CI. The description is completed before review.
Issue and approved scope
Issue: Fixes #4187
Issue: Fixes #4165
Human scope-approval comment: #4187 (comment) , #4165 (comment)
Does this PR complete the issue, or what remains? It completes both issues.
Type of change
Testing
Changelog
## [Unreleased]inCHANGELOG.md.