Skip to content

fix(install): dry-run reports the req-tg-011 skip of an excluded Agent Plugin - #5784

Merged
Daniel Meppiel (danielmeppiel) merged 7 commits into
mainfrom
fix-5781-dry-run-agent-plugin-skip
Dec 2, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 7 commits into
mainfrom
fix-5781-dry-run-agent-plugin-skip

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: a0a5502dd45afd10a79d7b872d15f99bf63f6eb3

Dimension Assessment Rationale
Change confidence 9/10 ↑ Red-first lifecycle cells (claude, codex) fail at 269867c and pass after the fix; req-tg-011 spec cells pass.
↑ Review follow-ups (unique-key skips, anchored transitive path, update count) each have a cell that is red before the fix and goes red again under mutation.
↑ tests/unit/install, tests/unit/copilot_plugins, the spec module and the lifecycle cells: 4599+ passed locally.
↓ PR CI and Integration at this head are pending; earlier runs were disrupted by a GitHub Actions incident.
Diagnosis confidence 9.5/10 ↑ preflight_agent_plugin_dry_run already asked enforce_agent_plugin_deployment_boundary about each dependency but swallowed AgentPluginTargetExcludedError, so the renderer still printed -> install.
Evidence fit 9.5/10 ↑ The reporter's exact batch (local Agent Plugins kit + ordinary package, targets: [claude]) reproduces "-> install" / "would install 2" on main, and shows -> skip with the install's diagnostic after the fix.

Description

apm install --dry-run listed an Agent Plugins v1 dependency that the selected targets exclude (req-tg-011, section 8.5.5) as -> install and counted it in "would install N", while a real install skips it with one [!] diagnostic. The spec requires the dry-run to report the same per-dependency deployment decision without mutating state.

The fix stays in the shared dry-run planner and keeps one decision owner:

  • preflight_agent_plugin_dry_run (install/template.py) already evaluated enforce_agent_plugin_deployment_boundary for each selected dependency but discarded the exclusion. It now returns each skip with the same diagnostic a real install records.
  • One message builder, agent_plugin_target_skip_message, serves both the install's _record_agent_plugin_target_skip and the preview, so the text cannot drift.
  • ProspectiveInstallPlan.with_agent_plugin_skips records the skips, keyed by each dependency's unique key, so packages that share a display identity keep separate decisions. The renderer shows -> skip and prints the diagnostic once. apm_dependency_count and updated_apm_dependency_count count only what the preview would install or update.
  • A relative transitive Agent Plugin is located at the resolver's anchored_local_path.
  • _record_agent_plugin_target_skip takes its package key from the same agent_plugin_skip_package_key owner.
  • Docs: reference/cli/install.md and the apm-usage commands.md describe the dry-run skip.

The real install's behaviour is unchanged. Out of scope: which targets host Agent Plugins.

Two existing tests encoded the old behaviour and are updated:

  • test_dry_run_target_exclusion_is_non_fatal_preview asserted that the preview prints no diagnostic. It now asserts one diagnostic and -> skip per excluded package.
  • The install-deployment-skills-root-derivation allowlist entry follows the message builder to its new public name; the reason is unchanged.

KnownFailure rows: #5771 (Pi target) is still open and its current diff carries no #5781 KnownFailure cell, so nothing flips here. If #5771 lands with one first, it flips on rebase.

Issue and approved scope

Issue: Fixes #5781

Human scope-approval comment: #5781 (comment) (scripts/governance/eligibility.cjs at main ef53e98: record-present, review contact danielmeppiel).

