Skip to content

feat: reference librarian — knowledge stage + ask() mode#151

Merged
rctruta merged 1 commit into
mainfrom
feat/reference-librarian
Jul 6, 2026
Merged

feat: reference librarian — knowledge stage + ask() mode#151
rctruta merged 1 commit into
mainfrom
feat/reference-librarian

Conversation

@rctruta

@rctruta rctruta commented Jul 6, 2026

Copy link
Copy Markdown
Owner

LIBRARIAN specialist (read-only reference desk: capsules + docs + catalog + projections; three closes). Librarian-first in run() = structural Finding-21 fix; ask() mode = the probe-the-lab use case (surface information, never execute; build-worthy → needs_experiment, caller decides). Live smoke: cheapest ladder model answered the quack question with 4 correct capsule ids + real published numbers, zero execution.

  • 38 orchestrator tests + 4 library tests green
  • Pre-push green
  • CI green (no --admin)

New LIBRARIAN specialist: read-only reference desk over the lab's
published knowledge — search_published_capsules, list_lab_docs /
get_lab_doc (README, FAQ, methodology docs, the generated experiment
catalog), plus the result projections. Three closes: FINAL ANSWER
(cited, from corpus) | HANDOFF: build reason=... | HANDOFF: impossible.

Wired twice:
1. Librarian-first in run() — structural fix for Finding 21 (0/5
   unprompted adoption: schema exposure doesn't bind, a stage does).
   Corpus-answerable goals terminate as "answered" before
   config_builder spends anything. Librarian failure falls through to
   build — a broken reference desk never blocks measurement.
2. ask() mode (multi_agent.py --ask) — the user-delegation use case:
   surface information without running the lab. Build-worthy questions
   return "needs_experiment"; the CALLER decides whether to spend.

Also: lab_docs logic + /v1/catalog/docs endpoints (progressive
disclosure: list names/titles -> fetch one, size-capped with stated
truncation; no path-traversal surface — names come from the listing).

Live smoke: gemini-2.5-flash in ask() answered "are there published
capsules measuring Quack?" with four correct capsule ids and the real
published overhead numbers (attach 2.7x@100K -> 4.9x@1M, pushdown
~1.9x). Zero execution.

Tests: 7 new (read-only desk pinned — no submit/template tools; three
closes parse; ask answers/routes without executing; run() answers from
corpus and skips build / proceeds on handoff / proceeds on librarian
failure); 6 older orchestrator tests updated for the librarian-first
sequence. 38 green + 4 library tests.
@rctruta rctruta merged commit da92a91 into main Jul 6, 2026
1 check passed
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.

1 participant