Skip to content

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

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 10, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

What

The goal acceptance gate validates only the last 4000 bytes of a turn's completion text (executor::execute_turn stores tail(text, 4000) as RunRecord.evidence). A literal written earlier in the reply was invisible to the gate and the refusal said only (missing: [...]), so 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.

This branch makes that case name itself, and states the judged window before the first attempt instead of after it.

Commits

  • fix(goal): name acceptance literals cut by the judged evidence tail

Verification

Run in the main worktree at 6ae7e2f48, Rust pinned to 1.99.1 (the PATH rustc is Homebrew 1.96.0), ulimit -n 8192:

  • cargo fmt --all -- --check → clean
  • cargo clippy -p future-goal --all-targets -- -D warnings → clean
  • cargo test -p future-goal → all suites passed, 0 failed (unit, integration and doc targets)
  • cargo test -p future-goal --test completion_contract → 4 passed, 0 failed

User-visible changes

  • An acceptance rejection whose literals were written but fell outside the judged tail now says so, names each literal with the byte offset it was written at, and asks for a resubmit instead of reporting the token as missing. The verdict is unchanged: the tail is still rejected, and a text that also fails on the full completion still reports missing. Revert 552c1e9e9.
  • The acceptance line in the turn envelope now states the judged window up front ("must land inside the last 4000 bytes") and an acceptance rejection reaches the worker whole — previously the 200-character cap cut a four-token list down to (missing: [dispatches_…. Runaway-narration errors are still capped. Revert 552c1e9e9.
  • No default, permission, migration or flag change.

Notes

  • completion::EVIDENCE_TAIL_BYTES is now the single constant behind the executor's window, the diagnostic and the envelope text, so the three cannot drift apart again.

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:19
@huichen
huichen merged commit 318fd29 into main Nov 10, 2026
28 checks passed
@huichen
huichen deleted the pr/huichen branch November 10, 2026 01:42
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