Skip to content

fix: strip bullet-glyph artifacts and redundant stitching from served answers#469

Merged
BigSimmo merged 30 commits into
mainfrom
claude/response-formatting-cleanup-b57a9c
Jul 11, 2026
Merged

fix: strip bullet-glyph artifacts and redundant stitching from served answers#469
BigSimmo merged 30 commits into
mainfrom
claude/response-formatting-cleanup-b57a9c

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Fixes the "Source-only" answer formatting defect where a live lithium-dosing answer rendered a literal Word/PDF sub-bullet glyph and doubled stitching: "For lithium, … The guidance is that for lithium, acute Mania: o IR product: 750 to 1000mg…". It now renders "For lithium, twice daily dosing should be spaced by 12 hours. For acute mania, IR product is 750 to 1000mg daily in 2 or 3 divided doses or as a single dose at night."
  • Adds a shared normalizeInlineBulletGlyphs sanitizer (bullet glyphs •◦▪‣● and the bare "o" sub-bullet, with the existing "37 o C" / "blood group o positive" guards preserved verbatim) and applies it across every serving path: extractive evidence splitting (sub-bullets become fact boundaries), extractive point cleaning, sanitizeAnswerText (final net for LLM answers too), the API snippet field (also fixes "Copy with sources"), and the display layer for cached answers.
  • Extractive stitching de-duplication: sentenceFromFact completes the sentence before attaching the query entity (once), and the second lead sentence suppresses the entity prefix when the answer already names it.
  • Heading handling: short section headings split off by a bullet boundary merge into the following fact as readable context ("For acute mania, …") instead of being dropped (indication context is clinically load-bearing); "Label: " reads as "Label is " only when a numeric dose follows.
  • Evidence-segment join fix: segments get terminal punctuation and the section heading becomes a "Heading:" label (skipped when the content already opens with it), so the prose collapse can no longer glue a bare heading onto the first sentence or fabricate a contentless "Label: Label." fact.
  • Corpus is untouched: serve-time normalization covers the live index; no re-index, no DB writes, no chunking changes (per docs/chunking-ocr-reindex-lever-finding-2026-07-08.md).
  • Rides along: base commit 648abfa, a pre-existing 2-line docs version-stamp alignment (docs/production-readiness-checklist.md, Next.js 16.2.9 → 16.2.10 + review date) that this branch was seeded on.

Verification

  • npm run verify:pr-local — not runnable as a single command in this worktree (no local node_modules; scripts hard-code node_modules/vitest/vitest.mjs). Every component gate was run individually instead, post-merge with origin/main:
    • full vitest: 1464 passed / 0 failed (npx vitest run)
    • full eslint (same file set as npm run lint): clean
    • prettier --check on all PR-diff files: clean
    • check:runtime, check:github-actions, sitemap:check: pass
    • typecheck: fails only on next.config.ts@next/bundle-analyzer resolution — a stale local install inherited from main's perf: bundle analyzer + Server-Timing measurement rail (perf round 2, phase 0) #458 (dependency is in package.json + lockfile; not touched by this diff); CI's fresh install is the arbiter
  • npm run verify:ui — not runnable in this worktree (no dependency install; dev server cannot boot). Change is text-content sanitization, not styling/routing; relying on the required ui-smoke CI check
  • npm run verify:release — not applicable
  • npm run eval:retrieval:quality — not run: no retrieval, ranking, selection, chunking, or scoring behavior changed (answer post-processing and display sanitization only)
  • npm run eval:rag -- --limit 15 / eval:quality --rag-only — not run: live-provider evals, no keys in this worktree. Offline equivalent ran instead: eval:rag:offline fixture schema passed (36 golden cases) + all 5 offline contract suites (58 tests) green
  • npm run check:production-readiness — file/runtime checks pass; the only failures are missing NEXT_PUBLIC_SUPABASE_URL/SUPABASE_SERVICE_ROLE_KEY/OPENAI_API_KEY because this worktree has no .env.local (expected per repo docs; no env behavior changed)

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use (source-only badge/verify-passages flow unchanged)
  • No patient-identifiable document workflow was introduced or expanded
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy) — no Supabase config touched
  • Service-role keys and private document access remain server-only — no access paths touched
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative — sanitization only converts bullet glyphs to separators/boundaries; dose/threshold text is never deleted, and the clinically-sensitive "37 o C" / "blood group o" guards are regression-tested
  • No clinical decision-support behavior changed (presentation/formatting of already-served source text only)

Notes

  • The clinicalProseUsefulness gate (H2 regression history) was deliberately not touched.
  • New regression coverage: tests/extractive-answer-formatting.test.ts includes the exact lithium case end-to-end through buildExtractiveAnswer.

🤖 Generated with Claude Code

BigSimmo and others added 5 commits July 10, 2026 21:54
…stitching

Adds a shared normalizeInlineBulletGlyphs sanitizer (bullet glyphs and the
PDF/Word sub-bullet "o") applied across the extractive answer path, answer
prose polish, source snippets, and display text; sub-bullets become fact
boundaries in evidence splitting with short headings merged as context; and
sentenceFromFact completes facts before entity prefixing so "For lithium, ...
The guidance is that for lithium," can no longer compound.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ssions

Adds the lithium source-only regression cases (sub-bullet fact boundary,
heading-as-context merge, entity de-duplication), normalizeInlineBulletGlyphs
unit coverage including the 37-o-C guards, and snippet/answer-prose bullet
assertions; prettier-formats the touched files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Evidence segments joined for fact extraction now carry terminal punctuation,
and the section heading becomes a "Heading:" label (skipped when the content
already opens with it) so the prose collapse can no longer fuse a bare
heading onto the first sentence ("Dosing Twice daily dosing...") or fabricate
a contentless "Label: Label." fact. Adds a buildExtractiveAnswer end-to-end
regression for the lithium source-only case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@supabase

supabase Bot commented Jul 10, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds reusable inline bullet normalization across clinical and RAG text paths, and improves extractive answer formatting by rewriting headings, preserving evidence boundaries, normalizing punctuation, and suppressing repeated entity prefixes.

Changes

Clinical text formatting