This PR completes the issue. The record's "KnownFailure cells added by #5771 flip" clause depends on #5771, which has not landed yet.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)
promise: P-INV-I7 -- apm install --dry-run reports the same per-dependency deployment decision a real install makes, without mutating state (source: openapm-v0.1 req-tg-011, section 8.5.5; #5781)
cell: OP=install --dry-run|install SRC=local PKG=agent-plugin+ordinary TGT={claude, codex} SCOPE=project
owner: agent_plugins.errors.enforce_agent_plugin_deployment_boundary (decision); install/template.py agent_plugin_target_skip_message (diagnostic)
instrument: today test -> tests/integration/test_agent_plugin_dry_run_target_skip_lifecycle.py::test_dry_run_reports_the_agent_plugin_skip_a_real_install_makes[claude|codex] (new); tests/spec_conformance/test_copilot_plugins_reqs.py::test_dry_run_reports_the_same_target_exclusion_decision_as_install[claude|codex] (req-tg-011)
oracles: [snapshot unchanged after --dry-run, I6 ascii, I9 one diagnostic, preview line == install line]
decisive: "./vendor/ap-kit -> skip", the diagnostic once, "would install 1 APM dependency"
failing-before: red-first 269867c8 -> both targets: "./vendor/ap-kit -> install", "would install 2 APM dependencies"
passing-after: lifecycle 2 passed; spec module 11 passed, 1 skipped
ledger: tests/fixtures/lifecycle_bug_ledger/bugs/5781.json

All runs went through the host guard local-test.sh, sequentially:

  • APM_BINARY_PATH=.venv/bin/apm pytest tests/integration/test_agent_plugin_dry_run_target_skip_lifecycle.py tests/spec_conformance/test_copilot_plugins_reqs.py tests/unit/scripts/test_architecture_skills_root_guard.py tests/unit/install tests/unit/copilot_plugins: 4595 passed, 11 skipped
  • pytest tests/integration/test_architecture_owner_rule_mutations.py -k "dry-run or skills-root": 9 passed
  • Dry-run and Agent Plugin integration neighbours (test_install_dry_run_e2e, test_coverage_gaps_phase4w2, the agent-plugin cells of test_required_lifecycle_state_machine): 101 passed. tests/lifecycle/machines/test_m_source.py fails locally on a git https helper (git: 'remote-https' is not a git command) and reproduces on another tree, so it is environmental.
  • CONFORMANCE regenerated: full --collect-only, then gen_statement.
  • CI-mirror lint: ruff 0.15.12 check and format, R0801 (0 findings), YAML, file-length (commands/install.py at 2099) and relative_to guards, symlinks, auth signals, architecture boundaries, complexity, taxonomy and obligation ratchets, and tm006: all clean.

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

(The req-tg-011 text is unchanged; the implementation now meets its dry-run clause.)

…#5781)

Red-first cells for two non-host targets (claude, codex): the dry-run
preview must show the Agent Plugins dependency as skipped with the real
install's single diagnostic and the ordinary dependency as installed,
mutating nothing; the real install then makes the same decision.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…t Plugin

The dry-run preflight already asked the deployment-boundary owner about
each selected dependency, but swallowed a target exclusion, so the
preview listed the excluded Agent Plugin as an install. It now returns
each skip with the diagnostic a real install records (one message
builder for both), and the preview shows the dependency as skipped,
prints that diagnostic once and counts only what it would install.

Fixes #5781

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… decision

Behavioral conformance for the req-tg-011 dry-run clause (section 8.5.5)
on two non-host targets; CONFORMANCE regenerated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 16:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Dry-run exclusions can miss transitive plugins or incorrectly skip ordinary dependencies, while summary counts still include excluded updates.

4 open issues
What changed in this PR

Addresses #5781 by making the shared install dry-run planner report target-excluded Agent Plugins as skipped, matching real-install diagnostics without mutating state.

Changes:

  • Records exclusions and removes skipped packages from preview install counts.
  • Shares recovery messages between preview and real installation.
  • Adds regression coverage and updates conformance records.
File Description
tests/​unit/​scripts/​test_architecture_skills_root_guard.py Updates the allowlisted helper name.
tests/​unit/​install/​test_agent_plugin_deployment_boundary.py Expects skip rows and diagnostics.
tests/​spec_conformance/​test_copilot_plugins_reqs.py Adds req-tg-011 preview checks.
tests/​integration/​test_agent_plugin_dry_run_target_skip_lifecycle.py Tests preview/install agreement and unchanged state.
tests/​fixtures/​lifecycle_bug_ledger/​bugs/​5781.json Records regression evidence.
src/​apm_cli/​install/​template.py Collects exclusions and shares diagnostic construction.
src/​apm_cli/​install/​presentation/​dry_run.py Renders skips and recovery diagnostics.
src/​apm_cli/​install/​dry_run_plan.py Stores skips and adjusts install counts.
src/​apm_cli/​commands/​install.py Applies exclusions to the preview plan.
scripts/​architecture_linter/​checks/​install_skills_root_derivation.py Follows the renamed message helper.
CONFORMANCE.md Updates requirement coverage totals.
CONFORMANCE.json Registers new conformance cases.
changelog.d/​5784.fixed.md Documents the user-visible fix.

Review effort: Balanced

Comment thread src/apm_cli/commands/install.py Resolved
Comment thread src/apm_cli/install/dry_run_plan.py Resolved
Comment thread src/apm_cli/install/template.py Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…te count

Review follow-ups for the req-tg-011 dry-run skip (#5781):
- skips are keyed by the dependency's unique key, so a plugin and an
  ordinary package sharing a display identity keep their own decisions
- a relative transitive Agent Plugin is located at the resolver's
  anchored path, so its exclusion is not missed
- the preview's update count leaves out skipped packages
- docs: --dry-run reports the skip and its diagnostic

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The plan and preflight cells assert return values; they are unit tests,
not component tests (assertion-quality AQ003 ratchet).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit edb62af into main Dec 2, 2026
57 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the fix-5781-dry-run-agent-plugin-skip branch December 2, 2026 19:27
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
Restacked as one commit onto main 4e733b0 (#5775, #5778, #5743 and #5784
landed). This is the net Pi delta of danielmeppiel-pi-target at 0871e7d7 over
the stack it carried, applied with no conflicts:

- the pi target (registry profile, catalog capability, .pi detection, skills
  in .agents/skills, commands in .pi/prompts, PI_CODING_AGENT_DIR user root,
  read verbatim), trust hint, init picker from the registry, unsupported
  primitive warning once, governance_dirs for unmanaged_files;
- project cleanup removes only roots that do not signal their target, and only
  roots that do are created before a write (materializes_root); an auto_create
  target's merged hook config is created with its root;
- the trust hint also fires for project-only .apm content;
- harness conformance: Pi cells all required (zero baseline), HC-PLUGIN-01
  .dryrun promoted (26 rows formerly #5781) with an exact-line oracle;
  main's required cells kept (the carried ratchet had them in baseline),
  known_failing merged into the promise engine, PI_CODING_AGENT_DIR scrubbed
  in tests/conftest.py, Pi journey variants, Pi receipts;
- real-harness Pi 1.6.0 lane with the cross-spawn and minimatch overrides.

apm-spec-waiver: adds the pi target as registry data on the shared target layer; no change to an OpenAPM v0.1 requirement
apm-spec-waiver: policy default scan dirs now come from registry data; the existing list is byte-identical and pi adds .pi

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
Restacked as one commit onto main 4e733b0 (#5775, #5778, #5743 and #5784
landed). This is the net Pi delta of danielmeppiel-pi-target at 0871e7d7 over
the stack it carried, applied with no conflicts:

- the pi target (registry profile, catalog capability, .pi detection, skills
  in .agents/skills, commands in .pi/prompts, PI_CODING_AGENT_DIR user root,
  read verbatim), trust hint, init picker from the registry, unsupported
  primitive warning once, governance_dirs for unmanaged_files;
- project cleanup removes only roots that do not signal their target, and only
  roots that do are created before a write (materializes_root); an auto_create
  target's merged hook config is created with its root;
- the trust hint also fires for project-only .apm content;
- harness conformance: Pi cells all required (zero baseline), HC-PLUGIN-01
  .dryrun promoted (26 rows formerly #5781) with an exact-line oracle;
  main's required cells kept (the carried ratchet had them in baseline),
  known_failing merged into the promise engine, PI_CODING_AGENT_DIR scrubbed
  in tests/conftest.py, Pi journey variants, Pi receipts;
- real-harness Pi 1.6.0 lane with the cross-spawn and minimatch overrides.

apm-spec-waiver: adds the pi target as registry data on the shared target layer; no change to an OpenAPM v0.1 requirement
apm-spec-waiver: policy default scan dirs now come from registry data; the existing list is byte-identical and pi adds .pi

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 3, 2026
Restacked as one commit onto main 4e733b0 (#5775, #5778, #5743 and #5784
landed). This is the net Pi delta of danielmeppiel-pi-target at 0871e7d7 over
the stack it carried, applied with no conflicts:

- the pi target (registry profile, catalog capability, .pi detection, skills
  in .agents/skills, commands in .pi/prompts, PI_CODING_AGENT_DIR user root,
  read verbatim), trust hint, init picker from the registry, unsupported
  primitive warning once, governance_dirs for unmanaged_files;
- project cleanup removes only roots that do not signal their target, and only
  roots that do are created before a write (materializes_root); an auto_create
  target's merged hook config is created with its root;
- the trust hint also fires for project-only .apm content;
- harness conformance: Pi cells all required (zero baseline), HC-PLUGIN-01
  .dryrun promoted (26 rows formerly #5781) with an exact-line oracle;
  main's required cells kept (the carried ratchet had them in baseline),
  known_failing merged into the promise engine, PI_CODING_AGENT_DIR scrubbed
  in tests/conftest.py, Pi journey variants, Pi receipts;
- real-harness Pi 1.6.0 lane with the cross-spawn and minimatch overrides.

apm-spec-waiver: adds the pi target as registry data on the shared target layer; no change to an OpenAPM v0.1 requirement
apm-spec-waiver: policy default scan dirs now come from registry data; the existing list is byte-identical and pi adds .pi

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

[BUG] install --dry-run reports an excluded Agent Plugins dependency as "install" instead of the req-tg-011 skip

2 participants