GALENOSAPOSTOLUS

In Silico · system structure

CDSS Design for Early Detection of Mental Health Crises

Four decision-support designs for crisis prevention: early detection, rule-bound safety planning, on-device isolation detection and immediate handoff to a counsellor.

This is a research record, not a help service. If you are in Korea and need to talk to someone now, the suicide prevention counselling line 109 can be reached by phone. Elsewhere, contact your local emergency number.

4unitsP1 · P2 · P3 · P4
24componentsin hand-off order below
4/4audit gates passedprevent12
4projectsP1 · P2 · P3 · P4

What this work is

Design specifications and a reference implementation for four decision-support units around mental-health crises: early detection from coded records, a template-constrained safety-plan engine, on-device detection of isolation transitions, and crisis screening with counsellor handoff. The software flags cases, sets the order of review or selects approved wording. Assessment and action stay with the specialist, case manager, welfare worker or counsellor.

Scope The reference implementation runs on fixed synthetic inputs and reports virtual metrics; it is not an evaluation on a real cohort, clinical validity has not been assessed and no auditor has signed the result. It is not a counselling service.

P1 · Synthetic harness · prevent12

Early detection of acute crises from de-identified records

Uses coded longitudinal event sequences to raise an early alert for an acute crisis event and to order face-to-face assessment by a specialist. The alert does not replace the specialist's assessment.

  1. Zero-raw-text schema checkSynthetic coded event rows from the seeded generator → Admitted sequences, or reason codes for rejection
  2. Censored hazard risk modelEvent histories as observable on the training cut day → Channel weights and a risk score per evaluation time
  3. Recall-bound alert thresholdPeak scores before each calibration event, with weights → Frozen threshold, or none if positives are too few
  4. Review-queue routingScore, threshold, ensemble spread, history size, latest grade → Route and reason code
  5. Subgroup recall auditTest rows with group, score, outcome and weight → Per-group table, gap and verdict code
  6. Independent audit recomputationRun evidence document and frozen fixtures → Gate verdicts and benchmark entry
ComponentWhat it doesInput → outputCode
Zero-raw-text schema checkAdmits only coded and numeric event rows. A row with an unlisted field or free text is rejected whole, and each sequence is checked for order and gaps.Synthetic coded event rows from the seeded generator → Admitted sequences, or reason codes for rejectionprevent12/t121.py:validate_sequence
Censored hazard risk modelFits an additive hazard with time decay to the training histories, allowing for subjects whose follow-up ended early, and scores the risk within the prediction horizon.Event histories as observable on the training cut day → Channel weights and a risk score per evaluation timeprevent12/t121.py:fit_hazard
Recall-bound alert thresholdSets the alert threshold from calibration positives by an order-statistic rule so that recall stays above the target with stated confidence, weighting for censoring.Peak scores before each calibration event, with weights → Frozen threshold, or none if positives are too fewprevent12/t121.py:np_threshold
Review-queue routingApplies ordered rules to each score: priority alert, clinician review or routine. Missing model output and uncertain or near-threshold cases go to clinician review.Score, threshold, ensemble spread, history size, latest grade → Route and reason codeprevent12/t121.py:route
Subgroup recall auditComputes recall per abstract subgroup at the frozen threshold and reports whether a group is below target or the gap between groups exceeds the tolerance.Test rows with group, score, outcome and weight → Per-group table, gap and verdict codeprevent12/t121.py:equal_opportunity
Independent audit recomputationWithout importing the unit's code, recomputes threshold, recall, group gap and routes from the evidence rows in exact rational arithmetic and compares them with the run.Run evidence document and frozen fixtures → Gate verdicts and benchmark entryprevent12/audit.py:_check_121_numbers

Flow

  1. A seeded generator produces synthetic coded event sequences for abstract subgroups, and no clinical record or note text is read.
  2. Every row passes the zero-raw-text schema check, and subjects are split by enrolment day into training, calibration, embargo and test parts.
  3. The risk model is fitted only on what was observable at the training cut day, with change-point alarms from a numeric channel as one input channel.
  4. The alert threshold is set on the calibration part and frozen before it is applied to test subjects.
  5. Each test score is routed to a priority alert, clinician review or routine follow-up, and recall is compared across subgroups.
  6. The run document is hashed, and the independent audit recomputes the figures before a verdict is recorded.

