FE-867: Agent extension host — dual-mode pi-harness contract#213
FE-867: Agent extension host — dual-mode pi-harness contract#213kostandinang wants to merge 2 commits into
Conversation
5ea98a6 to
0a176f5
Compare
0a176f5 to
bcccd55
Compare
PR SummaryLow Risk Overview Tests enforce that invariant and a two-consumer witness: cook
Reviewed by Cursor Bugbot for commit 7ae1e4f. Bugbot is set up for automated code reviews on this repo. Configure here. |
95ac829 to
eb6e902
Compare
86df4fc to
4cac54a
Compare
eb6e902 to
39d50cb
Compare
Define the dual-mode (elicit/execute) agent-extension-host contract as transport-safe metadata only — src/agent-extension-host.ts: AgentExtensionMode, capability/plugin/consumer-witness contracts, flattenCapabilityIds. The module is dependency-free and names no execute-only concept, so it stays neutral across both consumers (cook via the pi SDK, interview via the Vercel AI SDK) and any future runtime. Prove the two-consumer bar without migrating any runtime: cook's execute surface matches createPiActions() action ids exactly; the interview's elicit surface is witnessed against the real createExplorationTools() family plus a type-enforced coverage check over keyof InterviewerTools (gated by lint --type-check). Contract-first, zero behavior change. Defers the runtime host/dispatch and a pi adapter until a real driver lands (coordinated with the pi-harness thread that owns the core implementation). Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a Co-authored-by: Amp <amp@ampcode.com>
Lean on no-imports as the load-bearing neutrality guarantee and drop the redundant forbidden-substring denylist (a dependency-free module cannot reference an execute-only or SDK type, so neutrality is structural, not a name list to maintain). Make the interview exploration plugin proof bidirectional — its capability ids must exactly equal Object.keys(createExplorationTools(...)), catching phantom as well as missing tools. Document that the three native interviewer tools are covered type-level only (superset) because constructing them needs a live DB. Review findings #1 and #2 from ln-review. Zero behavior change. Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a Co-authored-by: Amp <amp@ampcode.com>
39d50cb to
bb36ee8
Compare
4cac54a to
7ae1e4f
Compare

Stack Context
Stacks on FE-864 (#212). First Arc-1 frontier and the base of the cook stack -- every Arc-1 frontier lands on this contract.
What?
The dual-mode (
elicit/execute) agent-extension-host contract --src/agent-extension-host.ts, transport-safe metadata only:AgentExtensionMode, the capability/plugin/consumer-witness types, andflattenCapabilityIds.Dependency-free and names no
execute-only concept (slice/epic/plan/worktree/toolchain) -- neutrality is a checkable invariant. Two-consumer proof, no runtime migration:executesurface matchescreatePiActions()ids exactlyelicitsurface is witnessed againstcreateExplorationTools()+ akeyof InterviewerToolscoverage checkWhy?
The pi harness is reused for spec elicitation and cook execution; one dual-mode host (not two) keeps dispatch, confinement, and tool-scoping shared. This file is the serialization point with the unpublished pi-harness thread that owns the core runtime -- targeting the contract, not
pi, keeps the dispatch-seam frontiers decoupled from that rewrite.Tests
Two-consumer witnesses, no runtime touched: cook's
executesurface set-equalsObject.keys(createPiActions()); the interview'selicitsurface equalsObject.keys(createExplorationTools(...)), with the native interviewer tools covered type-level viakeyof InterviewerToolsunderlint --type-check. Mode-neutrality is the module's zero-import invariant -- mechanically checkable, not asserted.Deferred
Runtime host/dispatch + a
piadapter wait until a real driver lands. Contract-first, zero behavior change.Co-authored-by: Amp amp@ampcode.com