tdfs4ds.impact_agent.ledger¶
tdfs4ds.impact_agent.ledger
¶
The evidence ledger of an impact study: every tool call, who answered, how long it took.
Each entry: {"tool", "args", "digest", "duration", "source", "model", "ok", "skipped", "error"}
(model is the model name on a model entry, skipped is True with the reason in error when a
step was not run: no question, bad arguments, already done, budget spent) where source is
code (a deterministic tool), consumer (the consumer agent was asked) or model (the
impact agent's own model: planner or narrative). digest is a short hash of the result, so two
studies can be compared without storing the results twice. Pure.
Ledger
¶
An ordered list of entries. record adds one; entries is the JSON-able list.
record
¶
record(tool: str, args: Optional[dict], result: Any, duration: float, source: str = 'code', error: Optional[str] = None, model: Optional[str] = None, skipped: bool = False) -> dict
digest
¶
A short, stable hash of a JSON-able value (repr for anything else).