What is guarded

Not built or not run

Result and documents

Recall on the synthetic test set, weighted for censoring, was 0.9155 against the internal target of 0.90. The alert burden was 46.1 per 100 patient-months and episode-level precision was 0.079.

Synthetic inputs only (synthetic_only). These are virtual metrics on synthetic inputs. No real cohort has been evaluated, clinical validity has not been assessed and no auditor has signed the result.

Measured values, limits and gates on the P1 record · Early Detection of Acute Mental-Health Crises

P1 design specification: early detection of acute crises (KR) · P1 to P4 replay record (KR) · Audit record (JSON) · Run output (JSON)

P2 · Synthetic harness · prevent12

Risk trajectory and rule-constrained safety-plan support

Supports a case manager's follow-up after emergency-department discharge: it flags a rising risk trajectory from structured scale scores and walks through the safety-plan components using approved wording only. It is not a free-text chatbot, and a high-risk transition is connected to counsellors and the crisis network by fixed rules.

  1. Risk-trajectory flagContact intervals, response flags, integer scale grades → Flag code mapped to an engine event
  2. Safety-plan state machineCurrent state and one enumerated event → Next state and entry effects
  3. Approved template renderingState, plan reference IDs, confirmation mask → Canonical output with mandatory links
  4. Deterministic policy gate (gate A)Candidate output and the template manifest → Rejection codes (empty if accepted)
  5. Fail-closed release (with gate B)Candidate, gate A codes, classifier verdict → Released candidate or the fixed safe notice
  6. Independent audit of the engineRun evidence document and frozen manifest → Gate verdicts and benchmark entry
ComponentWhat it doesInput → outputCode
Risk-trajectory flagFilters a hidden-state model over contact intervals, response and integer grades, then decides in a fixed order: rule, model, outreach. Invalid input is held for a human.Contact intervals, response flags, integer scale grades → Flag code mapped to an engine eventprevent12/t122.py:trajectory_flag
Safety-plan state machineApplies the transition function to enumerated events. Handoff tickets, case-team notices and counsellor connection fire on state entry, whatever gates or generator do.Current state and one enumerated event → Next state and entry effectsprevent12/t122.py:SafetyPlanEngine
Approved template renderingBuilds the canonical output for a state from its one approved template, slots that hold reference IDs matching a fixed grammar, and the mandatory escalation links.State, plan reference IDs, confirmation mask → Canonical output with mandatory linksprevent12/t122.py:canonical_output
Deterministic policy gate (gate A)Rejects any candidate that is not the byte-exact rendering of an approved template with valid slots and all mandatory links, or that the external policy lexicon reports.Candidate output and the template manifest → Rejection codes (empty if accepted)prevent12/t122.py:gate_a
Fail-closed release (with gate B)Releases the candidate only if gate A and an independent classifier both accept. Any rejection, fault or timeout discards it and returns the fixed notice.Candidate, gate A codes, classifier verdict → Released candidate or the fixed safe noticeprevent12/t122.py:release
Independent audit of the engineWithout importing the engine, rebuilds every transition from a separate rule table and checks template placeholders, hashes and the full fail-closed release matrix.Run evidence document and frozen manifest → Gate verdicts and benchmark entryprevent12/audit.py:_check_122_rules

Flow

  1. The trajectory flag turns structured follow-up observations into one engine event: high risk, outreach due, low risk or unrecognised.
  2. The state machine moves to the next state and fixes that state's entry effects before any output is generated or gated.
  3. The canonical output for the new state is rendered from the approved template, plan reference IDs and mandatory links.
  4. An untrusted generator is optional and is not called when the next state is terminal, which includes the crisis escalation state.
  5. If either gate rejects the candidate or fails, the fixed notice is sent, the session moves to the fail-safe state and a counsellor connection is requested.
  6. The audit recomputes transitions, release decisions and trajectory forecasts by different methods and compares them with the run.

What is guarded

Not built or not run

Result and documents

Disallowed output events on the synthetic test: 0 of 30,210, against a target of zero. The value holds within the closed template space, on the assumption that the approved wording has passed clinical review.

