Repository navigation
feat(pi): verify a pi member's saved agent spec at spawn - #22911
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The PR declares the three deleted #22813 pins, and each of the three reasons that kept pi out (no recorded spec, an overstated pane, no zero-tool ban) is now covered by the diff or by #22808. Notes
What this change shipsInventory (9 items) — 7 justifiedIntent: let a crew member with a saved agent spec chat on pi, verified against the spec the session actually used and never with more than was saved. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 2f674e5 Description read[DESCRIPTION-READ] c9a1f251aa7f153ea00c513d278c733ebe07d72453b494bc9a7b0acef8efdf5f That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The stub filter fails closed, the consumed spec comes from the same parse as the mounts, and a declared server that never reaches pi shows as Notes
[DESIGN-REVIEWED] 2f674e5 Description read[DESCRIPTION-READ] f5c8c392d6e8197478f9d41eecb3c4799f8193b9ad171320a7afb3934341fa0b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
ab4f572 to
de1ae5e
Compare
de1ae5e to
e14dc7c
Compare
e14dc7c to
2d2e034
Compare
2d2e034 to
c5e678a
Compare
c5e678a to
ca21f75
Compare
|
HOLD (human review) at ca21f75. I found no defect. The pi member path records the consumed spec from the same parse as its mounts, clears it before each read, and fails closed: a missing or unreadable member spec grants no pooled stub (client_mcp_array.py). The only other It is held because it adds pi to — crew-pr-reviewer (r121) |
ca21f75 to
6e2e191
Compare
pi joins ACP_BACKENDS_MEMBER_CAPABILITIES. pi has no mirror, so _mirrorless_member_mounts now records _session_agent_spec from the same session_mcp_projection parse its member mounts and zero-tool answer come from; confirm_member_projection digests it against the saved intent, and a spec edited after its save is refused with capability_runtime_unverified. A re-resolve clears the record before it reads, so an unreadable spec never leaves an older parse standing. pi's projection stays BROKER_ONLY: a declared server that is not pooled does not reach pi, and runtime_view keeps that member unverified rather than applied. The set's comment says so and cites a live capture off pi-acp 0.0.34 over pi 1.3.0 (acp_frames/pi/saved-spec-projection-live.jsonl).
A mirror filters the pooled broker stubs through the spec's tools allowlist; pi has no mirror, so a member on pi received every pooled stub, and a saved spec with tools ["@A"] still mounted pooled server b beside a spec confirmed as consumed. On a member session the mirror-less branch now records the allowlist from the same parse as the consumed spec, and _pooled_mcp_servers filters the stubs through it. Non-member pi sessions and kiro-cli record none, so their stubs are unchanged.
6e2e191 to
2f674e5
Compare
Problem / Motivation
Goal: a crew member with a saved agent spec runs on pi the way it runs on kiro, KAS, claude, codex and deepseek: the spec is verified against what the session consumed, and the member is never run with more than it was saved with.
Today pi is outside
ACP_BACKENDS_MEMBER_CAPABILITIES, so every saved-spec member on pi is refused before spawn (capability_harness_unsupported). #22813 kept it out because pi has no mirror:_mirrorless_member_mountsnever recorded_session_agent_spec, so a confirmation could only refuse.Why it matters
pi is a supported member harness (member dispatch and panel already land on it). Without saved-spec verification, any member whose capabilities were saved on the Capabilities page cannot chat on pi at all.
Not a goal
mcpServersfor pi: a declared server still reaches pi only when the shared gateway pools it.ACP_BACKENDS_MEMBER_TOOL_LIMITS): a spec withdisabledToolsis still refused before spawn.acp/harness/pi.py,acp/harness/pi_node.py(fix(pi): run pi under a Node that meets its engine floor #22883) or the pi gate extension.What changed (motivation → approach → change)
Commit 1 —
feat(pi): verify a pi member's saved agent spec at spawnacp/client_mcp_array.py: for a mirror-less host whose array Crew composes (pi),_mirrorless_member_mountsrecords_session_agent_specfrom the samesession_mcp_projectionparse fix(pi): honour an agent spec's zero-tool ban on pi sessions #22808 readszero_toolsfrom, so the mounts, the ban and the consumed spec are one spec generation (the follow-up fix(pi): honour an agent spec's zero-tool ban on pi sessions #22808's "Not a goal" names). It clears the record before the read, so a failed re-read never leaves an older parse standing.confirm_member_projectiondigests that parse against the saved intent; a spec edited after its save is refused withcapability_runtime_unverified.agent_sdk/backends_members.py: pi joinsACP_BACKENDS_MEMBER_CAPABILITIES. The set's comment (from feat(pi): mount the crew member panel on pi member threads #22813) is rewritten: the stale third bullet (pi doesn't honour the zero-tool ban) now says it does (fix(pi): honour an agent spec's zero-tool ban on pi sessions #22808), and the exclusion paragraph becomes the membership rationale, citing the live capture. This file is also in feat(pi): mount the crew member panel on pi member threads #22813; the edit is confined to that one comment block plus one set member, so a rebase stays mechanical.piisBROKER_ONLY: a declared server reaches pi only when the shared gateway pools it. The confirmation does not claim declared servers run:session_capabilities.runtime_viewreads "applied" only when every declared server is in the session's ready report, and pi's ready report is always empty, so such a member readsunverified(capability_mcp_unreported) rather than overstating.Commit 2 —
fix(pi): mount only the pooled stubs a member's saved spec referencesA fresh-context review of commit 1 found pi handed every pooled broker stub to the session, while the claude mirror drops a stub the spec's
toolsnever references. So a savedtools: ["@a"]still mounted pooledbon pi, beside a spec confirmed as consumed: wider than saved.toolsallowlist (projection.allowlist, the object claude's mirror uses) from the same parse, and_pooled_mcp_serversfilters the stubs through it. It fails closed: a member spec that is missing or unreadable grants nothing, because the record is cleared to grant nothing before each read; everysession/new/session/loadsplice evaluates pi's array (which records it) before the pooled stubs, pinned by a test._pooled_mcp_serversreads only that instance field, so kiro-cli's stub composition gains no branch and no registry lookup (H13; Opus 5.5 finding onc5e678a141, fixed). A pooled server with a tool switched off (in the spec or the global settings) is withheld whole, as the member mounts already are, because pi carries no per-tool deny (GPT 6.1 review finding onde1ae5ef76, fixed). Non-member pi sessions and kiro-cli record none, so their stubs are unchanged; kiro's path gains only aNonecheck (H13).client_class.pydeclares the field;client_lifecycle._reset_statedrops it with the session.Docs (
docs/system-specs/modules/harness-onboarding.md, pi table): row 2 now names pi INACP_BACKENDS_MEMBER_CAPABILITIES(and INACP_BACKENDS_STEERING_REQUEST, which #22923 made true but the row still called "out of all three steer sets"); the live-spill row counts nine captures (adds steer and saved-spec); theopen gapsrow drops saved-spec verification and mid-turn steer and keeps only what is still open: per-tool limits (ACP_BACKENDS_MEMBER_TOOL_LIMITS) and the spec's own MCP servers underbroker-only. The fixture READMEs keep main's re-captured text and add the saved-spec row.Not changed:
acp/harness/pi.py,acp/harness/pi_node.py(#22883) and the pi gate extension are untouched.Backwards compatibility
disabledToolsis still refused before spawn (capability_tool_limits_unsupported; pi is not inACP_BACKENDS_MEMBER_TOOL_LIMITS).toolsdoes not reference (claude parity). Non-member pi sessions are unchanged.Tests
test/test_pi_saved_spec.py(new, 22 tests), on the real resolver and confirmation:runtime_view: a declared server that did not reach pi keeps the paneunverified(capability_mcp_unreported); no servers readsapplied;*keeps both,[]and a missingtoolskey keep none, a switched-off server is dropped, a server with a globally switched-off tool is withheld whole, an unreadable or missing member spec mounts none, stubs asked for before the spec is read are withheld on a member (not on a non-member), a re-resolve takes the editedtools, a non-member pi session keeps the full pool, kiro's stubs are never filtered, the allowlist is dropped on reset;session/request_permission, server answer in the turn.test/test_member_mount_pi.py: the three exclusion tests from feat(pi): mount the crew member panel on pi member threads #22813 are replaced by the above; the BROKER_ONLY mount fact stays pinned.test/test_harness_parity.py: the membership pin includes pi.Local results
HARNESS_BASE_REF=origin/main scripts/check_harness_parity.py✓ (x-capture gate: pi's membership cites a replayed live capture) and--test✓;check_brand_name.py✓ andcheck_comment_history.py✓ (baseorigin/main);check_file_line_cap.py✓;check_acp_frame_host_data.py✓; black ✓; mypy on the changed modules ✓.Manual verification
test/fixtures/acp_frames/pi/saved-spec-projection-live.jsonl(+.expected.json), recorded by the in-product recorder while a realAcpClient(acp_backend="pi")ran as a crew member, off pi-acp 0.0.34 over pi 1.3.0 installed pinned into a scratch npm prefix (not the host's global pi), with a scripted model on the loopback interface:tools: ["*"], one serverloaded_capability_template= the member, no gaps; the spec's server was called through the gatecapability_runtime_unverified(both spawns); server never calledtoolsdoes not reference the servernative_tools(pane unverified); the pooled stub never reached pi, server never spawnedcapability_runtime_unverified): the record is what makes verification passNot verifiable on this host: it refuses user namespaces, so no sandbox backend runs. The capture driver replaced only the routing's sandbox preflight with "no mask", and stood in for gatewayd pooling with the spec's own entry so the call is observable at the server. The gate-extension seal, read-back, envelope nonce, permission path and member confirmation ran as shipped. No sandboxed dashboard-gateway pi turn was observed.
Independent fresh-context reviews: commit 1 — UNSOUND (the pooled-stub width above), fixed in commit 2. Commit 2 — reviewed from the diff and the claude-parity requirement only: MEETS. Its hardening findings are folded in: a member with no recorded allowlist, or a missing spec, now grants no stub (it previously relied on call order / matched claude's grant-all), and the skipped-stub log compares names. Its note that the fixture carries only the first drive's frames is now stated in the corpus README; the third drive's mount set is pinned by the unit tests and the header note.
Related Issues
None. Follows #22808 and #22813.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Sensitive change: none. No file in this diff matches
SENSITIVE_GLOBS(checked with fnmatch over both commits), and nothing is inherited.Contribution License Agreement
Contributed under the project's Apache-2.0 license.