Add four new scenario branches to the existing fake-claude.mjs fixture and write corresponding unit tests in the fast (offline) test suite. This strengthens coverage of EventParser and CliProcess edge cases without requiring credentials or a live binary.
Requirements
- Add
session-resume scenario to fake-claude.mjs: accepts --resume <id> CLI flag, emits system/init event with that same session ID, exits cleanly with code 0
- Add
rate-limit scenario: emits a rate_limit_event line on stdout (not stderr only), then exits with a non-zero code
- Add
permission-request scenario: emits a server_tool_use block inside an assistant event after system/init, before the result event
- Add
multi-block scenario: emits a single assistant event whose message.content array contains both a text block and a tool_use block in one emission
- Any unknown
FAKE_SCENARIO value must write to stderr and exit with code 1
- Add one test per new scenario in
CliProcess.test.ts and/or EventParser.test.ts, following the existing FAKE_SCENARIO injection pattern (set env var, inject fixture into PATH, collect events, assert structure)
- All new tests must pass with
npm test (no credentials required)
Design Guidance
Implements the 'Extended Fake Fixture Scenarios' section of the architecture design. The four scenario names, their trigger conditions, and their expected output structure are specified in the architecture's component design table for fake-claude.mjs scenarios.
Acceptance Criteria
Add four new scenario branches to the existing
fake-claude.mjsfixture and write corresponding unit tests in the fast (offline) test suite. This strengthens coverage ofEventParserandCliProcessedge cases without requiring credentials or a live binary.Requirements
session-resumescenario tofake-claude.mjs: accepts--resume <id>CLI flag, emitssystem/initevent with that same session ID, exits cleanly with code 0rate-limitscenario: emits arate_limit_eventline on stdout (not stderr only), then exits with a non-zero codepermission-requestscenario: emits aserver_tool_useblock inside anassistantevent aftersystem/init, before theresulteventmulti-blockscenario: emits a singleassistantevent whosemessage.contentarray contains both atextblock and atool_useblock in one emissionFAKE_SCENARIOvalue must write to stderr and exit with code 1CliProcess.test.tsand/orEventParser.test.ts, following the existingFAKE_SCENARIOinjection pattern (set env var, inject fixture into PATH, collect events, assert structure)npm test(no credentials required)Design Guidance
Implements the 'Extended Fake Fixture Scenarios' section of the architecture design. The four scenario names, their trigger conditions, and their expected output structure are specified in the architecture's component design table for fake-claude.mjs scenarios.
Acceptance Criteria
FAKE_SCENARIO=session-resumewith--resume <id>arg emitssystem/initwith matching session IDFAKE_SCENARIO=rate-limitemitsrate_limit_eventon stdout and exits non-zeroFAKE_SCENARIO=permission-requestemitsserver_tool_useinside anassistanteventFAKE_SCENARIO=multi-blockemits a singleassistantevent with bothtextandtool_usecontent blocksFAKE_SCENARIOvalue causes exit code 1 with stderr messagenpm testnpm testtotal test count increases by at least 4