Skip to content

fix: render lists, bold and links in articles, and stop blocking bank-verified claims - #163

Merged
snowopsdev merged 13 commits into
mainfrom
fix/content-scoring
Nov 10, 2026
Merged

snowopsdev merged 13 commits into
mainfrom
fix/content-scoring

Conversation

@snowopsdev

Copy link
Copy Markdown
Owner

The style guide asks the writer for lists, bold text and links, but the converter only understood headings, so readers saw raw - item, **term** and [text](url) on published pages. Some scoring rules also blocked articles that were correctly sourced. This PR addresses the open audit findings for content and scoring.

Rich text. One shared, dependency-free converter (cms/src/lib/richText.ts) now handles headings, lists, quotes, bold, italic, inline code and links (http(s) and site-relative only). The public page renders it escaped. QA, reading time and phrase matching read it back as plain text, and template fields read it back as markdown. The generate prompt names exactly this subset.

Scoring.

  • A first-party claim that the evidence bank verifies no longer triggers the FIRST_PARTY_MEASUREMENT_PRESENT block.
  • Source-class suggestions are capped at secondary.
  • [F<n>] / [R<n>] count as evidence markers only when the bank has that ref. The generate stage now passes the bank in, and citation excerpts are stored as plain text.
  • A judge entry with no numeric internalDuplicateProbability is refused.
  • Range bounds (5-10%, $5-10) take the range's kind and still match everything main matched. Compound word numbers (twenty-five) read as one amount.

Proof: typecheck and lint clean; pipeline 920/920; CMS integration 862/862 after rebasing on main. Each fix has a test that failed before it.

Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol. Sol verdict: approved

Created with Claude Opus 5.5 (implementer subagents Claude Opus 5.5 and Claude Sonnet 5.5) in Claude Code.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: db933d8a-cc12-4139-a494-d76ea7e20c08
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T07:01:08.104545Z 24c39b4 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread cms/tests/int/richText.int.spec.ts Fixed

@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: 89cc305bcb

ℹ️ 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 cms/src/lib/richText.ts Resolved
@snowopsdev

Copy link
Copy Markdown
Owner Author

Note

🤖 Claude Opus 5.5 responding on behalf of snowopsdev

@codex review

24c39b4 changes cms/src/lib/richText.ts to fix the adjacent-delimiter finding, so please check that commit.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 24c39b49f1

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

snowopsdev and others added 13 commits November 10, 2026 02:01
…ticle bodies

One shared Markdown<->Lexical module (cms/src/lib/richText.ts) replaces the
duplicated converters. The writer's lists, bold, italic, code, quotes and
http(s)/site-relative links now become real Lexical nodes, the public page
renders them with an escaped URL allow-list, and the readers emit one line per
list item and line break so QA text no longer runs words together. The writer
prompt names the supported subset.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Also fixes the rich-text round-trip test setup and a stale lint directive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A line of unclosed `*` or `_` openers rescanned the rest of the line once per
opener: quadratic, reachable from a template save or the writer's output
(120 KB took 18 s). Remember where a closer search already failed. The CMS
`lexicalToPlainText` returns plain words again (reading time and the
banned-phrase scan read it); the template textareas use the new
`lexicalToMarkdownText`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A first_party_measurement claim that firstPartyOutcome verified against a
bank entry the draft cited now carries qualitySource 'evidence-bank', and
decidePolicy no longer emits FIRST_PARTY_MEASUREMENT_PRESENT for it.
Unbacked first-party claims are still blocked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A verifier rubric guess of primary or official_docs is now suggested as
secondary, so accepting a Source review suggestion unchanged can no longer
create a floor-clearing rule from a model guess.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as them

evidenceRefsIn and stripEvidenceRefs take an optional { bank }. With it,
[E<n>] is always a marker (a hallucinated [E9] still reaches QA as
unknown), while [F<n>] and [R<n>] are markers only when that ref exists in
the bank; otherwise ordinary prose like "[F5]" is left untouched. Without
the option the behaviour is unchanged until generate.ts passes the bank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ility

The judge prompt requests the field in every call, so a missing or
non-numeric value is refused like duplicateProbability instead of being
read as 0, which hid internal duplicates from review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers as one amount

5-10% now reads as two percents and $5-10 as two currency amounts, so they
match 5% to 10% and $5 to $10. The re-kinded bound is flagged
alsoBareNumber and still matches whatever the bare number matched, and
anchors are chosen with the bare reading, so matching only gains.
Tokenisation is unchanged; only two shapes are relabelled, and years,
signed numbers, figures glued to letters, suffixed amounts, to-ranges and
spaced em dashes read as before.

twenty-five and twenty five read as 25 rather than 5 (or as a 20-5 range).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The passage still quoted an `EVIDENCE_RULES` constant that said Datum has no
first-party data. Describe `evidenceRules` with and without a bank, the
evidence-bank section, and when the rules appear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bank-aware marker rule had no effect in real runs: the generate stage
still called the readers without the bank, so "[F5]" and "[F12]" in prose
were stripped and recorded. Pass the workspace's bank to every reader and
stripper, label the new evidence-bank quality source on the review page,
regenerate the policy field's description, and document the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scoring matches a citation's excerpt against the body read back as plain
text, so a cited sentence carrying a link or bold never matched and a
bank-backed measurement stayed blocked. Read each excerpt through the shared
converter before storing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ape test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aved again

Neighbouring text nodes with different marks were written as
`**Bold***italic*`, which the parser reads as literal asterisks, so a
second save of a template corrupted it. Join neighbours that share marks,
and write the italic side with `_` where two `*` runs would touch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snowopsdev
snowopsdev merged commit 9885af7 into main Nov 10, 2026
13 checks passed
@snowopsdev
snowopsdev deleted the fix/content-scoring branch November 10, 2026 07:09
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