# B3 native-state SPO-style audit Development tooling with **unfrozen defaults**, not empirical evidence or a verified SPO reproduction. The separate [adapter](b3_contract.py) checks the existing [native B3 sequence](../baseline-prompts/b3-spo/README.md). It executes no requests, supplies no quality judgments, repairs no records, and chooses no new incumbent. It validates coordinator-designated links and recorded selections. All outputs are coordinator-only, outside artifact-quality packets and adaptation; directory names do not enforce confidentiality. ## Native scope and interface Use [manifest-b3.template.json](manifest-b3.template.json) with manifest version **1.2**, run scope `b3-native`, and contract `b3-spo-native/1.0`. Nulls are blank placeholders, not observations. Fill an explicit inventory of already sealed runs and records, then use the existing `prepare`/`summarize` commands in the [main guide](README.md). Existing 1.0/1.1 manifests and adapter schemas remain unchanged. A 1.2 manifest may mix native B3 rows with the existing 1.1 scoped row variants, keeping every run in every supplied archive assigned exactly once. B3 is **not projected onto B1/B2 history**. Its optimizer receives only the full public packet and one incumbent directive/artifact pair. Workers use fresh candidate-worker contexts. Comparators receive anonymous output bundles, and selection sees only pair identities and vote records. Earlier/rejected state remains in coordinator records, not additional generator input. Initialization uses B3's unchanged `candidate-worker.txt` wrapper with `P0`, the directive paragraphs of `common-initial-worker.txt` before the packet label. The reversible default removes only terminal CR/LF separators from that prefix. The directive source is hash-pinned, but the resulting request is **not** the common-initial template and makes no byte-identical initialization claim. Native initialization is reported separately; B3 is out of scope for the existing common-initial/continuation-history coverage fields. `whole_run_compliance_certified` remains false. Structural success cannot establish honest logging, hidden system/chat context, genuine receipt, semantic provenance or absence of leakage. ## Coordinator graph Use the six existing run identity fields, archive alias/seal ID, Boolean `packet_inventory_complete`, and these native fields: - `states`: unique `state_id`, directive `prompt` string or null, and `artifact_record_id`/`artifact_sha256` (both null if unavailable). An artifact must be a sealed `artifact` record in this run; responses and analyses cannot substitute for delivered text. Null prompt/artifact evidence remains unknown. - `initialization`: its `state_id`, every `worker_attempts` entry, and the explicit `artifact_attempt_id` producing the retained initial artifact. Each worker entry has `attempt_id`, `artifact_record_id` and `artifact_sha256`. Retain all failed and retry attempts; a missing captured artifact has null record/hash. - `iterations`: unique `iteration_id`, increasing positive `sequence`, explicit `incumbent_id`, one new `candidate_id`, generation attempts, explicit chosen `generation_attempt_id`, worker attempts and `artifact_attempt_id`, four comparison slots, a selection descriptor, and `next_incumbent_id` (or null if unknown). Each selected generation response supplies exactly the XML-decoded `` used by that iteration's worker attempts. Designations do not mean a best prompt or artifact was inferred; retry/output-retention policy still needs human audit. - Nonworker attempts have exact fields `attempt_id`, `response_state`, `response_record_id`, `response_sha256`. `available` names a sealed UTF-8 `operational_record` linked to that attempt. `not_produced` and `unavailable` require null record/hash; they are explicit declarations, not deductions from success/failure status. Unavailable responses remain unknown. Known malformed XML is recorded as a mechanical failure; it is never repaired into a proposal or a valid vote. A malformed chosen proposal cannot feed a worker execution. - Each comparison slot has `round` (all four distinct values 1–4), `a_id`, `b_id`, `attempts`, and `vote_attempt_id`. A/B must name incumbent/candidate in either order. Explicitly designate which attempt supplied the recorded vote; do not select one by preference. An unattempted round uses an empty list and null vote ID. An attempted request with missing input instead retains a packet slot. Retain extra failed and retry comparisons even when their outputs were unused. - `selection` has `state` (`available`, `not_executed`, `unavailable`), `record_id`, `sha256`, `selector_attempts`, and `result_attempt_id`. Default deterministic selection has no model attempts. A separately reported model-serializer variant must declare all selector calls/retries and the explicit result-producing attempt. Its exact input/output is checked against the same recorded decision, not counted as an extra vote. All such calls remain chargeable under existing accounting. - `final_incumbent_id` must agree with the declared chain and, when available, its artifact must match the archive's prescribed final endpoint. A missing endpoint is unknown. A known different endpoint is rejected, never replaced. - `packets`: one `input_scope: "native"` entry for every declared model attempt, with existing packet/attempt IDs, increasing request sequence, record ID and hash. Use null record/hash for missing inputs. Packet IDs remain unique across the whole audit. No deterministic selection operation is fabricated as a model call. Default archived roles are `worker` for initialization/candidates, `optimizer` for generation, `comparator` for judgments and optional `selector`. Every adaptation attempt with these roles must be explicitly assigned to a stage. Each nonempty stage/round contains one root plus transport retries; retry links cannot cross stages, rounds or iterations. Initialization, iteration and request chronology is caller-declared and checked for consistency. Stages, pairings and winners are never inferred from prompt content or archive-array order. Historical truth and whether a purported retry was actually justified remain outside structural checks. ## Literal input and link checks The four original templates are pinned by SHA-256 in `TEMPLATES`; their literal wrappers, block order and terminal newline must remain unchanged. Valid compact or indented JSON is accepted without rewriting source bytes. Duplicate JSON keys, unresolved placeholders, invalid UTF-8, extra blocks/prose, unknown identities, unsupported contracts, duplicate attempts and inconsistent hashes are rejected. The common input byte cap applies; the legacy memory-entry bound is unused here. Generation/worker inputs require the decoded complete public packet to match the immutable registry hash and task ID. Generator state must exactly match its declared incumbent prompt and linked delivered artifact. Worker input must equal the chosen generation response's complete XML-decoded prompt, without forwarding analysis or modification elements. Whether it makes one substantive valid change or preserves all obligations is a **human semantic question**. No generated quality diagnosis or correctness claim is accepted as independent assessment. Comparison inputs must contain exactly one complete public task and one output per side with only `task_id` and `text`. Their task IDs/order and full text must match the declared A/B states. Prompt identities, histories, earlier votes and success labels have no model-facing fields. Opaque A/B labels cannot remove intrinsic disclosures inside artifact text, and consistent mappings do not prove independent randomization or probability 1/2. The adapter neither randomizes nor generates judgments. Strict XML parsing accepts only the documented elements; DTD/entity declarations, nested markup and malformed choices are not repaired. ## Recorded deterministic selection Archive the coordinator's actual record as a UTF-8 `operational_record` using [selection-record-b3.template.json](selection-record-b3.template.json): an explicit audit envelope with `selection_record_version: "1.0"`, `records`, and `result`. This envelope is an unfrozen archival choice, not an extra published SPO mechanism. `result` retains the existing selection template's exact eight-key JSON contract. Do not populate it by asking this audit utility to choose a winner. The validator checks the supplied result against the documented rule: exactly four valid, correctly identified rounds map A/B choices to states; promote only for a strict candidate vote majority; 2–2 retains the incumbent. Incomplete or invalid records must retain the incumbent with **both** vote totals null and `reason: "incomplete_keep_incumbent"`. Valid source choices and the record's A/B mapping must agree with the declared comparison bundles. Unknown response evidence is never recovered from a claimed choice. Available invalid XML yields only an invalid/null choice, not an invented forced preference. The next declared incumbent must equal the supplied selection's `selected_id`; the next generator must use that state. If selection was explicitly not executed, the declared next state must retain the old incumbent. If its record is unavailable, chain verification remains unknown; the utility does not select a replacement. Optional model-selector requests must have the unchanged `selection.txt` wrapper, only its three permitted values, and an output identical to the recorded result. ## Coverage and human judgments Existing blank independent/adjudicated forms and exact hash-bound packet evidence are reused unchanged. Copied files contain recorded requests only, named by opaque packet indices, with `b3_*_input` kinds in the coordinator context. Artifacts and generator/comparator/selector response records are not promoted to extra request packets or quality ratings. They remain sealed coordinator records. `b3_native_coverage` separates initialization calls, stage and outcome counts, retries, unknown inputs/responses, malformed outputs, incomplete iterations, complete-comparison nonpromotions, and incumbent retention due to incomplete comparison. Missing required state/artifact provenance is conservatively unknown, even when an interrupted iteration retained its old incumbent. Known incomplete iterations remain recorded and are not task-completion claims. Every assigned run stays in condition/series denominators; no failed or unfavorable run is dropped, replaced, repaired or rerun. A confirmed human violation remains noncompliant despite other gaps; a zero judgment cannot imply scoped compliance when required evidence or review is missing. Independent agreement and adjudication remain separate. Hashes prove byte consistency, not preregistration, prior immutability, exhaustive logging or semantic purity. No native scope certifies the entire run, establishes SPO fidelity/strength, or changes primary quality scores or resource accounting. The study remains untested; no study inputs, judgments or findings are supplied. ```sh cd 'Japa two/observation-boundary' python3 -B -m unittest -v test_b3_contract.py ``` Tests use temporary artificial text/numeric fixtures only.