Expand deterministic symptom escalation regression suite #62
Open
rockachopa
wants to merge 3 commits from
timmy/21-escalation-regression-suite into main
pull from: timmy/21-escalation-regression-suite
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/13-provisional-suggestion-state
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/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
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#62
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 #21 (parent epic #5).
What
Prove model behavior can never suppress or soften urgent symptom handling, per the issue's acceptance criteria.
Acceptance criteria coverage
tests/symptom-escalation.regression.test.jspins all six flags (blood, blackOrDarkRed, severePain, vomiting, fever, cannotPassGas): 56 positive chat expressions mapped to their exact flag, plus checkbox-level positive/negative tests per flag, and 27 idiomatic negatives that must NOT escalate (I threw up my hands,yellow fever outbreak in history class,black tea,cannot pass the salt). Matrix size is pinned so silent shrinkage fails CI.symptoms,flags, orurgentkeys are dropped by the parser;mergeVisualSuggestiontouches only Bristol type and color and can neither inject nor wipe user-reported symptoms. Ledger sanitizer coerces symptom values to strict booleans, so truthy junk ("yes",1,{forced:true},[true]) cannot fabricate an escalation while a forgedtruestill triggers it.urgentChatMessageis a frozen module constant exported read-only (urgentSymptomCopy); tests prove null/undefined/empty/prompt-injection provider replies cannot alter it. The boundary suite proves every red-flag phrase, confirmed ledger flag, and ledger note intercepts chat with zero Hermes calls (runTurnspy stays empty) — the authoritative invariant.Existing matrix preserved
The original 24-expression vomiting/blood/pain/gas matrix from
tests/domain.test.jsis fully retained and passing; the new suite extends it to 56 positives + 27 negatives. All prior domain/service/browser expectations unchanged.RED evidence
Before the fix, the new suites failed with:
URGENT_MESSAGEnot exported; misses onbleeding from my rectum,bloody stool today,I have bloody poop,severe pain in my abdomen; false positives onI threw up my hands/throwing up confetti(idiomatic) and unboundedfevermatches (Malaria fever research).GREEN evidence
npm test: 87/87 pass (was 67; +20 new tests across three suites)npm run check:syntax: cleannpm run check:diff: cleannpm audit --audit-level=high: 0 vulnerabilitiespython3 tests/staging-deploy.test.py -v: 20/20 OKtest:ui,test:photo,test:sleek: pass; urgent input intercepted before any/api/agent/chatrequestPrivacy/safety boundary
No real medical imagery, no credentials, no environment data in the diff; detection stays centralized in the frozen domain pattern table; zero-Hermes-call override preserved at both server and browser layers.
Independent verification: CHANGES REQUESTED at
e05d7d1e1a828e98d73b7981cc9f209e4d06997c. The expanded tests pass, but the new fever guard introduces clinically ordinary false negatives at the authoritative zero-Hermes-call boundary:The pain expansion also misses common forms:
These requests would now reach Hermes instead of deterministic escalation. The negative research controls must not be implemented with a narrow continuation-word allowlist that blocks unanticipated ordinary symptom wording. Add these exact RED regressions plus punctuation/case/contraction variants; retain the valid nonclinical controls; prove zero Hermes calls for every new phrase at both detector and service boundary. Do not merge while CI is pending or these false negatives remain.
Independent exact-head hostile review of
1aadca91c67be4cdc588e28040a81d8be1724f79: CHANGES REQUESTED. The five reported phrases now intercept with zero Hermes calls, frozen copy remains exact, CI is green, and 90/90 + browser/deploy gates pass. But ordinary urgent variants still bypass the authoritative gate:Each was nonurgent at detector and service boundaries and invoked the adapter once; live HTTP proved
I can not pass gas.reached the fake adapter.The contextual exclusions are also punctuation/coverage fragile. False positives included
yellow-fever outbreak in history class,fever-tree,feverish, with excitement,I threw up, my hands in surrender, fever research/history,fever pitch, the movie titleSaturday Night Fever, andGold fever.Replace accumulating narrow regex patches with a structured, auditable urgent-expression grammar: normalize punctuation/hyphens/contractions, support tense/plural/word-order variants, and apply bounded nonclinical context classes without suppressing arbitrary future symptom language. Add every listed phrase at detector, service zero-call, and HTTP wiring layers. No merge/deploy until adversarial matrix is green.
Exact-head hostile review of
693e02375883c6e0a8e8263a7f87c9a3228b88aa: REQUEST_CHANGES / do not merge. CI is green, but an independent detector matrix still produced 11 urgent false negatives and 6 contextual false positives.False negatives included:
blood keeps coming out when I poop;I wiped and there was bright red blood;there is blood mixed throughout the stool;black tarry poop today;my abdomen hurts severely;the abdominal pain is unbearable;I threw lunch up;I keep throwing my food up;I can not get any gas out;I haven't passed gas since yesterday;unable to fart.False positives included:
I researched blood in stool for a paper;history of black stool in medieval medicine;the movie showed someone vomiting;this plant has dark red stools for decoration;I cannot pass gas prices this high;black stool is a term I read about.Reproducer: import
detectUrgentTextfromsrc/domain.js, assert the first list is urgent and the second is not. Because this detector is authoritative before Hermes, these are release blockers regardless of the submitted suite. Preserve exact frozen escalation copy and prove zero Hermes calls at service/HTTP boundaries. No merge or deployment.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.