You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(targets): add the Pi coding agent target (#2908) - #5771
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.pyKNOWN_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;
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
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:
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):
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.
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 #57433c71b0d1 + old #5778a01acef2 + main through #5784edb62afb), 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).
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.
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.
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.
A cell sits in at most one section: cell_problems refuses a required cell that is also in known_failing, and known_failing_problems refuses a ledger row that is not required. Pinned by test_a_cell_sits_in_at_most_one_known_failing_section.
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>
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>
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>
…#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>
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>
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.
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.
- 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>
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
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.
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.
…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>
…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>
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>
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>
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>
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
full-integrationRun the full integration suite (ci-integration.yml) on this PR before merge
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 nopibranches; theregistry_delegation.harness_name_literalsguard from #5743 enforces this.Registry data:
core/target_catalog.py: thepicapability (inall, compile familyagents) and itsTargetDetectionrow (.pi/folder signal).integration/targets.pyKNOWN_TARGETS["pi"]:.agents/skills/<n>/SKILL.md, and to<agent-dir>/skills/at user scope;.pi/prompts/<n>.mdthrough the sharedclaude_commandtransformer;AGENTS.md, and into<agent-dir>/AGENTS.mdat user scope through the data-driven user-root compile;trust_hintfield.USER_ROOT_VARIABLES["pi"]:PI_CODING_AGENT_DIR, default.pi/agent.hosts_agent_pluginsstaysFalseandnative_plugin_settingsstays unset. A test pins both.Shared-layer changes (generic, no harness names):
Trust hint: install finalize prints each active target's registry
trust_hintonce, on project-scope installs only. Pi loads.agents/skillsand.pi/promptsonly 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'sagent-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..agents/xand.agents/skills/x..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. Soapm install --target pinames 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:
apm initpicker; now offered (registry-derived list).apm initpicker: the interactive target list is derived fromAUTO_DETECT_ORDER. The seven existing entries keep their order and labels, andkiro,grok-buildandpiare now offered.MCP dependencies with
--target pi: no change needed. Main's generic path already prints[i] Skipped targets without MCP support: piand 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_hintis 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 torequired.Tests: this branch merges the Pi tests branch (unit, lifecycle, real-harness) and flips the four Pi real-harness cells in
expected.jsontoLOADS. In this PR, a PiLOADSverdict requires the skill and the prompt template to be listed by Pi.Pi-specific code vs data:
TargetDetectionrow and order-tuple entries;KNOWN_TARGETS["pi"](includingtrust_hintandwarn_unsupported_primitives);USER_ROOT_VARIABLES["pi"]target_compile_familyreader; init picker 1Reuses 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
Testing
Validation evidence, run locally on this head; each
pytestrun went through the host guard script with-p no:xdistandAPM_BINARY_PATH=.venv/bin/apm:.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).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).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*.pyuvx ruff@0.15.12 checkandformat --checkon the CI pathspylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801(CI paths)bash scripts/lint-auth-signals.shscripts/check_complexity_ratchet.py --base-ref <main d0bdbe76>python -m tests.quality.taxonomy --changedscripts/check_test_assertions.pyscripts/lint_architecture_boundaries.py --root .changelog_fragments.py checkintegration/targets.pyis at 2082CI 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):known_cells()scan and lifecycle collection cached per session)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 head0871e7d7over the stack it carried (old #57433c71b0d1+ old #5778a01acef2+ main through #5784edb62afb), cherry-picked with no conflicts.src/is byte-identical to the pre-restack head. One resolution:tests/quality/harness_conformance.jsontakes main's 193 surface-witnessrequiredcells, which the carried ratchet still had in baseline. The baseline now equals main's (465),requiredis a superset of main's (274), andknown_failingis 8 rows, all #3616.New relative to
066f1a05(the folds):.apmcontent prints the trust hint (local_files_changed); a target root is created before any write only when it signals its target (materializes_root), and anauto_createtarget's merged hook config is created with its root;PI_CODING_AGENT_DIRis read verbatim;tests/conftest.pyscrubs it, with a registry-equality guard;load_generatedreads harnessknown_failingrows as known failing.auto_createcontract.require_dirstays 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 torequired(34-cell run with--runxfailandAPM_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.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\bskipregex passed that mutation.Review round 2 (dfe4817)
finalize_native_pluginnames only the skip, never a native registration the Copilot owner may have refused (failing-before testtest_a_refused_plugin_is_never_reported_as_registered)..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.dfe48176, so it can be dropped cleanly:Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.5771.added.mdadds the target.5771.fixed.mdcovers the.agents/residue and theapm initpicker.Spec conformance (OpenAPM v0.1)
The new target is registry data. Section 4.2.1's registered set already omits other shipped targets such as
kiroandgrok-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
.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:
known_failing(feat(targets): add the Pi coding agent target (#2908) #5771): NON-required cells that are new at the base. Each cites an OPEN issue and its witness carries a strictKnownFailure(_hcmarks it).required_known_failing(test(lifecycle): a required harness cell whose witness skips or is not collected fails #5800): REQUIRED cells. It is the shrink-only ledger, holding exactly the 8 [BUG] install silently drops primitive kinds the target does not carry (no HC-UNSUP-01 diagnostic) #5797 HC-UNSUP-01 cells. A skipped or xfailed required witness is admitted only through obligations'_known_failure_tracking.cell_problemsrefuses a required cell that is also in known_failing, andknown_failing_problemsrefuses a ledger row that is not required. Pinned bytest_a_cell_sits_in_at_most_one_known_failing_section.known_failing_growth(test(lifecycle): a required harness cell whose witness skips or is not collected fails #5800, ledger) keeps its name. feat(targets): add the Pi coding agent target (#2908) #5771's helper is renamedknown_failing_growth->known_failing_demotions; it refuses a required or baseline cell moved into known_failing.known_cellsreads both sections throughload_ratchet._hc: feat(targets): add the Pi coding agent target (#2908) #5771's known_failing marks, then test(harness): conformance oracles assert the exact product line (#5798) #5801's_KNOWN/_UNSUP_5797marks for required cells, plus test(harness): conformance oracles assert the exact product line (#5798) #5801's_line/_has_line. The S137 dry-run oracle is unchanged.harness_conformance.jsonis regenerated bypython -m tests.lifecycle.harness_ratchet --base 1622a4aa761ed9f28d0ff811c73265cc1859a19c --owner "#2908", not hand-merged, with a zero diff on rerun. It holds 274 required, 8 known_failing ([EPIC] New harness = one data record plus one shared checklist #3616), 8 required_known_failing ([BUG] install silently drops primitive kinds the target does not carry (no HC-UNSUP-01 diagnostic) #5797) and 465 baseline. Pi is 42 required / 0 baseline / 0 known_failing, and no row cites [BUG] install --dry-run reports an excluded Agent Plugins dependency as "install" instead of the req-tg-011 skip #5781.[!] ...,DiagnosticCollector._render_warning_group). diagnostic-mutation: src/apm_cli/install/target_warnings.py:128 "does not support these primitives" -> "cannot carry these primitives" -> red atassert _has_line(result.stdout, warning)(test_hc_unsup_01[pi-project]). The 8 [BUG] install silently drops primitive kinds the target does not carry (no HC-UNSUP-01 diagnostic) #5797 ledger cells stay strict XFAIL.Copilot nits declined
changelog.d/5771.added.md: fragment over the 25-word guideline (docs only; trim can follow as a fragment edit).changelog.d/5812.breaking-changes-and-upgrade-notes.md:**BREAKING:**prefix; the fragment belongs to feat(list): apm list shows the agent config on disk for every harness #5812 and reaches this PR through the list train merge.