Cursor prompt: Add AI action lifecycle state machine (stub)¶
Prerequisites¶
Read:
- [ ] [ONTOUI.md](../AI_ORCHESTRATION.md`
- [ ] 0006-ai-preview-before-apply.md
Non-goals¶
- Real LLM providers
- Network calls
Current state¶
- No AI state in store today
Tasks¶
- Add ai slice to WorkspaceStore with lifecycle enum (Idle, ProposalGenerated, PreviewShown, Applied)
- Add actions: proposePatch, showPreview, approve, reject (no network)
- Gate approve() to require PreviewShown state
- Add aiStore.test.ts for lifecycle transitions
Acceptance criteria¶
- [ ] Cannot approve from Idle
- [ ] approve only from PreviewShown
- [ ] Tests pass
Tests¶
cd extension/webview-ui && npm test
Do not¶
- Do not add API keys or fetch calls