Title#
test(#247): add integration test for BLOCKED:PERSISTENT → gated → refine
Problem#
No integration test covered the end-to-end state-machine handoff from BLOCKED:PERSISTENT → status=gated (introduced in #243) to applyDirective('refine') acceptance/rejection (#237). Unit tests validated each service in isolation but not together against a shared database.
Task / Link#
GitHub Issue #247 — Integration test: BLOCKED:PERSISTENT → gated → refine eligibility
Changes#
- Created
test/integration/blocked-persistent-gated-refine.integration.spec.tswith 4 test cases - Uses real
InternalAdapterServiceandDirectiveServicebacked by shared in-memory SQLite - Mocks external I/O: GitHub API (
global.fetch), job queue, and dispatch service - Tests state visibility:
handleSignalwrites to DB,TaskStateService.findByIssueAndReporeads from same DB
Notes#
- Pre-existing lint errors in
src/main.tsandsrc/ws-gateway/are unrelated to this change - Traceability comments reference #243 and #237 inline in each test case
Testing#
npm run test -- blocked-persistent-gated-refine→ 4/4 tests passnpx eslint test/integration/blocked-persistent-gated-refine.integration.spec.ts→ zero issues