Result envelope¶
Public envelope contract:
status,verdict,findings,files_touched,remaining, andblockerscarry decisions, blockers, and remaining work;confidence,confidence_gaps, andconfidence_null_reasonsay how far the result can be trusted or why no score exists (§Confidence). Transcript-onlydetailshold additional evidence and never hide required work or substitute for a public field.The bridge has two validation boundaries. The peer/model-to-harness result contains model-authored core defined by
schemas/envelope.schema.jsonplus bounded verbosedetails. Local harness validates that core, persistsdetailsin bounded transcript, strips them from harness-to-caller public envelope, adds observed metadata and workspace-relative transcript and incident-path references, then validates public result withschemas/harness-envelope.schema.json. Open the JSON file at anincidentpath before inspecting itsfault; public envelope does not inline that record.
Model-authored core¶
Every model response contains exactly
status,verdict,findings,files_touched,remaining,blockers, andconfidence_gaps.statusis onlycomplete,partial, orblocked; every list contains strings; no telemetry, identity, path, lifecycle, or confidence-number field is model-authored. A response that omits onlyconfidence_gapsstill delivers its answer and isunscored.
Harness metadata¶
The harness owns final timeout and refusal outcomes, model and effective effort, an optional effort substitution record, cost and token counters,
duration_seconds,depth,run_id, incident and session references, transcript path, verb, direction, the derivedconfidence, andconfidence_null_reason. Public envelope status may additionally betimeoutorrefused. Caller receives decision-critical fields and metadata; verbose detail remains opt-in through the referenced artifact.A timeout or a recursion refusal has no model core to merge. Harness constructs the required verdict and empty lists itself, places the concrete cause in
blockers, and validates the full result before returning it.Only a Codex child stopped by
output-limitmay have optional harness-ownedpartial_output: an unverified fragment of the last completeitem.completedagent message, limited to 4 KiB of UTF-8 without splitting a character.
- It is also stored in the incident; it is absent when no message was seen and for Claude children.
- Status remains
blocked, incident fault remainsoutput-limit, and findings remain empty.- Label the fragment unverified and use it only to scope a split follow-up, never as findings or a verdict.
- Older results without this optional field remain valid; neither envelope schema has an integer version.
Provider stops¶
The harness names a provider stop; the peer never does.
- Classes (incident
fault):quota-exhausted(credit, usage-limit, spend-limit or subscription stop),rate-limited, andcapacity(model at capacity). - Attempts: one child attempt; no timeout retry and no lower-effort retry.
- Result: status
blocked, with a harness-authored verdict and firstblockersline: <peer> quota exhausted: ...<peer> rate limited[ (retry after Ns)]: ...<peer> model at capacity: ...- With a hard cutoff: status stays
timeout;blockerslistshard cutoff reached, then the classified line. - Not classified: contradictory evidence (a 429 or 402 beside capacity wording, a 402 beside rate wording), a content-policy stop, and every unrecognized failure stay a plain
blockedwith the provider's own text. - Terminal failure: only a Codex
turn.failedwith no laterturn.completed, even when it carries no message text. A top-level reconnect or retry notice is context inblockers, never the verdict. A terminal failure outranks an earlier model answer. - Wording source: candidate wording from the Codex and Claude Code binaries, not captured wire records. Extend the table when a real stop is captured.
Provenance contract¶
- An envelope is harness-classified only when
incidentis non-null and the incident file'sfaultequals the class. - The verdict and
blockerstext is prose. A peer model can write ablockedresult with the same wording, but its envelope links no incident whosefaultis a provider class:incidentisnull, or after a retry it names atimeoutorunsupported-effortincident. - Consumers decide on the incident
fault, never on verdict text. - Provider classification added no public field of its own.
confidence_null_reasonis harness-authored, a peer cannot set it, and for these classes it equals the incidentfault, so a consumer may read either.
Confidence¶
A result's
confidenceis derived by the harness from the peer's named gaps, never authored by the peer and never a constant. When no number can be derived,confidenceisnullandconfidence_null_reasonnames the cause from a closed set.
- Gap lines: each
confidence_gapsentry reads exactly(-0.NN) <limit>, the deduction from 1.00 with two decimals ((-1.00)at most), a space, then the specific limit: a file not read, a check not run, a claim not verified.(-0.00)names a limit that did not lower the score. - Derivation:
confidence= 1.00 minus the sum of the deductions, exact to two decimals, only forstatuscomplete. An empty list cannot be scored: it is what a peer that skipped the accounting returns, so a peer that finds nothing limiting writes one(-0.00) <reason>line. - Exclusivity: exactly one of
confidenceandconfidence_null_reasonis non-null. The harness rejects a stored or forwarded envelope whose number differs from its own gap lines. - Gaps stay public: the peer's gap lines are kept for every status, as named limits a consumer reports; they are empty when no usable peer answer exists.
- No ceilings: the bridge applies no cap for what the peer could not do, such as a read-only sandbox. A consumer applies its own ceilings and names each one as a gap.
| Code | Status | Incident fault |
Cause |
|---|---|---|---|
quota-exhausted |
blocked or timeout |
quota-exhausted |
Harness-classified provider stop: credit, usage, spend or subscription limit |
rate-limited |
blocked or timeout |
rate-limited |
Harness-classified provider rate limit |
capacity |
blocked or timeout |
capacity |
Harness-classified model-at-capacity stop |
timeout |
timeout |
timeout |
Hard cutoff reached without a classified provider stop |
output-limit |
blocked |
output-limit |
Child output exceeded the capture limit; any partial_output stays unverified |
refused |
refused |
refused or network-preflight |
Recursion depth refused, or a failed github-read preflight |
peer-unavailable |
blocked |
blocked |
The child could not be started, for example a missing peer executable |
peer-failed |
blocked |
blocked |
The child ran and failed for a cause the harness does not classify; read the incident reason |
empty-result |
blocked |
blocked |
The child finished without a usable model result: none, or one that fails the core contract |
incomplete |
partial or blocked |
none of its own | The peer itself reported partial or blocked; on a split envelope, also every wave of a multi-wave partition |
cancelled |
blocked |
blocked, or the completed child's own |
The job owner cancelled the detached job |
invalid-request |
blocked |
blocked |
The request was rejected before any child ran: invalid depth or unsupported effort |
unscored |
complete |
none of its own | The gap list is absent or empty, a line is not (-0.NN) <limit>, or the deductions exceed 1.00 |
not-recorded |
any | any | A stored envelope written before the bridge recorded confidence |
- Incident column: "none of its own" means the code records no incident; after the one timeout or effort retry,
incidentstill links the earlier attempt's record. - Status pairing: the harness rejects a single-call envelope whose code does not fit its status per the Status column, such as
completewithtimeoutorblockedwithunscored;not-recordedfits any status. A merged split envelope is not held to the column: its code is a scope's own cause lifted onto the merged status, sopartialmay pair withquota-exhausted,timeoutorunscored; every wave of a multi-wave partition carriesincompleteorquota-exhaustedbeside any merged status,completeandtimeoutincluded (see Partitioned reviews). - Consumers: count
confidenceonly on acompleteresult. Anullconfidence never enters a minimum, median or aggregate: name it once as a gap with its status and code, and never substitute a number. - Split reviews: the merged envelope keeps each scope's three fields in its
splitsrow and lists every gap line as a string,(-0.NN) split N: <limit>, soconfidence_gapsis a list of strings on every route. Itsconfidenceis the lowest scope score only when every scope has one. Keep the original deductions from the first scope with that score, and write every other scope's gaps with(-0.00). The merged deductions then derive the merged score, and each row retains its original deductions. Otherwise it isnull, and the code isquota-exhaustedwhen any scope hit that stop, or else the first unscored scope's code. - Partitioned reviews: one wave's rows cover only part of a partition, so when
wavesis above 1 every wave, the last included, carriesconfidence: nullwith the codequota-exhausted(a group of that wave hit that stop) orincomplete, whatever its rows scored; no wave's number stands for the partition. The caller derives the partition score after the last wave: the lowestsplits[].confidenceacross every wave's rows, only when every group of every wave has a number. A group without one (a nullconfidence, named by its row'sstatusandconfidence_null_reason) a wave that did not run, or a file named in any wave'sskippedlist leaves the partition unscored: name each once as a gap, never take the minimum over the scored groups alone. Build the partition's gaps fromsplits[].confidence_gapsacross all waves and label each line(-0.NN) split N: <limit>using the row's group number. For a scored partition, keep deductions only from the first group with the lowest score (smallest group number) and use(-0.00)for every other group. These deductions derive the partition score. Use the original row lines as input, since wave-level lines can reflect a wave's local minimum. A partition of one wave is an ordinary split. - Stored envelopes: no integer version was added. A stored envelope that carries none of the three fields predates them and is read back as
nullwithnot-recordedand an empty gap list; one that carries only some of them is invalid.
Incident records¶
schema_versionis 2; readers still accept 1.workspace_deltaisnullwhen no delta was computed (read-only verb, or Git unreadable and no edit reported); otherwise a list:- new
git status --porcelainlines since spawn; file_change <path>entries the Codex transcript reported (Codex only), workspace-relative when inside the workspace, bounded and free of control characters, which cover a file already modified before the call.- A file Git already lists as changed is not repeated from the transcript. A repository that does not ignore
.temp/may list?? .temp/, created by the bridge's own artifacts. - An empty or null delta never proves that no edit landed.
returncodeis the child exit status when a child ran.
MCP inputs¶
MCP surface has three input shapes (
bridge_implement,bridge_advise, andbridge_review); all three names are advertised bytools/list.Each bridge MCP tool requires
taskand accepts optionalmodel,effort,depth,run_id,timeout_seconds, and caller-providedsupported_effortscapability data. Server binds every request to its host-provided launch workspace; model-supplied workspace, background, and session fields are rejected.schemas/mcp-tools.schema.jsondefines all four input shapes.