Repository navigation
fix(0.37): tier-2 consistency polish at the owners (#3967, #3940) [PR C of #3983] - #3992
Conversation
…3962) Harvested from #3977. Co-authored-by: Copilot App <[email protected]>
…#3963) Harvested from #3978. Co-authored-by: Copilot App <[email protected]>
…nt (#3959) Harvested from #3976; the positional install reads the lock lazily. Co-authored-by: Copilot App <[email protected]>
…un (#3960) Harvested from #3973. Co-authored-by: Copilot App <[email protected]>
Harvested from #3974. Co-authored-by: Copilot App <[email protected]>
…ops them (#3956) Harvested from #3975. Co-authored-by: Copilot App <[email protected]>
…deny (#3958) Harvested from #3981. Co-authored-by: Copilot App <[email protected]>
…a same-store deny (#3957) Harvested from #3979. Co-authored-by: Copilot App <[email protected]>
A partial name could grant or deny execution for another package. Co-authored-by: Copilot App <[email protected]>
Harvested from #3971. Co-authored-by: Copilot App <[email protected]>
… executables: (#3954) exec_trust_context_for_project takes the manifest file instead of deriving apm.yml from a caller-chosen root; -g resolves APM_HOME/apm.yml through core.scope.get_manifest_path. A closed-world guard registers every caller. Supersedes #3969 and keeps its lifecycle test. Co-authored-by: Copilot App <[email protected]>
Every caller of the shared install entry now runs inside a registered catalog-freshness envelope; the guard is closed-world. Co-authored-by: Copilot App <[email protected]>
APM_NO_SCRIPTS, org executables.deny_all and project script trust now apply; LifecycleScriptRunner is built only by build_runner_from_context, guarded closed-world by the new lifecycle-script-firing-gate owner. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
#3966) The only opt-out is a dependency's own authored .mcp.json; a closed-world guard refuses any other. Co-authored-by: Copilot App <[email protected]>
…ervers (#3956) Co-authored-by: Copilot App <[email protected]>
…ove matching Co-authored-by: Copilot App <[email protected]>
… the gate was never on (#3958) Harvested from #3981 (b4cface, cb015e6); the trust read uses the scope manifest. Co-authored-by: Copilot App <[email protected]>
Harvested from #3969 (5c2cab2). Co-authored-by: Copilot App <[email protected]>
Reads the manifest restriction through the same owner install uses. Co-authored-by: Copilot App <[email protected]>
- compile's no-output hint names targets:, not the deprecated target: - pack's mismatch hint no longer suggests the deprecated pack --target - skip messages name executables.allow instead of allowExecutables - origin and freshness errors say marketplace, not catalog - generated apm.yml headers and unknown-target errors stop listing vscode - config docs show default_client: copilot Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
Harvested from #3972. Co-authored-by: Copilot App <[email protected]>
…#3965) Harvested from #3980. Raw apm.yml readers must pass the manifest path to manifest_target_restriction; only APMPackage-loaded configs may omit it (closed-world guard). Co-authored-by: Copilot App <[email protected]>
…2606) Harvested from #3951 (eecc79d). Co-authored-by: Copilot App <[email protected]>
…idity owner (#3964) A warm copy that contradicts apm.lock.yaml routes audit to the lock-pinned scratch replay, as a cold checkout does; replay's own marker check now asks drift.locked_copy_holds_commit. The copy-validity guard is closed-world. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
…egration (#3874) Every requested package resolves and downloads before any is integrated, so a failed multi-package install leaves no untracked deployed files. Guarded by the install-outcome rule. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
…ing systems The committed plugin pin covers path and bytes; the exec bit stays only in the per-machine integrity hash, because Windows derives it from file extensions and an approval made on macOS would park on Windows. The trust-fingerprint guard requires the mode-less pin and owns it closed-world. apm-spec-waiver: approval pin binding is implementation-defined; root digest integrity unchanged Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…call (C5d) C5d wrapped the uninstall heal in report_retired_mcp_heal, which re-indented its stored_configs argument to match the remove_stale call; the mutation case now anchors on the removal call's fail_on_write_error line. Co-authored-by: Copilot App <[email protected]>
…ics (Q1) Q1 passes ctx.diagnostics into the shared instruction scan. InstallContext always has the field (default None) and the scan accepts None, so the fake context now mirrors the real shape instead of production growing a getattr. Co-authored-by: Copilot App <[email protected]>
…ize boundary (Q1) Q1 passed ctx.diagnostics into the shared instruction scan eagerly, so a context without diagnostics raised AttributeError before any scan. The hint owner now reads it as optional; the spec test's fake context (no diagnostics) is restored to keep proving that boundary. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 2 | 1 | Each #3967 item sits in its owner. Two second-renderer seams and a LOC-budget regression from B were folded. |
| Supply Chain Security Expert | 0 | 0 | 1 | No trust or policy decision changes; refusals keep their exit codes. |
| Test Coverage Expert | 0 | 2 | 0 | Every fold has a test that fails on the base. The tip-probe failure came from a test that still encoded the pre-S11 list. |
| Doc Writer | 0 | 2 | 0 | Journey pages come from #3996 plus the CDO patch. The PR body and one CHANGELOG line lagged the code. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 4 follow-ups
- [Python Architect] Route policy refusals and the approve usage error through
CommandLogger.refusalon stderr (P13, 4f3f41f). -- One refusal renderer, as R5 established. - [Test Coverage Expert] A subprocess test captures stdout and stderr separately, and the S11 help test asserts the derived list (86c8f91). -- CliRunner mixes the two streams, and tests must assert the derived contract.
- [Python Architect] Fix the guards that drifted (each guard that drifts silently stops guarding):
- [Doc Writer] Update the PR body and the S11 CHANGELOG line (done). -- Reviewers see the real scope and behaviour.
Recommendation
Ready for maintainer review after #3996 and #3989 land. The full matrix runs on the release/0.37-train PR. Every finding is folded.
Folded in this run
- (panel) Merge fix(0.37): finish owner hardening for bundle MCP, audit copies, failed installs, MCP targets and plugin pins #3989 forward (P11, P5, drift.py LOC budget), keeping C's
--excludelifecycle cases -- resolved in 011a2e1, e098dba. - (ci) Tip probe: the
-ghelp test asserts the adapter-derived runtime list, Kiro included -- resolved in 86c8f91. - (panel) Red team P13: policy refusals and the bare
approveusage error print on stderr; S11 CHANGELOG line corrected -- resolved in 4f3f41f. - (panel) Merge
danielmeppiel-0-37-c-ux-folds-- resolved in 6d95c73:- Q1: compile hint after uninstall/prune;
- Q2:
compile --cleanwording; - Q6:
Shell scriptlabel.
- (ci) The removal-baseline mutation case anchors on the
remove_stalecall -- resolved in dd2a54c. - (ci) Tip probe: Q1's finalize reads diagnostics as optional; the spec fake keeps proving that boundary -- resolved in 8a1de96.
- (panel) PR body covers R2/R4/R5, LSP
--exclude, the docs: zero-based redesign around the agent supply chain #3996 re-home, P13 and Q1/Q2/Q6; PR marked ready; base kept on B -- resolved in PR body edit.
Copilot signals reviewed
- None: Copilot has not reviewed this PR (0 threads).
Regression-trap evidence (mutation-break gate)
tests/integration/test_policy_refusal_stderr_lifecycle.py::test_policy_refusals_and_approve_usage_error_write_stderr-- three mutations, each restored afterwards; the test FAILED every time:- the whole P13 change reverted;
- only the
updateroute reverted; - only the
approveroute reverted.
tests/spec_conformance/test_manifest_reqs.py::test_consumer_emits_project_compile_guidance_for_dependency_instructions-- removed the optional diagnostics read; the test FAILED (AttributeError); guard restored.
Lint contract
| Check | Result |
|---|---|
uvx [email protected] check and format --check |
silent |
scripts/lint-auth-signals.sh |
clean |
scripts/lint-architecture-boundaries.sh |
exit 0 |
| pylint R0801 | 10.00/10 |
| file-length (2100) | clean |
CI
ci.yml runs only on PRs to main, so this PR's full matrix runs through the release/0.37-train PR (#4002). Exact-head targeted evidence at 8a1de96, all passed:
- 1140 unit tests;
- 58 lifecycle tests;
- 902 architecture mutation tests.
Mergeability status
| PR | head SHA | CEO stance | iters | folds | defers | Copilot rounds | CI | mergeable | mergeStateStatus | notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #3992 | 8a1de96 |
ship_now | 2 | 7 | 0 | 1 | green (rollup) | MERGEABLE | CLEAN | base #3989; matrix via #4002 |
Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.
…0.37 owner changes - test_mcp_install_flow: the plan-view stub gains bundle_owned, the field uninstall cleanup now reads (the integration twin of the unit fixture fix). - test_fail_before_integrate_lifecycle: publish the fixtures on a generic git host so pre-install validation uses git ls-remote, which honors the insteadOf rewrite. A github.com ref was probed through the REST API and 404'd under the frozen binary, so the test never reached the microsoft#3874 barrier. It also asserts that the failed run names notapkg. - test_govern_core_contract: policy refusals print on stderr (microsoft#3967, microsoft#3992), so the pinned-constraint check is asserted there. Co-authored-by: Copilot App <[email protected]>
Description
PR C of the #3983 umbrella (0.37 owner hardening). Stack: #3996 (docs redesign) <- PR B (#3989) <- this PR; PR A (#3988) has landed on main. It holds the tier-2 consistency polish from #3967, the Antigravity user-scope skills move (#3940) and one docs-sweep correction (#3948). Each fix sits in the owner that already makes the decision. Help and vocabulary text is derived from the catalog, adapters or detection owners rather than edited as strings.
core/target_detection.parse_target_fieldtarget: agentswarns once per run (the duplicate from the targets phase is gone).apm update -gnames the user manifest it actually read.advertised_manifest_target_namesvscodeno longer advertised in headers and errors.install/mcp/retired_destinations.report_retired_mcp_heal;errors._signal_listfromSIGNAL_WHITELIST.github/mcp.jsonis emptied, never deleted (docs).retired_destinations.preview_retired_mcp_moves(new, read-only, reusessplit_mcp_claimsand the heal's proof)install --dry-runpreviews servers moving from.github/mcp.json/.vscode/mcp.jsonto.mcp.json, and tells a move from a plain removal (R4).filter_excluded_mcp_runtimes--excludereads values the same way--targetdoes: case-folded, alias warns and canonicalizes, unknown values warn (exit code unchanged, per decision 5). Project MCP installs and LSP servers read--excludethrough the same normalizer (R2, LSP--exclude).deps listrows andapm findhost:portlock key, so they never collapse.deps/lockfile_generator.refusal_exitapm installincluded (R5), renders the newer-lockfile refusal with the same[x]prefix on stderr; the user-scope lockfile is named by path. Closed-world guard: only install and pack may callcheck_current_clidirectly.DependencyTree.add_declaration_error->ProspectiveInstallPlan.dependency_declaration_errorsinstall --dry-runshows the #3895 shared-directory and nested-declaration refusals without--verbose(exit code unchanged).commands/approve._not_found_messageapm approve owner/reponames the ported key to approve. It still never grants across ports.commands/view+admit_marketplace_resolutionapm view x@mktfixes the swallowedTypeErrorcall, and never suggests installing an entry that install refuses (#1326).scripts/runtime/setup-codex.sh/.ps1wire_apifollows the installed Codex version:chatfor v0.116 and later, includinglatest. Docs updated.mcp_user_scope_runtimes.user_scope_runtime_labelsinstall -g --helpkeeps no list of its own. The helpers move to their own module somcp_integrator_install.pystays under the 2100-line gate.integration/targets.pyantigravityuser_root_dir+ lockfile-recorded cleanup owner-gskills land in~/.gemini/config/skills/; recorded old-path copies are retired on the next-ginstall; unrecorded files are never touched.CommandLogger.refusal(stderr console, as R5)install,install --frozenandupdate, and the bareapm approveusage error, print on stderr. Exit codes unchanged.commands/uninstall/cli.py,commands/prune.py,install/phases/finalize.pyuninstallandprunehintapm compilewhen removed instructions are still compiled intoAGENTS.md/GEMINI.md.compilation/distributed_compiler.pycompile --cleanreports the orphanedAGENTS.mdit removes instead of telling you to run--clean.output/script_formatters.pyapm runlabels a runtime-less scriptShell script, notUnknown.Docs re-home on #3996
Journey-page edits are re-homed on #3996's redesigned pages through the CDO patch (
docs: 0.37 owner-hardening behaviour on the redesigned pages (#3992)). Deleted pages are not resurrected; reference pages (reference/**) and the apm-usage skill keep this PR's edits.Red-team folds
--exclude VSCodehonoured (mixed case reads through the runtime normalizer).apm installsends the newer-lockfile refusal to stderr like every other command.approveusage error on stderr (subprocess test captures both streams).compile --cleanwording,Shell scriptlabel (side branchdanielmeppiel-0-37-c-ux-folds, merged).Issue and approved scope
Issue: Fixes #3967, Fixes #3940. Refs #3983 #3948
Human scope-approval comment: #3983 scope records (umbrella, no-deferral rule); #3940: #3940 (comment) ; #3948 docs item forwarded by the coordinator under the docs-sweep scope.
Does this PR complete the issue, or what remains? #3967 is complete across #3988 (C5c, B5b) and this PR (every other item). #3940 is complete. #3948 gets only the policy-banner correction here.
Type of change
Testing
-n 2; the full matrix runs in CI)Each new test was confirmed to fail on the base with the src change reverted:
tests/unit/test_view_command.py::...::test_marketplace_ref_hint_names_a_refused_entry_as_refusedtests/unit/deps/test_lockfile_generator.py::test_every_command_renders_the_refusal_like_install, plus an assertion intests/integration/test_lockfile_generator_gate_lifecycle.py::test_user_scope_lockfile_is_guarded(17 passed)tests/unit/install/test_dry_run_graph.py::test_two_hosts_one_slot_is_a_declaration_errorandtests/unit/install/test_dry_run_render.py::...::test_declaration_errors_show_without_verbosetests/unit/commands/test_approve_deny.py::test_port_less_name_points_at_the_ported_packagetests/unit/install/test_copilot_project_mcp_destination.py::test_dry_run_preview_names_exactly_what_the_heal_movesandtest_dry_run_render.py::...::test_retired_mcp_moves_are_previewed_for_project_scopetests/unit/test_runtime_setup_codex_script.py::test_setup_codex_config_matches_the_installed_versiontests/unit/commands/test_find_cli_surface.py::test_ported_and_default_port_packages_stay_distincttests/integration/test_policy_refusal_stderr_lifecycle.py::test_policy_refusals_and_approve_usage_error_write_stderrfails on the base (violation missing from stderr); mutation-breaks reverting only theupdateroute or only theapproveroute each fail it.tests/unit/install/test_no_policy_flag.py::...::test_install_help_lists_kiro_runtime_and_global_scopeasserts the derived list (Kiro included) rather than a hard-coded one.tests/unit/test_removal_compile_hint.py,tests/unit/compilation/test_empty_agents_shells_1730.py,tests/unit/test_script_formatters.py.contracts-tooling-lockfile-generator-gate(prune bypassingrequire_current_cli).Lint contract on HEAD:
uvx [email protected] checkandformat --checkon src/, tests/ and the linter scripts: clean.scripts/lint-auth-signals.sh: clean.scripts/lint-architecture-boundaries.sh: rc 0.relative_toguards: clean.CI:
ci.ymlruns only on PRs tomain, so this PR's full matrix runs through therelease/0.37-trainPR (#4002).Changelog
## [Unreleased]((#3967, #3992),(#3940, #3992)).Spec conformance (OpenAPM v0.1)
No
req-XXXbehaviour changes. Exit codes and normative surfaces are unchanged.