Skip to content

feat(targets): add the Pi coding agent target (#2908) - #5771

Open
Daniel Meppiel (danielmeppiel) wants to merge 103 commits into
mainfrom
danielmeppiel-pi-target
Open

Daniel Meppiel (danielmeppiel) wants to merge 103 commits into
mainfrom
danielmeppiel-pi-target

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Milestone 0.40.0; lands after the v0.39.4 tag. Stacked on #5743 and #5775 (merged in at 1622a4a): review and merge those first; this diff includes their commits until then.

Release gate: no release ships this PR without the Pi MCP follow-up PR (stacked on this branch), unless the maintainer decides otherwise. MCP for Pi moved out of this PR so it can reuse the shared MCP env reference owner from #5773.

Description

Adds the Pi coding agent (@earendil-works/pi-coding-agent) as an APM target, built as declarative data on the shared target layer. There are no pi branches; the registry_delegation.harness_name_literals guard from #5743 enforces this.

Registry data:

  • core/target_catalog.py: the pi capability (in all, compile family agents) and its TargetDetection row (.pi/ folder signal).
  • integration/targets.py KNOWN_TARGETS["pi"]:
    • skills go to the Agent Skills root .agents/skills/<n>/SKILL.md, and to <agent-dir>/skills/ at user scope;
    • commands go to Pi prompt templates .pi/prompts/<n>.md through the shared claude_command transformer;
    • instructions are compile-only into AGENTS.md, and into <agent-dir>/AGENTS.md at user scope through the data-driven user-root compile;
    • a trust_hint field.
  • USER_ROOT_VARIABLES["pi"]: PI_CODING_AGENT_DIR, default .pi/agent.
  • hosts_agent_plugins stays False and native_plugin_settings stays unset. A test pins both.

Shared-layer changes (generic, no harness names):

  • Trust hint: install finalize prints each active target's registry trust_hint once, on project-scope installs only. Pi loads .agents/skills and .pi/prompts only after project trust. APM never writes Pi's trust or settings files.

  • Agent Plugins: native Agent Plugin registration now names the effective targets that have no native Agent Plugins host. Before, it skipped them silently; this covers pi+copilot and codex+copilot. The warning goes through DiagnosticCollector, and the host set is derived from the registry.

  • Uninstall cleanup: project empty-parent cleanup now keeps only detected target roots, which are the opt-in signal install that retires the last deployed file removes the empty target root; the next install recreates it #4132 protects. Every root that is not detected by its directory (detect_by_dir=False) and that APM creates on demand (auto_create=True) is now removed when empty: .agents/ and grok-bot's agent-data/. Before, an emptied shared .agents/ survived uninstall for every target that deploys there, including codex, opencode and pi; reproduced on main for codex and opencode.

    • A root that still holds a user file, at any depth, stays. Tests cover .agents/x and .agents/skills/x.
    • Caveat (accepted): APM keeps no record of whether .agents/ existed before the install. An empty .agents/ that a user created and that held only APM files is also removed. This matches user-scope behaviour.
  • Unsupported primitives: the pi profile sets warn_unsupported_primitives (data). The shared warning now counts a package's prompts as carried by a target's commands, and its instructions as carried by the target's compile family. So apm install --target pi names only skipped agents and hooks in one [!] line. Cowork output is unchanged. The warning now goes through the diagnostics collector only; before, it was printed inline and again by the install summary. A registry-generated golden covers every target that sets the flag (copilot-cowork, pi) and asserts one rendering.

  • Corrections to other targets:

    • copilot-cowork: the unsupported-primitive warning printed twice (inline and in the summary); it now prints once, with the same text.
    • kiro and grok-build: missing from the apm init picker; now offered (registry-derived list).
  • apm init picker: the interactive target list is derived from AUTO_DETECT_ORDER. The seven existing entries keep their order and labels, and kiro, grok-build and pi are now offered.

  • MCP dependencies with --target pi: no change needed. Main's generic path already prints [i] Skipped targets without MCP support: pi and writes no .pi/mcp.json. With pi as the only target, it fails closed with the existing [!]/[x] lines.

Harness contract (from #5775): the contract claims the registry fields #5743 added, trust_hint is no longer a forward field, and the ratchet is regenerated at 1622a4a with the 41 Pi cells in the baseline owned by #2908 until their witnesses move them to required.

Tests: this branch merges the Pi tests branch (unit, lifecycle, real-harness) and flips the four Pi real-harness cells in expected.json to LOADS. In this PR, a Pi LOADS verdict requires the skill and the prompt template to be listed by Pi.

Pi-specific code vs data:

Kind Lines
Pi-specific code 0
Pi data catalog entry plus TargetDetection row and order-tuple entries; KNOWN_TARGETS["pi"] (including trust_hint and warn_unsupported_primitives); USER_ROOT_VARIABLES["pi"]
Shared logic trust hint 8; hostless warning 7; shared-root cleanup 4; unsupported-primitive carriers 8 plus an 8-line target_compile_family reader; init picker 1

Reuses the profile shape and rationale from closed community PR #2907 by Abhishek Sharma (@abhishekbiyala), credited as co-author.

Issue and approved scope

Issue: Refs #2908

Human scope-approval comment: #2908 (comment) (apm-scope:v1, v4, 2026-12-02; supersedes earlier records)

What remains: MCP for Pi, in the stacked follow-up PR (#5785). Pi is qualified against Pi 1.6.0: the real-harness lane loads the deployed skills and prompt templates in all 4 cells, and every applicable Pi conformance cell is required (42 required, 0 baseline, 0 known_failing).

Type of change

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

Testing

  • Tested locally
  • All existing tests pass (targeted suites below)
  • Added tests for new functionality (if applicable)

Validation evidence, run locally on this head; each pytest run went through the host guard script with -p no:xdist and APM_BINARY_PATH=.venv/bin/apm:

Command Result
.venv/bin/python -m pytest -q -p no:xdist tests/unit/scripts/test_architecture_runner.py tests/unit/scripts/test_architecture_harness_literals.py tests/quality tests/unit/copilot_plugins tests/unit/install tests/unit/integration tests/unit/core (at 96b40b1, the split) 12452 passed, 15 skipped
.venv/bin/python -m pytest -q -p no:xdist tests/lifecycle/scenarios/test_pi_target.py tests/unit/integration/test_pi_target.py tests/unit/scripts/test_real_harness_check.py tests/unit/adapters tests/unit/install/test_mcp_self_defined_declared_keys.py tests/unit/integration/test_targets_registry_completeness.py tests/unit/core/test_target_registry_derivation.py (at the split) 712 passed, 3 skipped
.venv/bin/python -m pytest -q -p no:xdist tests/unit/test_init_command_selection.py tests/unit/install/test_services.py tests/unit/install/test_services_rendering.py tests/unit/install/test_services_branches.py tests/integration/test_install_services_orchestration.py tests/unit/core/test_target_registry_derivation.py tests/unit/integration/test_targets_registry_completeness.py tests/lifecycle/scenarios/test_pi_target.py tests/unit/test_init*.py 458 passed
uvx ruff@0.15.12 check and format --check on the CI paths passed
pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 (CI paths) 10.00/10
bash scripts/lint-auth-signals.sh clean
scripts/check_complexity_ratchet.py --base-ref <main d0bdbe76> clean
python -m tests.quality.taxonomy --changed clean (17 modules)
scripts/check_test_assertions.py ratchet clean
scripts/lint_architecture_boundaries.py --root . clean
changelog_fragments.py check 5 fragments valid
File-length guard largest file is 2100 lines; integration/targets.py is at 2082

CI timing

Architecture Ratchet Contracts runs 9.9 to 15.3 min in CI against a 15-minute cap, including 14.9 min on main's #5539 head. Local sequential runs of its exact pytest selection (host guard, -p no:xdist, --durations=30):

Head Selection time
1622a4a (target base) 417 s
ae883b1 (Pi tests and QL guards merged) 437 s (+4.8%)
066f1a0 (known_cells() scan and lifecycle collection cached per session) 400 s

066f1a0 changes tests only: every assertion is kept and no timeout changes. Architecture Scaling's selection is 235 s at 1622a4a and 246 s at ae883b1; its 10-minute cancellations line up with the Actions incident, not this diff.

Restack and review folds (ecb4f8b)

Restacked as one commit on main 4e733b07, which already contains #5775, #5778, #5743 and #5784. The commit is the net Pi delta of the previous head 0871e7d7 over the stack it carried (old #5743 3c71b0d1 + old #5778 a01acef2 + main through #5784 edb62afb), cherry-picked with no conflicts. src/ is byte-identical to the pre-restack head. One resolution: tests/quality/harness_conformance.json takes main's 193 surface-witness required cells, which the carried ratchet still had in baseline. The baseline now equals main's (465), required is a superset of main's (274), and known_failing is 8 rows, all #3616.

New relative to 066f1a05 (the folds):

  • Review threads: project-only .apm content prints the trust hint (local_files_changed); a target root is created before any write only when it signals its target (materializes_root), and an auto_create target's merged hook config is created with its root; PI_CODING_AGENT_DIR is read verbatim; tests/conftest.py scrubs it, with a registry-equality guard; load_generated reads harness known_failing rows as known failing.
  • The antigravity hook test is updated to the auto_create contract. require_dir stays covered for cursor (test_skips_when_no_cursor_dir).
  • HC-PLUGIN-01.dryrun: the 26 [BUG] install --dry-run reports an excluded Agent Plugins dependency as "install" instead of the req-tg-011 skip #5781 rows move to required (34-cell run with --runxfail and APM_BINARY_PATH=.venv/bin/apm: 26 pass; the 8 failures are the [EPIC] New harness = one data record plus one shared checklist #3616 experimental-target rows). The oracle is now an exact line on stdout, CRLF-normalized: [i] - ./vendor/hc-ap-kit -> skip.
  • diagnostic-mutation: src/apm_cli/install/presentation/dry_run.py:48 "skip" -> "skipped" -> AssertionError: [pi/project] no exact line '[i] - ./vendor/hc-ap-kit -> skip': ['[i] - ./vendor/hc-ap-kit -> skipped']. The previous \bskip regex passed that mutation.

Review round 2 (dfe4817)

  • Hostless-target warning: finalize_native_plugin names only the skip, never a native registration the Copilot owner may have refused (failing-before test test_a_refused_plugin_is_never_reported_as_registered).
  • "Packed, not qualified" label dropped (targets matrix and changelog fragment); both conditions hold.
  • .apm/-only unsupported-primitive discovery is deferred to [BUG] install silently drops primitive kinds the target does not carry (no HC-UNSUP-01 diagnostic) #5797 step 2.
  • README, its own commit dfe48176, so it can be dropped cleanly:
-GitHub Copilot | Claude Code | Grok Build | Cursor | OpenCode | Codex | Gemini CLI | Windsurf | Kiro
+GitHub Copilot | Claude Code | Grok Build | Cursor | OpenCode | Codex | Gemini CLI | Windsurf | Kiro | Pi

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).

5771.added.md adds the target. 5771.fixed.md covers the .agents/ residue and the apm init picker.

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

The new target is registry data. Section 4.2.1's registered set already omits other shipped targets such as kiro and grok-build.

apm-spec-waiver: adds the pi target as registry data on the shared target layer; no change to an OpenAPM v0.1 requirement

Agent assessment

  • Change confidence: medium-high.
    • The Pi unit, lifecycle and derivation tests pass, and the broad unit suites pass after the MCP split.
    • The real-harness cells run only in CI.
    • The .agents/ cleanup and the unsupported-primitive warning change are generic and covered by regression tests. They affect every target that deploys under .agents/ or sets the warning flag.

Stack restack (a57ed54)

Linear stack: #5809 -> #5800 -> #5801 -> #5814 -> #5771 -> #5785. This head is #5801 b20dc20 (on #5800 50b2e27), plus one merge of main 641743f (the stack base predates #5743's 4e733b0), plus #5771's own commits. The replayed tree is byte-identical to the prep resolution.

Conflict resolution (harness_ratchet.py, test_harness_conformance.py, harness_conformance.json), keeping both sides:

Copilot nits declined

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
apm-spec-waiver: adds the pi target as registry data on the shared target layer; no change to an OpenAPM v0.1 requirement

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
scripts/check_test_assertions.py flagged three component/e2e Pi tests:
- detection now reads `apm targets --json` (pi inactive with only .agents/,
  active with .pi/) instead of resolving targets in-process;
- --target all now installs the kit and asserts .pi/prompts/<n>.md exists;
- the lifecycle helpers that assert the exit code and the user's mcp.json
  are named _assert_ok / _assert_user_kept, which the ratchet recognises.
No baseline growth; the scanner reports clean. The unit module stays red on
main (12/12) and passes on PR-B base #5771 (12/12).

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
scripts/check_test_assertions.py flagged three component/e2e Pi tests:
- detection now reads `apm targets --json` (pi inactive with only .agents/,
  active with .pi/) instead of resolving targets in-process;
- --target all now installs the kit and asserts .pi/prompts/<n>.md exists;
- the lifecycle helpers that assert the exit code and the user's mcp.json
  are named _assert_ok / _assert_user_kept, which the ratchet recognises.
No baseline growth; the scanner reports clean. The unit module stays red on
main (12/12) and passes on PR-B base #5771 (12/12).

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
…#2908)

test_pi_mcp_skips_an_sse_server_and_writes_the_others: a package declaring
an SSE server and a stdio server installs with exit 0; a [!] block names
sse-srv, SSE and Pi; sse-srv is absent from .pi/mcp.json; the stdio server
is written and the user's servers are kept. Red on main at Unknown target
'pi'; green on #5771 at 537df1b.

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
MCP deployment for the pi target moves to a stacked branch that builds
on the shared MCP env reference owner. This PR keeps the base
primitives: registry data, the trust hint, the hostless Agent Plugins
warning, the shared deploy-root cleanup fix, docs and the non-MCP
lifecycle and real-harness cells. The real-harness Pi verdict now
requires skill and prompt listing only.

apm-spec-waiver: scope split only; MCP code removed from this PR, no new install or integration behavior

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
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
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danielmeppiel
Daniel Meppiel (danielmeppiel) marked this pull request as ready for review December 2, 2026 18:31
Copilot AI balanced review requested due to automatic review settings December 2, 2026 18:31

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

Unresolved issues risk writes outside the test sandbox, incorrect Pi deployment paths, unstable repeated installs, lost known-failure tracking, and missing trust reminders for local-only deployments.

5 open issues
1 file not reviewed
  • scripts/real_harness/npm/pi-1.6.0/package-lock.json: Generated file
What changed in this PR

Adds Pi as a registry-driven APM target, building on the shared target refactor and harness-conformance framework. Pi MCP support remains deferred to a follow-up.

Changes:

  • Adds Pi detection, skill deployment, prompt templates, compiled instructions, and user-directory configuration.
  • Centralizes target metadata and improves trust reminders, unsupported-target warnings, cleanup, and the init picker.
  • Extends lifecycle coverage, real-harness checks, architecture guards, and documentation.
File Description
tests/​unit/​test_mcp_command.py Refines hidden-option help assertion.
tests/​unit/​test_init_command_selection.py Tests expanded target picker.
tests/​unit/​scripts/​test_architecture_runner.py Registers new guard expectations.
tests/​unit/​scripts/​test_architecture_harness_literals.py Tests registry ownership guards.
tests/​unit/​integration/​test_targets.py Covers Pi user-root resolution.
tests/​unit/​integration/​test_pi_target.py Adds Pi deployment acceptance tests.
tests/​unit/​integration/​test_data_driven_dispatch.py Includes Pi command routing.
tests/​unit/​integration/​test_base_integrator.py Tests shared-root cleanup.
tests/​unit/​install/​test_services.py Tests single-render primitive warnings.
tests/​unit/​core/​test_target_catalog.py Adds Pi catalog expectations.
tests/​unit/​core/​test_target_catalog_io.py Updates accepted-target output.
tests/​unit/​core/​test_scope.py Includes Pi in scope expectations.
tests/​unit/​copilot_plugins/​test_pr2705_folds.py Tests hostless-target warnings.
tests/​unit/​copilot_plugins/​test_capability.py Tests Pi plugin refusal.
tests/​quality/​test_ci_topology.py Caches lifecycle collection results.
tests/​quality/​promise-catalog.json Registers harness-conformance promise.
tests/​quality/​lifecycle_obligations.json Adds Pi target metadata.
tests/​quality/​known_cell_issues.py Includes harness failures; caches scanning.
tests/​quality/​known_cell_issue_states.json Updates tracked issue states.
tests/​quality/​complexity_baseline.json Removes resolved detection complexity debt.
tests/​lifecycle/​obligations.py Incorporates required harness witnesses.
tests/​lifecycle/​obligation_space.py Generates harness obligations.
tests/​lifecycle/​journeys/​test_journeys.py Supports declarative harness variants.
tests/​lifecycle/​journeys/​consumer/​J10-global-setup.yaml Adds Pi global-install journey.
tests/​lifecycle/​journeys/​consumer/​J09-switch-harness.yaml Adds Pi switching journey.
tests/​lifecycle/​journeys/​consumer/​J08-uninstall-cleanup.yaml Adds Pi cleanup journey.
tests/​lifecycle/​journeys/​consumer/​J03-ci-gate.yaml Enables Pi CI-gate variant.
tests/​lifecycle/​journeys/​consumer/​J02-team-onboarding.yaml Adds Pi onboarding variant.
tests/​lifecycle/​journeys/​consumer/​J01-first-run.yaml Adds Pi first-run expectations.
tests/​lifecycle/​harness_ratchet.py Implements harness coverage ratchet.
tests/​integration/​test_verdict_record.py Checks registry-root fingerprint coverage.
tests/​integration/​test_install_services_orchestration.py Expects deferred warnings only.
tests/​integration/​test_architecture_owner_rule_mutations.py Adds ownership-guard mutations.
tests/​fixtures/​lifecycle_bug_ledger/​bugs/​2908.json Records Pi regression coverage.
src/​apm_cli/​policy/​unmanaged_scan.py Derives governance directories from registry.
src/​apm_cli/​native_plugins/​scopes.py Derives native-plugin settings paths.
src/​apm_cli/​integration/​user_scope_links.py Extracts user-scope link policy.
src/​apm_cli/​integration/​targets.py Adds Pi profile and shared metadata.
src/​apm_cli/​integration/​base_integrator.py Preserves detection roots during cleanup.
src/​apm_cli/​install/​verdict_record.py Includes Pi in governed roots.
src/​apm_cli/​install/​target_warnings.py Recognizes primitive carriers; deduplicates warnings.
src/​apm_cli/​install/​services.py Uses revised warning interface.
src/​apm_cli/​install/​phases/​finalize.py Emits registry-defined trust hints.
src/​apm_cli/​install/​native_plugin_admission.py Reports targets without plugin hosts.
src/​apm_cli/​core/​target_detection.py Derives detection and display tables.
src/​apm_cli/​core/​target_catalog.py Adds detection metadata and Pi capability.
src/​apm_cli/​copilot_plugins/​settings.py Reuses canonical activation key.
src/​apm_cli/​copilot_plugins/​constants.py Removes redundant target constant.
src/​apm_cli/​copilot_plugins/​capability.py Resolves plugin hosts from registry.
src/​apm_cli/​compilation/​context_optimizer.py Derives hidden deployment roots.
src/​apm_cli/​commands/​init.py Derives interactive target choices.
src/​apm_cli/​bundle/​lockfile_enrichment.py Derives cross-target path mappings.
scripts/​real_harness/​probe.py Adds Pi resource-discovery probes.
scripts/​real_harness/​npm/​pi-1.6.0/​README.md Explains dependency overrides.
scripts/​real_harness/​npm/​pi-1.6.0/​package.json Pins Pi and dependency overrides.
scripts/​real_harness/​npm/​pi-1.6.0/​.npmrc Selects public npm registry.
scripts/​real_harness/​expected.json Adds four Pi load expectations.
scripts/​architecture_linter/​groups/​registry_delegation.py Registers new architecture checks.
scripts/​architecture_linter/​checks/​registry_harness_literals.py Guards harness literals and settings ownership.
packages/​apm-guide/​.apm/​skills/​apm-usage/​package-authoring.md Documents Pi authoring and deployment.
packages/​apm-guide/​.apm/​skills/​apm-usage/​dependencies.md Lists Pi as an accepted target.
packages/​apm-guide/​.apm/​skills/​apm-usage/​commands.md Documents Pi auto-detection.
docs/​src/​content/​docs/​reference/​targets-matrix.md Documents Pi capabilities and qualification limits.
docs/​src/​content/​docs/​reference/​environment-variables.md Documents Pi user-directory override.
docs/​src/​content/​docs/​reference/​cli/​targets.md Adds Pi detection signal.
docs/​src/​content/​docs/​consumer/​choose-harnesses.mdx Explains Pi trust and compilation.
CONFORMANCE.md Updates target-detection coverage count.
CONFORMANCE.json Adds Pi conformance test references.
changelog.d/​5771.fixed.md Records cleanup, picker, and warning fixes.
changelog.d/​5771.added.md Announces Pi with qualification caveat.
changelog.d/​5743.fixed.md Records Grok compile-placement corrections.
apm.lock.yaml Refreshes deployed acceptance-script hashes.
.github/​workflows/​real-harness.yml Adds pinned Pi lane and latest-version probe.
.github/​workflows/​merge-train.yml Runs harness-conformance quality checks.
.github/​workflows/​ci.yml Runs harness-conformance quality checks.
.apm/​skills/​release-acceptance/​scripts/​world.py Sandboxes Pi's user directory.
.apm/​architecture/​owners/​marketplace-plugins.json Associates native-settings guard with owner.
.apm/​architecture/​owners/​hooks-integrations.json Assigns extracted link-policy ownership.
.apm/​architecture/​owners/​core-runtime.json Associates harness-literal guard with owner.
.apm/​architecture/​harness-literal-legacy.json Records legacy harness-literal exemptions.
.agents/​skills/​release-acceptance/​scripts/​world.py Updates deployed Pi sandbox configuration.

Review effort: Balanced

Comment thread src/apm_cli/install/phases/finalize.py Resolved
Comment thread src/apm_cli/integration/targets.py Resolved
Comment thread tests/lifecycle/obligations.py Resolved
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
- finalize: the project trust hint also fires when only the project's own
  .apm content was written (ctx.local_files_changed, the #4184 files_changed
  count); local skills count as sub_skills, so the skill counters missed it.
- targets: only a root that signals its target (detect_by_dir) is created
  before any write (TargetProfile.materializes_root); any other root (.agents
  for antigravity) is created by its first write, so retiring its last file
  is a fixed point instead of a remove-and-recreate cycle (#4132). A merged
  hook config's opt-in check defers to auto_create, so antigravity hooks still
  deploy into the root they create.
- PI_CODING_AGENT_DIR is read verbatim, like Pi 1.6.0 getAgentDir.
- tests/conftest.py scrubs PI_CODING_AGENT_DIR; a test holds the scrub list
  equal to USER_ROOT_VARIABLES.
- obligations.load_generated reads harness known_failing rows as known
  failing, not baseline.

Each fix carries a failing-before test.

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

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.

🔵 Needs a closer look

The ratchet can falsely fail unchanged PRs by comparing against a moving base-branch tip, and generated Pi prompts leave named input placeholders unexpanded.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Expand named prompt inputs from positional arguments

src/​apm_cli/​integration/​targets.py:1358

For a prompt declaring input: [name] and ${input:name}, this renderer emits $name, so /review Alice leaves the placeholder literal instead of inserting Alice. Pi 1.6.0 ignores the generated arguments frontmatter and substitutes positional/all-argument tokens, consistent with the upstream substitution contract. Add a registry-declared positional-input mode to the shared renderer and test argument expansion.

Medium severity Compare against the tested commit’s first parent

tests/​lifecycle/​harness_ratchet.py:173

Fetching the live base-branch tip can compare this checkout against a different commit than the PR merge was built on. If main promotes a baseline cell while this job is queued or before a rerun, the unchanged PR still contains that cell and baseline_growth() incorrectly fails the required check. Fetch the tested commit and use its first parent, as the merge-queue and push paths already do.

5 resolved since last review
1 file not reviewed
  • scripts/real_harness/npm/pi-1.6.0/package-lock.json: Generated file

Review effort: Balanced

…t collected fails

A required cell in tests/quality/harness_conformance.json must earn a passing
receipt. Until now ReceiptWitnessPlugin only checked witnesses that passed, so
a skipped witness left its required cell unproven without failing anything.

- ReceiptWitnessPlugin fails a skipped or xfailed witness of a required cell
  (setup or call phase), naming every cell and the skip reason. A cell that no
  longer applies leaves through the contract (applies()), not a run-time skip.
  Skips of nodes that witness no required cell stay skips.
- harness_ratchet.uncollected_witnesses(): every required witness node must be
  collected (pytest --collect-only over the witness modules), so a renamed or
  unparametrized witness is refused.
- Mutation tests: a required witness that skips fails the gate (pytester), a
  skip outside required cells stays a skip, and a dropped node is named as
  not collected.

Refs #5796

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…easured; plain skips and untracked xfails fail

Refs #5796

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

# Conflicts:
#	src/apm_cli/integration/targets.py
…t (S141)

D removed the scripts table from list_cmd (run.py is its single owner, #5806).
TestListCmd in tests/integration/test_coverage_phase4.py patched
list_cmd._list_available_scripts/_get_console and is deleted. Each of its
seven behaviours already has an exact oracle in tests/unit/commands/test_run_list.py:

- test_no_scripts_shows_warning_and_example -> test_run_list_prints_the_0_39_list_output_and_runs_nothing[no-scripts-panel] (exact bytes) + test_no_scripts_panel_gets_the_example_block
- test_scripts_shown_via_fallback_no_console -> test_plain_fallback_without_console[start-is-default, no-default] (exact output)
- test_start_script_marked_as_default -> test_run_list_prints_the_0_39_list_output_and_runs_nothing[scripts-table] (exact "[>] | start" row) + test_plain_fallback_without_console[start-is-default]
- test_scripts_shown_via_rich_console -> test_rich_console_prints_table_then_default_note (console.print call count) + [scripts-table] exact table
- test_exception_in_list_scripts_exits_1 -> test_read_error_exits_1_with_the_error (exit 1 + "[x] Error listing scripts: disk error")
- test_no_scripts_rich_panel_import_error_fallback -> test_no_scripts_panel_fallback_on_import_or_name_error (exact output, ImportError and NameError)
- test_rich_console_exception_falls_back_to_simple -> test_rich_failure_falls_back_to_plain_once (one plain listing, every name, default note)

Stale text after the bare apm list switch: the canvas page's "not shown by
apm list", and a lifecycle test docstring that said apm list never reads the
lock. (troubleshooting/index.md is B's hunk; fixed there to avoid a merge conflict.)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The failed `apm run missing` prints the exact stderr line
"Run 'apm run --list' to see each script and its command." The test
runs that step, checks that it reaches the scripts table, and checks
that it changes no durable state.

Docs: the troubleshooting entry and the run reference no longer say
what bare `apm list` shows. The entry points to `apm run --list` for
scripts, so it stays true before and after the inventory switch.

Refs #5756

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
After the switch, bare 'apm list' is the inventory: each row is an item a
harness reads and SOURCE names the package that installed it. The entry
now says so, shows 'apm list <package>' for one package, keeps the
'apm deps' pointers and 'apm run --list' for scripts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A declared transport does not show whether the fetched payload keeps a
remote, so a header-sourced overlay refusal is always deferred to the
existing payload confirmation under --frozen; an env overlay still
decides alone.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merges B's signed head (no rebase) so D merges cleanly after B on main.
packages/apm-guide/.apm/skills/apm-usage/commands.md, Scripts table, resolved to
exactly two rows after `apm preview SCRIPT`: B's `apm run --list` row as B has
it, then D's `apm list [NAME]` inventory row. The stale "`apm list` | List
available scripts" row is removed (S141); no other "List available scripts" or
apm-list-means-scripts text remains in the tree.

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

# Conflicts:
#	tests/quality/known_cell_issue_states.json
#	tests/quality/known_cell_issues.py

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

The import regression guard can pass without exercising the inventory because it discards CLI invocation failures instead of asserting success.

3 open issues

Review effort: Balanced

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

# Conflicts:
#	tests/quality/harness_conformance.json
The pi reader record now cites the pinned Pi 1.6.0 docs commit, as the pi
target's user-root row does. With pi in KNOWN_TARGETS no reader record is
reader-only, so the record test asserts none is.

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

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

The import-budget regression test can pass even when apm list fails because it discards the invocation result without checking its exit code.

4 open issues
1 resolved since last review

Review effort: Balanced

Comment thread changelog.d/5771.added.md Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🔵 Needs a closer look

The import guard can pass even when the invoked command fails because the probe checks unloaded modules without first asserting a successful command exit.

4 open issues

Review effort: Balanced

The project MCP write for a Gemini-family adapter was gated on its config
directory existing. That is Gemini's opt-in (.gemini), but Antigravity's
.agents root is shared and created only when Antigravity is selected, so
with the root no longer created ahead of every install the MCP config
was skipped. The gate now applies only to a target whose registry profile
does not auto-create its root; Gemini keeps its opt-in.

The legacy 'all' target suggestion is derived from the registry
(TARGET_CAPABILITIES in_all targets that install), not a hand-written
list.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The expected list stays hand-written on purpose: it is an independent
oracle for what 'all' resolves to, so a target entering or leaving 'all'
by accident fails here instead of passing with the catalog it reads.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants