Make AI suggestions visibly provisional and correction-first (#13) #69
Closed
rockachopa
wants to merge 0 commits from
timmy/13-provisional-suggestion-state into main
pull from: timmy/13-provisional-suggestion-state
merge into: stackchain:main
stackchain:main
stackchain:timmy/19-metrics-operator-report
stackchain:timmy/16-image-ingress-hardening
stackchain:timmy/40-security-rc-evidence
stackchain:timmy/27-dataset-card
stackchain:timmy/26-review-adjudication
stackchain:timmy/32-abstention-policy
stackchain:timmy/29-evaluation-harness
stackchain:timmy/35-portable-backup-versions
stackchain:timmy/24-training-contribution-consent
stackchain:fix/demo-caption-pixels
stackchain:timmy/36-photo-lifecycle-controls
stackchain:timmy/release-notes-grounded-chat
stackchain:timmy/37-grounded-chat-citations
stackchain:timmy/21-escalation-regression
stackchain:timmy/34-explainable-pattern-summaries
stackchain:timmy/15-container-worker-receipts
stackchain:timmy/73-blank-first-ordering
stackchain:timmy/18-vision-corpus
stackchain:timmy/20-photo-dataflow-threat-model
stackchain:timmy/67-hard-stool-followup
stackchain:timmy/12-manual-fallback-draft-recovery
stackchain:timmy/11-mobile-capture-recovery
stackchain:free/hy3-timmy-16
stackchain:timmy/35-version-ledger-migrations
stackchain:timmy/41-release-observability-dashboard
stackchain:free/step-timmy-14
stackchain:timmy/21-escalation-regression-suite
stackchain:timmy/17-bounded-inference-queue
stackchain:timmy/58-strict-csp-runtime-config
stackchain:timmy/55-staging-deployment-tooling
stackchain:timmy/53-private-subpage-staging
stackchain:timmy/10-reproducible-smolvlm-bootstrap
stackchain:timmy/48-vomiting-phrase-hotfix
stackchain:timmy/48-server-safety-override
stackchain:timmy/47-sleek-hermes-agent
stackchain:timmy/9-product-boundary-decisions
stackchain:timmy/8-ci-gates
No Reviewers
Labels
Clear labels
area/backend
area/data
area/frontend
area/model
area/privacy
area/release
area/safety
blocked
human-gate
priority/P0
priority/P1
priority/P2
state:review
type/docs
type/epic
type/feature
type/ops
type/research
type/security
type/test
Application API and storage
Dataset and provenance
PWA and interaction design
Vision model and inference
Privacy and consent
Release engineering and distribution
Clinical safety boundary
Blocked on an explicit dependency or decision
Requires explicit human approval
Release-critical
High priority
Planned
Documentation and evidence
Roadmap epic
Product feature
Infrastructure and operations
Research or evaluation
Security hardening
Verification and quality gate
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stackchain/timmy-talking-turd#69
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #13
Outcome
AI suggestions are now a distinct, provisional state everywhere they appear, and correcting one clears the AI-confirmed state without losing anything the user entered.
What changed
src/suggestion.js(new): provenance state machine for a log entry's visual fields —pending→confirmed→corrected, plusmanualwhen no suggestion was in play. It also owns the visible and screen-reader copy for each state.app.js: the scan result renders as provisional (data-provenance="pending", confidence badge retained, "nothing is saved until you confirm it"); confirming is an explicit act; tapping a different type or changing the colour clears the AI-affirmed state, records the correction, and keeps every user field (urgency, discomfort, note, photo) intact. Step 2's note now reports the correction instead of silently dropping the suggestion.styles.css: dashed/neutral provisional styling, teal confirmed styling, amber corrected styling so the three states never look alike.tests/suggestion.test.js(new): state machine and accessibility copy.tests/provisional-suggestion.acceptance.mjs(new): browser acceptance with screenshots.scripts/record_release_demo.mjs: the demo now reviews → confirms → corrects the suggestion on camera, with touch indicators and captions, then shows the corrected value surviving in the retained draft..gitea/workflows/quality.yml,scripts/build_release.py,package.json: the new unit file and browser acceptance are gated in CI, the release builder, and the manifest (provisional_suggestion_state).Acceptance criteria
data-provenance+AI SUGGESTION(dashed) vsAI PREFILLED(teal) vsCORRECTED BY YOU(amber), each with its own copy.affirmedflips to false, the suggestion is retained as context, and urgency/note/photo/colour survive the correction.Evidence (all run from a clean clone of this branch, commit
5aee743)npm test→ 92 pass / 0 failnpm run test:ui|test:photo|test:mobile-capture|test:sleek|test:manual-fallback|test:provisional→ all passpython3 tests/staging-deploy.test.py -v→ 20 tests OKnpm run check:syntax→ pass;npm audit --audit-level=high→ 0 vulnerabilitiesnode scripts/record_release_demo.mjs→ 51s webm; OCR of extracted frames confirms the video visibly showsAI SUGGESTION · 83% CONFIDENCE+ "provisional", "…and you confirmed it", andCORRECTED BY YOU / Type 2 · brownwith the caption "Change a suggested value and Timmy clears the AI-confirmed state".artifacts/provisional-suggestion-{pending,confirmed,corrected}-mobile.pngPrivacy / safety boundary
No change to the product boundary. The suggestion still covers only visible Bristol form, broad colour, and image quality; urgency, discomfort, symptoms, and notes remain user-entered, deterministic symptom escalation is untouched, and this PR adds no inference, no new upload path, and no model or image data. All demo and test data is the existing synthetic fixture — no real medical image is in this branch, and no secret or generated artifact is included.
Demo path changed
scripts/record_release_demo.mjs— the feature is exercised live (mocked synthetic vision response) so tomorrow's release video covers this exact change. Infrastructure-only steps: none in this PR.Pull request closed