Repository navigation
fix(install): capture acquired manifest versions on first install - #3311
Conversation
…ment Preserve resolver and legacy-plugin version authority; match acquired package-type evidence by the unique lock identity. Integrates main693 documentation without losing conflict-repair guidance. Current-head qualification remains pending; historical first-green evidence belongs to the earlier53cc draft. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Preserve landed local-content preflight and pre-transformation hashing alongside the acquired-version guard and unique package-type identity. No current-head validation has run; rebind qualification to this merge. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Faithfully integrate dc7b6a6 without changing the acquired-version repair, frozen local-content preflight, or canonical source hashing. Qualification remains unrun and requires a newly bound grant. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Faithfully integrate 70a924a. Preserve both dry-run documentation and acquired-version frozen checks. No qualification has run for this head; a newly bound grant remains required. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Retain public-main cold frozen MCP and local-content protection. Remove the unshipped inventory-version-only veto, which remains an unresolved accepted-scope requirement under req-lk-019. Preserve ordinary snapshot coherence and compatibility controls for a non-closing draft delivery. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Move real inventory-authority controls into conformance and exercise acquired nonmapping rejection with cached descriptors. Regenerate only the derived requirement test mappings; keep frozen replay and the specification unchanged. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| APM CEO | 0 | 1 | 0 | Missing external analysis is user-excepted. The public catalog follow-up has now been folded and verified. |
Counts preserve the actual authority-delta return. Its one recommendation is now resolved by delivery; no new review is implied.
Counts are signal strength, not gates. The maintainer ships.
Recommendation
The independently recorded stance remains ship_with_followups; the ordinary source ship_now remains valid, and the only catalog follow-up is now complete. The PR is non-draft and non-closing. Merge Master exclusively performs the final landing assessment and authorized bypass merge.
The inventory-version-only frozen veto remains excluded under current req-lk-019. This working ordinary subset does not complete or close #3246, and #3206 remains open. Future resolution of that wider scope is not a condition on this scoped PR.
Original proof, the initial ordinary completion, and the superseded native-analysis hold remain preserved as history.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Merge Master final readiness: ship_now
My independent assessment of exact head 806c776c57b030fd93416d18d6272c2c9471233e is ship_now for the ordinary acquired-manifest subset. This is my landing assessment, not a relabeling of the genuine CEO ship_with_followups delta or a new source panel. The original ordinary-source ship_now remains supported.
I verified the sealed release/completion, strict terminal owner-v2 result (one owner, two exact-head lifecycle witnesses), actual 175 passing functional cases, nine current static/catalog checks and canonical lint. The causal production mutation failed on the first-install stale-version assertion and passed after exact restoration; the relevant owner/oracle files are unchanged at this head. The public catalog repair retains its original author and Cherry-picked-from attribution, and its stable patch ID matches the sole producer's public commit. Its 18-case integration selection and current completeness assertion passed. The former catalog failure is historical, not retroactively declared successful.
Current public main 6f691d2c8e76f11519bfcc1d5b371b0979138fe4 is an ancestor of this head; the strict combined tree is b975e24613880a65bb2546855906dd55600daff6. All 24 own-head checks are complete and nonfailing. The imposed CodeQL comparison remains missing/undetermined and explicitly excepted, not passed. No source tests, mutations or panel were rerun by the Merge Master.
All writer roles are explicitly released. The PR is nonclosing: #3246 and #3206 remain open, and the inventory-version-only frozen veto remains excluded. This assessment does not claim full issue completion or that the merge has already happened.
Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.
There was a problem hiding this comment.
🔵 Needs a closer look
Reported native CodeQL clearance remains indeterminate and requires maintainer resolution before landing.
No open issues 🎉
What changed in this PR
Fixes stale manifest-derived lockfile versions on the first ordinary install after a branch switch, addressing part of #3246 without changing frozen replay rules.
Changes:
- Capture current manifest metadata through one adapter for local, cached and fresh acquisition.
- Add regression, conformance and architecture-guard coverage.
- Document inventory versions separately from resolver-selected versions and replay pins.
| File | Description |
|---|---|
tests/unit/scripts/test_architecture_runner.py |
Register expected guard vocabulary. |
tests/unit/install/test_materialized_manifest_snapshot.py |
Test cache independence and metadata handling. |
tests/spec_conformance/test_acquired_manifest_reqs.py |
Cover existing manifest and lockfile contracts. |
tests/integration/test_manifest_version_snapshot_lifecycle.py |
Test branch switches, repeated installs and frozen replay. |
tests/integration/test_architecture_owner_rule_mutations.py |
Add the central guard mutation case. |
tests/integration/test_architecture_manifest_snapshot.py |
Test guard bypass detection. |
src/apm_cli/install/sources.py |
Capture metadata across all acquisition paths. |
src/apm_cli/install/source_helpers.py |
Add the acquired-manifest snapshot adapter. |
scripts/architecture_linter/checks/install_manifest_snapshot.py |
Guard snapshot ownership and handoffs. |
scripts/architecture_linter/checks/install_deployment_analyzers.py |
Register the snapshot guard. |
packages/apm-guide/.apm/skills/apm-usage/commands.md |
Align packaged install guidance. |
docs/src/content/docs/reference/cli/install.md |
Explain first-install version coherence. |
CONFORMANCE.md |
Update requirement test counts. |
CONFORMANCE.json |
Update requirement test mappings. |
.apm/architecture/owners/install-deployment.json |
Register snapshot ownership. |
Review effort: Balanced
Preserve landed #3307 native-service ownership and lock immutability alongside #3311 acquired-manifest inventory capture. Retain both conformance mappings and both install guides; no frozen-version veto or private catalog repair. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Preserve landed #3316 audit path identity and prior #3307 frozen-service changes without changing the ordinary acquired-manifest fix. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Add the two missing canonical mutation cases for declaration association and locked ref evidence. Both use meaningful valid-AST bypasses and prove their owning rule reports a violation; no guard or runtime behavior is weakened. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 3dea031b-9e0c-4c51-8986-4b55ae7dfbc8 Cherry-picked-from: 21b9c82 Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Preserve landed #3308 schema identity and #3277 triage changes alongside acquired-manifest capture and the public #3304 catalog repair. No private or speculative producer changes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: daed9f36-025c-4757-85ea-54b8aaf9442d
Description
fix(install): record versions from the acquired package snapshot
TL;DR: The first ordinary install after a branch switch now records manifest-derived metadata from the acquired package, rather than an older descriptor cached for the same
apm_modulespath. Local, cached and fresh acquisition use one adapter while registry/Git-semver version precedence remains intact. This is a partial, non-closing PR: the accepted inventory-version-only frozen veto is excluded because it conflicts with currentreq-lk-019.Important
The maintainer explicitly authorized bypass of missing imposed external CodeQL analysis. Missing analysis is not a passing scan, and no security settings, SARIF or approvals were changed. The independent marketplace catalog gap has now been repaired by consuming the sole #3304 owner's published test-only commit 21b9c82, preserving its authorship. The previously failing catalog assertion now passes; no private patch, duplicate implementation or waiver was used.
Problem (WHY)
Body 1.1.0.while recordingversion: 1.0.0on the first install. A production bypass reproduces that mismatch atattempt=1.InstalledPackage.The evidence follows the Agent Skills validation loop: "do the work, run a validator (a script, a reference checklist, or a self-check), fix any issues, and repeat until validation passes." The advisory distinguished correctness within optional inventory recording from a new normative obligation; the Mode B heuristic was not used to invent one.
Approach (WHAT)
load_yamlandAPMPackage.from_mapping, without changing the process-wide path cache.Implementation (HOW)
src/apm_cli/install/source_helpers.pysrc/apm_cli/install/sources.py.apm/architecture/owners/install-deployment.jsonscripts/architecture_linter/checks/install_manifest_snapshot.py,install_deployment_analyzers.pytests/integration/test_architecture_manifest_snapshot.py,tests/unit/scripts/test_architecture_runner.pytests/integration/test_architecture_owner_rule_mutations.pytests/unit/install/test_materialized_manifest_snapshot.pytests/spec_conformance/test_acquired_manifest_reqs.pyCONFORMANCE.json,CONFORMANCE.mdtests/integration/test_manifest_version_snapshot_lifecycle.pydocs/src/content/docs/reference/cli/install.md,packages/apm-guide/.apm/skills/apm-usage/commands.mdDiagram
The dashed node is the new capture boundary; existing lock construction still decides version authority.
flowchart LR subgraph Acquire["Existing acquisition"] L["Local copy"] C["Verified cached package"] F["Fresh download"] end subgraph Capture["Acquired metadata"] S["materialized_manifest_snapshot"] P["load_yaml and APMPackage.from_mapping"] N["Native or legacy projection"] end subgraph Record["Existing lock construction"] I["InstalledPackage"] V["Resolver version precedence"] K["apm.lock.yaml"] end L --> S C --> S F --> S S -->|"Authored APM manifest"| P S -->|"Native or legacy format"| N P --> I N --> I I --> V --> K classDef new stroke-dasharray: 5 5; class S new;Trade-offs
Benefits
Issue and approved scope
Issue: Refs #3246.
Human scope-approval comment: #3246 (comment)
This PR implements only ordinary snapshot coherence. It does not complete #3246 or rewrite its acceptance record. The accepted inventory-only frozen refusal remains excluded: current
req-lk-019says dependency-manifest-derived versions "MUST NOT drive frozen replay" for Git/local entries. Existing frozen content/pin/MCP checks remain in place. Future resolution of that excluded scope is not a landing condition for this working subset.Original report: Rafael Azevedo (@rrazvd); independent reproduction: Kaustubh Arora (@Kaustubh1235). #3206 supplies related fixed-ref evidence only and remains open. This PR does not claim completion of #2627.
Type of change
Testing
Validation
Current head:
806c776c57b030fd93416d18d6272c2c9471233e; integrated public main:6f691d2c8e76f11519bfcc1d5b371b0979138fe4. Normal merges preserved landed #3307, #3316, #3308 and #3277; #3304's public catalog commit was cherry-picked with original authorship and aCherry-picked-fromtrailer. No force-push or shared-stash operation.Engineering CI and the specification gate passed at this head, including Windows compatibility/native-symlink checks and lifecycle smoke. The missing native CodeQL comparison remains NEUTRAL and explicitly bypass-authorized. The independent ordinary-subset
ship_nowsource review remains valid. The later CEO authority-delta returnedship_with_followups; its catalog follow-up has now been folded and verified, not cosmetically relabeled.b04385df3; cases/guards unchanged by the final schema/triage mergeb04385df3, including the previously selected controls and landed service-boundary casesb04385df3, first-install assertion failed; exact restoration and same witness passed. Snapshot owner/handoffs/static guard remain byte-identical at current head.3306f1548proof: 3 rejection failures, 2 resolver-precedence failures, 1 omission failure; exact restoration and same witnesses passedterminal_evidence_required: true, one touched owner and two executed exact-head lifecycle witnesses3306f1548commit; not misrepresented as execution of all 455 current casesThe former 151-pass/1-failure catalog result remains historical. The exact failed completeness assertion now passes after the public repair. Two recorder schema mistakes (
pendingversusyellow, then missing interim completion fields) were corrected in evidence artifacts only; no source change or test replay was needed. The complete corrected owner proof was schema-validated and strictly verified.Executed current-head commands and evidence
Python commands use the existing offline/no-sync environment. Exact argv, output and hashes are retained in
3246-recovery-final-main-806/{receipt,delta-receipt,owner-schema-repair}.json; preceding integrated mutation evidence is in3246-recovery-public-main-b043/receipt.json.The original local reproduction was red on
53ccf06; fixed-ref Git was already green there. Earlier 27-test evidence belongs only to that historical draft. Original proofs and the superseded native-analysis hold are preserved, not overwritten.Scenario Evidence
test_manifest_version_snapshot_lifecycle.py::test_first_install_after_checkout_records_current_manifest_snapshottest_manifest_version_snapshot_lifecycle.py::test_frozen_replays_pins_without_using_inventory_versiontests/spec_conformance/test_acquired_manifest_reqs.pytest_acquired_manifest_reqs.py,test_materialized_manifest_snapshot.pytest_dependency_schema_reqs.py,test_manifest_schema_cli_contract.pyHow to test
APM_BINARY_PATHto the installed CLI. Runuv run --extra dev pytest -q tests/spec_conformance/test_acquired_manifest_reqs.py tests/unit/install/test_materialized_manifest_snapshot.py tests/integration/test_manifest_version_snapshot_lifecycle.py; expect all 20 cases to pass.uv run --extra dev pytest -q tests/integration/test_architecture_manifest_snapshot.py tests/integration/test_architecture_owner_rule_mutations.py::test_matrix_covers_every_registry_guard_exactly_once; both snapshot guards and catalog completeness must pass.Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual in the
development guide:
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.
No new normative requirement is proposed by this PR. Existing
req-mf-001covers nonmapping rejection,req-lk-011covers unset-field omission, andreq-lk-019preserves inventory round-trip and resolver/frozen authority. Meaningful production mutations demonstrate those bindings. Landed main's separate schema proposal is preserved without claiming ratification. Install-reference and packaged-guide updates remain aligned; no repeated documentation panel is claimed.Co-authored-by: Copilot [email protected]