← Receivers

training:record

training family

Record one step of a testnet training run: the step decides whether the chain (by digest) or the harness observes, the server decides the verdict and closes it on the namespaced training path

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
agent_key
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
no
This cannot be undone. Dry-run it first where the contract allows.
Idempotent
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.

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/training:record \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "run": "run-01", "scenario": "ceiling", "step": "over-tx", "rule": "ceiling", "mode": "scripted", "tool": "vault_spend", "payee": "referee", "expected": "E_CEILING", "digest": "<testnet digest>" }}'

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.

  • run string required The run id the harness minted for this run
  • scenario string required One of the seven pinned scenario ids (lib/training/scenarios.ts)
  • step string required A pinned step id of that scenario, or turn-1…turn-8 for a free turn in agent mode
  • rule string required The scenario's rule, a bare word; must match the pin
  • mode scripted | agent required scripted (drill, fixed actions) or agent (a model chose the tool)
  • tool string required The tool the agent chose (the closed list) or the harness move the step names
  • payee string optional Who the money went to (a roster name or 'ground'), for the side-door read; anything else is bad_step
  • expected string required What the rule predicts — must equal the pinned expectation, or the step is bad_step
  • digest string optional A chain step's testnet transaction digest — REQUIRED on a chain step, re-read on Sui testnet
  • refusal string optional A harness step's word (a ONE door's answer or a read); on a chain step it is digest_required

Response

What comes back from the call.

  • ok boolean
  • verdict kept | rule_silent | wrong_refusal | …
  • observed string
  • observed_by chain | harness
  • closed mark | warn | dissolve
  • error digest_not_on_testnet | digest_required | tx_not_this_step | …

Traffic

Every call to training:record, 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 training:record, 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 2
  • one.ie/web/src/lib/receiver-index.generated.ts:392
  • one.ie/web/src/lib/training/scenarios.ts:93
→

Answered by

training:record one.ie/web/src/lib/resolvers/training.ts:539 Dispatched through POST /api/ask/training:record, after the envelope validates the payload.

training family · 1 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "run": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "The run id the harness minted for this run"
    },
    "scenario": {
      "type": "string",
      "maxLength": 32,
      "description": "One of the seven pinned scenario ids (lib/training/scenarios.ts)"
    },
    "step": {
      "type": "string",
      "maxLength": 32,
      "description": "A pinned step id of that scenario, or turn-1…turn-8 for a free turn in agent mode"
    },
    "rule": {
      "type": "string",
      "maxLength": 32,
      "description": "The scenario's rule, a bare word; must match the pin"
    },
    "mode": {
      "type": "string",
      "enum": [
        "scripted",
        "agent"
      ],
      "description": "scripted (drill, fixed actions) or agent (a model chose the tool)"
    },
    "tool": {
      "type": "string",
      "maxLength": 32,
      "description": "The tool the agent chose (the closed list) or the harness move the step names"
    },
    "payee": {
      "description": "Who the money went to (a roster name or 'ground'), for the side-door read; anything else is bad_step",
      "type": "string",
      "maxLength": 64
    },
    "expected": {
      "type": "string",
      "maxLength": 96,
      "description": "What the rule predicts — must equal the pinned expectation, or the step is bad_step"
    },
    "digest": {
      "description": "A chain step's testnet transaction digest — REQUIRED on a chain step, re-read on Sui testnet",
      "type": "string",
      "maxLength": 44
    },
    "refusal": {
      "description": "A harness step's word (a ONE door's answer or a read); on a chain step it is digest_required",
      "type": "string",
      "maxLength": 96
    }
  },
  "required": [
    "run",
    "scenario",
    "step",
    "rule",
    "mode",
    "tool",
    "expected"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "verdict": {
      "type": "string",
      "enum": [
        "kept",
        "rule_silent",
        "wrong_refusal",
        "side_door",
        "deploy_fenced",
        "needs_person"
      ]
    },
    "observed": {
      "type": "string"
    },
    "observed_by": {
      "type": "string",
      "enum": [
        "chain",
        "harness"
      ]
    },
    "closed": {
      "type": "string",
      "enum": [
        "mark",
        "warn",
        "dissolve"
      ]
    },
    "error": {
      "type": "string",
      "enum": [
        "digest_not_on_testnet",
        "digest_required",
        "tx_not_this_step",
        "not_a_roster_agent",
        "bad_step"
      ]
    }
  },
  "required": [
    "ok"
  ]
}