Title#
Add integration test: BLOCKED:PERSISTENT → gated → refine eligibility
Problem#
No end-to-end test validated the handoff between #243 (BLOCKED:PERSISTENT sets status=gated) and #237 (refine directive rejects non-gated tasks). The two behaviours were tested in isolation but not as a combined state-machine path.
Task / Link#
Closes #245
Changes#
- Add
test/integration/blocked-persistent-to-refine.integration.spec.ts - Wires
InternalAdapterService,DirectiveService, andTaskStateServiceagainst in-memory SQLite - Test 1: BLOCKED:PERSISTENT signal transitions task to
status=gatedwithgatePhaseandgateReasonset (#243) - Test 2: gated task accepts
/agent refine, clears gate, enqueuesphase_refine(#237) - Test 3: non-gated (active) task rejects
/agent refineand does not enqueue
Notes#
- Lint errors in
src/main.tsandsrc/ws-gateway/ws-gateway.gateway.tsare pre-existing on master and not introduced by this PR
Testing#
- All 3 integration test cases pass:
npx jest blocked-persistent-to-refine - Mocked only external I/O (GitHub API, job queue, hooks); DB and TaskStateService are real