Expand deterministic symptom escalation regression suite #62
No reviewers
Labels
No Label
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
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stackchain/timmy-talking-turd#62
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "timmy/21-escalation-regression-suite"
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?
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.Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Gitea.