Skip to content

Phase 1058: Single State Consolidation#27

Merged
wiseyoda merged 15 commits intomainfrom
1058-single-state-consolidation
Feb 2, 2026
Merged

Phase 1058: Single State Consolidation#27
wiseyoda merged 15 commits intomainfrom
1058-single-state-consolidation

Conversation

@wiseyoda
Copy link
Owner

@wiseyoda wiseyoda commented Feb 2, 2026

Summary

Completes phase 1058 - Single State Consolidation.

Bug Fixes for User Input Handling

  • Fix question state reset race condition: Prevents premature answer submission when session file updates cause questionsKey to recompute mid-answer
  • Add question lock during answer flow: Ensures question set consistency even if sources change during answer flow
  • Dedupe question SSE broadcasts: Prevents duplicate questions from being shown to users
  • Consolidate question sources: Single source of truth for questions using locked questions ref
  • Fix resume to continue existing execution: API now supports session ID lookup, preventing new executions from being created when answering questions

Files Changed

  • packages/dashboard/src/app/projects/[id]/page.tsx - Main UI fixes
  • packages/dashboard/src/lib/watcher.ts - Question deduplication
  • packages/dashboard/src/lib/services/workflow-service.ts - Session ID lookup
  • packages/dashboard/src/app/api/workflow/answer/route.ts - API support for session lookup
  • packages/dashboard/src/hooks/use-workflow-actions.ts - Hook interface updates

🤖 Generated with Claude Code

wiseyoda and others added 15 commits January 24, 2026 17:01
Phase goal: Consolidate orchestration to single state file
- Add phase file to .specify/phases/
- Create specs directory with spec.md, plan.md, tasks.md
- Add implementation and verification checklists
- Update ROADMAP.md with new phase

Key changes planned:
- Extend CLI state schema with orchestration.dashboard section
- Remove OrchestrationExecution type
- Simplify decision logic to < 100 lines
- Remove all hack code (reconciliation, guards, Claude analyzer)
- Add UI step override

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major architectural changes:
- Remove parallel state tracking (OrchestrationExecution from shared)
- Simplify decision logic to getNextAction() (<100 lines)
- CLI state file is single source of truth for orchestration
- Dashboard reads state, does NOT maintain separate state
- Sub-commands (flow.*) own step.status, dashboard trusts them

Key changes:
- Delete packages/shared/src/schemas/orchestration-execution.ts
- Move OrchestrationExecution to dashboard-local types
- Remove legacy makeDecision() function (~700 lines)
- Add getNextAction() simplified decision logic
- Update tests for new decision API (12 tests pending state mocking)
- Add StepOverride component for manual step navigation
- Add /api/workflow/orchestrate/go-back endpoint
- Update constitution with Principles IX and X

Memory document updates:
- constitution.md v1.4.0: Added Principles IX (Single Source of Truth)
  and X (No Hacks or Workarounds)
- PDR updated with Phase 1058 architectural decisions

All 26 tasks complete (100%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add userGateStatus field to current phase
- Remove null dashboard from state
- Change dashboard schema to nullish for null compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
`phase add` now creates both a ROADMAP.md entry and a `.specify/phases/NNNN-name.md`
detail file with YAML frontmatter template. Adds `--no-file` flag to skip file creation.

Extracts shared phase utilities (phaseSlug, createPhaseDetailFile) into lib/phases.ts,
consolidating duplicate slug generation across open.ts, status.ts, history.ts, and
backlog.ts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ted/cancelled)

- orchestration-service: check terminal status before blocking new orchestrations
- Fixes 409 conflict when previous orchestration failed but active state remains
- Also includes dashboard improvements: watcher, session parsing, workflow services

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Bug fixes for user input handling in orchestration:
- Fix question state reset race condition (prevent premature answer submission)
- Add question lock during answer flow for consistency
- Dedupe question SSE broadcasts (prevent duplicate questions)
- Consolidate question sources to single source of truth
- Fix resume to continue existing execution instead of creating new

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@wiseyoda wiseyoda merged commit b1fd6ab into main Feb 2, 2026
2 of 3 checks passed
@wiseyoda wiseyoda deleted the 1058-single-state-consolidation branch February 2, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant