S6 — Find and repair bugs
Read Layer 0: shared operating rules, this stage and the assigned input bundle.
Role and write scope
Workers write new search and repair artifacts; approved properties and prior patches stay read-only.
1. Input
The model reviewed in S5, restricted to the scope actually trace-validated.
2. Procedure
- Write timestamped predictions for each bug family before running. Enable known repairs so shallow known failures do not hide deeper ones; record every switch.
- Parameterize hardcoded constants first. At the old values, require matching verdicts and state counts; only then increase one dimension.
- Classify each counterexample as model defect, known bug or new candidate. Attach code steps and a minimal trigger.
- Reproduce progressively: source-level reasoning, real control-code replay with stubs, controlled timing on the real system. State the actual level as Gate 3 names it (
model only,CPU replay of real code,real engine), never rounded up, and any injected behavior. A namedhuman_verifierrequiresreal engine. Putentrypoint,launch_cmd,preconditions,injectedand the hit count with itshit_unitandhit_kindin the finding record, following the recording rules; writeunknownfor a fact not established, never a placeholder. Build each real-code check from a clause by the four parts of a clause check, and record every refused or ineffective operation in its refusal record. Run one-GPU checks in a queue shared with another team as packed jobs (GPU check jobs): one GPU and own CPUs per run, a time cap, GPU memory back to idle, one claim across queues. - Compare repair candidates in the model: the original failure disappears, other safety and liveness properties hold, and removing the repair restores the failure. Then change code and check unpatched N/N versus patched 0/N under the declared trigger. Add a reference arm: a reference implementation of the same contract where one exists, otherwise a control differing only in something a deployment can vary. Take the expected value from that run, not the author's belief; a patched arm that disagrees with the reference arm is not a validated fix.
3. Exit checks
- Triage every candidate and record its reproduction scope.
- Mechanical:
scripts/check_refusals.py REFUSALS.tsv --docs DOC_ROOTchecks that each refused or ineffective operation answers both questions of the refusal rule with the documentation quoted, and that its verdict follows from them; a refusal of a promised sequence is a failure, not a documented precondition. Whether a quote really promises or forbids the sequence remains for the reviewer. For GPU runs,scripts/gpu_pack.py runpasses a job only when every run exits 0 within its cap and every GPU is idle afterwards. - Mechanical: scripts/grade_findings.py checks that every finding record is complete and its stored grading fields agree; evidence and reference agreement remain manual. Run it on the record file before handing back and give its command and last line as done evidence: a record it refuses is incomplete and goes back to its author, and nobody grades it by hand (who assigns).
- For every finding, record its method class, its Gate 1 result (1a and 1b separately) and
found_by(checkerorreading). A finding that fails 1a or 1b is not reported as caught by formal checking. Gate 2 belongs to S5 and Gate 4 to the coordinator; S6 does not wait for them. - Require repair controls and the full regression to match frozen expectations.
- A known-bug baseline matching expectations is not the same as a repaired implementation passing; require the fixed-state contract when validating a repair.
4. Rollback
Return an unrealizable counterexample to S3, or to S2 if the promise or assumption is wrong. A repair requiring a weaker promise returns to S2 for approval. Use a rollback ticket.
Concrete Examples
For PD KV slot reuse, compare repairs that preserve in-flight accounting across reuse. Check both safe release and eventual release, then remove each repair component to test its role.


