PR #24 ยท pramaan-io/pramaan-agents ยท merged 2026-06-03
sequenceDiagram autonumber participant harness as Strands Harness participant ctx as Tool Context participant db as Database participant rec as Recorder harness->>ctx: bind firm/user/run ctx->>db: open connection db->>db: set RLS = firm_id db-->>ctx: rows ctx->>ctx: stamp duration ctx->>rec: log call ctx-->>harness: result
| Method | in โ out | what it does |
|---|---|---|
MatterChatToolContext | (firm_id, user_id, run_id, tool_call_recorder, _tool_context) | |
matter_chat_tool_context | (context) โ Iterator[None] | |
_current_firm_id | () โ UUID |
Holds the seven MatterChat read tools plus the run-scoped context class, RLS guard, and recorder decorator โ landing the deterministic toolset and firm/user/run binding this PR ships.
| new class | signature |
|---|---|
MatterChatToolContext | (firm_id, user_id, run_id, tool_call_recorder, _tool_context) |
matter_chat_tool_context | (context) โ Iterator[None] |
_current_firm_id | () โ UUID |
_get_engine | () โ Any |
_set_rls | (conn, firm_id) โ None |
_rows | (statement, params) โ list[Mapping[str, Any]] |
_one | (statement, params) โ Mapping[str, Any] | None |
_text | (value, default) โ Any |
_uuid_text | (value) โ str |
_string_list | (value) โ list[str] |
_date_text | (value) โ str | None |
_optional_int | (value) โ int | None |
_citation | (document_id, quote_id) โ str |
_run_tool | (tool_name, input_json, body) โ dict[str, Any] |
_duration_ms | (started) โ int |
_record_tool_calls | (func) โ F |
wrapper | () โ dict[str, Any] |
Gains a run id field so the tool context can carry a stable run identifier for the recorder and audit trail during MatterChat calls.
run_id : UUID | None