`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. |
||
|---|---|---|
| .. | ||
| instructions | ||
| __init__.py | ||
| _base.py | ||
| _tools.py | ||
| analysis.py | ||
| compaction.py | ||
| evidence.py | ||
| ledger.py | ||
| policy.py | ||
| rag.py | ||