37 Commits
Author SHA1 Message Date
CatoandClaude 380a31be95 Quick check reads PDFs; a scored deadline eval set; docs truth (#183)
* feat(intake): PDF on the quick check, and a deadline eval set

- /api/extract-pdf reads a PDF's text layer on the server (unpdf, %PDF magic
  check, 10 MB, 10 pages, text capped at MAX_TEXT). Nothing stored or logged.
  Scans answer scanned_pdf; the page then offers the photo picker.
- One file input takes a PDF or photos; the text flows into the letter box and
  the existing redaction and analyze path. Messages in en, de, fr, it.
- eval/letters: 17 synthetic Swiss letters (de, fr, en) with expected
  deadlines; eval/pdf: text and image-only PDFs; `pnpm eval:deadlines` scores
  stored replies offline, or live with --url on the free chain.
- Docs: README quick-check/matter line, ROADMAP ticks, CHANGELOG 2026-12-02,
  .env.example host path.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(eval): optional private letter set, scored separately

--private <dir> / CAUSIUS_EVAL_PRIVATE_DIR (default
/opt/causius/shared/eval-private). Absent: "private set: not present,
skipped". Present: "private: N/M (x%)" and pass/fail by position only; no ids,
names, quotes or dates are printed. eval-private/ and eval/private/ ignored.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(eval): precision, recall and false-invention rate; answer key for the private set

Most letters correctly have no deadline, so each is scored true negative,
false invention, true positive, miss or wrong date. Ranges accept any date in
them. Private set reads answers.json and letters/*.txt and prints only counts,
metrics and pass/fail by position. Four more synthetic traps: open-ended
suspension risk, amount with no date, spend-cap reset, 2-3 working days.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-03 01:55:56 +01:00
CatoandClaude e90a1ad6f4 Work for yourself, whatever your permit: a workflow, and a place chosen by the link (#182)
A new workflow for someone whose residence status may limit self-employment
or founding a company: the agent researches, with cited provisions, what this
status may do and what each route needs, sets out every lawful way to reach
the actual goal (earn, invoice, pay tax, comply), never one that breaks the
law, and names the provision that closes a route where none is open, so it
can be changed.

/matters?in=CH-ZH chooses the place, so a place's page on Solon can open a
matter already set there. Only a code the picker offers is taken.


Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-01 13:06:01 +01:00
Cato df5a2bd1d9 Help people resolve everyday disputes (#179) 2026-11-20 05:14:53 +01:00
CatoandClaude 53400228b0 chore(deps): @bitbaum/ai-kit 1.26.0: Google out of the free AI chain (#147)
ai-kit <=1.25 put Google's Gemini API in the free model chain on the
fleet-wide GEMINI_API_KEY. That key sits on a billed Google project and
cost about $567 on 10-11 Nov 2026. 1.26 builds no Google link (free chain
is Groq, then OpenRouter :free), keeps paid AI off unless an app opts in,
and adds daily caps.

- the freeAvailability test now pins that a Gemini key switches nothing
  on, and that Groq comes before OpenRouter
- README, live-check warning and the live check's comments no longer name
  GEMINI_API_KEY as a free key


Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-13 10:06:56 +01:00
CatoandClaude 5710d86b3e chore(deps): bip-kit, limitkit, ai-forms and threadkit from the @bitbaum scope (#143)
Owner, 2026-11-06: the fleet's packages belong under the @bitbaum npm
organization (fleet docs/package-scope-migration-plan.md). Same code and
versions; dependency keys and import specifiers moved with
scripts/packages/rename-package.mjs from fleet.


Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 11:17:49 +01:00
CatoandClaude Opus 5.5 b405b49ae7 feat(auth): account mail through AccountKit's shared mailer, with the sign-in code (#132)
* feat(auth): account mail through AccountKit's shared mailer, with the sign-in code

The account mails stay this app's own words, in the reader's language, with
HTML: the template is handed to createAuthMailer({ render, codes: true })
(AccountKit 0.26.1). The shared mailer checks the link's origin, skips
addresses that cannot receive mail and puts a six-digit code in the sign-in
link's email, which the template prints ("On another device? Type this
code ..."). The sign-in page then offers the field for it.

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

* chore: keep main's AccountKit 0.27.0 (the merge had lowered it)

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-03 02:01:27 +01:00
CatoandClaude Fable 5.1 4b74d8af64 fix(ask): in a group, keep to the law and hand the rest over (#103)
* fix(ask): Swiss non-compete stays Swiss; no decision chips

Found through the OrangeCat bots list on 2026-10-31: asked whether a
24-month non-compete was enforceable, Causius said the employer "must pay a
third of the salary" for the restriction. That is §74 HGB, German law; under
OR 340 to 340c a Swiss post-employment non-compete needs no compensation to
be valid. The prompt now says so, and says never to carry another country's
rule into a Swiss answer (a court may narrow an excessive clause, OR 340a,
and reduce a disproportionate penalty, OR 163).

The same answer offered "Sign as written" as a one-tap reply under a clause
it had just called excessive. The prompt says a reply suggestion is a
question or a step to understand or negotiate, never a decision for the
reader; `withoutDecisions` drops such a chip whether or not the model
listens.

Tests: the clause from the live test as a fixture; the chip filter end to
end and on its edge cases.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(ask): in a group, keep to the law and hand the rest over

Seen twice on OrangeCat's bots list (2026-10-31): in a room with
Diplodoctor, asked whether a sick employee even needs to see a doctor for
a cold, Causius answered the medical half itself. The rule now says: when
a scene names other members, answer only the part that is law and hand a
medical, tax, technical or other part to the member whose job it is, by
its @handle, without answering it even briefly. Fixture test with a room
scene.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 05:59:59 +01:00
CatoandClaude 8328bd71d7 fix(ask): Swiss non-compete stays Swiss; no decision chips (#100)
Found through the OrangeCat bots list on 2026-10-31: asked whether a
24-month non-compete was enforceable, Causius said the employer "must pay a
third of the salary" for the restriction. That is §74 HGB, German law; under
OR 340 to 340c a Swiss post-employment non-compete needs no compensation to
be valid. The prompt now says so, and says never to carry another country's
rule into a Swiss answer (a court may narrow an excessive clause, OR 340a,
and reduce a disproportionate penalty, OR 163).

The same answer offered "Sign as written" as a one-tap reply under a clause
it had just called excessive. The prompt says a reply suggestion is a
question or a step to understand or negotiate, never a decision for the
reader; `withoutDecisions` drops such a chip whether or not the model
listens.

Tests: the clause from the live test as a fixture; the chip filter end to
end and on its edge cases.


Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 19:43:33 +01:00
CatoandClaude Fable 5.1 13d9c9eb02 feat(ask): take the caller's scene, the setting a question is asked in (#96)
* feat(ask): serve the fleet bot contract at /api/ask

Causius joins group chats in OrangeCat's companions home over the same
contract Diplodoctor already serves: POST /api/ask with messages, a
locale and an optional BYOK key, answering with text and reply chips.
Legal information, not advice; free links from the analyzer; rate
limits askFree (30/h) and askOwn (200/h) in lib/limits.ts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(ask): take an attached document as context

OrangeCat's companions home now lets a person attach a text file or a PDF
in a chat with Causius; the file arrives as `context`, the same field and
cap Diplodoctor's contract has. It is put in the system turn as data to
answer about, with the instruction never to follow instructions inside it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(ask): Causius answers under Swiss law unless told otherwise

Asked about a Zahlungsbefehl with no country named, Causius described the
German Mahnverfahren (found 2026-10-30 in OrangeCat\x27s companions home).
Causius is Swiss: the prompt now says the law that applies is Swiss law,
federal and cantonal where it matters, and that a letter is read as a
Swiss one, unless the person says they are elsewhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(ask): take the caller\x27s scene, the setting a question is asked in

In OrangeCat\x27s companions home Causius sits in a group chat with other
companions, and its rules live here, not there. Without being told who
else is in the room, Causius wrote Diplodoctor\x27s answer inside its own
line (found 2026-10-30). `scene` (up to 1,000 characters, written by the
caller) is put after the rules and before the document, and cannot change
the rules. The same field Diplodoctor\x27s contract takes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 12:32:49 +01:00
CatoandClaude Fable 5.1 29426791e4 fix(ask): Causius answers under Swiss law unless told otherwise (#93)
* feat(ask): serve the fleet bot contract at /api/ask

Causius joins group chats in OrangeCat's companions home over the same
contract Diplodoctor already serves: POST /api/ask with messages, a
locale and an optional BYOK key, answering with text and reply chips.
Legal information, not advice; free links from the analyzer; rate
limits askFree (30/h) and askOwn (200/h) in lib/limits.ts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(ask): take an attached document as context

OrangeCat's companions home now lets a person attach a text file or a PDF
in a chat with Causius; the file arrives as `context`, the same field and
cap Diplodoctor's contract has. It is put in the system turn as data to
answer about, with the instruction never to follow instructions inside it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(ask): Causius answers under Swiss law unless told otherwise

Asked about a Zahlungsbefehl with no country named, Causius described the
German Mahnverfahren (found 2026-10-30 in OrangeCat\x27s companions home).
Causius is Swiss: the prompt now says the law that applies is Swiss law,
federal and cantonal where it matters, and that a letter is read as a
Swiss one, unless the person says they are elsewhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 11:30:46 +01:00
CatoandClaude Fable 5.1 a9f927034c feat(ask): take an attached document as context (#91)
* feat(ask): serve the fleet bot contract at /api/ask

Causius joins group chats in OrangeCat's companions home over the same
contract Diplodoctor already serves: POST /api/ask with messages, a
locale and an optional BYOK key, answering with text and reply chips.
Legal information, not advice; free links from the analyzer; rate
limits askFree (30/h) and askOwn (200/h) in lib/limits.ts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(ask): take an attached document as context

OrangeCat's companions home now lets a person attach a text file or a PDF
in a chat with Causius; the file arrives as `context`, the same field and
cap Diplodoctor's contract has. It is put in the system turn as data to
answer about, with the instruction never to follow instructions inside it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 10:52:56 +01:00
CatoandClaude 85f153538c feat(ask): serve the fleet bot contract at /api/ask (#89)
Causius joins group chats in OrangeCat's companions home over the same
contract Diplodoctor already serves: POST /api/ask with messages, a
locale and an optional BYOK key, answering with text and reply chips.
Legal information, not advice; free links from the analyzer; rate
limits askFree (30/h) and askOwn (200/h) in lib/limits.ts.


Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 09:47:40 +01:00
Cato ed4288cecd fix(auth): adopt shared account forms and recovery (#51)
* fix(auth): adopt shared account forms and recovery

* fix(auth): use released all-method second-factor protection
2026-10-26 05:34:47 +01:00
CatoandClaude 9eadeddd8c feat(law): the agent finds the law by what it says, from Solon (#49)
Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-24 07:28:40 +02:00
CatoandClaude b3ce74d3ee feat(law): the agent reads the law from Solon first (#48)
Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 11:11:42 +02:00
CatoandClaude 38710b13fe fix(agent): answers come in the reader's language; PGlite setup gets 30 s (#45)
An English question was once answered in German after the agent read
German statutes. answer-check now reads which language an answer is
plainly in (function words, quoted text left out, 40 words or more) and
sends one in another language than the reader's back, to be written
again with its facts and citations.

Test setup: a cold machine starting every file at once took PGlite past
vitest's 10 s hook default and failed whole files without a test run.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 19:26:17 +02:00
CatoandClaude Opus 5.5 6cf21ce9e7 feat(agent): read the law of all 26 cantons through LexFind (#44)
* feat(agent): read the law of all 26 cantons through LexFind

lib/law/lexfind.ts finds a cantonal act by abbreviation (StG), systematic
number (631.1) or title through LexFind's public API (Institute of
Federalism, University of Fribourg), reads the canton's official PDF
with unpdf, drops repeated page headers, rejoins hyphenated words and
cuts out one § or Art., stopping at the next heading but not at a
reference to it. The source link is the canton's own page.

read_law reads a non-federal act from the matter's canton, or from one
named with the new canton field. Checked live: ZH StG § 140, BE StG
Art. 187, VD LI Art. 1 (and LU, GE by hand).

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

* fix(agent): a runaway reply runs 8 calls, a turn 12 law reads; point the agent at read_law

Agent check on d13d436: one model reply asked for read_law ~150 times and
the turn failed; in the tax case the model searched instead of reading
Zürich's StG and answered too late to be corrected.

- One reply runs at most 8 tool calls; the rest, and any exact repeat,
  are answered 'not run' so the model can ask again.
- Per turn: read_law 12, web_search 8, read_page 8 (with the writes).
- The Swiss and Liechtenstein market notes now tell the agent read_law
  reads federal, cantonal and Liechtenstein acts, with an example.

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

* fix(agent): keep the turn's real answer when a correction ends in a call note

Agent check on 51ac8c7: the tax answer (a table with the deadline) was
flagged for narrating a call; two corrections later the last reply was
only '(called add_task)', so the person saw 'could not finish' although
the deadline was recorded. The turn now keeps its best real answer,
narration removed, and stores that when the last reply has nothing.

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

* fix(agent): a turn never ends with nothing; cantonal letters mean the canton's act

Agent check on 2a4221e: the tax turn's only reply came in round 6, too
late for a correction, and was just '(called note_fact)'; the deadline
was recorded but the person saw 'could not finish'. Such a turn now gets
one more round without tools, to answer in words.

The model also never read Zürich's StG: the matter's canton was set
mid-turn, after the jurisdiction note was written. The system prompt now
says a cantonal authority's letter rests on the canton's own act, to be
read with read_law.

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

* fix(agent): a turn with no answer gets one rescue round, by another model

Agent check on 4126c2e: the agent now reads Zürich's StG, but the
tool-less last round was answered by a text-protocol model with a TOOL
line, so the person saw 'could not finish'. A turn that has produced no
real answer at all now gets one more round, past the limit if need be,
by the next model in the chain, told that tools are gone and to answer
in words from what they returned.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 18:59:29 +02:00
CatoandClaude d9dfb24089 feat(agent): read Liechtenstein law from gesetze.li; one read_law per country (#40)
lib/law/lilex.ts reads one provision of a Liechtenstein act from Lilex,
the Government's consolidated collection: art:n and par:n anchors, a
provision ending at the next provision or heading, a link scrolled to
it. Lilex has no API and puts its listings behind a browser proof-of-
work, so acts come from a map checked against the live pages (LV, ABGB,
SR, PGR, ZPO, StGB, StPO, LVG, AuG, SteG, ArG), and a challenge page is
reported as unreachable with one polite retry, never parsed as law.

lib/law/index.ts picks the collection by the matter's country first
(StGB and ZPO exist in both) and follows update_matter during the turn.
A country is added by giving it a reader there.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 18:16:27 +02:00
CatoandClaude af0757a737 feat(agent): read Swiss federal law from Fedlex, no search engine needed (#36)
A read_law tool: an act by abbreviation (OR, ZGB, SchKG, DBG, AIG, CO,
CC, LP…, all three official languages) or SR number, and an article.
lib/law/fedlex.ts asks Fedlex's open SPARQL endpoint which consolidated
version applies today, fetches its HTML from the official file store and
cuts out the article (paragraph numbers kept, footnote markers dropped).
The text comes back with its Fedlex link as a numbered source.

Free and on our side of the wire, so the agent can source federal law
while web search is down; an unsourced answer is corrected toward
read_law, and stored unverified only when Fedlex is unreachable too.
live/law.live.ts (pnpm run check:law) reads real articles and checks
that every SR number in the abbreviation map is a real act.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 11:08:38 +02:00
CatoandClaude 6be9aa9470 feat(matters): open a quick check as a matter in one tap (#34)
The quick check lived only in the browser; its next step was retyping.
Now a card under the deadline opens it as a sealed matter: the deadline
item with the sentence it was read from, the letter as the first
document, the draft reply as a draft, the place read from the check's
words (jurisdictionFromText: cantons by any of their names, markets
only), and every value the check hid from the model as a word to hide.
Signed out, the button goes through sign-in and back to the check.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 10:18:33 +02:00
CatoandClaude Opus 5.5 1efd80ab5c feat(matters): ask the same questions of every document (#33)
* feat(matters): ask the same questions of every document

Up to three questions across a matter's documents, answered as a table
with each answer's quoted passage. A quote not found in the document is
dropped, never shown. The table is saved as a draft. Personal data is
redacted before the model sees it and restored after.

Also: a one-letter account name no longer makes matter creation fail
(wordsToHide trims and drops words shorter than two letters).

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

* fix(agent): a deadline given in the answer must be recorded

The real-model Agent check saw the model compute the tax objection
deadline correctly (4 November 2026) and never call record_deadline, so
no reminder was set. An answer naming a deadline date while the matter
holds none now gets the one correction, like a narrated call.

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

* fix(agent): a model that writes its calls out hands the retry on

Agent check run on b33cf5d: a text-protocol model in the free chain wrote
update_matter and note_fact as JSON blocks and, corrected, answered
'(called web_search, web_search)'. Correcting the same model with no
format to use cannot work. Now a narrated answer moves the serving link
to the back of the chain for the rest of the turn, and the correction
alone carries TEXT_TOOL_PROTOCOL_HINT (in the system prompt it broke the
native callers). Calls written as JSON naming the tool count as narrated.

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

* fix(agent): narration left after the correction is never stored

Agent check on 7decfe8: the final round offers no tools, so a text-protocol
model's TOOL lines there were never parsed and became the stored answer;
a bare '(called note_fact)' was stored likewise. Such an answer is now
stripped of TOOL lines, call notes and fenced JSON naming a tool; if
nothing remains, the existing 'could not finish' message is shown. The
live test logs which model served each turn.

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

* fix(agent): two corrections, each answered by the next model

Agent check on 8639cc8: groq gpt-oss-20b computed the tax deadline,
was told to record it, and answered again without recording it; the
rent answer claimed '(recorded)' with nothing recorded. A model that
ignored the rule ignores its correction too. Every correction now moves
the serving link to the back of the chain, and a turn gets up to two.

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

* fix(agent): eight rounds, so a late answer can still be corrected

Agent check on 8f903eb: qwen3.8-27b researched for four rounds, its
answer arrived too late for a correction, and the final tool-less round
produced only narration, so the person saw 'could not finish'.

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

* test(live): trace every round of a real-model turn

runTurn takes an optional onRound callback (served link, calls asked
for, what the answer check found, the text's start). The live check
prints it, so a failing run shows what each model did, not only the end.

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

* test: the answer check corrects an unrecorded deadline; live trace printed after the turn

A scripted-model test proves the loop: a deadline answered without
record_deadline is sent back, recorded, then answered. The live check
now collects its round trace and prints it with the other lines.

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

* fix(agent): a search outage cannot eat the turn

Agent check on 2952096, traced: every web_search came back empty, so
gpt-oss-120b searched six rounds running and the answer arrived in the
last, uncorrectable round. Search is now withdrawn for the turn after an
outage or two empty searches, the model is told to answer from the
matter and name what it could not check, and a missing source is no
longer 'corrected' by asking for a search that cannot happen: the answer
is stored marked unverified. The live check logs each search backend's
outcome.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 10:08:56 +02:00
CatoandClaude Opus 5.5 eba1b0abb5 fix(agent): no tool calls written out, no law without a source (#32)
* fix(agent): no tool calls written out, no law without a source

Found on the live site: a free model answered a Zürich rent-increase
question without calling one tool, wrote update_matter(…) and
record_deadline(…) into its answer as text, and stated rules of law with
no source. Nothing was searched or recorded.

- The system prompt now carries ai-kit's TEXT_TOOL_PROTOCOL_HINT, so a
  model that calls tools in text uses the format complete() parses.
- lib/matters/answer-check.ts checks every final answer: tool calls
  narrated instead of made, or law (Art./§/OR/ZGB/SchKG/SR/LGBl…) stated in
  a turn with no source. One precise correction, then a retry; an answer
  still failing is stored under a visible 'unverified' step.
- live/agent.live.ts gains the failing question as a real-model case.

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

* fix(agent): the tool-format hint actually reaches the model

The previous commit imported TEXT_TOOL_PROTOCOL_HINT but its edit to the
system prompt was lost; lint flagged the unused import.

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

* test(live): show the rent case's lines in the Agent check output

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

* fix(agent): withdraw the text tool hint; '(called …)' is not an answer

The real-model Agent check failed with TEXT_TOOL_PROTOCOL_HINT in the
prompt: the chain's models (all native callers) switched to text calls and
answered '(called note_fact)', copying the loop's own note of a call. It
passed without the hint. The hint is withdrawn, and an answer that is only
such a note now counts as narrated, so it gets the one correction.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 09:44:23 +02:00
CatoandClaude 1310257bac feat(chat): answer actions and one-tap replies in the matter conversation (#31)
Bring Causius onto the current fleet chat packages: @bitbaum/chatkit ^0.12.0
(npm, was a git sha of 0.7.0) and @bitbaum/ai-kit ^1.21.0. accountkit stays on
its pinned sha f07353e (v0.3.0): the v0.2.1 tag the other products use is
older and predates the auth runtime Causius imports.

- ChatThread gets `share`, so Copy · Listen · Share sit under every answer;
  the thread labels gain `listen` and `share` in all four locales.
- The agent's system prompt carries RICH_ANSWERS_INSTRUCTION and
  REPLIES_INSTRUCTION. The quick_replies block is taken off the answer with
  extractReplies before it is stored, so history, copies and exports never
  carry it; the replies live beside the message event (sealed body, no new
  column) and reach ChatThread through toChat, under the latest answer.
- Tests: the instructions are in the system prompt, the stored text has no
  block, the replies are parsed, the next turn's history is clean.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 08:35:37 +02:00
CatoandClaude 4be58da713 feat(markets): Switzerland and Liechtenstein only, one record per country (#28)
The owner narrowed the focus: no US market for now. Markets are now a
config (lib/jurisdictions.ts): each country is one record with its regions,
interface languages and a note for the agent; MARKETS lists the ones that
are switched on. Adding a country is that record, its words under
Home.where.<code>, and its code in MARKETS. A test fails if a market lacks
its words in any language.

The agent's country rules moved out of its prompt into each market's note,
read for the matter's own jurisdiction. The front page's markets and kicker
are generated from MARKETS. The US stays pickable under Elsewhere.

The Spanish interface existed for the US market and goes with it (git
history keeps it); a letter can still be translated into Spanish.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 07:45:38 +02:00
CatoandClaude Opus 5.5 5193b47e2a feat: a new front page, Switzerland, Liechtenstein and the US, five languages (#27)
* wip: front page redesign, CH/LI/US markets, five locales (translations in progress)

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

* i18n: German and French for the new front page; one word under budget

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

* i18n: Spanish, and the sample case in Italian and Spanish

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

* wip: Italian (in progress)

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

* feat: a new front page, Switzerland, Liechtenstein and the US, five languages

Front page (inspired by what Harvey and Laine do well, for a person rather
than a firm): an invented letter worked through as an animation (the name
hidden, the deadline with its source, a draft, the person's decision), two
calendars (days without, minutes with), the anonymisation drawn, an honest
comparison with a chatbot and a lawyer, markets counted from the data, the
common problems linking straight into a matter. Headlines in sentence case
with an italic accent (one edit in theme.css). The OrangeCat section is gone:
no account elsewhere is needed, and the page no longer suggests one.

Markets: Liechtenstein and the fifty states join the cantons; one grouping
(JURISDICTION_GROUPS) feeds every picker; the agent keeps cantonal, state
and federal law apart and Liechtenstein's own order distinct.

Languages: Italian and Spanish, whole (site, accounts, mail, sample). The
locale list is one SSOT; three hard-coded copies are gone. A letter can be
translated into nineteen languages, the same list helpers choose from.

Sign-up asks who the account is for (needs help / helps others).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 07:40:35 +02:00
CatoandClaude 21c446931f feat(matters): start from a common problem (#26)
Six workflows (debt collection notice, rent increase, tax assessment,
dismissal, insurance refusal, founding an association) on the start screen.
Each tells the agent what to establish and what to draft, and the person
what to have ready. No law lives in them: a test refuses any digit in a
brief, so deadlines and articles are always researched and cited. The
matter keeps its workflow (sealed, optional), and Find a helper opens on
its area.

Roadmap: ask across a matter's documents as a table, watch a matter's
rules for change, flat-priced helper payments (no fee sharing).


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 05:54:01 +02:00
CatoandClaude e3dcbda881 feat(helpers): a directory of helpers, lawyers checked and still pseudonymous (#25)
- Helpers list themselves (AI service, legal assistant, licensed lawyer) under
  a name or pseudonym; the same account keeps matters of its own. Directory
  search and filters through searchkit and listkit, with the typo suite.
- A lawyer's admission is submitted privately (evidence sealed per
  credential), checked by a staff reviewer, and published as an SD-JWT signed
  with Ed25519: the place in clear, the legal name only as a salted digest.
  Key at /.well-known/jwks.json; anyone can check at /verify. A lawyer is
  listed only where verified.
- An owner asks a helper about a matter, with or without their personal
  details; the request is previewed exactly as it will be read. Accepted, the
  helper becomes a participant; anonymisation is applied in the store, so no
  route can forget it. A lawyer hands over the checked name with proof.
  Ending it removes access in the same transaction.
- Reviewers are staff/admin accounts, granted by the Grant role workflow.
- Who may do what is lib/professions.ts, the one domain file, so Diplodoctor
  reuses the engine by changing it.
- Fixes: the account menu label template; one site URL instead of three, with
  a dev-only origin so local sign-in works.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 05:48:41 +02:00
CatoandClaude 476a157cd8 feat(accounts): Causius has its own accounts; OrangeCat is one way in, not the only one (#23)
Email and password, a sign-in link, passkeys, two-step codes and (where
configured) the shared sign-in and OrangeCat, all from @bitbaum/accountkit/auth.
Matters made while OrangeCat was the only way in are re-keyed to the account the
same person signs in with. Live check and provisioning updated.


Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-15 09:20:46 -07:00
CatoandClaude 1f15478e27 feat: a look of its own (ink on paper, light and dark) and much less to read (#22)
One file, app/theme.css, now decides the whole look: light by default, a deep
ink-indigo accent on warm paper, near-square corners, headlines set as capitals
in the shared display serif. Display font, headline case/tracking/weight and
action case are knobs there, so "more gothic" is a one-file edit. Dark follows
the device or a header toggle, set before first paint by a nonce'd boot script.
lib/theme.test.ts enforces WCAG AA for text, accent, on-accent label and status
colours on every surface in both modes.

Copy: the home page goes from about 980 words to about 240 (capabilities list
and identity statement moved to /platform); the quick check, case page, helpers,
platform and security pages were cut, in en/de/fr. lib/copy-budget.test.ts holds
each page to a budget.

Nav contract: language links, theme toggle and footer links are all at least
44x44; nothing overflows at 390/834/1440 in en/de/fr, light and dark.


Claude-Session: https://claude.ai/code/session_01UzP8kyUAz5uhKE3mt87Yi7

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 11:19:48 -07:00
CatoandClaude 67d583434e feat(matters): one message box with voice, photos, files and a model choice (#21)
Starting a matter and writing in one use the fleet's chatkit Composer: a
microphone (server transcription, disclosed on /security), a camera/photos/files
menu, in-browser covering of photos before they are read, PDFs and text files,
and a model picker that starts the free chain at the chosen model.


Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-12 09:42:55 -07:00
CatoandClaude Sonnet 5.5 69944583e0 fix(security): harden redaction and the agent, make the security copy true (#20)
* fix(security): harden redaction and the agent, and make the security copy true

Redaction: titles, initials, ALL CAPS, street/PO-box forms, phone/IBAN variants,
bounded quantifiers (no quadratic backtracking), token guard.
Agent: untrusted-data wrapping, strict dates, write caps, address guard,
per-matter turn lock. Copy: deadline dates readable, detection not perfect.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

* fix(security): keep the log-content sentence

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-12 09:31:04 -07:00
CatoandClaude Opus 5.5 35faee8843 Agent: set the matter up, cite every rule, answer in the reader's language (#19)
* Agent: set the matter up first, cite every rule, answer in the person's language

From the first real-model run: it found the right deadline but answered a
question written in English in German (the letter's language), wrote ß, cited
the federal act for a cantonal assessment without a source number, and left
the matter untitled.

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

* Agent answers in the reader's interface language

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 13:45:33 -07:00
CatoandClaude Opus 5.5 4a610f612d Search queries keep their placeholders; a real-model agent check (#18)
* Provision: record 0000_init in the shared deploy's schema ledger

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

* Search queries keep their placeholders; a real-model agent check that runs on the box

The agent restored placeholders in every tool's arguments, so a search query
the model wrote as "[NAME-1] …" went to the search engine with the name in
it. Arguments are now restored only for tools that write into the matter;
web search, page reads and domain lookups go out as the model wrote them.

live/agent.live.ts runs one turn through the real free chain on PGlite and
asserts a recorded deadline and that no request carried the name; the Agent
check workflow runs it on the box, where the keys are.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 13:31:58 -07:00
CatoandClaude Opus 5.5 40a5c4b05d Matters, the fleet design system and a technical narrative (#10)
* Matters: encrypted, agentic legal workspace behind OrangeCat sign-in

A matter is sealed per matter (AES-256-GCM data key under CAUSIUS_MASTER_KEY).
The agent works it with tools (search, read, deadlines, tasks, drafts,
approvals); every personal detail is swapped for a placeholder before a model
sees it, and the person's account name is always one of them. The database in
the clear holds no name, message, deadline or document.

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

* Fleet design system, a technical narrative, one account across the fleet, domain checks

- @bitbaum/design-tokens replaces the bespoke paper-and-ink theme; Solon's
  grammar (kicker, headline-caps, btn-frame) for every page, pinned dark.
- New Platform, Security and Ecosystem pages; the home page rebuilt around what
  works today (lib/capabilities.ts is the one place a status is decided).
- Sign-in and sign-up routes hand straight to OrangeCat; the account menu and
  the ecosystem page link the rest of the fleet, read from the fleet map.
- The agent can check domain names with the registries over RDAP.
- The i18n parity test reads ICU properly (select branches, apostrophes).

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

* Provision matters on the host: database, OrangeCat client, runtime env

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 12:23:14 -07:00
Claude ded10a84c0 Migration and court letters always recommend a lawyer
The live check found the free model calling a migration office's request
for proof of stays abroad paperwork for an assistant. A residence permit is
at stake in every such letter; say so in the prompt and check it live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ
2026-10-11 19:31:46 +02:00
Claude 4fe0b47672 Anonymise letters in the browser, harden headers, fix English 500s
- Anonymisation: names, addresses, AHV, IBAN, phone, e-mail, birth dates and
  labelled reference numbers are replaced with placeholders before a letter
  leaves the browser; the reader sees and can adjust every replacement and
  preview what is sent. The browser restores the values in the result.
- Photo cover tool: black out areas of a page; boxes are burnt into the
  pixels before upload.
- Anonymised export for helpers; pseudonymity for clients, assistants and
  lawyers in the helper rules (lawyer named to a client on engagement).
- Security: per-request nonce CSP (strict-dynamic, connect-src 'self',
  frame-ancestors 'none'), HSTS, nosniff, no-referrer, Permissions-Policy,
  COOP/CORP, no-store on the API, no X-Powered-By.
- Fix: unprefixed English pages were rewritten by next-intl to
  https://localhost behind the box's proxy and answered 500. Every language
  is now prefixed; / redirects by browser language.
- AGENTS.md: finish to production; security and privacy stay strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ
2026-10-11 19:21:39 +02:00
CatoandClaude Fable 5.1 1ccc37cdea Build out Causius: cases, own model, helpers, EN/DE/FR (#7)
* Build out Causius: case intake, case file, helper marketplace

Replace the day-zero page with the product: a landing page, letter intake
with env-gated AI analysis, a case view (deadline, checklist, translations,
draft reply), browser-only case storage with export/import, and the helper
marketplace rules for legal assistants and licensed lawyers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

* Put Causius on the fleet's stack and its three planes

- AI: replace the hand-rolled single-vendor fetch with @bitbaum/ai-kit
  complete() over the shared free chain; no pinned model id. Add the
  fleet's own-model flow (ai-kit byok + probe), key kept in the browser.
- Validation with zod, rate limits with limitkit, tests with Vitest.
- Identity rendered from the Loki fleet map; ROADMAP.md and CHANGELOG.md
  as the public record, shown through bip-kit.
- Helpers live on OrangeCat as services; OrangeCat and Solon links appear
  only when the fleet map reports the profiles exist.
- Nav contract: routes constant, aria-current, 44px targets. Beta label.
- CI and auto-merge from the current site template; TypeScript 6,
  ESLint 10, Node 24; AGENTS.md from the fleet template.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

* Speak English, German and French; make intake work end to end

- next-intl with locale routing (en unprefixed, /de, /fr), every string in
  the message catalogues, a parity test, Swiss German spelling.
- The analysis is written in the reader's language.
- Several pages per letter; photos are shrunk in the browser so a phone
  picture fits.
- The deadline is shown with the sentence it was read from, and the model
  is told never to compute a date the letter does not state.
- /api/health, and the intake page says up front what the free models can
  do. `pnpm run check:analyze` runs the sample letter through a real model.
- A down fleet map no longer stalls on-demand pages.
- Refuse the two build scripts next-intl brought, so installs stay clean.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 18:59:28 +02:00