OIP system: LEDGER
LEDGER
A generated article for one OIP shelf. It lists every operation in this API/CLI/MCP/device/model/core subsystem, links each leaf article, and gives the ledger path for proof.
This page is the operating article for one build subsystem. It is generated from live directory rows. If a task belongs to this subsystem, scan the operations below, open the matching capability article, run only the exact object named there, and verify by receipt.
Kind: core. Capabilities: 4. Machine system map: /api/dispatch?map=LEDGER&format=markdown. Root: /a/oip.
Operations
LEDGER_QUERY
Raw SELECT against the LEDGER D1 binding (loop-shared-events.events table). $1=SQL, rest = bind params. Returns JSON array of result rows Use when: you need to ledger query Arguments: $1. Human article: /a/oip-capability-ledger-query. Machine doc: ?key=LEDGER_QUERY&format=markdown. Invocation history: /api/invocations?object_id=LEDGER_QUERY.
LEDGER
Read your own ledger to troubleshoot: recent messages, each tool you ran with its output/error, and your reply. $1 optional = a trace_id for one message Use when: you need to ledger Arguments: see content. Human article: /a/oip-capability-ledger. Machine doc: ?key=LEDGER&format=markdown. Invocation history: /api/invocations?object_id=LEDGER.
LEDGER_ERRORS
Return the most recent ledger event whose own response starts with ERR. Use when: Cyrus asks for the last error, recent errors, or why something failed. Arguments: none.. Human article: /a/oip-capability-ledger-errors. Machine doc: ?key=LEDGER_ERRORS&format=markdown. Invocation history: /api/invocations?object_id=LEDGER_ERRORS.
LEDGER_EXEC
Run a non-SELECT D1 query against the LEDGER database (loop-shared-events). INSERT/UPDATE/DELETE only. Use when: writing audit events or other data to the shared ledger. Arguments: $1 = SQL. Pipes inside SQL are preserved. Remaining args = bind params.. Human article: /a/oip-capability-ledger-exec. Machine doc: ?key=LEDGER_EXEC&format=markdown. Invocation history: /api/invocations?object_id=LEDGER_EXEC.