record_run_event
Append structured run events to a durable authority ledger in one transaction, preserving accurate session memory and audit trails for coding agents.
Instructions
Append one structured event to a run's durable authority ledger.
Sequence allocation, event persistence, child work-item creation, and projection updates occur in one transaction. This tool never sets an implicit current run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | Server-minted run identifier returned by `begin_run`. | |
| payload | No | Optional structured JSON payload, limited to 32 KiB. Raw reasoning fields are rejected. | |
| summary | Yes | Bounded factual event summary. Raw transcript or hidden reasoning is not allowed. | |
| agent_id | No | Optional declared agent responsible for the event. | |
| evidence | No | Optional structured evidence references, limited to 32 KiB. | |
| thread_id | No | Optional external thread or conversation identifier for the event. | |
| event_type | Yes | Structured v1 or governed-v2 logical event type. | |
| provenance | No | Optional bounded declared provenance for the event. | |
| work_item_id | No | Existing server-minted work-item identifier. Omit only for `work_item_started` when creating a child work item. | |
| workspace_key | Yes | Declared workspace scope that owns the run. | |
| owner_agent_id | No | Optional declared owner for a newly created child work item. | |
| work_item_goal | No | Goal for a new child work item, used only with `work_item_started`. | |
| idempotency_key | Yes | Caller-generated retry key scoped to this run; only its SHA-256 digest is stored. | |
| memory_attribution | No | Required receipt-bound or explicit manual memory attribution for memory_recalled, memory_applied, and memory_rejected. Recall receipt tokens are validated but never persisted. | |
| parent_work_item_id | No | Parent work-item identifier, used only when creating a child work item. | |
| event_schema_version | No | Event payload schema version; governed-v2 runs require version 2. | |
| expected_last_sequence | No | Optional compare-and-swap precondition. The append is rejected without writes when the authority ledger has a different latest sequence. | |
| expected_database_epoch | No | Database epoch CAS precondition; required by governed-v2 runs. | |
| expected_run_generation | No | Run generation CAS precondition; required by governed-v2 runs. | |
| expected_work_item_status | No | Optional compare-and-swap precondition for an existing work item. Conflicts report the actual authority-derived status. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||