Skip to content

fix: trust and integrity consistency hardening - #4051

Merged
Daniel Meppiel (danielmeppiel) merged 16 commits into
mainfrom
danielmeppiel-laughing-bassoon
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 16 commits into
mainfrom
danielmeppiel-laughing-bassoon

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Trust and integrity consistency hardening. Install-time trust and integrity paths now consult their canonical owners and honor policy outcomes:

  • Executable-trust readers route the org policy discovery outcome through one owner (policy.outcome_routing.resolve_trust_policy), which applies policy.fetch_failure_default exactly as package installs do. Readers outside apm install report a block neutrally, and a miss is reported once.
  • Local bundle installs resolve org policy the same way package installs do, with one policy discovery shared by the trust map and the bundle policy preflight.
  • apm update accepts new package content only for a dependency whose resolved commit moved (one locked_commit_unchanged predicate; carried licence files follow the same rule) and reports new locked content after the lock write. The mismatch hint names the lockfile to edit for a deliberate re-pin.
  • The deprecated apm unpack refuses executable content (hooks, MCP/LSP configuration including plugin manifests, bin/, canvas extensions) and points to apm install <bundle>.
  • apm install -g <bundle> keeps its lock, approvals and gate configuration under APM_HOME.

Each fix lands at its owner. Architecture guards install-deployment-trust-policy-outcome, install-deployment-update-content-integrity, install-deployment-unpack-executable-refusal and install-deployment-bundle-user-scope-root are registered in the owner registry with mutation-break cases; the local-bundle preflight guard requires the shared discovery path. Docs updated: update, unpack, troubleshooting, registry proxy and the apm-guide governance page.

Issue and approved scope

Issue: Refs #4027

Human scope-approval comment: #4027 (comment)

Does this PR complete the issue, or what remains? Not alone. This PR covers items 1-4 and 6 of the approved scope. Item 5 lands in a separate follow-up PR.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally

  • All existing tests pass (CI runs on the stacked train PR)

  • Added tests for new functionality (if applicable)

  • tests/integration/test_trust_integrity_consistency_lifecycle.py: installed-CLI chains for each item, including a dry-run step under fetch_failure_default: block and the new-content report on apm update.

  • tests/unit/policy/test_trust_policy_outcome.py, tests/unit/test_unpacker.py::TestUnpackRefusesExecutables, tests/unit/install/test_carried_license_install.py, drift replay handler tests in tests/unit/test_audit_ci_command.py and tests/unit/commands/test_export_patch.py, and a one-discovery test in tests/integration/test_install_local_bundle_e2e.py.

  • Owner mutation matrix: tests/integration/test_architecture_owner_rule_mutations.py::test_trust_and_integrity_owners_reject_bypasses.

  • Lint contract: ruff check, ruff format --check, pylint R0801, lint-auth-signals.sh, lint-architecture-boundaries.sh all clean.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

No req-XXX behaviour changes.

@danielmeppiel
Daniel Meppiel (danielmeppiel) changed the base branch from danielmeppiel-scaling-potato to danielmeppiel-3995-user-scope-bundle-rows November 20, 2026 02:17
@danielmeppiel
Daniel Meppiel (danielmeppiel) changed the base branch from danielmeppiel-3995-user-scope-bundle-rows to danielmeppiel-docs-037-native November 20, 2026 02:58
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Bump pyproject.toml and uv.lock to 0.37.0 and move [Unreleased] to [0.37.0] in CHANGELOG.md, re-sanitized to one line per change in one section, with 4 Highlights. README: apm-guide pin to v0.37.0 and Codex .codex-plugin/plugin.json in the Build plugins line. Lint mirror green locally (ruff check + format, pylint R0801, auth-signals).

