Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

get_ledger

Retrieve the complete, validated journal for one question version.

Contract

Reloading checks sequence continuity, question identity and lifecycle rules, and recomputes stored Bayesian audits. A missing key is an error; direct database tampering is not cryptographically authenticated.

Fields

FieldTypeRequired
keyKeyYes
op"get_ledger"Yes

Setup

Start a fresh --memory process and send these requests, one per line, before the example. The same sequence also works with a new SQLite database.

{"version":1,"id":"setup-1","command":{"op":"create_question","question":{"id":"doc-launch","version":1,"proposition":"Release before timestamp 100","opens_at":0,"deadline":100,"resolve_after":110,"yes_rule":"Archive confirms release strictly before 100","no_rule":"Complete archive confirms no qualifying release","void_rule":"Archive permanently unavailable","resolution_sources":["official archive"]}}}
{"version":1,"id":"setup-2","command":{"op":"append_forecast","key":{"question_id":"doc-launch","version":1},"forecast":{"id":"f1","as_of":1,"evidence_cutoff":1,"probability":0.3,"previous_id":null,"change":"initial","method":"empirical outside view","rationale":"12 of 40 comparable attempts","assumptions":["cases are comparable"],"next_review_trigger":"readiness test","evidence":[]}}}
{"version":1,"id":"setup-3","command":{"op":"update_forecast","key":{"question_id":"doc-launch","version":1},"revision":{"id":"f2","previous_id":"f1","as_of":20,"evidence_cutoff":20,"rationale":"diagnostic readiness evidence","assumptions":["illustrative likelihoods"],"next_review_trigger":"dependency completion","likelihoods":[{"evidence":{"id":"readiness","origin_id":"test-1","locator":"supplied:test-1","claim":"Readiness test passed","published_at":10,"observed_at":9},"given_h":0.8,"given_not_h":0.2}]}}}

Request

Send this object on one line. It is expanded below for readability.

{
  "version": 1,
  "id": "example",
  "command": {
    "op": "get_ledger",
    "key": {
      "question_id": "doc-launch",
      "version": 1
    }
  }
}

Response

This response is generated by executing the example against the current binary. Commit timestamps, when present, are shown as <runtime UTC seconds>; the actual protocol returns integer UTC seconds.

{
  "version": 1,
  "id": "example",
  "result": [
    {
      "event": {
        "kind": "question",
        "question": {
          "deadline": 100,
          "id": "doc-launch",
          "no_rule": "Complete archive confirms no qualifying release",
          "opens_at": 0,
          "proposition": "Release before timestamp 100",
          "resolution_sources": [
            "official archive"
          ],
          "resolve_after": 110,
          "version": 1,
          "void_rule": "Archive permanently unavailable",
          "yes_rule": "Archive confirms release strictly before 100"
        }
      },
      "recorded_at": "<runtime UTC seconds>",
      "sequence": 1
    },
    {
      "event": {
        "calculation": null,
        "forecast": {
          "as_of": 1,
          "assumptions": [
            "cases are comparable"
          ],
          "change": "initial",
          "evidence": [],
          "evidence_cutoff": 1,
          "id": "f1",
          "method": "empirical outside view",
          "next_review_trigger": "readiness test",
          "previous_id": null,
          "probability": 0.3,
          "rationale": "12 of 40 comparable attempts"
        },
        "kind": "forecast"
      },
      "recorded_at": "<runtime UTC seconds>",
      "sequence": 2
    },
    {
      "event": {
        "calculation": {
          "likelihoods": [
            {
              "evidence": {
                "claim": "Readiness test passed",
                "id": "readiness",
                "locator": "supplied:test-1",
                "observed_at": 9,
                "origin_id": "test-1",
                "published_at": 10
              },
              "given_h": 0.8,
              "given_not_h": 0.2
            }
          ],
          "prior": 0.3
        },
        "forecast": {
          "as_of": 20,
          "assumptions": [
            "illustrative likelihoods"
          ],
          "change": "evidence",
          "evidence": [
            {
              "claim": "Readiness test passed",
              "id": "readiness",
              "locator": "supplied:test-1",
              "observed_at": 9,
              "origin_id": "test-1",
              "published_at": 10
            }
          ],
          "evidence_cutoff": 20,
          "id": "f2",
          "method": "conditional Bayesian likelihood update",
          "next_review_trigger": "dependency completion",
          "previous_id": "f1",
          "probability": 0.631578947368421,
          "rationale": "diagnostic readiness evidence"
        },
        "kind": "forecast"
      },
      "recorded_at": "<runtime UTC seconds>",
      "sequence": 3
    }
  ]
}

Verification

The documentation gate executes the setup and request, then checks the following result fields against independently specified expectations:

JSON pointer within resultExpected
/2/sequence3
/2/event/forecast/probability0.631578947368421

Float comparisons use a 1e-12 tolerance. Request schema validation and cross-record validation still apply. See errors and recovery for failure handling.