Harden non-success trajectory truncation

This commit is contained in:
2026-08-07 01:40:36 +08:00
parent c6c583dcee
commit ba7d619624
10 changed files with 360 additions and 171 deletions
+9 -1
View File
@@ -210,13 +210,21 @@ Training use is tracked separately as `SFT_FULL`, `SFT_STEP_ONLY`,
1. The boundary call receives the trajectory as roughly 32-turn blocks without
splitting an assistant action from its immediate tool result. It cannot see
`resolved`, model patches, or reference patches. It selects the earliest
`resolved` or reference patches, but it does see the trajectory's own final
model patch to check task coverage and diff pollution. It selects the earliest
unrepaired major/critical assistant turn, keeps a safe full process trace,
or returns `HOLD` when neither decision is supported.
2. Python slices the exact messages before that assistant turn. The quality call
receives only this materialized prefix, so suffix behavior cannot affect its
score.
For a complete trajectory, the quality call also sees its final model patch. A
truncated prefix never receives that suffix-derived patch. Every non-success
trajectory (`resolved=0` or `-1`) is capped before its first statically detected
state-changing assistant turn. The effective boundary is the earlier of this
local cap and the GLM boundary. This intentionally prefers a shorter, safer
investigation trace.
Successful trajectories skip boundary selection and are scored as complete
trajectories. The command remains simple: