Confirmation state machine for write operations #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Depends on forgejo_admin/westside-ai-assistant #6 (AI engine core). Split from original #6 per review-598-2026-03-28 decomposition recommendation.
Repo
forgejo_admin/westside-ai-assistantUser Story
As Marcus (admin)
I want write operations to require explicit confirmation before executing
So that I can't accidentally modify program data through a misinterpreted message
Context
When the AI engine (#6) identifies a write operation, it returns a confirmation indicator instead of executing. This ticket implements the confirmation UX: posting a confirmation prompt to GroupMe, storing the pending action, handling "yes" (execute) or anything else (cancel), and expiring stale confirmations after 5 minutes.
File Targets
Files the agent should create:
app/confirmation.py— confirmation state machine: pending action store (dict keyed by group_id), store_pending(group_id, action), check_pending(group_id, message), expire_stale(), 5-minute TTLtests/test_confirmation.py— full state machine testsFiles the agent should modify:
app/ai.py— integrate confirmation module: write tool_use → post confirmation prompt → store pending; incoming "yes" → execute pending → post result; anything else → cancel pending → post cancellation; check expiry on each messageFiles the agent should NOT touch:
app/basketball.py— consumed as-isapp/groupme.py— already wired to ai.process_message() in #6app/config.py— no new config neededAcceptance Criteria
Test Expectations
pytest tests/test_confirmation.py -vConstraints
Checklist
Related
project-westside-ai-assistant— parent projectstory-westside-ai-assistant-write-ops— write operations storystory-westside-ai-assistant-safety— safety storyScope Review: READY
Review note:
review-604-2026-03-28Ticket scope is solid. All template sections present, traceability complete (story:write-ops, story:safety, arch:A2), file targets well-specified, acceptance criteria agent-verifiable, and blast radius low. Dependency on #6 is documented and clean — #6 explicitly leaves a "confirmation needed" indicator for this ticket to consume. Fits in a single agent pass (~3-4 min).
QA agent reading issue for acceptance criteria review.