feat(specifiers): add full DSM-5-TR catalogue with verification gate#656
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a complete DSM-5-TR specifier catalog, server and client search helpers, catalog reference pages, enhanced search results, validation tests, and dynamic detail-page routing with curated-content fallback. ChangesSpecifier catalog experience
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3470e94f59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3470e94f59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
data/specifiers-content.json (2)
11721-12168: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winCategory "20. ICD-11 Specifics" fully duplicates content already present in other categories.
Several disorders in this category are near-identical/byte-identical repeats of entries already defined elsewhere in the file, rather than differentiated ICD-11-specific views:
- Gaming Disorder (Lines 11726-11791) duplicates the entry under "16. Substance & Addictive" (Lines 9948-10013) — identical "meaning" text for both type and severity items.
- Compulsive Sexual Behaviour Disorder (Lines 11793-11819) duplicates the entry under "13. Sexual Dysfunctions" (Lines 8988-9014).
- Bodily Distress Disorder (Lines 11911-11971) duplicates the entry under "9. Somatic Symptom" (Lines 6162-6223).
- Partial Dissociative Identity Disorder (Lines 11973-11999) duplicates "8. Dissociative Disorders" (Lines 5570-5596).
- Trance Disorder (Lines 12001-12027) duplicates "8. Dissociative Disorders" (Lines 5598-5646).
- Olfactory Reference Disorder (Lines 12029-12111) duplicates "6. Obsessive-Compulsive" (Lines 4799-4881).
- Body-Focused Repetitive Behaviour Disorder (Lines 12113-12139) duplicates "6. Obsessive-Compulsive" (Lines 4883-4909).
- Complex PTSD (Lines 11821-11847) closely duplicates "7. Trauma & Stressor" (Lines 5092-5140), with only minor label wording differences.
Unlike "Catatonia" in this same category (whose ICD-11 sub-items genuinely differ from the DSM-5-TR "Catatonia" entry elsewhere), these are exact-content duplicates. This inflates the
disorders/specifierItemsstats, produces redundant catalog entries a user could stumble on twice with no distinguishing information, and creates a content-drift risk: because each copy has its ownrowKey/contentHash, future edits to one copy will not automatically propagate to the other.Consider either deduplicating (drop the exact-duplicate entries from "20. ICD-11 Specifics" and rely on category tags/cross-links instead), or giving the ICD-11 Specifics versions genuinely differentiated content (as done for Catatonia).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@data/specifiers-content.json` around lines 11721 - 12168, The ICD-11 Specifics category contains duplicate disorder entries already defined in other categories, inflating catalog counts and creating content drift. In the category identified by id "icd", remove the duplicate entries for Gaming Disorder, Compulsive Sexual Behaviour Disorder, Complex PTSD, Bodily Distress Disorder, Partial Dissociative Identity Disorder, Trance Disorder, Olfactory Reference Disorder, and Body-Focused Repetitive Behaviour Disorder, while retaining Catatonia and Gender Incongruence; do not alter the canonical entries in their original categories.
295-300: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDrop the nested
definition.status. OnlydefinitionStatusis read by the schema and consumers, so the nested copy is redundant and can drift out of sync.data/specifiers-content.json:295-308🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@data/specifiers-content.json` around lines 295 - 300, Remove the nested status property from the definition object in the Intellectual Developmental Disorder entry, while preserving definition.meaning, definition.clinicalNote, definition.sourceFamily, and the existing top-level definitionStatus value consumed by the schema.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@data/specifiers-content.json`:
- Around line 1101-1127: Remove the Selective Mutism entry identified by name
and its associated icd11Context and groups data from the Neurodevelopmental
section, while preserving the existing Anxiety Disorders entry and valid
surrounding JSON structure.
In `@data/specifiers-search-index.json`:
- Around line 618-626: Update the upstream catalog generator responsible for
specifier definitions so entries such as “Current severity” for Brief Psychotic
Disorder no longer reuse tic-severity or other cross-domain templates. Use
validated disorder-specific definitions where available; otherwise mark the
entry undefined/manual-review instead of defined. Regenerate both
specifiers-content.json and specifiers-search-index.json from the corrected
generator.
In `@src/components/specifiers/specifier-reference-page.tsx`:
- Around line 153-159: Update the “Deep guide” Link in SpecifierReferencePage to
navigate to the curated detail-page route instead of the `/specifiers/compare`
comparison workflow, preserving its existing label and styling.
In `@src/components/specifiers/specifiers-home-page.tsx`:
- Around line 213-218: Update catalogMatches to apply the active family and
diagnosis filters consistently with curated results, then use the combined
curated and catalog collections when deriving result counts and
EmptySearchResults visibility. Ensure catalog-only queries render valid cards
instead of the zero-match state. Add focused tests covering catalog-only results
and diagnosis-filtered catalog results, and run the narrowest relevant
validation.
---
Nitpick comments:
In `@data/specifiers-content.json`:
- Around line 11721-12168: The ICD-11 Specifics category contains duplicate
disorder entries already defined in other categories, inflating catalog counts
and creating content drift. In the category identified by id "icd", remove the
duplicate entries for Gaming Disorder, Compulsive Sexual Behaviour Disorder,
Complex PTSD, Bodily Distress Disorder, Partial Dissociative Identity Disorder,
Trance Disorder, Olfactory Reference Disorder, and Body-Focused Repetitive
Behaviour Disorder, while retaining Catatonia and Gender Incongruence; do not
alter the canonical entries in their original categories.
- Around line 295-300: Remove the nested status property from the definition
object in the Intellectual Developmental Disorder entry, while preserving
definition.meaning, definition.clinicalNote, definition.sourceFamily, and the
existing top-level definitionStatus value consumed by the schema.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fcb1a9a6-d791-4e5b-93a3-8ccd20fcf042
📒 Files selected for processing (10)
data/specifiers-content.jsondata/specifiers-search-index.jsonsrc/app/specifiers/[slug]/page.tsxsrc/components/specifiers/specifier-record-page.tsxsrc/components/specifiers/specifier-reference-page.tsxsrc/components/specifiers/specifier-ui.tsxsrc/components/specifiers/specifiers-home-page.tsxsrc/lib/specifiers-content.tssrc/lib/specifiers-search-index.tstests/specifiers-content.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c8bfd4ca3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
data/specifiers-content.json (2)
2776-2792: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
clinicalNotereferences a parenthetical severity list that doesn't exist on these labels.Cyclothymic Disorder's and Persistent Depressive Disorder's "With anxious distress" items carry the note "The parenthetical severity levels grade the anxious distress specifier, not the whole disorder." but their labels have no parenthetical severity list (unlike the Bipolar I/II/MDD variants, whose label reads "With anxious distress (mild, moderate, moderate-severe, severe)"). Since this PR's stated goal is correcting anxious-distress content, these two look like leftover copy-paste from the parenthetical variant.
🩹 Proposed fix
- "clinicalNote": "The parenthetical severity levels grade the anxious distress specifier, not the whole disorder.", + "clinicalNote": null,(apply at both Cyclothymic Disorder line ~2779 and Persistent Depressive Disorder line ~3415)
Also applies to: 3412-3427
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@data/specifiers-content.json` around lines 2776 - 2792, Remove the inaccurate parenthetical-severity reference from the clinicalNote of the “With anxious distress” entries for Cyclothymic Disorder and Persistent Depressive Disorder. Keep the labels and other definition metadata unchanged, and replace the note with wording that accurately describes these non-parenthetical variants.
1360-1380: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftWrong severity template reused across multiple rows
data/specifiers-content.jsonassigns the tic-disorder “current severity” wording (“tic frequency, complexity, suppressibility…”) to Brief Psychotic Disorder, Substance/Medication-Induced Psychotic Disorder, PTSD, and several paraphilic entries. These severities need disorder-specific domains, so this looks like a template-mapping bug and should be regenerated at the source rather than patched row by row.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@data/specifiers-content.json` around lines 1360 - 1380, Regenerate the severity entries in the source that produce the affected rows, including Brief Psychotic Disorder and the other disorders identified in the comment, so each “Current severity” definition uses disorder-specific domains instead of the tic-disorder wording. Rebuild data/specifiers-content.json from the corrected source and verify the reused template no longer appears in those rows.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@data/specifiers-content.json`:
- Around line 2776-2792: Remove the inaccurate parenthetical-severity reference
from the clinicalNote of the “With anxious distress” entries for Cyclothymic
Disorder and Persistent Depressive Disorder. Keep the labels and other
definition metadata unchanged, and replace the note with wording that accurately
describes these non-parenthetical variants.
- Around line 1360-1380: Regenerate the severity entries in the source that
produce the affected rows, including Brief Psychotic Disorder and the other
disorders identified in the comment, so each “Current severity” definition uses
disorder-specific domains instead of the tic-disorder wording. Rebuild
data/specifiers-content.json from the corrected source and verify the reused
template no longer appears in those rows.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3825d38b-62d7-4a27-a7f2-d40dd9ffa25b
📒 Files selected for processing (6)
data/specifiers-content.jsondata/specifiers-search-index.jsonsrc/components/specifiers/specifier-reference-page.tsxsrc/components/specifiers/specifiers-home-page.tsxsrc/lib/specifiers-content.tstests/specifiers-content.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/components/specifiers/specifier-reference-page.tsx
- tests/specifiers-content.test.ts
- data/specifiers-search-index.json
- src/components/specifiers/specifiers-home-page.tsx
- src/lib/specifiers-content.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
CI triageCI failed on this PR. Automated classification of the 3 failed job(s):
Heuristic only — a main-side or flake label is a starting point, not a verdict. |
|
@codex fix all open comments please without regression |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60c7603fcf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Summary
Testing
|
|
@copilot resolve the merge conflicts on this branch. |
Head branch was pushed to by a user without write access
Resolved on commit |
343f4ee to
4f889f0
Compare
Populate the existing Specifiers feature with the complete DSM-5-TR specifier taxonomy (585 items across 20 categories, 131 disorders, 218 groups) imported from the clinical content export, layered additively on top of main's curated records — routes, wiring, and curated cards are unchanged. Governance-safe verification gate: only the 71 source-verified definitions are displayed; the 494 unverified auto-generated definitions (which were systematically mis-templated across domains in the source export) are withheld behind a neutral "pending clinician verification" notice and are neither rendered nor ranked-on in client search. The full catalogue structure/labels stay searchable. - data/specifiers-content.json: full nested dataset (server-only) - data/specifiers-search-index.json: compact client search index (definition text blanked for non-verified items) - src/lib/specifiers-content.ts: server catalog loader, slug map, curated enrichment confined to mood (bip/dep) categories - src/lib/specifiers-search-index.ts: client-safe ranked catalog search - specifier-reference-page.tsx: gated catalogue detail page - specifier-ui.tsx: category/review/DSM badges + quick tiles - specifiers-home-page.tsx: additive catalogue results beneath curated - [slug]/page.tsx: resolve curated first, then catalogue (dynamicParams) - tests: catalog integrity, gate, enrichment-confinement, search Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
4f889f0 to
8ffbc0e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ffbc0e87b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@data/specifiers-content.json`:
- Around line 1332-1350: Update the sourceFamily value for the Brief Psychotic
Disorder “Current severity” item in the Severity section to “Best-effort
DSM-derived clinical anchor pending manual verification,” matching the standard
value used by other Current severity entries while leaving its review and
verification statuses unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c95a453a-60f2-4ee0-a400-452b74cd6d3a
📒 Files selected for processing (9)
data/specifiers-content.jsondata/specifiers-search-index.jsonsrc/app/specifiers/[slug]/page.tsxsrc/components/specifiers/specifier-reference-page.tsxsrc/components/specifiers/specifier-ui.tsxsrc/components/specifiers/specifiers-home-page.tsxsrc/lib/specifiers-content.tssrc/lib/specifiers-search-index.tstests/specifiers-content.test.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- src/components/specifiers/specifier-reference-page.tsx
- src/app/specifiers/[slug]/page.tsx
- data/specifiers-search-index.json
- src/lib/specifiers-search-index.ts
- src/lib/specifiers-content.ts
- src/components/specifiers/specifier-ui.tsx
Address Codex/CodeRabbit review findings on the catalogue: - Gaming Disorder "Predominantly online"/"Predominantly offline" subtypes (both source-verified, so displayed) shared one merged "online or offline" definition. Give each a direction-specific definition in both the content dataset and the compact search index, and add a regression test asserting the two subtypes stay distinct. - Brief Psychotic Disorder "Current severity": replace the leftover internal note "Needs manual review - incorrect template removed" in sourceFamily (which surfaces on the detail page) with the standard "Best-effort DSM-derived clinical anchor pending manual verification". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
Review-findings disposition (clean rebuild, head
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6834b64a09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Address a further round of Codex review findings on displayed content: - Source badge: ICD-11 catalogue items (e.g. Gaming Disorder (ICD-11), Gender Incongruence) were unconditionally labelled DSM-5-TR. Derive the badge from the item's provenance (ICD-11 Specifics category, ICD-11/WHO source family, or "(ICD-11)" disorder name). - Search results: a catalog-only query showed the "No strong match" empty state and a "0 matches" count while the full-catalogue section listed real matches below. Drive the shared count and empty-state from both curated and catalogue results. - Clinical notes: PTSD "with delayed expression" (a timing threshold) and Conduct Disorder "adolescent-onset type" (an age-of-onset threshold) carried a generic "symptom-count threshold" note. Replace it with a dimension-neutral caveat on those two source-verified rows; the genuine symptom-count severity rows keep their note. Add a regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
|
Addressed the latest Codex findings in
Build compiles; 23/23 specifier tests pass. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acddc95bd0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
rankCatalogRecords compares its field/full-text/exact/prefix haystacks against a normalized (lowercased) query, but searchSpecifierCatalog passed the raw-cased specifier values, so a lowercase query like "mild" missed the exact/prefix/phrase/field bonuses on a capitalized "Mild" label and could rank below rows that merely contain "mild" in a parenthetical range. Normalize the haystacks the same way the other catalog callers do, and add a regression test that an exact label match ranks first. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03200832f6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Address two more Codex review findings on head 0320083: - Catalogue de-dupe: the label-only exclusion removed every catalogue row whose normalized label matched a curated card, even across different diagnoses — so a query like "schizophrenia catatonia" had its diagnosis-specific catalogue rows hidden by the generic curated "With catatonia" card. The curated set is mood-only and generic, so drop the de-dupe entirely; the disorder-specific catalogue rows now stay reachable. - AMPD provenance: three source-verified DSM-5-TR Section III (AMPD) trait rows (Negative affectivity, Detachment, Disinhibition) carried an ICD-11 sourceFamily, which the reference page turned into an ICD-11 badge/source panel for DSM content. Correct them to the DSM value used by the sibling AMPD rows; add a regression test that AMPD provenance stays DSM-specific. Universal specifiers (18) are intentionally not flattened: they are export metadata and are not surfaced or advertised anywhere in the UI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b42a50f205
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Two more source-verified rows displayed clinically wrong text: - Binge-Eating Disorder (and the identically-templated Hypersomnolence Disorder) severity notes told users to document "compensatory behaviours", which are not part of those disorders — they belong to Bulimia. Drop that item from the note for the non-purging disorders; Bulimia's note is left intact. - "With/without possession" rows (Dissociative Identity Disorder, Trance Disorder) had a one-sided meaning asserting possession is present, so the non-possession reading was wrong. Use neutral wording covering both states, in both the content dataset and the compact search index. Add regression tests for both. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 796c443a8e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The full-catalogue results section can include ICD-11/WHO rows (Gaming Disorder, Gender Incongruence), so its "Full DSM-5-TR catalogue" eyebrow misstated provenance before a user opened a row. Use a neutral "Full specifier catalogue" label; per-item source is already shown on the cards and the detail page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
… review Follow-up to the DSM-5-TR specifier catalogue (#656). Automated review repeatedly surfaced clinically wrong auto-generated text among the rows whose SOURCE was verified (gaming subtypes, PTSD/Conduct threshold notes, AMPD provenance, BED severity notes, possession meanings, ...). "Source verified" only attests the specifier's existence/attribution, not that the generated definition text is clinically correct, so displaying any of it as trusted is unsafe for a decision-support tool. Withhold the generated meaning/clinical-note for ALL catalogue rows — not just the previously-ungated ~514 — until a clinician authors real definitions: - specifier-reference-page.tsx: every catalogue detail page now shows the "definition pending qualified clinician verification" notice instead of generated meaning/clinical-note. Structural facts (label, disorder, group, ICD-11 context), the source/review badges, and the hand-authored curated fit/exclusion guidance are still shown. - specifiers-search-index.json: blank all 71 remaining meaning fields so no generated definition text is displayed or ranked on client-side. - tests: assert the client index carries no generated definition text. The full 585-item catalogue, search, routing, provenance badges, and structure are unchanged. The nested content dataset is left intact so a future clinician-reviewed regeneration can restore verified definitions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
… review (#691) * fix(specifiers): withhold all generated definitions pending clinician review Follow-up to the DSM-5-TR specifier catalogue (#656). Automated review repeatedly surfaced clinically wrong auto-generated text among the rows whose SOURCE was verified (gaming subtypes, PTSD/Conduct threshold notes, AMPD provenance, BED severity notes, possession meanings, ...). "Source verified" only attests the specifier's existence/attribution, not that the generated definition text is clinically correct, so displaying any of it as trusted is unsafe for a decision-support tool. Withhold the generated meaning/clinical-note for ALL catalogue rows — not just the previously-ungated ~514 — until a clinician authors real definitions: - specifier-reference-page.tsx: every catalogue detail page now shows the "definition pending qualified clinician verification" notice instead of generated meaning/clinical-note. Structural facts (label, disorder, group, ICD-11 context), the source/review badges, and the hand-authored curated fit/exclusion guidance are still shown. - specifiers-search-index.json: blank all 71 remaining meaning fields so no generated definition text is displayed or ranked on client-side. - tests: assert the client index carries no generated definition text. The full 585-item catalogue, search, routing, provenance badges, and structure are unchanged. The nested content dataset is left intact so a future clinician-reviewed regeneration can restore verified definitions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG * fix(specifiers): correct ARFID third driver label (ICD-11 6B83) Source verification against ICD-11 6B83 found the ARFID feature labelled "With inadequate food intake associated with limited availability" names an ICD-11 EXCLUSION ("unavailability of food") rather than a driver. The genuine third ARFID driver — alongside sensory-based avoidance and fear of aversive consequences — is an apparent lack of interest in eating / low appetite. Relabel it accordingly in the content dataset and the client index (rowKey/slug kept stable to avoid breaking URLs), and add a regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG * fix(specifiers): source-neutral wording for undefined ICD-11 rows CodeRabbit: the "no separate definition" branch of the reference-page description hardcoded "DSM-5-TR", so an ICD-11 item without a definition told users to read it against the wrong manual. Use the per-item sourceManual label (DSM-5-TR or ICD-11) already derived for the badge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Populates the existing
/specifiersfeature with the complete DSM-5-TR specifier taxonomy — 20 categories → 131 disorders → 218 groups → 585 specifier items (+18 universal specifiers) — imported from the clinical content export and layered additively on top ofmain's curated records. Routes, navigation, the curated 14-record lib, and the builder/compare/map tools are unchanged. Rebased cleanly onto currentmainas a single commit.Governance-safe verification gate
The source export's auto-generated definitions were systematically mis-templated across domains (e.g. FND "psychological stressor" text landing on unrelated diagnoses). Rather than patch row by row, display is gated on source trust:
Changes (9 files)
data/specifiers-content.json(full nested export, server-only) +data/specifiers-search-index.json(compact client index, definition text present only for verified rows).src/lib/specifiers-content.ts(typed loader, stable slugs, curated enrichment confined to moodbip/depcategories, bounded static-param subset) andsrc/lib/specifiers-search-index.ts(client-safe ranked search reusingrankCatalogRecords).SpecifierReferencePagerenders any catalogue item with the gate applied;/specifiers/[slug]resolves curated records first, then the catalogue (dynamicParamsfor the long tail).tests/specifiers-content.test.ts— catalog↔stats consistency, unique slugs, gate invariants, enrichment confinement, and search.Verification (run in-sandbox)
src/file (the onlytscfailures are pre-existing missing dev-deps@testing-library/*/@axe-core/playwright, declared inpackage.jsonbut uninstalled in this sandbox — CI installs them).tests/specifiers-content.test.ts+tests/specifiers.test.ts→ 21/21 pass.Clinical Governance Preflight
sourceVerificationStatusand the dataset scope warning stay visible; unverified generated text is withheld, not shown.Clinical KB Database/sjrfecxgysukkwxsowpy).Notes
🤖 Generated with Claude Code
Summary by CodeRabbit