- Problem: Weak regex patterns matched echoed prompt text, causing false positives
- Solution:
- Separated markers into "weak" (could be echoed) and "strong" (plugin-specific)
- Require EITHER 2+ weak markers OR 1 strong marker
- Strong markers: /autopilot.*(?:activated|initialized|configured)/i, /[Tool:.*mcp_/i
- Weak markers: /autonomousStrength/i, /\bstrength.*(?:aggressive|balanced|conservative)/i
- Problem: Timed-out PTY sessions left processes running
- Solution:
- Track spawned process handle in runAutopilotSession
- On timeout, call process.kill() explicitly
- Await process.exited with 2-second fallback timeout
- Log cleanup steps for debugging
- Problem: Tests could pass on generic output or timeout without concrete side effects
- Solution:
- File creation test requires BOTH plugin activation AND file existence
- Infrastructure tests skip (not pass) when plugin not activated
- Clear skip messages explain why test cannot validate
- No generic passes on timeout-only execution
- Added "Plugin Activation (Strict)" to critical requirements
- Documented multi-marker validation strategy
- Added timeout cleanup to implementation details
- Updated code examples to show stricter patterns
__tests__/e2e/helpers/pty-runner.ts(4 edits)__tests__/e2e/autonomous-behavior.test.ts(3 edits)__tests__/e2e/README.md(3 edits)
- ✅ All tests compile and skip correctly
- ✅ TypeScript type checking passes (bun run typecheck)
- ✅ No new type errors introduced
- ✅ Bun LSP errors are pre-existing (Bun runtime types)
- No false positives: Require specific evidence, not generic patterns
- Explicit cleanup: Always terminate and await timed-out processes
- Clear outcomes: Pass with proof, skip with reason, never pass generically