Synthetic inputs only (synthetic_only). These are virtual metrics on synthetic inputs. No real cohort has been evaluated, clinical validity has not been assessed and no auditor has signed the result.

Measured values, limits and gates on the P2 record · Safety-Plan Support after Emergency Care

P2 design specification: risk trajectory and safety-plan engine (KR) · P1 to P4 replay record (KR) · Audit record (JSON) · Run output (JSON)

P3 · Synthetic harness · prevent12

Consent-based on-device detection of isolation transitions

With prior explicit consent that can be withdrawn at any time, uses daily statistics aggregated on the device to detect a sustained transition into social isolation and to order wellbeing checks by a community welfare worker. It is not a location-tracking or content-monitoring tool, and a person does the checking.

  1. Daily aggregate featuresHourly activity, relative distances, beat intervals → Daily numeric features
  2. Change-point detection on baselineDaily residual series with unworn days as gaps → Length and mean of the last segment
  3. Sustained-shift rule gateWear mask, residual series, last-segment summary → Reason code, and features if scored
  4. Precision-certified thresholdCalibration scores and labels → Certified threshold or none, with the test table
  5. Consent and export gatePayload, consent ledger, scope, privacy ledger → Accept, or the first refusal code
  6. Independent audit recomputationRun evidence document and frozen scenarios → Gate verdicts and benchmark entry
ComponentWhat it doesInput → outputCode
Daily aggregate featuresComputes rest-activity regularity, relative movement dispersion, interaction counts and a physiological load index. It accepts no coordinates, content or identifiers.Hourly activity, relative distances, beat intervals → Daily numeric featuresprevent12/t123.py:interdaily_stability
Change-point detection on baselineOn series standardised against the person's own baseline, runs Bayesian online change-point detection to find when the last segment began and how far its level moved.Daily residual series with unworn days as gaps → Length and mean of the last segmentprevent12/t123.py:bocpd_last_segment
Sustained-shift rule gateDeclines to judge when wear is too low, the baseline is too short or the shift is not sustained. Only subjects that pass receive multi-scale features for scoring.Wear mask, residual series, last-segment summary → Reason code, and features if scoredprevent12/t123.py:detect_features
Precision-certified thresholdTests a fixed grid of thresholds with an exact binomial test and keeps the lowest one whose precision is certified above the target. It returns none if none is certified.Calibration scores and labels → Certified threshold or none, with the test tableprevent12/t123.py:precision_threshold
Consent and export gateBefore anything leaves the device, checks live consent for that scope, then the exact allow-list schema, then the privacy budget, and names the first cause of refusal.Payload, consent ledger, scope, privacy ledger → Accept, or the first refusal codeprevent12/t123.py:gate_upload
Independent audit recomputationWithout importing the unit's code, recomputes the certification test, confidence bounds and prevalence-shift bounds from the evidence rows in exact rational arithmetic.Run evidence document and frozen scenarios → Gate verdicts and benchmark entryprevent12/audit.py:_check_123_numbers

Flow

  1. Sensor readings are designed to be reduced to daily aggregates on the device, while the reference run starts from synthetic daily series of several scenario types.
  2. Each channel is standardised against the person's own baseline, and the change-point detector locates the last segment.
  3. The rule gate withholds judgement for low wear, a short baseline or an unsustained shift, and a logistic classifier scores the rest.
  4. A threshold is certified on a separate calibration cohort and then applied to the test cohort.
  5. The certified threshold is re-examined under lower assumed prevalences, and each prevalence is marked certified or not certified.
  6. Sharing a result or contributing a noised aggregate must pass the consent, allow-list and privacy-budget gate, and the audit then recomputes the figures.

What is guarded

Not built or not run

Result and documents

Synthetic precision for detecting a sustained transition was 0.978, with a one-sided 95% lower bound of 0.933, against the internal target of 0.85. Whether the threshold stays certified depends on the assumed prevalence, listed below.

Synthetic inputs only (synthetic_only). These are virtual metrics on synthetic inputs. No real cohort has been evaluated, clinical validity has not been assessed and no auditor has signed the result.

Measured values, limits and gates on the P3 record · Consent-Based Detection of Transitions into Isolation

P3 design specification: on-device isolation transition detection (KR) · P1 to P4 replay record (KR) · Audit record (JSON) · Run output (JSON)

