Skip to content

fix(goal): name acceptance literals cut by the judged evidence tail - #1578

Merged
huichen merged 2 commits into
mainfrom
dev-huichen
Nov 10, 2026
Merged

huichen merged 2 commits into
mainfrom
dev-huichen

Conversation

@huichen

@huichen huichen commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

为什么

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。

改了什么(只加诊断与文案,判定语义不变)

  1. 构造 record 时全文与截断后的 evidence 各判一次;全文过、尾巴不过 ⇒ 错误文本点名这是截断造成的,并给出字节位置与"重投时把验收行放进最后 4000 字节"的要求;
  2. missing 列表不再被 200 字符截断(4 token 的清单此前会被切成 (missing: [dispatches_…);
  3. 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;
  • 双向证伪:删掉诊断块 → e2e 红且报的正是旧的 (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"。

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
huichen enabled auto-merge (squash) November 10, 2026 01:29
@huichen
huichen merged commit ee6d1fe into main Nov 10, 2026
28 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