feat(facts): one text box; the drafter turns a statement into a raw source #12

Merged
k.renner merged 1 commits from feat/fact-from-statement into main 2026-09-25 06:57:05 +00:00
Member

Replaces the form from #11 with what was asked for: one text box. You write "Alle Räume im Erdgeschoss haben Fußbodenheizung außer die Garderobe", the model turns it into a fact, and it is recorded.

  • Port IFactDrafter: FactStatement (text, who, when) → FactDraft (title, content, tags). Sees only the statement.
  • Anthropic AnthropicFactDrafter over the same Messages transport as the answer model (extracted into MessagesTransport, no behaviour change). Prompt asks for one JSON object in the statement's language, faithful restatement, no additions, English slug tags. FactDraftPrompt.Parse tolerates surrounding text and fences, normalises tags, rejects replies without title or content. Registered per Wiki:AnswerModels entry under the same key, so the same config and key serve both ports.
  • Use case RecordStatementUseCase: draft → RawSource with source: stated by <user> on <date> via the wiki, body = restatement plus the statement verbatim in a quote block → DepositFactUseCase. Empty input never reaches the drafter.
  • Page /facts: text box, Record, then the recorded title, content, tags and a link to the raw page. Still needs the Authentik sign-in for attribution.
  • Contract suite FactDrafterContract (3 tests) run against the Anthropic adapter over the fake server, plus parse tests; 3 use-case tests. Full suite 137 green.

🤖 Generated with Claude Code

Replaces the form from #11 with what was asked for: one text box. You write "Alle Räume im Erdgeschoss haben Fußbodenheizung außer die Garderobe", the model turns it into a fact, and it is recorded. - **Port** `IFactDrafter`: `FactStatement` (text, who, when) → `FactDraft` (title, content, tags). Sees only the statement. - **Anthropic** `AnthropicFactDrafter` over the same Messages transport as the answer model (extracted into `MessagesTransport`, no behaviour change). Prompt asks for one JSON object in the statement's language, faithful restatement, no additions, English slug tags. `FactDraftPrompt.Parse` tolerates surrounding text and fences, normalises tags, rejects replies without title or content. Registered per `Wiki:AnswerModels` entry under the same key, so the same config and key serve both ports. - **Use case** `RecordStatementUseCase`: draft → `RawSource` with `source: stated by <user> on <date> via the wiki`, body = restatement plus the statement verbatim in a quote block → `DepositFactUseCase`. Empty input never reaches the drafter. - **Page** `/facts`: text box, Record, then the recorded title, content, tags and a link to the raw page. Still needs the Authentik sign-in for attribution. - Contract suite `FactDrafterContract` (3 tests) run against the Anthropic adapter over the fake server, plus parse tests; 3 use-case tests. Full suite 137 green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude-bot added 1 commit 2026-09-25 06:55:46 +00:00
feat(facts): one text box; the drafter turns a statement into a raw source
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
8b8e56d1b2
IFactDrafter port: a statement in, title/content/tags out. Anthropic
implements it over the transport the answer model already uses (extracted
into MessagesTransport). RecordStatementUseCase drafts, sets the person as
source, keeps the statement verbatim in the body and deposits through the
existing use case. The Facts page is the text box and the receipt; the API
shape for machines is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
k.renner merged commit 125911a4e6 into main 2026-09-25 06:57:05 +00:00
k.renner deleted branch feat/fact-from-statement 2026-09-25 06:57:05 +00:00
Sign in to join this conversation.