P4 · Synthetic harness · prevent12

Crisis screening and immediate counsellor handoff

On a public youth counselling platform, classifies each turn for signs of crisis; when a turn is flagged it stops autonomous AI replies and hands the session to a human counsellor and the official crisis lines. The handoff guarantee covers detected turns only, and how many turns the screen detects is a separate measure.

  1. Text normaliserOne turn of text → Normalised symbol sequence
  2. External lexicon matcherSymbol sequence and the digest bundle → Match, no match or unavailable
  3. Screening verdict and triggerRule verdict, model probability, threshold → Trigger or safe verdict for the turn
  4. Default-deny generation gatewaySession state and a per-turn grant → Generation and delivery allowed or dropped
  5. Fail-closed handoff routerTriggered turn and an injected fault schedule → Timed event trace and terminal handoff state
  6. Independent trace auditRun evidence document and frozen router settings → Gate verdicts and benchmark entry
ComponentWhat it doesInput → outputCode
Text normaliserReduces one turn of text to a sequence of consonant, vowel and other symbols so that spelling variants of the same expression arrive at one form. It holds no vocabulary.One turn of text → Normalised symbol sequenceprevent12/t124.py:to_symbols
External lexicon matcherMatches symbol windows against a signed bundle of keyed digests from an authorised institution. The bundle holds no term text; failed verification makes it unavailable.Symbol sequence and the digest bundle → Match, no match or unavailableprevent12/t124.py:HmacLexiconMatcher
Screening verdict and triggerMaps a model probability to safe, risk or error; a missing model or invalid output is an error. A rule match, a model risk or any unavailable screening part triggers.Rule verdict, model probability, threshold → Trigger or safe verdict for the turnprevent12/t124.py:model_verdict
Default-deny generation gatewayIs the only holder of the generator. Generation needs a safe verdict for this session and this turn on an unlatched session, and the latch is checked again at delivery.Session state and a per-turn grant → Generation and delivery allowed or droppedprevent12/t124.py:Gateway
Fail-closed handoff routerOn a trigger, first latches the session, then shows the official contact panel, records the handoff, queues a counsellor and escalates to a person or the hotline bridge.Triggered turn and an injected fault schedule → Timed event trace and terminal handoff stateprevent12/t124.py:handle_turn
Independent trace auditWithout importing the router, derives the expected events and timing of every fault combination from the fault code and timing settings alone and compares each trace.Run evidence document and frozen router settings → Gate verdicts and benchmark entryprevent12/audit.py:_check_124_numbers

Flow

  1. Each turn is normalised to a symbol sequence and matched against the externally supplied lexicon bundle.
  2. The rule verdict and the model verdict are combined by OR, and an unavailable lexicon or a model timeout or error also counts as a trigger.
  3. If the turn is safe, the gateway issues a grant valid for that turn only and the AI reply is delivered.
  4. If the turn triggers, the session is latched at once, any unsent AI reply is cancelled, and the official contact panel is shown by the server or the client watchdog.
  5. The handoff is committed with retries, a counsellor queue is assigned, and acknowledgment escalates through three roles, ending in a hotline bridge if no one answers.
  6. Later turns in a latched session go to the human channel without screening, and the audit rebuilds every trace independently.

What is guarded

Not built or not run

Result and documents

Immediate handoff on the synthetic test: 1,584 of 1,584 detected turns, across 1,728 fault combinations. The value lies within detected turns and the modelled fault space; screening recall was not measured.

Synthetic inputs only (synthetic_only). These are virtual metrics on synthetic inputs. No real cohort has been evaluated, clinical validity has not been assessed and no auditor has signed the result.

Measured values, limits and gates on the P4 record · Student Crisis Screening and Immediate Counsellor Handoff

P4 design specification: screening and immediate handoff routing (KR) · P1 to P4 replay record (KR) · Audit record (JSON) · Run output (JSON)

How to read this screen

This screen describes structure: the parts, the order work passes through them and what each run is checked against. It carries no measured value of its own. The figure in each result paragraph is filled from the audit file when the site is built, and every component names the code that does the work.

Analysis registry · Replay commands · Audit results

© 2026 RISCON Co., Ltd.Privacy PolicyTerms of UseCookie SettingsContact

RISCON Labsrisconlabs.com