Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ coverage/

# SpecFlow workflow session files
.specflow/workflows/
# Dashboard local state
packages/dashboard/.specflow/
52 changes: 49 additions & 3 deletions .specflow/orchestration-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "specflow",
"path": "/Users/ppatterson/dev/specflow"
},
"last_updated": "2026-01-24T21:57:04.195Z",
"last_updated": "2026-02-02T00:49:27.213Z",
"orchestration": {
"phase": {
"id": null,
Expand All @@ -21,7 +21,8 @@
"Eliminate race conditions - Atomic writes, spawn intent pattern",
"Reduce code - Target simplicity"
],
"hasUserGate": true
"hasUserGate": true,
"userGateStatus": "confirmed"
},
"next_phase": {
"number": "1060",
Expand All @@ -34,14 +35,50 @@
},
"analyze": {
"iteration": null,
"completedAt": 1769189896
"completedAt": 1769292224
},
"implement": null,
"progress": {
"tasks_completed": 0,
"tasks_total": 0,
"percentage": 0
},
"dashboard": {
"active": {
"id": "1058-verify-session",
"startedAt": "2026-02-01T18:30:00.000Z",
"status": "waiting_merge",
"config": {
"autoMerge": false,
"additionalContext": "",
"skipDesign": false,
"skipAnalyze": false,
"skipImplement": false,
"skipVerify": false,
"autoHealEnabled": true,
"maxHealAttempts": 1,
"batchSizeFallback": 15,
"pauseBetweenBatches": false,
"budget": {
"maxPerBatch": 5,
"maxTotal": 50,
"healingBudget": 2,
"decisionBudget": 0.5
}
}
},
"batches": {
"total": 0,
"current": 0,
"items": []
},
"cost": {
"total": 0,
"perBatch": []
},
"decisionLog": [],
"lastWorkflow": null
},
"steps": {}
},
"health": {
Expand All @@ -68,6 +105,15 @@
"completed_at": "2026-01-24T21:57:04.195Z",
"tasks_completed": 0,
"tasks_total": 0
},
{
"type": "phase_completed",
"phase_number": "1058",
"phase_name": "Single State Consolidation",
"branch": "1058-single-state-consolidation",
"completed_at": "2026-02-02T00:49:27.213Z",
"tasks_completed": 0,
"tasks_total": 0
}
]
}
Expand Down
65 changes: 65 additions & 0 deletions .specify/archive/1058-single-state-consolidation/RESUME_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Resume Plan - Single State Consolidation (Phase 1058)

Last updated: 2026-02-01 (Phase 2 complete)
Branch: 1058-single-state-consolidation
Last commit: 94a256f (phase2: harden orchestration status + cancel flow)
Remote: origin/1058-single-state-consolidation (pushed)
Working tree: clean

## Why this file exists
Compact, actionable context so work can resume quickly after interruption.

## Current State (after Phase 6 refactor)
### ✅ Stabilization & runtime aggregation complete
- Phase 0/1 fixes are in place (merge step mapping, running indicator accuracy, index rebuild, session end handling).
- Runtime aggregator uses JSONL/metadata health (no stale `index.json` reliance).

### ✅ CLI state is the single source of truth
- Orchestration dashboard state lives under `orchestration.dashboard` in CLI state.
- Dashboard service reads/writes only CLI state (no legacy orchestration files).
- Runner + API routes use CLI state-backed updates.

### ✅ Decision logic simplified
- `orchestration-decisions.ts` rewritten to a small, state-based decision matrix.
- Removed legacy decision adapters, staleness backoff, Claude analyzer fallback.
- Removed workflow lookup fallback and batch completion guards.
- Runner now uses `readOrchestrationStep()` + `readDashboardState()` for inputs.

### ✅ Auto-heal simplified
- `autoHealAfterWorkflow` now reads CLI step state and only updates when step matches the workflow skill.
- State healing is deterministic (no Claude fallback).

### ✅ Tests updated
- Decision tests rewritten for the simplified matrix.
- Runner tests updated to mock `readDashboardState` + `readOrchestrationStep`.
- Removed obsolete Claude fallback test block and old OrchestrationDeps fixtures.

### ✅ UI Step Override complete
- StepOverride UI is wired in context drawer.
- `goBackToStep` uses CLI state set and clears last workflow.
- API now blocks when an external workflow is active and restarts the runner if needed.

### ✅ Phase 2 state consistency fixes (complete)
- Header/session indicator now reflects orchestration status when no workflow is active.
- Step override resets batches/cost when going back to design/analyze/implement.
- Orchestration start treats `specflow status` failures as needing design/open to avoid tasks.md errors.
- CLI session discovery now marks stale instead of “completed” after inactivity.
- Session cancel by sessionId attempts SIGINT → SIGTERM/SIGKILL and surfaces warning toast when forced.

## Remaining Work
1) **Deferred cleanup (optional)**
- Remove `OrchestrationExecution` compatibility layer and schema once UI is migrated.

## Key Files (recently touched)
- `packages/dashboard/src/lib/services/orchestration-decisions.ts`
- `packages/dashboard/src/lib/services/orchestration-runner.ts`
- `packages/dashboard/src/lib/services/orchestration-service.ts`
- `packages/dashboard/tests/orchestration/orchestration-decisions.test.ts`
- `packages/dashboard/tests/orchestration/orchestration-runner.test.ts`
- `packages/dashboard/tests/fixtures/orchestration/helpers.ts`

## How to Resume
1) Run quick sanity checks (lint/tests) if desired.
2) Implement Phase 7 UI step override.
3) Decide whether to remove `OrchestrationExecution` compatibility layer.
4) Update plan/status docs and commit/push.
Loading
Loading