Repository navigation
fix: HFO risk-level breakdown groups by Active Life Threat - #312
Merged
Merged
Conversation
Scoring grouped by SI's "Short Current Suicide Risk Level" column for every target, so HFO runs printed a KeyError traceback and skipped scores_by_risk.json. RISK_LEVELS now maps each target's risk column to its levels in order: SI's suicide risk level, and HFO's Active Life Threat, which matches the HFO rubric's danger tiers. A personas file with neither skips the breakdown with one line. SI is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
luca-belli
commented
Nov 4, 2026
| # imminent danger present). A personas file with neither has no breakdown. | ||
| RISK_LEVELS: Dict[str, List[str]] = { | ||
| "Short Current Suicide Risk Level": ["None", "Low", "High", "Immediate"], | ||
| "Active Life Threat": ["N/A: No harm", "Absent", "Present"], |
Collaborator
Author
There was a problem hiding this comment.
that feels something that the TSV should know about not the code
Collaborator
Author
There was a problem hiding this comment.
Agreed, moved in 2f62d4c. Each target's manifest.json now has an optional risk_levels section with the persona column and its levels in order:
"risk_levels": {"column": "Active Life Threat", "order": ["N/A: No harm", "Absent", "Present"]}Scoring reads it from the manifest beside the personas file (it must list that file). Without it, there is no breakdown, just a one-line note. The code no longer knows any target's column or levels: RISK_LEVELS, RISK_LEVEL_ORDER and RISK_LEVEL_COLUMN are gone. One consequence: a custom personas file passed to --personas with no manifest beside it now skips the breakdown, even if it has SI's column. That's in the CHANGELOG entry.
An optional risk_levels section in data/<target>/manifest.json names the persona column the breakdown groups by and its levels in order. Scoring reads it from the manifest beside the personas file; without one there is no breakdown. Replaces the RISK_LEVELS table and the SI constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Hotfix for 2.0.x.
release/2.1has the same code and gets this with the nextmainsync.Problem
vera pipeline(andvera score/vera pool) on HFO printed aKeyErrortraceback during scoring:The run itself finished, but HFO never got a risk-level breakdown (
scores_by_risk.jsonand its chart). The breakdown grouped conversations by a hard-coded SI column, with SI's level order.Fix: the target's data says how to break it down
manifest.jsongets an optionalrisk_levelssection, with the persona column and its levels in order:{"column": "Short Current Suicide Risk Level", "order": ["None", "Low", "High", "Immediate"]}(unchanged behavior){"column": "Active Life Threat", "order": ["N/A: No harm", "Absent", "Present"]}load_risk_levels(personas_path)reads it from the manifest beside the personas file, which must list that file. Scoring and the charts use its order.risk_levels,vera scoreandvera poolprint one line and skip the breakdown, with no traceback.RISK_LEVEL_ORDERandRISK_LEVEL_COLUMNare removed.Active Life Threatfor HFO: its three values match the HFO rubric's Danger Tier Classification (No Danger / Imminent Danger Absent / Imminent Danger Present). EveryPresentpersona is alsoImminentonHarm imminence, but only half the imminent ones arePresent, so it's the tier, not just the timing. It's also the column HFO's manifest already copies intoresults.csv.Behavior change: a custom personas file passed to
--personaswith no target manifest beside it now skips the breakdown, even if it has SI's column. It's in the CHANGELOG entry.docs/targets.mddocuments the new manifest field;docs/scoring.mdis updated. The roadmap's longer-term plan (take the risk level from a rubric question) is unchanged; this is the interim fix.Checks
ruff and pyright clean on
score/and its testsSI levels and order unchanged, so SI scores and charts are identical; run records don't checksum manifests, so old
config.jsonfiles stay validNew and updated unit tests:
risk_levels(present, missing, or a manifest that lists other files);They're written but not run locally (CI runs them).
Worth confirming with the HFO rubric authors that
Active Life Threatis the breakdown they want.🤖 Generated with Claude Code