Part V · Contracts · Plate 07

Soma rubric · gate exit codes

On this page

5. Soma → Thalamus System 1 Oracle and the cns gate Exit Contract

5.1 What a rubric verdict measures

soma concerns check --systemone sends the concern's question text verbatim through Thalamus, using the model discovered through /admin/v1/status and criteria derived from expect. Pass rates from a different model, prompt or evaluation path do not establish the reliability of these verdicts.

5.2 Request (writer: Soma soma-systemone; reader: Thalamus /v1/systemone, proxied verbatim to the System 1 server)

THALAMUS_URL is required: Soma names no model host, so unset means not evaluated. There is no default relay address (§1.1). --systemone-timeout-ms (default 45000) is one budget measured from the start of soma concerns check: the status read and the call share its deadline.

  1. GET ${THALAMUS_URL}/admin/v1/status. The model is models[0] of the first (by name) entry of planes.verification[] with healthy == true, draining == false, "system1.decide" in capabilities, and a non-empty models. None: not evaluated. /v1/classify (the rerank handler) is never called.
  2. POST ${THALAMUS_URL}/v1/systemone, header x-request-id: <32 hex>, body:

    {"model": "<models[0]>",
     "state": {"git_diff": "<unified diff base..head or working tree>", "changed_files": "<paths, newline-separated>"},
     "questions": {"<concern-id>/<n>": {"type": "noul", "instructions": "<question text verbatim>",
                                        "criteria": {"true": "yes", "false": "no"}}}}
    

    <n> is 1-based within the concern. Only questions of concerns that fired are sent; nothing fired means no call (rubric: vacuous). Section 1.2's example key question is not what Soma sends; Soma sends instructions + criteria.

  3. Polarity. A Questions bullet may start with [expect: yes] or [expect: no] (default yes). The marker is removed from the text. This is the one accepted syntax: exactly [expect: yes] or [expect: no], lowercase, one space after the colon, first in the bullet, followed by whitespace and the question. Any other text that starts like a marker ([expect, in any case or spacing) anywhere in the bullet, including a trailing ... [expect: no], is an unrecognised polarity marker: soma concerns validate fails, soma concerns check refuses (exit 2), and soma concerns lint --polarity lists every one and exits 2. Nothing marker-like is ever sent as question wording or read as a silent yes. The one fixed mapping (soma_systemone::criteria_for) is yes -> {true: "yes", false: "no"}, no -> {true: "no", false: "yes"}; its canonical JSON {"no":{"false":"yes","true":"no"},"yes":{"false":"no","true":"yes"}} hashes to expect_map_sha = dac6eaec67864d2e8f89f3e7df411f20d7918d24a50cf05d6c8a9a53c82fae5c.

5.3 Response and verdict

5.4 soma concerns check exit codes and output

Exit Meaning
0 Every requested oracle ran; with --check, nothing red
1 With --check: a critical/warning fire, an invalidated pin, or a rubric-red concern
2 Refused (bad arguments, invalid registry)
3 --systemone requested and not evaluated, whatever the structural result

Markdown output ends with ## Oracles, one line oracles: structural; rubric: not evaluated (not requested) | oracles: structural; rubric: vacuous | oracles: structural; rubric: not evaluated (<reason>) | oracles: structural, systemone; rubric: pass|fail (...), then structural: pass | structural: red (<gating concern ids>[; pinned anchor invalidated]), and fired: <n>. The structural: line states the structural result on its own, because exit 3 outranks it. JSON output carries oracles, rubric and structural: {red, gating, pinInvalidated}.

5.5 Verdict log (writer: Soma; reader: concern census)

<generated_dir>/rubric-verdicts.jsonl (default .soma/rubric-verdicts.jsonl, git-excluded), one row per evaluated question, appended: {ts, concern_id, question_idx, expect, score (null when malformed), pass, delta_sha (sha256 of state.git_diff), model, threshold, expect_map_sha, thalamus_url, thalamus_node (x-thalamus-node or null), request_id (= x-request-id sent)}. Unanswered questions are not logged (the run is exit 3).

5.6 cns gate (writer of a vitals.v1 row; reader: cns status [5])

5.7 cns gate --stop-hook (writer of soma/stop-gate rows and .cns/stop-gate-state.json; reader: the harness)

cns gate --stop-hook --harness <claude|codex|agy|pi> reads the harness's Stop payload on stdin (session_id/conversationId, stop_hook_active/continuationActive, cwd/workspacePaths[0], terminationReason, fullyIdle, error), runs from the Git top level of that directory, always exits 0 and prints only the harness's decision on stdout.

Situation Decision Runs
A non-empty error; fullyIdle: false; a terminationReason other than NO_TOOL_CALL (Antigravity: USER_CANCELED, MAX_INVOCATIONS, MAX_FORCED_INVOCATIONS, MAX_TOKEN_BUDGET_EXCEEDED, ERROR, EARLY_CONTINUE, TERMINAL_STEP_TYPE, TERMINAL_CUSTOM_HOOK, INJECTED_RESPONSE) allow nothing, no row
Not Git; no change outside CNS state allow nothing, no row
No change outside CNS state, and the stored count is above 0 or the newest stop-gate row did not exit 0 (fixed and committed after a blocked or released stop) allow nothing; count reset, an allow row with exit 0
The newest soma/gate row with this tree_sha256 exited 0 with the same oracles_requested allow nothing; a stop-gate row
Not Soma-initialised, or no authored concern allow nothing, no row (the gate could only exit 3)
cns gate exits 0 allow the gate; attempt count reset
cns gate exits 1 or 3, attempt ≤ CNS_STOP_GATE_MAX_RETRIES (default 3) block with the gate report the gate
The attempt after that allow with a warning, stop_gate_exhausted: true the gate; count reset