Expand description
The Coder orchestrator — prompt -> infer -> normalize -> apply.
One method, Coder::run, wires the four pieces together:
build_promptscans the workspace for relevant files and composes a(system, user)pair around the S5 whole-file directive.- The injected
InferenceBackendruns onecompleteturn. normalize_emissionclassifies the raw reply asWholeFiles/UnifiedDiff/Prose.- The classified emission is applied to the workspace:
apply_whole_filesfor the directive’s happy path,apply_patchfor the diff fallback, no-op + warn for prose.
The caller (newt-acp-worker) then runs git diff to capture the
real workspace diff — the foreman’s empty-diff signal is computed
from git diff, not from anything in this struct.
Structs§
- Coder
- The coder. Holds the inference backend the orchestrator uses for
each
runcall; the backend isArc<dyn …>so callers can share one backend across coder + non-coder paths. - Coder
Run - Outcome of one
Coder::runturn. Surfaced via the ACP worker’sTaskReply.emission_shapeso the foreman’s scorecard can distinguish T0a / T0b / T0c instead of lumping them as “empty diff”.