Phase 3: typed questions over a retrieved context (POST /api/v1/ask), TypeSafe judge adapter #5

Merged
k.renner merged 3 commits from feat/ask into main 2026-09-24 13:45:30 +00:00
Member

Judge port, first adapter. Wiki.Adapters.TypeSafe: System One client (jev-latest by default) for the three primitives, 429/529 retry with Retry-After, the 255-option Choice cap enforced before sending, empty criteria serialised as null (context ids), a missing API key reported at call time and on the status page rather than failing startup. JudgeContract suite in test/Wiki.Contracts, run over the adapter with a fake System One.

Ask use case (Wiki.Application.Ask): wiki_ask.py moved into the service. Rank every query, unite the top notes into one context (12k chars per document, 60k total, dropped notes reported), expand paragraphs/documents choices over the context ids plus NONE, add the _covered gate, judge each context choice in its own request and the rest batched, attach the answering paragraphs' text. Judgements and quotations, no prose.

API: POST /api/v1/ask with the scripts' JSON (queries, questions with noul/choice/score and the "paragraphs"/"documents" sugar, k, optional model and judge to pick registered adapters). Judges are declared under Wiki:Judges like embedding models and listed on the status page.

109 tests green. Needs Wiki__Judges__Models__typesafe__ApiKey in the cluster; that comes with the homelab bump.

🤖 Generated with Claude Code

**Judge port, first adapter.** `Wiki.Adapters.TypeSafe`: System One client (`jev-latest` by default) for the three primitives, 429/529 retry with Retry-After, the 255-option Choice cap enforced before sending, empty criteria serialised as null (context ids), a missing API key reported at call time and on the status page rather than failing startup. `JudgeContract` suite in `test/Wiki.Contracts`, run over the adapter with a fake System One. **Ask use case** (`Wiki.Application.Ask`): `wiki_ask.py` moved into the service. Rank every query, unite the top notes into one context (12k chars per document, 60k total, dropped notes reported), expand `paragraphs`/`documents` choices over the context ids plus NONE, add the `_covered` gate, judge each context choice in its own request and the rest batched, attach the answering paragraphs' text. Judgements and quotations, no prose. **API**: `POST /api/v1/ask` with the scripts' JSON (`queries`, `questions` with `noul`/`choice`/`score` and the `"paragraphs"`/`"documents"` sugar, `k`, optional `model` and `judge` to pick registered adapters). Judges are declared under `Wiki:Judges` like embedding models and listed on the status page. 109 tests green. Needs `Wiki__Judges__Models__typesafe__ApiKey` in the cluster; that comes with the homelab bump. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude-bot added 3 commits 2026-09-24 13:41:31 +00:00
IJudge over TypeSafe's System One API: serialises noul/choice/score
questions and the caller's state, retries 429/529 with Retry-After or
backoff to 30s, rejects Choice past the 255-option cap before sending,
and skips the request entirely for an empty question set.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rank every query, unite the top notes into one context under a per-document
and a total budget, expand context choices over paragraph or document ids
plus NONE, add the covered gate, judge context choices alone and the rest
batched, attach the answering paragraphs' text. A missing TypeSafe key is a
call-time error shown in status, not a startup failure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/ask
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
3357ee84be
k.renner merged commit 5a6cb8b15a into main 2026-09-24 13:45:30 +00:00
k.renner deleted branch feat/ask 2026-09-24 13:45:30 +00:00
Sign in to join this conversation.