pediatric-ai-scribe-v3/migrations
Daniel 1270899dcb
Some checks failed
Forgejo Android APK / Root app tests (push) Successful in 46s
Forgejo Docker Build / Root app tests (push) Successful in 47s
Forgejo Android APK / Build signed APK (push) Successful in 1m56s
Forgejo Docker Build / Build Docker image (push) Successful in 18s
Forgejo Docker Build / Deploy to the host (push) Failing after 0s
feat: PubMed search for My Resources, and an image tool that actually fires
PubMed joins web search as an optional source for a generated resource: a
literature search on the topic, with abstracts, cited by PMID in References.
Off by default, admin-enabled, with its own optional API key (NCBI raises the
rate limit from 3/sec to 10/sec; it works without one).

Neither search is a tool any more, and that is the point. Offering them as
function calls meant the model decided whether to search, and with a prompt
ending "Output ONLY Pandoc markdown" it decided not to — every time, with and
without corpus grounding, no matter how the tool description was worded.
Calling callAI with the tool directly produced a correct pubmed_search call, so
the plumbing was never the problem. The search only ever needed the topic, and
the route knows the topic before it calls the model, so both searches now run up
front and their results go into the prompt as findings, exactly the way corpus
excerpts do. Ticking the box now means the search happened.

Verified live against deepseek-v4-flash: 30 corpus excerpts and 6 PubMed
results, and a References slide carrying both the library sources and four real
PMIDs (29562151, 38506440, 35721052, 28814254).

Three fixes to illustration, which had never once fired:

- The dispatch call had been lost in a refactor. The tool was still offered, the
  model still called it, and the call was dropped, so no job was ever enqueued.
- imageContext was passed as a bare topic string where dispatch expects
  { request, history }, which made the bound request undefined.
- The prompt never mentioned the tool existed while explicitly demanding only
  markdown — the same suppression that killed the searches. It now says an
  illustration is available and that calling it is not a violation of that rule.

my_resources is its own image workflow rather than a reuse of learning_hub,
because generated_image_links only accepts learning_hub assets, and that is
exactly the barrier that keeps a private illustration out of published content.
The illustration renders in the panel, rather than a toast pointing at an image
history this feature does not have.

Verified end to end: job queued, rendered, and the asset served to its owner as
a correctly labelled subglottic-anatomy teaching diagram.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
2026-09-11 16:47:08 +02:00
..
1744600000000_example-no-op.js
1744650000000_add-encounter-version.js
1777003849000_add-personal-notes.js
1777090000000_notes-trash.js
1777507197626_add-mermaid-diagrams.js
1777600000000_add-clinical-assistant-chats.js
1777700000000_add-prompt-revisions.js
1777800000000_generated-images.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
1777900000000_image-context.js feat: integrate durable image jobs/private assets into current core 2026-09-07 16:53:42 +02:00
1780000000000_drop-model-classification.js fix: separate Scribe/Clinical/Learning prompt sections; drop model classification entirely with scrub migration 2026-09-07 18:22:51 +02:00
1780100000000_registration-invites.js feat: invite-only registration 2026-09-10 23:12:07 +02:00
1780200000000_citation-audit.js feat: citation quality tracking, and the SSO settings fit a phone 2026-09-10 23:44:43 +02:00
1780300000000_user-resources.js feat: My Resources — anyone can generate teaching material, privately 2026-09-11 14:50:54 +02:00
1780400000000_my-resources-images.js feat: PubMed search for My Resources, and an image tool that actually fires 2026-09-11 16:47:08 +02:00