Skip to content

trajectory collector ignores verify verdict event from eval transcripts - label stays tool-hygiene only #460

Done

Description

@dahai80

Evidence (live roundtrip with fusion-eval#62 transcripts, 2026-12-02)

The eval harness now writes self-describing transcripts (fusion-eval#62, PR#63): line 1 carries a synthetic first-user prompt event, and the tail carries a fusion_eval_turn_summary event with the final verify verdict (verify_passed, failure_class, timed_out).

The trajectory collector does not consume the verdict. labelTrajectory() in src/services/trajectory/collector.ts:164 labels positive/self_correction by tool-error count only.

Live repro: a verify-PASSED eval session (fc-glm, configfix task, verify_passed: true) containing 1 benign tool error collects as self_correction, so:

  • trajectory export --format grpo emits reward 0 (reward = label === "positive" ? 1 : 0 in exporters.ts)
  • trajectory export --format sft emits 0 samples (SFT requires positive label)

Result: positive count (0) != verify-passed count (1) on the same directory. A task the agent actually completed produces a zero-reward GRPO sample and no SFT sample, while tool-hygiene alone decides the training signal.

Fix

In labelTrajectory() (or its caller): after parsing steps, check whether the raw transcript's last JSON event has type === "fusion_eval_turn_summary". When present, override the label:

  • verify_passed === true -> positive
  • verify_passed === false -> self_correction (failure), regardless of tool-error count

Transcripts without the summary event keep the existing tool-hygiene labeling (no behavior change for normal fusion-code sessions). The summary event is appended as a final line by the eval runner, so a single peek at the file tail is enough - no full second parse needed.

Acceptance

  1. Re-run the same collect/export on the two eval transcripts (one verify-passed with tool errors, one verify-failed): positive count == verify-passed count, GRPO reward matches the verdict in both directions.
  2. A transcript with no turn-summary event labels exactly as before (unit test).
  3. Full bun test src/__tests__/trajectory/ green.

Activity

  1. dahai80 commented on Dec 2, 2026

    @dahai80
    OwnerAuthor

    Acceptance verdict (officer live roundtrip, 2026-12-02)

    PR#461 verified on a fresh main build (v0.8.78). Two fresh fusion-eval transcripts (one verify-PASSED, one verify-FAILED), roundtripped through trajectory collect + export --format sft|grpo:

    session verify_passed tool errors label GRPO reward SFT
    t18-configfix-flags true 0 positive 1 1 sample
    t33-bugfix-median-even false 0 self_correction 0 0

    Key evidence: the failed session has zero tool errors — under the old tool-hygiene labeling it would have collected as positive; the verdict override correctly forces self_correction. Positive count (1) == verify-passed count (1). The passed session exports 1 SFT sample and a reward-1 GRPO sample. Bidirectional acceptance criterion met.

    Pass-direction override stress (verify-passed WITH tool errors) is covered by unit tests (verify_passed=true overrides tool errors to positive (#460), plus the non-boolean-summary fallback test) — trajectory suite 22 pass / 0 fail.

    No-summary transcripts keep tool-hygiene labeling (existing tests all exercise that path).

    Verdict: all three acceptance criteria PASS. This closes the consumer side of fusion-eval#62 criterion 2 - end-to-end chain (eval transcript -> collect -> export -> correct reward) now verified live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions