Title#
feat: implement #352 — migrate InternalAdapterService from SignalResult to PhaseResult
Problem#
InternalAdapterService.handleSignal accepted a lossy SignalKind string union, requiring PhaseRouterService to convert SignalResult → SignalKind → string via toSignalKind(). This conversion lost structured fields (blockedType, reason, conflictMetadata) and introduced an unnecessary intermediate type.
Task / Link#
Closes #352
Changes#
internal-adapter.service.ts: updatedhandleSignalto acceptPhaseResultdirectly; dispatch onresult.status/result.blockedType; removedSignalKindtype; added unrecognized-status fallback toblocked:transientphase-router.service.ts: removedtoSignalKind()method; allhandleSignalcall sites now passPhaseResultobjects directly (review_approved, worktree failure, post-invocation)internal-adapter.service.spec.ts: all test cases updated to passPhaseResultobjects; new test covers unrecognized-status fallbackphase-router.service.spec.ts: updatedhandleSignalassertions to matchPhaseResultshapewatchdog.service.spec.ts: fixed pre-existing env-var sensitivity (STUCK_THRESHOLD_MSnow pinned per test to avoid CI environment pollution)- Minor: lint-reformatted
claude-cli.provider.tsdestructure
Notes#
⚠️ Depends on #346 (PhaseResult type) — must not be merged if #346 hasn't landed. It has landed as of commit 251389a.
Testing#
- All 764 unit tests pass
- Lint: zero warnings
tsc --noEmit: clean