Repository navigation
fix(goal): name acceptance literals cut by the judged evidence tail - #1578
Merged
Merged
Conversation
The acceptance gate validates only the last 4000 bytes of a turn's
completion text: `executor::execute_turn` stores `tail(text, 4000)` as
`RunRecord.evidence`, so a literal written earlier in the reply is
invisible to the gate and the refusal says only `(missing: [...])`. On
the measured goal 5 of 6 acceptance rejections were exactly that — the
worker had written the token, the window cut it, and the next attempt
rewrote its prose instead of moving the acceptance line.
- completion: `truncated_acceptance_rejection` tells the two cases apart
(full text passes, judged tail does not), names each literal with the
byte offset it was written at, and states the resubmit requirement.
`truncated_before_acceptance` + `outside_tail` carry the same fact as
fields. The verdict is unchanged: a rejected tail is still rejected,
and a text that also fails on the full completion still says `missing`.
- executor: apply that diagnostic where the record is built, after the
existing `check_record`.
- turn_envelope: an acceptance rejection reaches the worker whole — the
200-char cap cut a four-token list down to `(missing: [dispatches_…`
(runaway narration errors are still capped) — and the acceptance line
now states the judged window up front ("must land inside the last
4000 bytes"), so the common first-attempt miss is prevented, not just
explained.
- `completion::EVIDENCE_TAIL_BYTES` is the single constant for the
executor's window, the diagnostic and the envelope text.
Revert: delete the `truncated_acceptance_rejection` block at the end of
`executor::execute_turn`, restore `truncate(err, GOAL_MEMORY_ERROR_CHARS)`
in place of `failure_cause_text`, and drop the envelope sentence; nothing
else reads them.
Red on revert:
`completion_contract::a_literal_outside_the_judged_tail_is_reported_as_truncation_not_as_missing`
(5648-byte completion, literal at byte 1547 — asserts the refusal names
the truncation and never says `(missing:`) and
`turn_envelope::tests::acceptance_rejection_arrives_whole_and_the_tail_window_is_stated_up_front`
for the whole list and the up-front window.
huichen
enabled auto-merge (squash)
November 10, 2026 01:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
orchestration/goal/src/executor.rs把结案证据截成tail(&summary.text, 4_000)才判定,于是 worker 写了验收要求的字面量、却因为它在 4000 字节窗口之外而被告知
missing。inferjet 的 goal 台账里 6 次验收拒绝有 5 次属于这种假红(
run_33e5f888:全文 5648 B,token 在第 1547 B,窗口从 1648 B 起)——每次假红 = 一整轮 worker run。改了什么(只加诊断与文案,判定语义不变)
missing列表不再被 200 字符截断(4 token 的清单此前会被切成(missing: [dispatches_…);turn_envelope的验收提示明写"这些 token 必须落在证据的最后 4000 字节内"。验证
literal_outside_the_judged_tail_is_named_as_truncation_not_as_missing(正向)与literal_absent_from_the_whole_text_stays_missing(门没变松);acceptance_rejection_arrives_whole_and_the_tail_window_is_stated_up_front;(missing: …);把failure_cause_text换回truncate(err, 200)、去掉第 3 条 → envelope 用例红;cargo fmt --check、cargo clippy -p future-goal --all-targets -- -D warnings、cargo test -p future-goal(lib 489 + 集成套件)全绿。回退
单提交
552c1e9e9,git revert即可;判定窗口与通过条件均未改动,revert 后行为回到"只报 missing"。