Problem
SkyTwin has a working decision pipeline on paper, but nothing persists to the database at runtime. The domain layer defines port interfaces with methods like saveDecision(), save(), saveOutcome(). The DB layer defines concrete repositories with different names: create(), recordOutcome(), addCandidateAction(). The as never casts at events.ts:39-42 suppress TypeScript errors but at runtime produce "saveDecision is not a function."
Additionally:
- Approved actions never trigger execution (approvals.ts responds but never calls IronClaw)
- Auto-executed actions never persist their execution plan or result
- No daily spend limit tracking
- No trust tier auto-progression
- No undo/rollback flow
Plan (5 phases)
Phase 1: Make the Core Loop Work
Phase 2: Safety Gaps
Phase 3: UX Completeness (parallel with Phase 4)
Phase 4: Infrastructure (parallel with Phase 3)
Phase 5: Polish
Critical Files
| File |
Issue |
events.ts:39-42 |
as never casts hide port/repo method mismatch |
approvals.ts:97-134 |
Approve response never triggers execution |
decision-maker.ts:28-38 |
DecisionRepositoryPort to implement |
explanation-generator.ts:18-22 |
ExplanationRepositoryPort to implement |
twin-service.ts:21-49 |
TwinRepositoryPort + PatternRepositoryPort |
policy-evaluator.ts |
Missing daily spend, quiet hours, domain trust |
Sequencing
Phase 1 → Phase 2 → Phase 3 + Phase 4 (parallel) → Phase 5
Problem
SkyTwin has a working decision pipeline on paper, but nothing persists to the database at runtime. The domain layer defines port interfaces with methods like
saveDecision(),save(),saveOutcome(). The DB layer defines concrete repositories with different names:create(),recordOutcome(),addCandidateAction(). Theas nevercasts atevents.ts:39-42suppress TypeScript errors but at runtime produce "saveDecision is not a function."Additionally:
Plan (5 phases)
Phase 1: Make the Core Loop Work
as nevercasts in events.ts and approvals.ts with proper adaptersPhase 2: Safety Gaps
Phase 3: UX Completeness (parallel with Phase 4)
Phase 4: Infrastructure (parallel with Phase 3)
Phase 5: Polish
Critical Files
events.ts:39-42as nevercasts hide port/repo method mismatchapprovals.ts:97-134decision-maker.ts:28-38explanation-generator.ts:18-22twin-service.ts:21-49policy-evaluator.tsSequencing
Phase 1 → Phase 2 → Phase 3 + Phase 4 (parallel) → Phase 5