Expand description
The native coding loop: plan → edit → verify → repair, on CAR inference.
Shape mirrors car-bench’s InferenceAgentRunner (multi-turn tool-use
conversation) wrapped in car-builder’s repair-loop philosophy: each
iteration appends the previous iteration’s failing check output to a
conversation that PERSISTS across repair rounds (F2, audit 2026-07-06 —
see the note above run_native_loop), bounded each turn by
[compact_history_to_window]. The loop only exits green when
evaluate_contract — not the
model — says so.
Structs§
- Loop
Outcome - How a loop run ended.
- Native
Loop Config - Tuning for the native loop.
Enums§
- Assistant
Generate Error - The typed failure of one ASSISTANT turn’s generation.
- Inference
Failure Kind - The model seam: one turn of generation. Implemented by
InferenceEnginefor production; test harnesses script it (the same injected-generation philosophy ascar-builder). - Loop
Failure - Why a loop run ended without green checks.
- Turn
Generation Error
Constants§
- ASK_
USER_ TOOL - The name of the model-invokable mid-session question tool. Recognized by the
loop (not the
WorktreeExecutor) so the channel plumbing stays with the sink + cancel flag the loop already holds. - REPORT_
NO_ CHANGE_ TOOL - The no-change nomination tool. See
super::no_changefor what the runtime does with a call, and why almost all of that is refusal.
Traits§
- AskUser
- The mid-session user-input seam: the loop hands a prompt to the host, which
surfaces it (emit
UserInputRequested), blocks for the user’s reply (while respecting cancellation and a bound), and returns the text — or anErrdescribing why no answer is coming (timeout, cancellation, no listener). AnErris fed back to the model as a tool error so it can proceed without the answer rather than the loop wedging. - Auth
Gate - Can the runtime reach a usable credential right now?
- Turn
Generator
Functions§
- model_
tool_ catalog - Every tool schema the native coder can advertise across its optional run
modes. Individual runs still filter
ask_user,report_no_change, and graph-memory recall according to the handlers and policy they carry. - run_
native_ loop - Drive the native loop to completion, cancellation, or exhaustion.