Repository navigation
TL-15: suggest-and-confirm rules and synthetic policy signals (C) - #31
Merged
Merged
Conversation
Reapplies 1643c69, which #18 merged and #19 reverted. Same four files, unchanged. Refs #3. Proof: npx tsx --test fixtures/*.test.ts -> 10 pass, 0 fail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
evaluateOptions returned act_now before checking silence, so an overdue, unanswered household lost its silent status when its margin fell under +15 or no compatible resource existed. CaseResult now carries a separate `silent` flag computed before any lane decision; lane order is unchanged. Proof: npx tsx --test fixtures/*.test.ts -> 11 pass, 0 fail. The new regression test and two silent assertions fail on 1d99a61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #27. Pure rule suggestNeeds(signals) in spacetimedb/src/domain/suggest.ts maps synthetic life policy notes, disability policy, home and car modifications to suggested needs with confidence and source signals. confirmedNeed() turns the resident's confirm/correct/skip into the need that reaches dispatch. All data synthetic. Proof: npx tsx --test fixtures/*.test.ts -> 17 pass, 0 fail (6 new). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eywords
confirmedNeed() returned undefined for step-free access, the same as Skip,
so the confirmed driver note was lost. It now returns { id, dispatchNeed? }.
Substring matching on free text produced false suggestions ("trampoline"
contains "ramp"; "Does not use home oxygen" matched oxygen). Policy signals
are now coded fields; unknown codes are ignored.
Proof: npx tsx --test fixtures/*.test.ts -> 19 pass, 0 fail. The review
repros and the step-free confirmation test fail on 5a6987c.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closed
… need The test compared H17 with itself, so it could not show that confirming changed anything. It now starts from H17 with no recorded need (Act now, nothing compatible) and checks that confirming the suggestion turns it into Watch with R4 +17, identical to H17's TL-03 result. Proof: npx tsx --test fixtures/*.test.ts -> 19 pass, 0 fail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #28. Refs #27 (C's part). TL-03 (#20) has merged, so the diff now shows only the TL-15 files.
What:
spacetimedb/src/domain/suggest.tssuggestNeeds(signals)→ suggested needs withid, resident-facinglabel,dispatchNeed(for equipment only),confidenceandsources.oxygen_concentrator,ramp,hand_controls, …), not free text. Unknown codes are ignored.confirmedNeed(answer)→{ id, dispatchNeed? }. Confirm keeps the suggestion'sid(step-free access is kept with nodispatchNeed), correct returns the resident's need, skip returns nothing.Synthetic signals in
fixtures/policy-signals.ts(H17, H22, F03, F09).Check:
npx tsx --test fixtures/*.test.ts→ 19 pass, 0 fail (8 for TL-15):{ id: 'step_free_access' }; skip returns nothingevaluateOptionsresult as a self-reported oneFor D: the confirm screen shows
labelandsources, with Confirm / Correct / Skip, and the "Prototype – synthetic policy data" label.For A: store only the
confirmedNeed(...)object (id, optionaldispatchNeed) with the consent record. PassdispatchNeedto dispatch and showstep_free_accessto the assigned driver as an access note. Do not store or exposesourcesto the coordinator or driver.🤖 Generated with Claude Code