Record a decision
1
Turn capture on
rootsign.init() runs. Settings are read when init() runs, as Configuration explains.2
Record the decision before the tool call
Call
ctx.record_decision() just before the tool call it explains:refund.py
3
Run it
4
Check what was stored
The session file now has a decision record ahead of the action, and the action carries the decision’s ID:
DECISION_RECORD
ACTION_RECORD
alternatives_considered is empty: at the default depth, summary, alternatives are not kept. Run it with ROOTSIGN_REASONING_DEPTH=full and the record keeps both.How a decision links to an action
- The next action recorded in the session takes the decision. It gets the decision’s ID as its
decision_id. The link is by order:selected_actionis stored as you wrote it and is not compared with the tool that runs. - One decision links to one action. An action after that has
decision_id: nulluntil you record another decision. To explain several tool calls, record a decision before each one. - A second decision replaces the first. If you call
record_decision()twice with no tool call between them, both decisions are stored, and the next action links to the second. The first is linked to nothing. - A call held for approval takes it too. With
require_approval=True, the pending action carries thedecision_id, so the decision, the held call and the approval read in order.
How much reasoning is kept
ROOTSIGN_REASONING_DEPTH decides: minimal keeps only the chosen action and the confidence, summary (the default) also keeps the first 500 characters of the reasoning, and full keeps up to 10,000 characters and the alternatives. Configuration has the table.
Each decision stores the depth it was captured at as reasoning_depth, so a reader can tell a summary that minimal dropped from one that was never given. reasoning_captured is true when a summary was kept.
The PostgreSQL backend stores
reasoning_depth after RootSign 0.3.1. Run rootsign-admin init after upgrading to add the column; decisions recorded earlier have no depth. In 0.3.1 and earlier, only the JSONL backend kept it.Values that are not recorded
A decision outside these limits is not recorded, on any backend.
record_decision() returns None, the next action has no decision_id, and RootSign logs one warning that names the field. It does not raise, so the agent keeps running:
Checking decisions on every backend was added after RootSign 0.3.1. In 0.3.1 and earlier, the JSONL backend stored values such as
confidence=1.5, and PostgreSQL refused them with a longer warning.When capture is off
record_decision() does nothing and returns None, and the session has no decision records. You can leave the calls in code that runs with capture on in one environment and off in another.
What gets recorded
When you export with
--redact-previews, the bundle leaves out reasoning_summary and alternatives_considered, and keeps the chosen action and the confidence.
What it does not do
- It is not in the hash chain. Decision records and an action’s
decision_idsit outside the chain, by design (ADR-008). Editing a decision’s reasoning, or which decision an action points to, still verifies asVALID. Verification proves the actions; treat decisions as the narrative around them. - It does not redact. Redaction configs apply to tool inputs and outputs, not to decision text. Keep personal data out of
reasoning_summary, or leave capture off. - It does not read the model’s reasoning for you. You pass the summary. RootSign does not extract it from a model response, and it does not store the prompt.
Related
Configuration
The capture and depth settings, and when they are read.
Python API
The
ctx.record_decision() signature.