fix(console): a running turn on an empty project never meets a Retry - #634
Conversation
The rail attributes a running turn to a section by its flow token, and a turn with no token pulsed nothing — but the turn that carries a member's interview answers is plain prose, and it is the very turn that writes the first requirements document. Unattributed, it left the spec workspace showing "Nothing written yet" plus a Retry that could fire /start against work in flight (wso2#629). Two rules close it, one per surface: - railSections: a flowless turn on a project that holds NOTHING claims Requirements by elimination — nothing downstream can be written before that document exists. The moment anything exists the rail's honest silence resumes; known flows are attributed exactly as before. - SpecView: the empty state additionally requires no agent working at all, so the one flow the rail places elsewhere (/design typed before any kickoff landed) cannot fall through to the Retry either — the pane shows a plain working spinner without naming a document it may not be writing. The three copies of "does this project have requirements" in SpecView collapse into one shared predicate, and the rail's lexicon entry records the elimination exception. Fixes wso2#629 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpXLxZ5x5PNYZrJ5Gmf5cG
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughSummary
WalkthroughThe rail now uses the running flow token to select an active section. For flowless or unknown work, Requirements is active only when the project has no requirements, design, or validation content. SpecView uses the shared requirements-file check, shows a generic working state for unattributed work, and hides the empty state and Retry action while an agent is working. Tests cover empty and partially populated projects. Sequence Diagram(s)sequenceDiagram
participant Agent
participant RailSections
participant SpecView
Agent->>RailSections: report active flow and project content
RailSections->>RailSections: select mapped section or empty-project Requirements fallback
RailSections-->>SpecView: return section activity
SpecView->>SpecView: evaluate active work and requirements files
SpecView-->>Agent: show requirements or generic working state
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The console now keeps the Requirements view in a working state while the first document is being written and prevents an unsafe Retry from appearing during active work. No actionable merge-blocking risk remains beyond normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Fixes #629.
What
The spec rail attributes a running turn to a section by its flow token — and a turn with no token pulsed nothing. But the turn that carries a member's interview answers is plain prose, not a
/<skill>command, and it is the very turn that writes the first requirements document. Unattributed, it left the spec workspace showing "Nothing written yet" plus a Retry that could fire/startagainst work in flight.Two rules close it, one per surface:
railSections(): a flowless (or unrecognised-flow) turn on a project that holds nothing — no requirements, no design, no validation — claims Requirements by elimination: nothing downstream can be written before that document exists. The moment anything exists, the rail's honest silence resumes; known flows are attributed exactly as before, and guessing from emptiness stays retired.SpecView: the empty state additionally requires no agent working at all, so the one flow the rail places elsewhere (/designtyped into chat before any kickoff landed) cannot fall through to the Retry either — the pane shows a plain working spinner without naming a document it may not be writing.SpecViewinherits the first rule throughrequirementsActive(it reuses the rail's answer), so the common case — the answer turn, or any plain-chat first write — renders the existing "Agent is working on the requirements document" spinner with the Requirements section pulsing. The three copies of "does this project have requirements" inSpecViewcollapse into one shared predicate, and the rail'slexicon.mdentry records the elimination exception.Accepted sliver: for up to one status-poll interval after the answers are submitted, the console does not yet know a turn is running, so the Retry can flash briefly. A click there is backstopped: the seed is guarded and the panel drops it once the rehydrated thread shows the exchange in flight.
Proof of real execution
On the local stack (console rebuilt from this branch's tree), project
office-parking-spot: kickoff/start→ interview → Use recommended answers → the flowless answer turn. The workspace was sampled every second against the newestagent_turnsrow:running/<empty>is exactly the shape from the issue's measurement. Zero samples showed Retry or "Nothing written yet" from the moment the status flipped toworkingthrough to the PRD landing in the workspace; the rail pulsed Requirements throughout, and the pane showed the working spinner.Tests
railSections.test.ts: flowless + working + empty project → Requirements active; unknown org-skill flow → same; flowless with design-but-no-requirements → still silent (the elimination premise is strict); flowless once requirements exist → silent; empty project with nobody working → not-started.SpecView.test.tsx: the flowless answer turn renders the spinner and no Retry; a/designrun on an empty project renders a plain "Agent is working" and no Retry. The pre-existing pin that a design run never claims the requirements document still passes.tscclean for the touched files (thesrc/features/marketplace/*errors on main are pre-existing and untouched); eslint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01MpXLxZ5x5PNYZrJ5Gmf5cG