Skip to content

Writer's indication pass: the disease on each entry (ADR 0053, decision 2) - #128

Merged
acarchidi merged 2 commits into
mainfrom
claude/elegant-newton-5sq66a
Nov 12, 2026
Merged

acarchidi merged 2 commits into
mainfrom
claude/elegant-newton-5sq66a

Conversation

@acarchidi

@acarchidi acarchidi commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

What changed (plain English)

This is the last step for indications: the disease now appears on each catalyst.

  • What the writer does. A new step in the writer, plain code with no AI, runs under the writer's own lock. For each catalyst that has no disease yet, it looks at the catalyst's latest try from the reading job (PR 127). It writes a disease only if that try found one, and only after re-checking:
    • the stored claim belongs to this catalyst;
    • the second model's confirmation is on file;
    • the MeSH disease is valid;
    • the words to be printed are in the claim's sentence;
    • the sentence is still word for word at its place in the stored press release, checked with the publish gate's own quote check.
  • What it writes. The disease and a change row citing the claim, so the disease's source sentence shows in the catalyst's sources like every other value.
  • Holds and limits.
    • A row that fails any check is held on its own, and the others are still written.
    • It never changes a disease already set.
    • A later refusal always wins over an earlier find.
  • What readers see. The press release's own wording, for example "melanoma", not the official MeSH name. If the stored words were ever not in the sentence, the site shows the MeSH name instead.
  • When it runs. On the weekday extract run, right after new catalysts are published. That run asks both models about them, then writes the confirmed diseases. catalyst publish-claims runs the writing step too.
  • If the indication step fails. Its own summary says so and the run turns red. Every earlier summary still prints, and finds from earlier runs are still written.
  • Cost. No workflow, role, or spending-cap change. The models spend under the existing daily caps, about half a cent per catalyst. The MeSH file is read only when there is a catalyst to ask about.

Roadmap item and checkpoint

Phase 7, "Facts on every entry" → "Indication" → "The writer", step 3 of 3, ticked here. Leads to CP7b. The parent "Indication" item stays open until the first live run shows its coverage.

How it was tested

  • 17 new test cases.
  • 9 for the writing step, on a test database with the models faked:
    • a confirmed disease is written and shown in the sentence's own word, with that sentence as its source;
    • a second pass writes nothing;
    • a later refusal wins;
    • a missing confirmation holds it;
    • a missing stored copy holds it;
    • two catalysts with one disease share one disease row;
    • a try that points at another catalyst's claim is held;
    • words not in the quote are never written;
    • one bad row is held while the other is written.
  • 5 for the reading job: the MeSH file is not read when there is nothing to ask; a MeSH file that cannot be read blocks the run without asking a model, in four ways it can fail.
  • 3 for the command line: a failing reading step still prints every summary, still writes, and fails the run; nothing is asked when publishing did not finish; a limit below 1 is refused.
  • The command, API, and indication tests: 1,211 passed. CI runs the full suite. Lint, strict types, and the pre-commit hooks pass.

Risks

  • First live run. This is the first time an indication can reach the site. The first weekday run after merging will ask about every published single-drug catalyst, up to the run's limit of 50. I'll read its summary and report the coverage.
  • Holds. A held disease is counted in the run's summary and log, not yet on the review-queue page, which is its own roadmap item.
  • Mismatched page readings. A press release that the two page readers see differently never gets a disease.
  • Review. Separate Opus review, round 1 on 954a5a8, was BLOCKING. A storage error while reading the MeSH file could crash the whole run and lose its summary. That is fixed here, along with three smaller points. Round 2 is running.

Existing tests edited:

  • tests/test_cli.py gains one automatic stand-in fixture for the two new steps, in the same style as its five other database-job stand-ins. No assertion changed.
  • tests/extract/test_indicate.py helpers were renamed from private to public names so the new test file can reuse them. No assertion changed.

Needed from the owner

Nothing.

Checklist

  • Tests written before the code for any logic
  • No existing test loosened (or the reason is explained above)
  • Docs, data dictionary, and roadmap ticks updated
  • ADR added for any decision the spec leaves open (ADR 0053, decision 2)
  • No secrets in code, logs, fixtures, or this description
  • Touches verification, publish gate, auth, billing, or migrations? Then reviewed with Opus (round 2 running)

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZBSRQTWBsnjC6tv6a2PDo

…med try (ADR 0053)

catalyst.publish.indication, under the writer's lock: for each catalyst
with no indication, it takes the latest indication_attempt; only when
that try found one, it checks the claim is the catalyst's own, the second
reader's pass is stored, and the quote still matches its stored copy
(gate.match_quote), then sets indication_id (one indication row per MeSH
disease) and writes a change row citing the claim. A later refusal wins
over an earlier find; an indication already set is never changed.

The read API names the indication in its claim's own words, not the MeSH
name. The weekday extract run asks both readers about newly published
catalysts right after the writer, then runs the pass; publish-claims runs
the pass too. No workflow, role, or cap changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZBSRQTWBsnjC6tv6a2PDo
…he words

Separate Opus review of 954a5a8: a storage, hash, or parse error while
reading the MeSH file escaped the extract command and lost every earlier
summary. The job now reports such an error as a blocked run, reads the
file only when there is a catalyst to ask about, and the extract chain
runs the readers and the writer's pass as separate steps, so finds kept
by earlier runs are still written when the readers fail; any failure
still turns the run red. Also: the writer holds an indication whose words
are not in its quote, or whose MeSH values are invalid, on its own
instead of failing the pass; the read API falls back to the MeSH name
when the words are not in the cited quote; extract-catalysts refuses a
--limit below 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZBSRQTWBsnjC6tv6a2PDo
@acarchidi
acarchidi marked this pull request as ready for review November 12, 2026 18:20
@acarchidi
acarchidi merged commit 3cf7195 into main Nov 12, 2026
7 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Overseer: did not finish

The overseer's answer could not be used (the answer is not JSON), so nothing was done. Re-run the check.

@github-actions

Copy link
Copy Markdown
Contributor

Claude review: did not finish

The reviewer returned no usable result. Re-run the check.

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