Repository navigation
fix(install): preserve unchanged manifest requests - #3346
Conversation
Separate each positional request's explicit update intent from accumulated serialization output. Preserve no-op manifest bytes, pinned refs, metadata and duplicate inputs while retaining alias changes and explicit marketplace repository boundaries. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
Exercise real resolution and manifest persistence for unchanged pinned and structured declarations, including duplicate inputs and top-level extension metadata. Bind four cases to existing req-cf-001 and regenerate only its derived coverage count and node list. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
There was a problem hiding this comment.
🟡 Changes recommended
Explicit Git resolver selection and HTTP-to-HTTPS upgrades can be discarded as unchanged requests.
2 open issues
What changed in this PR
This PR fixes repeated positional apm install requests so unchanged declarations retain their representation and avoid unnecessary manifest writes. It addresses install behavior separately from the CI scheduling repair in #3345.
Changes:
- Separate per-argument update intent from aggregate serialization output.
- Report actual manifest mutations and preserve equivalent declarations.
- Add regression and conformance coverage, update derived counts, and document unchanged-install behavior.
| File | Description |
|---|---|
| tests/unit/install/test_package_resolution_persistence.py | Tests equivalent entries, genuine changes, and write suppression. |
| tests/unit/commands/test_install_resolve_refs.py | Tests single and duplicate unchanged requests and diagnostics. |
| tests/spec_conformance/test_round_trip.py | Adds four real resolver/persistence round-trip cases. |
| src/apm_cli/install/package_resolution.py | Compares effective declarations and returns actual mutation status. |
| src/apm_cli/commands/install.py | Separates request intent from serialization output. |
| packages/apm-guide/.apm/skills/apm-usage/commands.md | Aligns agent guidance with repeated-install behavior. |
| docs/src/content/docs/reference/cli/install.md | Documents preservation of unchanged declarations. |
| CONFORMANCE.md | Updates the req-cf-001 test count. |
| CONFORMANCE.json | Records four additional conformance test bindings. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
Compare effective default-registry routing through the existing owner and preserve explicit HTTP-to-HTTPS changes with existing pins and selections. Add real persistence/reparse regressions and unchanged-request controls. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
Merge Master delivery assessment: ship_nowQualified The bounded correction preserves unchanged install declarations while retaining genuine updates. Both reported routing/HTTPS defects have causal regression evidence, corrected behavior and resolved inline replies. Existing independent bounded reviews are retained; no additional panel is claimed.
The failed publication guard remains explicitly FAILED: a shell-control-flow mistake allowed an already-authorized push after a stale-base assertion. Independent REST/ref reconciliation verified exact beda/2f afterward; this does not retroactively pass the guard or justify another push. This is the unique issue-less carrier under the existing bounded human exception. Closing references are empty; #3341, #2070 and #1882 remain open. No private sibling changes are included. Final fresh guards still precede the exact-head normal merge. Full actual-main nonpublishing platform/integration/release validation remains outstanding with its existing CI owner. This assessment does not authorize a tag, release, publication, deployment, credential/policy change or new dispatch. Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors. |
Compose landed #3346 and #3347; preserve receipt source and both conformance bindings. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 13c28cd3-d648-498c-97d8-95dd47e91145