Layer / File(s) Summary
Bullet glyph normalization and integrations
src/lib/source-text-sanitizer.ts, src/components/clinical-dashboard/display-text.ts, src/lib/rag-answer-text.ts, src/lib/smart-rag-api.ts, tests/*
Adds normalizeInlineBulletGlyphs, reuses it for compact display processing, and applies it to clinical prose, answer text, and Smart RAG snippets with coverage for bullet, sub-bullet, temperature, idempotency, and newline-joining cases.
Extractive evidence and sentence formatting
src/lib/rag-extractive-answer.ts, tests/extractive-answer-formatting.test.ts
Rewrites heading and dose phrasing, normalizes evidence boundaries and punctuation, preserves short heading fragments, and supports suppressing repeated entity prefixes during synthesized answer generation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SearchResult
  participant splitClinicalEvidenceSentences
  participant clinicalFactExtraction
  participant sentenceFromFact
  participant buildExtractiveAnswer
  SearchResult->>splitClinicalEvidenceSentences: evidence text
  splitClinicalEvidenceSentences->>clinicalFactExtraction: normalized evidence segments
  clinicalFactExtraction->>sentenceFromFact: extracted facts and query
  sentenceFromFact->>buildExtractiveAnswer: completed sentences
  buildExtractiveAnswer->>buildExtractiveAnswer: suppress repeated entity prefixes
Loading

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Verification Claims ❌ Error PR summary says “Vitest, lint, formatting, runtime, and offline evaluation checks passed” without naming commands/results, violating the required verification wording. Revise any pass/fail claims to name the exact command/check and outcome, e.g. “Ran npx vitest run: 1464 passed / 0 failed” or “Not run: no node_modules.”
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 70.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: stripping bullet-glyph artifacts and redundant stitching from served answers.
Description check ✅ Passed The description follows the required template and includes substantive Summary, Verification, Clinical Governance Preflight, and Notes sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Generated And Sensitive Files ✅ Passed Changed files are only source/test TS files; no .env, logs, caches, node_modules/.next/build artifacts, or secret-pattern hits were found.
Risky Git Or Deployment Actions ✅ Passed PASS: The PR only changes source/tests; no new docs/workflows recommend force-push, reset, destructive cleanup, branch deletion, or deploy without confirmation.
Supabase Project And Schema Safety ✅ Passed PR only changes answer-formatting source/tests; no Supabase project refs, env examples, migrations, RLS, or policy files are touched.
Runtime And Package Manager Integrity ✅ Passed PR only changes source/tests; no edits to package.json, lockfile, or .npmrc. Repo still enforces npm@11.17.0, Node 24.x, and engine-strict.
Api Route Failure Handling ✅ Passed No API/server/provider integration code changed; the patch only tweaks extractive-answer formatting/tests, and the extractive path still fails closed on empty results.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/response-formatting-cleanup-b57a9c
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/response-formatting-cleanup-b57a9c

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba91a5eaed

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/lib/rag-extractive-answer.ts (1)

975-987: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Keep entity-prefix gating on one intent path. buildExtractiveAnswer() uses the routed queryClass to derive args.intent, but sentenceFromFact() recomputes intent from classifyRagQuery(query). When clinical mode overrides the class, the suppression check can use a different entity than the sentence builder. Pass the resolved intent/entity into sentenceFromFact() so both use the same source of truth.

🤖 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 `@src/lib/rag-extractive-answer.ts` around lines 975 - 987, Entity-prefix
suppression derives intent differently from sentence generation, causing
inconsistent behavior when clinical mode overrides the routed class. In
buildExtractiveAnswer(), derive the resolved intent/entity once and pass it
through sentenceFromFact() (and its callers) so queryTokenMatchesText and
sentence construction use the same source of truth instead of recomputing
classifyRagQuery(query).
🤖 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 `@src/lib/rag-extractive-answer.ts`:
- Around line 83-87: Restrict doseLabelColonPattern so it does not rewrite
non-heading phrases ending in common prepositions or verbs such as “to”, “by”,
“at”, “of”, “with”, “into”, “onto”, or “towards”. Update the label’s final-word
matching while preserving existing heading and dose matches, including the
mid-string “IR product:” case, and ensure the corresponding replacement logic at
the later use remains consistent.

---

Nitpick comments:
In `@src/lib/rag-extractive-answer.ts`:
- Around line 975-987: Entity-prefix suppression derives intent differently from
sentence generation, causing inconsistent behavior when clinical mode overrides
the routed class. In buildExtractiveAnswer(), derive the resolved intent/entity
once and pass it through sentenceFromFact() (and its callers) so
queryTokenMatchesText and sentence construction use the same source of truth
instead of recomputing classifyRagQuery(query).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63cdbfb2-aa9f-419f-81dc-38ccbb4607fa

📥 Commits

Reviewing files that changed from the base of the PR and between 405b09e and ba91a5e.

📒 Files selected for processing (9)
  • src/components/clinical-dashboard/display-text.ts
  • src/lib/rag-answer-text.ts
  • src/lib/rag-extractive-answer.ts
  • src/lib/smart-rag-api.ts
  • src/lib/source-text-sanitizer.ts
  • tests/extractive-answer-formatting.test.ts
  • tests/rag-answer-text.test.ts
  • tests/smart-rag-api.test.ts
  • tests/source-text-sanitizer.test.ts

Comment thread src/lib/rag-extractive-answer.ts Outdated
Review follow-ups for PR #469: the sub-bullet "o" converter now skips
blood-group/type contexts ("blood group o RhD negative" stays intact), the
dose-label copula rewrite no longer fires on preposition-ended phrases
("reduce dose to: 500mg"), and the lead-answer entity suppression derives the
entity exactly the way sentenceFromFact does so the gate cannot disagree with
the prefix it gates. Regression tests for all three.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4afc93513

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
…n form

"Do not use: o Pregnancy" previously dropped both fragments (heading was
stoplisted from merging) and "Avoid:" was rewritten into noun context ("For
avoid,"). Directive headings now merge with their items and keep the colon
form; the merge stoplist is boilerplate-only. Regression tests for both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33ecff7ab4

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

"blood type: o Rh positive" / "blood group: o Negative" now keep their
clinical O value; the lookbehind accepts an optional colon after group/type.
Regression tests added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 367ab0b8b3

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated
"Blood Group o RhD negative", "Blood Type: o Negative", and "BLOOD GROUP: o
Rh positive" now keep their clinical O value. Explicit case classes are used
instead of the i flag so the bullet "o" itself never matches a clinical
capital "O". Title-case and upper-case regression tests added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f502c5a78e

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
"Caution: o Pregnancy..." previously dropped the Caution heading (it was in
the merge stoplist), losing the caveat qualifier. The stoplist is now split:
structural labels (source/section/table/...) still never merge; advisory
labels (note/warning/caution/important/nb) merge with their items and keep
their colon form. Regression test added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 945ee11e31

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
Comment thread src/lib/source-text-sanitizer.ts Outdated
…mption

Digit-bearing schedule headings ("Day 1:", "Step 2:") now merge with their
bullet items so a dose is never presented without its day/step; structural
labels stay excluded. The sub-bullet "o" exemption is narrowed to genuine
blood contexts (a "blood group/type" label, or group/type followed by an
Rh/positive/negative value), so "patient group o Adults" and "risk group: o
Pregnant patients" convert normally. Regression tests for both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5df355325e

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated
"Day 1: o 25 mg nightly" and "o 12.5 mg twice daily" now normalize (the
lookahead accepts a numeric dose start); "37 o C" stays protected by the
not-after-a-digit lookbehind. Schedule-dose regression tests now assert the
artifact is gone rather than merely that context is attached.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9cbe15fae6

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated
Comment thread src/lib/rag-extractive-answer.ts Outdated
A chunk that begins with the bare "o" sub-bullet ("o 12.5 mg twice daily")
now normalizes via a string-start lookbehind alternative, with a leading
separator strip so the joiner never dangles. Lowercase OCR headings ("day
1:", "do not use:") now merge with their bullet items, sentence-cased so the
merged fact passes the lowercase-start quality gate. Regression tests added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo dismissed coderabbitai[bot]’s stale review July 11, 2026 02:53

Dismissed with repo owner approval: the single actionable finding (doseLabelColonPattern overreach) was fixed in f4afc93 with a regression test, the thread is resolved, and CodeRabbit re-reviews of subsequent commits raised no new actionable findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a811c6ace

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated
"Dose:\no Start 750 mg" now normalizes in break-preserving display paths via
a newline alternative in the lookbehind, with a line-leading separator strip.
Lowercase followers ("o pregnancy") remain unconverted by design: deleting a
genuine clinical "o" value is worse than the cosmetic artifact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b51def5a3

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ca4e052bf

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
"48-72 hours: o Restart clozapine at 12.5 mg" now keeps the time window on
the restart fact (heading grammar accepts digit/comparator-leading labels);
structural labels stay stoplisted. Regression test added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 943b3a1ff6

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
BigSimmo and others added 2 commits July 11, 2026 11:55
"K+ >5.5 mmol/L: o Withhold..." keeps the electrolyte threshold attached to
the action fact. Regression test added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion

Clinical threshold headings are too varied to enumerate character-by-
character (comparators, electrolyte +, degrees, micro signs), so any short
colon-terminated fragment with alphanumeric content and no sentence
punctuation now qualifies for the merge; the word cap and structural
stoplist still bound it. Degree/micro regression added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 918e45bb87

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
Comment thread src/lib/rag-answer-text.ts Outdated
…ullets

"Avoid: o 12.5 mg" stays "Avoid: 12.5 mg..." (directive/advisory labels skip
the copula rewrite), and bold markers come off before bullet normalization so
"o **Reduce dose**" converts. Regression tests for both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4ca48d9df

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
…toplist

"Source control: o Review antibiotics..." keeps its heading (infection-source
management, not a provenance label). Regression test added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db69e58318

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts
"o RhD negative" / "o Negative" at a string or line start are the blood
value itself, not a bullet item; an Rh/positive/negative follower at an item
start is now exempt. Regression tests added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35b529dcaa

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
Comment thread src/lib/source-text-sanitizer.ts
"Reference range: o 0.6-1.0 mmol/L" keeps its heading (lab evidence, not a
bibliography label), and ABO/Rh-qualified group/type labels count as blood
context so "ABO group: o Negative" keeps its O value while "risk group: o
Positive" still converts. Regression tests for both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4327729732

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
Comment thread src/lib/source-text-sanitizer.ts Outdated
The item-start blood exemption now requires the whole line to be the ABO
value ("o RhD negative"), so "o Positive symptoms require urgent review"
converts as the list bullet it is. The structural "section" stoplist word is
anchored to the label start, so "Caesarean section:" merges while
"Section 2:" stays excluded. Regression tests for both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1864308e0

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts
@BigSimmo

Copy link
Copy Markdown
Owner Author

@anthropic-code-agent[agent] Please resolve all open comments after fixing them

@BigSimmo
BigSimmo enabled auto-merge (squash) July 11, 2026 07:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 415ef60b28

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b20165e10

ℹ️ 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".

Comment thread src/lib/source-text-sanitizer.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a40156b72

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts Outdated
@BigSimmo
BigSimmo merged commit 6535520 into main Jul 11, 2026
14 of 15 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a252e7cd5

ℹ️ 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".

Comment thread src/lib/rag-extractive-answer.ts
@BigSimmo
BigSimmo deleted the claude/response-formatting-cleanup-b57a9c branch July 13, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants