haiku.rag/haiku_rag_slim/haiku/rag/capabilities
Yiorgis Gozadinos 0882dc9fed
Lend the caller's client to the capability
`client.ask` and `client.analyze` built their capability from a db_path, so the
capability opened a second connection to the database the client already had
open, once per call.

Ownership is now explicit rather than inferred. `rag` stays the connection the
capability opened and must close; `borrowed_rag` is a caller's, which
`_ensure_rag` prefers and `_close` never touches. Two fields rather than a flag,
so closing a borrowed connection is not expressible.

`for_run` still clears `rag` per run, since a run owns what it opens. It leaves
`borrowed_rag` alone: that connection belongs to the caller and outlives the run.
2026-08-18 14:58:18 +03:00
..
instructions Let a model declare that nothing grounds its answer 2026-08-13 13:39:42 +03:00
__init__.py replace haiku.skills with native Pydantic AI capabilities 2026-07-24 15:26:17 +03:00
_base.py Lend the caller's client to the capability 2026-08-18 14:58:18 +03:00
_tools.py replace haiku.skills with native Pydantic AI capabilities 2026-07-24 15:26:17 +03:00
analysis.py Lend the caller's client to the capability 2026-08-18 14:58:18 +03:00
compaction.py Judge each capability's evidence by its own record 2026-08-13 15:57:33 +03:00
evidence.py Refuse to compact evidence the host kept no record of 2026-08-13 15:46:23 +03:00
ledger.py Let the record say whether a question is still being answered 2026-08-13 15:03:24 +03:00
policy.py Notice the endings a structured answer arrives in 2026-08-13 13:39:43 +03:00
rag.py Lend the caller's client to the capability 2026-08-18 14:58:18 +03:00