Create the fake-copilot.mjs fixture (if not already present from the feat/v0.4-copilot-backend merge) and a corresponding offline test file CliProcess.copilot.test.ts that exercises CliProcess with backend: 'copilot' against the fixture. This phase is blocked until the Copilot backend implementation is merged to main.
Requirements
- Prerequisite:
feat/v0.4-copilot-backend must be merged to main before this phase begins
- If
fake-copilot.mjs and CliProcess.copilot.test.ts are not brought in by the merge, create them:
fake-copilot.mjs driven by FAKE_SCENARIO env var, consuming ACP JSON-RPC requests from stdin, writing ACP-compliant NDJSON to stdout
- Scenarios:
golden-path (full handshake + one assistant turn + idle), stall, ignore-sigterm, nonzero-exit, permission-request
CliProcess.copilot.test.ts must mirror the structure of the existing CliProcess.test.ts: inject fake-copilot.mjs into PATH as copilot binary via beforeAll, instantiate CliProcess with backend: 'copilot'
- Cover the same scenario categories as the Claude fake suite: golden path, stall (idle_timeout), SIGTERM/SIGKILL escalation, nonzero exit, AbortSignal (pre-flight and mid-run)
ReadyEvent, TextEvent, and DoneEvent emitted by the Copilot backend must satisfy the same normalized field contracts as the Claude backend
- All tests must pass under
npm test with no live binary or credentials
Design Guidance
Implements the 'Copilot Fake Fixture' (FR-4) and 'Copilot Fake Test Suite' (FR-5) from the business requirements, and the 'Extended Fake Fixture Scenarios' and 'PATH Injection for Fake Binaries' patterns from the architecture design. The ACP protocol handshake sequence for the golden-path scenario is specified in the architecture's component design.
Acceptance Criteria
Dependencies
Prerequisite: feat/v0.4-copilot-backend merged to main
Create the
fake-copilot.mjsfixture (if not already present from thefeat/v0.4-copilot-backendmerge) and a corresponding offline test fileCliProcess.copilot.test.tsthat exercisesCliProcesswithbackend: 'copilot'against the fixture. This phase is blocked until the Copilot backend implementation is merged to main.Requirements
feat/v0.4-copilot-backendmust be merged tomainbefore this phase beginsfake-copilot.mjsandCliProcess.copilot.test.tsare not brought in by the merge, create them:fake-copilot.mjsdriven byFAKE_SCENARIOenv var, consuming ACP JSON-RPC requests from stdin, writing ACP-compliant NDJSON to stdoutgolden-path(full handshake + one assistant turn + idle),stall,ignore-sigterm,nonzero-exit,permission-requestCliProcess.copilot.test.tsmust mirror the structure of the existingCliProcess.test.ts: injectfake-copilot.mjsinto PATH ascopilotbinary viabeforeAll, instantiateCliProcesswithbackend: 'copilot'ReadyEvent,TextEvent, andDoneEventemitted by the Copilot backend must satisfy the same normalized field contracts as the Claude backendnpm testwith no live binary or credentialsDesign Guidance
Implements the 'Copilot Fake Fixture' (FR-4) and 'Copilot Fake Test Suite' (FR-5) from the business requirements, and the 'Extended Fake Fixture Scenarios' and 'PATH Injection for Fake Binaries' patterns from the architecture design. The ACP protocol handshake sequence for the
golden-pathscenario is specified in the architecture's component design.Acceptance Criteria
feat/v0.4-copilot-backendis merged to main before work beginsfake-copilot.mjsexists undersrc/__tests__/fixtures/with all five scenarios implementedFAKE_SCENARIO=golden-pathreads ACPinitializefrom stdin and writes a valid ACP response sequence to stdout, then exits 0CliProcess.copilot.test.tsexists and covers golden path, stall, SIGTERM/SIGKILL, nonzero exit, and AbortSignalgolden-pathscenario includeReadyEvent,TextEvent, andDoneEventwith the same field contracts as the Claude backendnpm testwithout the realcopilotbinaryDependencies
Prerequisite: feat/v0.4-copilot-backend merged to main