haiku.rag/tests/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
..
conftest.py replace haiku.skills with native Pydantic AI capabilities 2026-07-24 15:26:17 +03:00
test_borrowed_client.py Lend the caller's client to the capability 2026-08-18 14:58:18 +03:00
test_capabilities.py Stop a partly resolved citation asking to be retried 2026-08-13 15:03:51 +03:00
test_citation_policy.py Let the record say whether a question is still being answered 2026-08-13 15:03:24 +03:00
test_evidence_capsule.py Refuse to compact evidence the host kept no record of 2026-08-13 15:46:23 +03:00
test_evidence_ledger.py Enforce a declaration wherever there is something to declare 2026-08-13 13:39:42 +03:00
test_evidence_wire.py Judge each capability's evidence by its own record 2026-08-13 15:57:33 +03:00