← Receivers

trace:read

trace family

Read one signal trace back by the 24-hex id a response handed its caller in X-Trace-Id: every span that shares it, ordered by startMs, each {spanId, parent, hop, outcome, service, colo, startMs, durMs, offsetMs, mixedClock, sampleInterval}. THREE states, never a fourth: `found` (the spans), `pending` (none written yet — Analytics Engine ingests with a lag, and a hop with no binding writes nothing; this is NEVER "a trace with no hops"), `failed` (the read itself failed, with `error`; a failure is never an empty list). `offsetMs` across two services subtracts two workers' clocks and says so in `mixedClock`. Caps at 200 spans and names the cut in `truncated`; `sampled` is true when Analytics Engine kept a sample. Requires an attested caller (session, world key or staff) — the id is a correlation label, never authority

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
session
The class of authority the caller must already hold, decided from the attested context with no round trip.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/trace:read \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "traceId": <string> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • traceId string required The 24 lowercase hex trace id (12 hex of mint-time ms + 12 random). Anything else is refused as not_a_trace_id before it reaches SQL

Response

What comes back from the call.

  • ok boolean
  • state found | pending | failed found = spans below; pending = nothing written yet, not 'no hops'; failed = the read failed, see error
  • traceId string
  • spans object[]
  • total number
  • sampled boolean
  • truncated object Present only when the 200-span cap bit
  • reason string
  • error string On state:failed — not_a_trace_id · unauthenticated · no_account · no_credentials · unreachable · sql_<status>

Traffic

Every call to trace:read, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names trace:read, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 1
  • one.ie/web/src/lib/receiver-index.generated.ts:337
→

Answered by

trace:read one.ie/web/src/lib/resolvers/trace.ts:32 Dispatched through POST /api/ask/trace:read, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "traceId": {
      "type": "string",
      "description": "The 24 lowercase hex trace id (12 hex of mint-time ms + 12 random). Anything else is refused as not_a_trace_id before it reaches SQL"
    }
  },
  "required": [
    "traceId"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "state": {
      "type": "string",
      "enum": [
        "found",
        "pending",
        "failed"
      ],
      "description": "found = spans below; pending = nothing written yet, not 'no hops'; failed = the read failed, see error"
    },
    "traceId": {
      "type": "string"
    },
    "spans": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "spanId": {
            "type": "string"
          },
          "parent": {
            "type": "string",
            "description": "The caller's span id, or '' at the root"
          },
          "hop": {
            "type": "string",
            "description": "Closed vocabulary: web.chat · web.first-chunk · web.stream · channels.message"
          },
          "outcome": {
            "type": "string",
            "description": "ok · error · refused · dissolved"
          },
          "service": {
            "type": "string"
          },
          "colo": {
            "type": "string"
          },
          "startMs": {
            "type": "number",
            "description": "Epoch ms at the span's opening I/O edge"
          },
          "durMs": {
            "type": "number",
            "description": "Ms between two I/O edges; Workers clocks do not advance during pure CPU"
          },
          "offsetMs": {
            "type": "number"
          },
          "mixedClock": {
            "type": "boolean"
          },
          "sampleInterval": {
            "type": "number"
          }
        },
        "required": [
          "spanId",
          "parent",
          "hop",
          "outcome",
          "service",
          "colo",
          "startMs",
          "durMs",
          "offsetMs",
          "mixedClock",
          "sampleInterval"
        ]
      }
    },
    "total": {
      "type": "number"
    },
    "sampled": {
      "type": "boolean"
    },
    "truncated": {
      "description": "Present only when the 200-span cap bit",
      "type": "object",
      "properties": {
        "spans": {
          "type": "number"
        }
      },
      "required": [
        "spans"
      ]
    },
    "reason": {
      "type": "string"
    },
    "error": {
      "description": "On state:failed — not_a_trace_id · unauthenticated · no_account · no_credentials · unreachable · sql_<status>",
      "type": "string"
    }
  },
  "required": [
    "ok",
    "state"
  ]
}