Draft on the 0.37 stack (top: #4051); rebased as layers land. Post-merge: tag v0.37.0.

Co-authored-by: Copilot App <[email protected]>
Unpack classifies MCP and LSP configuration paths from their owners (LSP target specs, plugin manifest paths) at any depth, and counts each listed file once. Addresses panel follow-up from supply-chain-security-expert and performance-expert.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
A local bundle install discovers org policy once and shares it with the preflight at project scope. Trust readers report a policy miss once, with neutral wording outside install, and uninstall names the policy reason. Adds tests for the drift replay handlers. Addresses panel follow-ups from python-architect, performance-expert, test-coverage-expert, devx-ux-expert and cli-logging-expert.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
One predicate decides whether the locked commit moved; the content and carried-licence checks ask it, new locked content is reported after the lock write, and the re-pin hint names the lockfile path. Guards and mutation cases follow. Addresses panel follow-ups from python-architect, supply-chain-security-expert, devx-ux-expert and test-coverage-expert.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Aligns the troubleshooting, registry-proxy, unpack, update and apm-guide pages with the current behaviour. Addresses panel follow-up from doc-writer.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The lifecycle assertion follows the re-pin hint wording and the resolved lockfile path.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
A stale cached policy is reported as still enforced by trust readers, and regression traps pin the neutral block wording, the single miss report, the uninstall next step, the commit predicate and the unpack config catalogs. Addresses delta panel follow-ups from python-architect and test-coverage-expert.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

Delta review of trust and integrity consistency hardening: every finding from the previous full panel has been folded, the delta panel found no new integrity or policy regressions, and the three new test gaps are closed at 39e885d.

panel-mode=delta; personas=supply-chain-security-expert,python-architect,test-coverage-expert,apm-ceo (after one full pass with python-architect, test-coverage-expert, supply-chain-security-expert, doc-writer, performance-expert, devx-ux-expert, cli-logging-expert, oss-growth-hacker)

cc Daniel Meppiel (@danielmeppiel) -- a fresh advisory pass is ready for your review.

Since the full panel, these changes landed. The unpack classifier recognises the remaining config-file names and paths, read from the existing LSP target specs and plugin manifest paths rather than new literals. One locked_commit_unchanged predicate now drives update acceptance, integration, the lockfile report and the carried-licence check. Project-scope local bundle installs run policy discovery once and share the result with the preflight. Trust readers name a block neutrally and report a miss once, and uninstall shows the reason and the next step. The docs pages are aligned. All three delta panelists confirm their earlier findings are resolved, and each new trap was shown to fail with its guard removed.

Two panelist items were not folded. The Copilot user-scope mcp-config.json name does not apply to the unpack write surface: unpack writes only under project integration prefixes, and the destination check refuses that path before any write. The owner-helper proposal for the bundle policy discovery seam is hygiene; current behaviour is correct and covered by a call-count test.

Dissent. supply-chain-security-expert recommended adding mcp-config.json to the unpack classifier; the CEO agrees it does not apply here and keeps Copilot MCP paths owned by the Copilot adapter. python-architect's owner-helper item is deferred, not dropped.

Aligned with: secure by default (full config-path coverage from existing catalogs); governed by policy (one neutral report per outcome; stale cached policy labelled as still enforced); portable by manifest (one commit predicate across update, integrate, lockfile and licences); pragmatic as npm (one summary line by default, hashes under --verbose).

Panel summary (delta)

Persona B R N Takeaway
Supply Chain Security Expert 0 1 0 Earlier findings resolved; no new integrity or policy regressions.
Python Architect 0 2 0 Folds address earlier findings; stale-policy wording fixed; discovery seam helper deferred.
Test Coverage Expert 0 3 0 Earlier gaps closed; three new traps added at 39e885d.

B = blocking-severity findings, R = recommended, N = nits. Counts are signal strength, not gates. The maintainer ships.

Top 3 follow-ups

  1. [Python Architect] Move the bundle policy discovery reuse rule into one owner helper in local_bundle_handler -- the project-scope vs -g rule is decided at the call site today.
  2. [Test Coverage Expert] Have the dry-run preview name the policy outcome a real install would hit -- the preview router is shared with package installs.
  3. [Supply Chain Security Expert] Define an identity anchor for commit-less dependencies on apm update -- new content is reported for them today, but they have no commit to anchor acceptance.

Recommendation

Land in the stack with CI green on the release train tip. Every prior and delta finding is folded with test evidence or set aside with a stated reason. Scope item 5 of the accepted record lands in its own follow-up PR.

Folded in this run

  • (panel) Unpack refuses MCP/LSP config paths from their owners at any depth; listed files counted once -- resolved in 181aca4.
  • (panel) One org policy discovery per local bundle install, shared with the preflight; neutral block wording; miss reported once; uninstall reason and next step; drift replay handler tests; dry-run step -- resolved in 2efd159.
  • (panel) One commit predicate for update content, carried licences, integrate and lockfile; new-content report after the lock write; re-pin hint names the lockfile -- resolved in d57107b.
  • (panel) Docs aligned (troubleshooting, registry proxy, unpack, update, apm-guide governance) -- resolved in a8e34ec.
  • (panel) Stale cached policy wording and regression traps for the delta items -- resolved in 39e885d.

Copilot signals reviewed

No Copilot review on this PR after two fetch rounds.

Deferred (out-of-scope follow-ups)

  • (panel) Scope item 5 of the accepted record -- scope boundary: lands in a separate follow-up PR.
  • (panel) Bundle policy discovery owner helper -- scope boundary: restructure of the bundle install entry seam; behaviour is correct and tested.
  • (panel) Dry-run preview naming a would-be policy block -- scope boundary: shared router with package-install previews.
  • (panel) Identity anchor for commit-less dependencies on update -- scope boundary: the accepted scope covers unchanged commits only.

Lint contract

ruff check, ruff format --check, pylint R0801, lint-auth-signals.sh and lint-architecture-boundaries.sh all silent at 39e885d.

CI

This stacked PR targets a non-main base, so CI workflows run on the release train-tip PR #4014: run https://github.com/microsoft/apm/actions/runs/44670763874 is green with this PR at 39e885d (train tip a10a67f; one Linux shard rerun once after an unrelated timing-dependent thread test). Known inherited failures from the stack base, not this PR: 6 cases in tests/integration/test_local_single_file_frozen_lifecycle.py (#4026).

Mergeability status

PR head SHA CEO stance iters folds defers Copilot rounds CI mergeable mergeStateStatus notes
#4051 39e885d ship_with_followups 2 10 5 2 green MERGEABLE UNSTABLE draft; CI via train tip

This panel is advisory. It does not block merge.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) marked this pull request as ready for review November 20, 2026 04:11
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Bump pyproject.toml and uv.lock to 0.37.0 and move [Unreleased] to [0.37.0] in CHANGELOG.md, re-sanitized to one line per change in one section, with 4 Highlights. README: apm-guide pin to v0.37.0 and Codex .codex-plugin/plugin.json in the Build plugins line. Lint mirror green locally (ruff check + format, pylint R0801, auth-signals).

Built on main merged with the final 0.37 stack heads (#3996 ... #4051, without #4061). Post-merge: tag v0.37.0.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Bump pyproject.toml and uv.lock to 0.37.0 and move [Unreleased] to [0.37.0] in CHANGELOG.md, re-sanitized to one line per change in one section, with 4 Highlights. README: apm-guide pin to v0.37.0 and Codex .codex-plugin/plugin.json in the Build plugins line. Lint mirror green locally (ruff check + format, pylint R0801, auth-signals).

Built on main merged with the final 0.37 stack heads (#3996 ... #4051, without #4061). Post-merge: tag v0.37.0.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant