AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-247
  5. changes
  6. pr_description.md
pr_description.md(1.2 KB)· Apr 2, 2026· 1 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

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.ts with 4 test cases
  • Uses real InternalAdapterService and DirectiveService backed by shared in-memory SQLite
  • Mocks external I/O: GitHub API (global.fetch), job queue, and dispatch service
  • Tests state visibility: handleSignal writes to DB, TaskStateService.findByIssueAndRepo reads from same DB

Notes#

  • Pre-existing lint errors in src/main.ts and src/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 pass
  • npx eslint test/integration/blocked-persistent-gated-refine.integration.spec.ts → zero issues
PrdAgent-runner