Skip to content

Fix UI-owned phase transitions and workflow state#252

Open
JWThewes wants to merge 3 commits into
mainfrom
issue-228-ui-owned-phase-transitions
Open

Fix UI-owned phase transitions and workflow state#252
JWThewes wants to merge 3 commits into
mainfrom
issue-228-ui-owned-phase-transitions

Conversation

@JWThewes

Copy link
Copy Markdown
Contributor

Summary

  • Closes Agent shouldn't ask to transition phases — phase transitions are UI-only #228.
  • Makes the Sprint node the single workflow-state cursor by exposing and visualizing phase, currentStage, and phaseStatus.
  • Removes agent ask_question approval gates for phase-boundary transitions while keeping intra-phase approval gates intact.
  • Adds ready_for_transition state for terminal Inception and Construction stages so the UI can show when a phase is ready.
  • Backfills legacy/stale sprint behavior in the UI so construction evidence can move old INCEPTION displays forward without overriding REVIEW.

Why

Phase transitions are UI-owned: users click Approve & Move to Construction, End Construction & Move to Review, or complete review actions. The agent should finish phase work, mark the Sprint ready, summarize, and stop. This avoids duplicate approval modals and orphaned questions while giving both agents and the UI one shared source of truth for workflow position.

What changed

  • Sprint API now returns currentStage and phaseStatus and allows UI-owned updates for phase transition state and selected construction branches.
  • Sprint graph endpoints now include the Sprint node so agents can read the same workflow cursor the UI renders.
  • Observability uses Sprint state first, with fallback inference for older sprints without phaseStatus.
  • Construction kick-off normalizes stale INCEPTION sprints to CONSTRUCTION, but does not override REVIEW transitions.
  • Rule files now write phase_status for every stage and mark terminal stages ready_for_transition instead of calling ask_question for phase transitions.

Verification

  • npm --prefix frontend run typecheck
  • npm run format:check
  • npm test -- lambda/sprints/test/sprints.test.js lambda/sprint-graph/test/sprint-graph.test.js
  • pre-commit/lint-staged hooks passed on commit

});
return reload();
})
.catch(() => {});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put a console.warn

});
await reload();
const nextPath = getSprintPhasePath(projectId, sprintId, 'COMPLETED');
if (nextPath) navigate(nextPath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is useful, as marking COMPLETE would redirect to ReviewPage (on which we are already), furthermore there is the reload just before that does the job...

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.

Agent shouldn't ask to transition phases — phase transitions are UI-only

2 participants