Repository navigation
fix(install): preserve frozen lock bytes and recorded native-service ownership - #3307
Daniel Meppiel (danielmeppiel) merged 15 commits into
Conversation
Extend existing frozen suppression across the command and prepare MCP/LSP before checking recorded target ownership. Preserve actual source verification and ordinary-install recovery. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Preserve main's diagnostic-only lockfile repair and the bounded #3272 native-service replay changes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Preserve marketplace locked-evidence changes and the same bounded #3272 native-service delta. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Exercise repeated recorded, narrower, and refused service-only commands against a CLI-generated committed lock. Regenerate evidence without changing any normative requirement or waiver. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Use the previously proven MCP/LSP full-command stimulus while retaining the exact lock-byte and manifest-byte assertions. No production, requirement, or waiver change. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Faithfully integrate main 2e2d068. Resolve the sole TYPE_CHECKING import conflict by retaining both owners' imports. Preserve the coupled LSP/full-command conformance stimulus and existing byte/exit assertions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Faithfully integrate main dc7b6a6 without conflicts or additional source changes. Retain the corrected coupled LSP/full-command lock-byte stimulus and all prior evidence. Validation remains pending a new exact-bound grant. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
There was a problem hiding this comment.
🟡 Changes recommended
Source validation rejects removed local dependencies retained as lockfile orphans, breaking supported narrower frozen installs.
1 open issue
What changed in this PR
Extends frozen-install protection through late MCP/LSP integration, preserving committed lockfile bytes and requiring recorded native-service ownership.
Changes:
- Extends lock-write suppression across the full install command.
- Prepares both services and checks eligibility before native writes.
- Adds regression coverage, conformance cases, architecture guards, and recovery guidance.
| File | Description |
|---|---|
tests/unit/install/test_frozen_service_boundary.py |
Tests suppression lifetime and ownership checks. |
tests/spec_conformance/test_frozen_service_lock_reqs.py |
Adds three lock-preservation conformance cases. |
tests/integration/test_frozen_native_service_lifecycle.py |
Exercises replay, refusal, recovery, and drift. |
tests/integration/test_architecture_owner_rule_mutations.py |
Tests service-boundary guard mutations. |
src/apm_cli/install/service.py |
Owns suppression and frozen service eligibility. |
src/apm_cli/install/service_integration.py |
Prepares and checks both services before writes. |
src/apm_cli/install/mcp/integration.py |
Extracts reusable MCP preparation. |
src/apm_cli/install/lsp/integration.py |
Extracts reusable LSP preparation. |
src/apm_cli/commands/install.py |
Registers command-wide suppression; simplifies summary forwarding. |
scripts/architecture_linter/checks/install_frozen_and_audit.py |
Guards preparation, validation, and write ordering. |
packages/apm-guide/.apm/skills/apm-usage/commands.md |
Documents frozen ownership and recovery. |
docs/src/content/docs/reference/cli/install.md |
Explains native-service replay guarantees and limits. |
CONFORMANCE.md |
Updates existing requirement coverage count. |
CONFORMANCE.json |
Records three additional conformance cases. |
Review effort: Balanced
Integrate public main 70a924a faithfully before owned-runtime qualification. Preserve frozen native-service scope and wait for PR #3305's public membership API before its consumer fold. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <[email protected]> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Preserve both hydrated and command-lifetime frozen guards, both conformance case families, and scoped package-source recovery documentation. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Consume the publicly merged membership API using resolver-owned pre-selection evidence. Preserve unknown versus empty membership, strict late source verification, and MCP-off behavior. Add focused transport and selection regressions for qualification. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <[email protected]> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
… shape Use typed MCP declarations in component fixtures and the real positional selection interface before frozen replay. Preserve pin, native, manifest and lock assertions. Clarify concrete recovery commands without inventing a package-valued --only flag. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
Regenerate from all 367 collected conformance tests and verify the second generation is byte-identical. The merged coverage union is unchanged; only the canonical trailing newline needed restoration. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16677b90-8139-4721-9720-00f8297d9855
APM Review Panel:
|
| Persona | B | R | N | Retained source-review disposition |
|---|---|---|---|---|
| Python architect | 0 | 1 | 0 | Canonical transport sound; optional diagnostic localization is separate maintenance. |
| Test coverage | 0 | 1 | 0 | Actual fixture/CLI failures corrected; regression and mutation proof executed. |
| Supply-chain security | 0 | 0 | 0 | Fail-closed membership and active-source boundaries preserved. |
| DevX UX | 0 | 1 | 0 | Concrete same-store recovery folded into both references. |
| Documentation | 0 | 1 | 0 | Unsupported package-valued --only prose corrected. |
| Performance | 0 | 0 | 0 | No new algorithmic/I/O regression identified; no latency measurement claimed. |
Counts are retained review signals, not new panel executions or unresolved source work.
Top 2 follow-ups
- [APM CEO] Repository owners should restore valid CodeQL comparison coverage separately. The explicit waiver permits the campaign's bypass path; it does not repair or prove the missing analysis.
- [Python architect] Optional per-clause static-linter diagnostics may be handled as separate maintenance. No false-negative was demonstrated.
Recommendation
The independent recommendation is ship_with_followups. The source merits landing under the newly granted missing-analysis waiver, while the CodeQL result remains factually unavailable. Merge Master alone applies the authorized landing path and checks any other live conditions. This worker neither merges nor creates a human approval.
Full per-persona findings
Python architect
- [recommended; optional separate maintenance] More precise diagnostics could identify the failed clause. No demonstrated silent-pass defect remains.
Test coverage
- [recommended; completed] Execute current tests. Actual failures corrected typed MCP input, native config shape and unsupported selection syntax. The supported scenario uses ordinary positional install followed by full frozen replay.
Supply-chain security
No source findings. The later missing CodeQL comparison was live repository evidence, not a source finding attributed to this panelist.
DevX UX
- [recommended; folded] Recovery now names
apm installwithout--only mcpin the same store.
Documentation
- [recommended; folded] Complete graph evidence is not described as package-valued
--only.
Performance
No findings. Unmeasured timing estimates are not published.
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 landing assessment for b4962de6b882fdc4df1197864d2221da385a0482 against main cba243f12dc4888e1b34dca978e53af6e744f802 is ship_now. This is the Merge Master's assessment, not a relabeling of the independent CEO's retained ship_with_followups recommendation.
The accepted #3272 scope, current ownership and issue disposition are verified. The exact-source packet retains 110 focused passes, nine production mutants producing 13 functional failures, exact restoration and 11 restored passes, plus seven passing final-head functional cases for the four canonical owners. Independent strict owner verification and canonical lint are satisfied. Current own-head hosted checks are complete, the substantive workflows and aggregate gate pass, and the inline thread is resolved. Source and limited publication authority have been explicitly released.
No blocking in-scope finding remains. The retained optional diagnostic-localization suggestion is separate maintenance, not a correctness defect or landing prerequisite.
CodeQL check 119099782522 remains NEUTRAL / introduced alerts undetermined because the PR lacks the counterpart to main's API upload <default> configuration. The user's explicit campaign instruction authorizes bypass of this imposed missing-analysis condition. This is an exception, not a successful analysis, and does not waive actual security findings, failing source checks or other accepted-scope obligations. No scan, SARIF, workflow or security setting has been changed.
The exclusive Merge Master will execute a fresh head-guarded normal merge and verify the resulting commit and issue disposition. This assessment does not itself claim that the merge has occurred.
Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.
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

fix(install): preserve frozen lock bytes and recorded native-service ownership
Description
TL;DR
Extend existing frozen lock-write suppression across the entire install command, including late MCP/LSP and MCP-only integration. Prepare both services, verify actual declarations and recorded target/server ownership, then execute those exact inputs. Carry the resolver's complete active graph into the late MCP view so inactive orphan lock rows do not break valid frozen replay.
Important
Head
b4962de6b882fdc4df1197864d2221da385a0482includes public #3305 atcba243f1. Workflow CI, the aggregate status check, and local owner/lint evidence passed. New explicit human instruction waives missing imposed CodeQL analysis as a campaign bypass-merge blocker, including this PR. CodeQL check119099782522 still reports NEUTRAL/"1 configuration not found": theAPI upload <default>configuration on main is absent on this PR, so introduced alerts remain undetermined. Rule9294522 and factual check states are unchanged. Only Merge Master may apply the authorized bypass; this worker does not merge or manufacture human approval.Problem (WHY)
This repairs existing
req-lk-006, not a new normative requirement. Failed attempts remain evidence, following "then feed the results — all of them, not just failures — back into the creation process."Approach (WHAT)
InstallService, source selection inCurrentMcpConfigView, and target/consent decisions in existing owners.InstallResult, preserving unknown (None) versus known-empty evidence rather than reconstructing it from selected packages or directories.Implementation (HOW)
commands/install.pyinstall/service.pyinstall/service_integration.pyinstall/mcp/integration.pyinstall/lsp/integration.pyinstall/outcome.py,models/results.pyInstallResult.active_package_keys.scripts/architecture_linter/checks/install_frozen_and_audit.py,tests/integration/test_architecture_owner_rule_mutations.pytests/spec_conformance/test_frozen_service_lock_reqs.py,CONFORMANCE.{json,md}req-lk-006; mechanically reconcile the canonical collected map.commands.mdCanonical implementation: frozen owner and fullgraph transport.
Diagrams
Dashed stages extend frozen protection: both services are prepared and admitted before either native writer, while command-wide suppression prevents lock persistence.
flowchart LR subgraph Command["Frozen install command"] C["install: frozen_writes context"] P["Existing structural check and package pipeline"] C --> P end subgraph Prepare["Native service preparation"] M["prepare_mcp_integration: actual source view"] L["prepare_lsp_integration: trusted declarations and targets"] G["InstallService.enforce_frozen_services"] P --> M --> L --> G end subgraph Outcome["Recorded ownership decision"] R["FrozenInstallError: scoped ordinary-install recovery"] W["Existing MCP and LSP native writers"] G -->|"Unrecorded claim or unavailable source"| R G -->|"Recorded claims and verified source"| W S["LockFile.write: suppressed for full command lifetime"] W --> S end classDef new stroke-dasharray: 5 5; class C,M,L,G new;The unchanged diagram was rendered successfully with installed
mmdc; SHA-256e66fc6740a20ced4e9cde93283e0543f7bb3e4e0e8365b6b670f7451eec37bdc.Trade-offs
Benefits
Issue and approved scope
Issue: Fixes #3272. Bounded implementation, review repairs and workflow CI are complete. On 2026-10-21 the campaign coordinator forwarded the responsible user's instruction: "missind codeql native analysis in CI (red) is not a reason not to bypass merge: make sure this is clear for everyone", and explicitly applied it to #3307. This supersedes the earlier no-exception hold for missing analysis only; the missing comparison remains disclosed. The independent authorization-only recommendation is
ship_with_followups. Merge Master owns landing and all other live conditions.Human scope-approval comment: #3272 (comment)
Clarification: #3272 (comment)
Trusted governance returned
record-present,authorizes_implementation: false; execution was separately delegated by the responsible human. The issue/PR retain the same actor and existing requested reviewer.Included: command-wide no-write, recorded ownership, source-before-native-write evidence, scoped recovery and real consumer proof. Excluded: new schemas/stores/targets, unrecorded personal frozen success, native-client activation, general rollback, hash-policy changes and private peer implementations.
Type of change
Testing
Validation
Owned Python 3.12 runtime with actual offline editable installation:
uv --offline --no-python-downloads pip install --python .venv/bin/python --no-deps --no-build-isolation --no-index -e .exited 0. CLI fixtures use isolated HOME/config roots; no native-client activation.Executed commands, outcomes and retained failures
At
b213fa48f1d9fd41fde60ebeddabe9e7c66a5112:E=/Users/danielmeppiel/.copilot/session-state/16677b90-8139-4721-9720-00f8297d9855/files; ownedautonomy-env.shsupplies the installed CLI,APM_E2E_TESTS=1,PYTEST_ADDOPTS=''and isolated roots. Heavy work was serial/capacity-controlled.python "$E/convergence-mutations.py": exit 0. Nine real production mutations produced 13 functional failures, zero errors/skips, with byte-exact restoration after each; 11 affected restored tests passed. Filtered graph failed component and installed-CLI cases; dropped command membership failed the original orphan regression. Disabled suppression failedassert lockfile.read_bytes() == committed, not an output/exit proxy. Separate static-boundary mutations passed in the 110-test command.b4962de6differs fromb213fa48only by the generated statement's trailing newline. Exact-head/bin/bash "$E/convergence-final-gates.sh"passed the full canonical mirror and owner-functional selection:uv runuses--no-sync --frozen --extra dev)ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.pyruff format --checkon the same pathspython ../pr-3307-evidence/recovery-source-guards.pypython -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.pybash scripts/lint-auth-signals.sh;bash scripts/lint-architecture-boundaries.shpython scripts/check_test_assertions.py;python scripts/check_exact_test_duplicates.pypython -m tests.spec_conformance.orphan_checkBASE_REF=cba243f12dc4888e1b34dca978e53af6e744f802 GH_PR_BODY= GITHUB_ACTIONS=true bash tests/spec_conformance/mode_b_detector.shpython -m pytest tests/spec_conformance --collect-only -q -p no:randomly -p no:cacheprovider --basetemp="$E/convergence-full-collection-fixtures"python -m tests.spec_conformance.gen_statementtwice, then byte comparisonsOwner-v2 schema and canonical semantic verification passed for four owners with seven exact-head test IDs. This proves engineering boundaries, not the missing CodeQL comparison. The new human waiver changes landing authorization, not analysis results. No tests, lint or CI were replayed for this metadata update; no full-suite/type-check claim.
Local evidence bundle SHA-256:
390ee66748260d812a2619cf678c7409bef4db9307c21496909a51a5d38e493f. Final owner JUnit SHA-256:3e9bcae6c827559019a4c081b04544b0153d268cef24bca5f27a0816c564ddb5.Preserved without relabeling: original seven-red/one-control reproduction;
8eacqualification/Mode B failure; ineffectivea3aaMCP mutant; corrected7632coupled-LSP lock proof; real convergence fixture failures before correcting typed MCP input, nativemcpServersshape and unsupported package-valued--onlystimulus.Scenario Evidence
test_frozen_extra_intellij_refuses_before_native_writes_and_recoverstest_frozen_same_repeated_and_narrower_service_replays_preserve_lock_bytes;test_frozen_service_command_preserves_committed_lock_bytestest_frozen_lsp_unrecorded_target_blocks_coupled_mcp_before_writestest_frozen_service_only_missing_package_source_cannot_remove_native_serverstest_frozen_scoped_mcp_only_replay_and_refusal_preserve_selected_storetest_frozen_local_ignores_removed_dependency_source[transitive];test_late_service_boundary_requires_actual_selected_source_evidencetest_selected_package_install_retains_unselected_service_evidencetest_result_retains_complete_graph_instead_of_selected_packages;test_result_distinguishes_unknown_membership_from_resolved_empty_graphLifecycle cases:
tests/integration/test_frozen_native_service_lifecycle.py; orphan:tests/integration/test_frozen_local_path_lifecycle.py; component:tests/unit/install/test_frozen_service_boundary.py; lock bytes:tests/spec_conformance/test_frozen_service_lock_reqs.py.How to test
--frozen --target copilot,claude,intellij. Expect nonzero, target/server recovery text and unchanged native/manifest/lock bytes.--frozento record IntelliJ, then replay frozen/narrower targets. Expect success and exact committed bytes.--onlyacceptsapm/mcp, not package names.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.
Existing
req-lk-006is repaired/tested; no new requirement, specification amendment, schema change or waiver.Co-authored-by: Copilot [email protected]