fix(install): preserve unchanged manifest requests
Description
TL;DR
Keep a repeated positional
apm installfrom treating serialization output as a request to modifyapm.yml. Unchanged declarations retain their bytes, pinned refs and metadata, while genuine ref, skill, alias, repository-boundary, explicit HTTPS and marketplace-routing changes still apply. A separate test-only commit binds real resolver/persistence round trips to existingreq-cf-001.Important
Candidate:
beda4bb1028dd37854fff7d5244d58705101d408, composed with actual public2f1587b51382f2d27464aeda13ef34cabc1cfda8after #3345 landed. Actual hosted CI and the PR gate passed at this head; full-main nonpublishing validation remains outstanding. No private #3344 changes are included.Problem (WHY)
The regression evidence below applies 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.” Reinstating the exact public-baseline functions makes all four new manifest-byte oracles fail; restoring this candidate passes them.
Approach (WHAT)
Implementation (HOW)
src/apm_cli/commands/install.pysrc/apm_cli/install/package_resolution.pytests/unit/commands/test_install_resolve_refs.pytests/unit/install/test_package_resolution_persistence.pytests/spec_conformance/test_round_trip.pyx-*metadata. Only remote-existence validation is patched.CONFORMANCE.jsonreq-cf-001count changes from 6 to 10.CONFORMANCE.mddocs/src/content/docs/reference/cli/install.mdpackages/apm-guide/.apm/skills/apm-usage/commands.mdDiagram
For an existing dependency, dashed nodes show the corrected intent/classification path; aggregate serialization is output, never the next argument's intent.
flowchart LR subgraph Request["_resolve_package_references"] A["Fresh requested_entries<br/>for each positional argument"] end subgraph Decide["package_resolution.py"] B{"Same effective declaration<br/>and required repository boundary?"} C["Keep current_deps<br/>return false"] D["Replace current_deps<br/>return true"] end subgraph Persist["Install output"] E["_apm_yml_entries populated<br/>after successful classification"] F["persist_dependency_list_if_changed<br/>writes apm.yml only when changed"] end A --> B B -->|Yes| C B -->|No| D C --> E D --> E E --> F classDef changed stroke-dasharray: 5 5; class A,B,C,D,E changed;Trade-offs
Benefits
Issue and approved scope
Issue: None — separately attributable CI recovery under the maintainer's task-specific issue/approval exception; related umbrella #3341.
Human scope-approval comment: No public approval-comment link is asserted. The maintainer's direct instruction was: “you do it, and do not mandate for these fixes to require an issue and approval, it's not needed. get CI working ASAP”. This is a bounded CI-recovery exception, not an accepted label or a fabricated public approval record.
Does this PR complete the issue, or what remains? It completes only the unchanged-manifest classification correction and its conformance coverage. #3341, #2070 and #1882 remain open. Actual hosted qualification, legitimate landing and complete nonpublishing release validation remain separate; no release, tag, version bump, deployment, permission or credential change is requested.
Type of change
Testing
Validation
Current committed candidate
beda4bb: 391 passed, zero failures/errors/skips in 86.97s. This bounded affected/quality/round-trip run includes all three actual-command witnesses for the one detected canonical owner, Install command scope selection. The complete current-main-composed lint/static/ratchet chain passed. The entire repository/release suite is not claimed green; actual current-head PR results follow.bedaNeutral CodeQL is not a passing imposed-native check. The existing user exception is unchanged; no security setting, permission, credential or release action was changed.
Historical evidence:
b404c0fhad 641 passes and two existing conformance skips: 525 conformance, 48 affected-module and 68 quality passes. The skips are the existing publisher-timestamp SHOULD and absolute-source-path harness waivers, not new exclusions or a Mode B waiver. Its hosted spec job passed 525/2; its unsharded lifecycle job was cancelled after 617s at the ten-minute maximum, not a passing terminal suite.The sealed production commit
7a10fa6c532051b7ab25edc1e6a0fcaa582a2a0ahad 533 passes, 65 restored focused passes and cache/alias negatives. Its six files were byte-identical in the test/derived-onlyb404c0fdescendant. The later five-file review correction intentionally changes that source; no old execution is promoted tobeda.Exact current-head qualification and review regressions
Artifact-directory paths are abbreviated to
$EVIDENCE; behavioral execution used the shared two-slot gate.At unchanged
b404, the bounded new matrix produced 3 intended failures / 5 passing controls: marketplace source routing and plain/metadata-bearing HTTPS upgrades. The restored two affected modules passed 56 cases before freezing, then the committed-head run above passed all 391. Real parsing, persistence and reparse are exercised; serialization is not mocked. A broader initial draft also exposed pre-existing direct-positional/default-registry probing behavior and a fixture expectation error; that discarded draft is not counted as the bounded regression proof.Independent bounded review of the exact five-file correction found no high-confidence issue. No reviewer execution, new panel or unchanged 641-case rerun is counted. Both inline findings are replied to and resolved.
Historical conformance proof and current canonical lint
The following conformance commands ran at
b404, notbeda. Artifact paths are abbreviated to$EVIDENCE; selectors, flags and results are unchanged.The same actual Mode B command at parent
7a10fa6exited 1 for 27 substantive critical-path additions against threshold 20. The descendant exits 0 through a real existing-requirement binding; no normative change or waiver was added.All following canonical lint/static commands were rerun at exact
bedaafter composing public main2f1587b:The YAML-I/O, portable-relative-path and 2100-line guards also passed using the CI regex equivalents (macOS grep lacks
-P). Actual public main was2f1587band is an ancestor ofbeda.Original conformance negative proof: a session-only plugin reinstated exactly the three changed production functions from public
75bfa523in memory. The unchanged round-trip module produced4 failed, 5 passed in 0.34s; all four failures were atassert manifest.read_bytes() == canonical. No source files were reverted or modified during that run. Both the historicalb404full run and the currentbedabounded run pass all four.The first test draft's unsupported dependency-level extension field produced 2 failures/7 passes; that fixture was narrowed to declared Git fields and top-level extension metadata. This did not change the production field vocabulary or remove a previously passing regression test.
Independent read-only reviews found no high-confidence issue in the sealed production correction or the separate three-file conformance delta. No reviewer execution is counted as validation.
mmdcvalidated the diagram. No changelog/version change or release validation was performed.Scenario Evidence
tests/unit/commands/test_install_resolve_refs.py::TestResolvePackageReferencesDuplicateDetection::test_existing_dependency_without_new_intent_is_not_updated(regression trap for this CI repair)tests/spec_conformance/test_round_trip.py::test_existing_install_manifest_round_trip_preserves_declared_metadata(four byte-failure regression traps)tests/unit/install/test_package_resolution_persistence.py::test_effective_manifest_changes_are_still_appliedtests/unit/install/test_package_resolution_persistence.py::test_effective_manifest_changes_are_still_applied;test_merge_structured_entry_refuses_to_convert_registry_dep_to_gitin the same moduletest_marketplace_explicit_git_routing_is_preserved;test_explicit_https_upgrade_preserves_metadata_and_repeats_without_writesintests/unit/install/test_package_resolution_persistence.pyHow to test
git diff --exit-code CONFORMANCE.json CONFORMANCE.md: expect no changes.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.
This corrects behavior already covered by req-cf-001. No spec/schema/manifest requirement or ID changed. The unchecked spec/manifest boxes are deliberate; only genuine test bindings and derived counts changed. Install reference and agent-guide prose are updated; corpus assessment accompanies publication.
Co-authored-by: Copilot [email protected]