Commit Graph

2 Commits

Author SHA1 Message Date
1aadca91c6 fix: escalate ordinary fever and pain phrasing without allowlist narrowing
All checks were successful
Quality gates / quality (pull_request) Successful in 1m59s
Hostile verification of the fever continuation-word allowlist found ordinary
symptom false negatives at the authoritative zero-Hermes-call boundary:
'I have a fever right now', 'my fever is 103', 'fever started this morning',
plus 'severe pain in/around the abdomen' against the hard-coded 'my' in the
pain pattern.

- fever: drop the continuation-word allowlist entirely; the bare clinical
  word escalates with any continuation. Nonclinical controls become
  structured exclusions (malaria/yellow/dengue/cabin compounds, fever tree,
  figurative 'feverish about'/'feverish with excitement'), so future natural
  symptom wording can never be narrowed again.
- severePain: accept any determiner or none plus location qualifiers
  (lower/upper/left/right) between preposition and organ.
- blood: differential audit against origin/main caught the same regression
  class in the PR's rewrite: 'poop/stool with blood' (escalated on main)
  was lost while 'my stool has been normal' / 'the poop contains seeds'
  became false positives. Restored explicit blood shapes with bounded verbs.

RED regressions first: matrix grows 56 -> 82 pinned positives (fever +20,
severePain +6 with case/punctuation/contraction variants), a pinned
preserved-behavior list for main's blood shapes, and two boundary suites
proving every review phrase and variant escalates at the detector AND
intercepts chat at the service layer with exactly zero Hermes calls.

Gates: npm test 90/90, staging-deploy 20/20 OK, test:ui/test:photo/
test:sleek pass, check:syntax clean, check:diff clean, npm audit 0
vulnerabilities, diff secret scan clean.
2026-08-22 21:46:11 +00:00
e05d7d1e1a test: expand deterministic symptom escalation regression suite
All checks were successful
Quality gates / quality (pull_request) Successful in 1m28s
Issue #21 (epic #5). Prove model behavior can never suppress or soften
urgent symptom handling.

- Pin the six authoritative red flags, their canonical order, and the
  exact urgent copy as read-only exports; hostile provider output
  cannot reassemble it.
- Grow the positive text matrix from 24 to 56 pinned clinical phrases
  across all flags (bloody stool, dark-red/black descriptions, severe
  abdominal pain variants, vomiting tenses/slang, fever phrasings,
  inability to pass gas) and pin 27 idiomatic negatives that must not
  escalate (threw up my hands, yellow fever history class, black tea).
- Authoritative boundary suite: every red-flag phrase and confirmed
  ledger symptom/note intercepts chat with zero Hermes calls;
  malicious/missing provider replies cannot weaken the deterministic
  response; truthy junk symptoms can neither fabricate nor suppress
  escalation.
- Wiring suite: the single chat gate screens urgency before any agent
  turn in both service and browser code; detection stays centralized
  in the frozen domain pattern table.

RED evidence: URGENT_MESSAGE unexported, 9 matrix misses (bleeding from
my rectum, bloody stool/poop, severe pain in my abdomen), 8 false
positives (I threw up my hands, feverish about the election).

GREEN: 87/87 npm test, syntax/diff gates clean, 0 vulnerabilities,
browser suites pass with zero /api/agent/chat calls on urgent input.

Closes #21
2026-08-22 20:57:04 +00:00