Skip to content

fix(refiner): emitter validation rejections are feedback, not a fatal model failure - #86

Merged
wilke merged 1 commit into
chian:mainfrom
wilke:fix/emitter-rejection-feedback
Oct 9, 2026
Merged

wilke merged 1 commit into
chian:mainfrom
wilke:fix/emitter-rejection-feedback

Conversation

@wilke

@wilke wilke commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

The mango build build_request_30506a4d… ran on Qwen3.8-27B on 2026-10-09. The Implementer's transcription of asm_next_broker_probe streamed for 598 s and the model call succeeded. The emitter's own validation then rejected the module:

goal_view_mutable at module_source.scope_goal_state: scope_goal_state must use the supplied goal when scoping the view

TranscribedTurnSession.run_turn turns any exception into a coding-turn error. That surfaces as ModelCallFailed: implementer coding call failed; its owning Run must stop., and the build ended interrupted with no receipt. Two other paths already treat an EpisodeEmissionError as a deficit, not a crash: the Builder (service.py) and candidate admission (candidate_source.py).

Fix

  • EpisodeModuleEmitter.emit:
    • new optional repair_feedback, added to the prompt as rejected_previous_emission only when given, so the ordinary Builder prompt is unchanged;
    • a validation EpisodeEmissionError now carries the model's rejected_source.
  • emit_modules:
    • gives each rejected module one repair attempt, passing the rejection and the rejected source (EMISSION_ATTEMPTS = 2);
    • if the module is still rejected, it goes in EmittedSources.rejections, and its rejected source (when there is one) is written to the workspace;
    • candidate admission then reports the same deficit as ordinary feedback, and the next unit finds an existing file, so the coding agent repairs it (the existing "repair uses the coding agent" path).
  • The transcription turn succeeds and names each rejection in final_text and native_result["rejections"].
  • Model-call failures (ModelCallFailed, transport errors) still stop the turn as before.

Tests

  • tests/iterative_episode_refiner/test_emitter_transcription.py: 6 new tests covering:
    • a repair attempt that carries the rejection;
    • a repeated rejection writing the rejected source;
    • a rejection with no source being non-fatal;
    • ModelCallFailed still propagating;
    • the turn reporting rejections;
    • the emitter attaching rejected_source and adding the feedback to the prompt only when given.
  • On the related suites (tests/episode_builder/*, *emit*), this branch has the same 4 failures as origin/main, so none are new:
    • test_api_failure_stops_builder[emission];
    • 2 tests in test_repeatable_call_materialization;
    • test_emitter_failure_is_a_turn_error_and_writes_nothing, whose tmp dir is not empty before the turn runs.
  • Ruff is clean.

Touches the same with model_transport_scope(...) block in transcription.py as #85 (role_scope("emitter")). Whichever merges second needs a trivial rebase.

🤖 Generated with Claude Code

… model failure

A transcription turn turned any emitter exception into a coding-turn error,
which the Implementer reports as ModelCallFailed and which stops the owning
Run. On 2026-10-09 a 598 s Qwen3.8-27B emission that the emitter's own
validation rejected (goal_view_mutable) ended a mango build that way.

- EpisodeModuleEmitter.emit takes optional repair_feedback (added to the
  prompt only when given) and attaches the model's raw source to an
  EpisodeEmissionError raised by validation (rejected_source).
- emit_modules gives each rejected module one repair attempt with the
  rejection and the rejected source. A module still rejected is reported in
  EmittedSources.rejections; its rejected source, when there is one, is
  written so candidate admission reports the same deficit and the next unit
  repairs the existing file with the coding agent.
- The transcription turn succeeds and names each rejection in its text and
  native result. Model-call failures still raise and stop the turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wilke
wilke force-pushed the fix/emitter-rejection-feedback branch from de7c205 to 6bd2d01 Compare October 9, 2026 22:13
@wilke
wilke merged commit 98dadcc into chian:main Oct 9, 2026
33 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant