Skip to content

fix(bench): DRA replay resolved absolute transcript paths as ambiguous - #356

Merged
dahai80 merged 1 commit into
mainfrom
fix-dra-suite-path
Nov 26, 2026
Merged

dahai80 merged 1 commit into
mainfrom
fix-dra-suite-path

Conversation

@dahai80

@dahai80 dahai80 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Problem

dra.ts replay over the 2026-11-26 BENCH_DRA=1 run produced 22/23 ambiguous units — the dataset was unusable. Root cause: transcripts record absolute file_path (/private/var/.../hg-T02-*/hello.py); inverseApply joined that verbatim onto the snapshot dir, so every existsSync missed.

Secondary bug found in the same pass: the Write inverse reported applied without checking the file exists (T02 produced a false unneeded=1).

Fix

  • toSnapshotPath(file, dir) (exported from verify.ts so it is unit-testable without triggering dra.ts main): strips the transcript path through the hg-* workdir segment, falls back to raw join for relative paths.
  • Write inverse returns ambiguous when the file is missing instead of claiming applied.
  • Regression test: tests/benchmarks/harness-gain-dra.test.ts (3 cases: absolute-with-hg-segment, relative, no-hg-segment fallback).

First valid attribution (post-fix, same run)

15 resolved tasks replayed, 23 Edit/Write units: needed=23, unneeded=0, ambiguous=0, unneededRate 0.000 — below the 15% close line from the DRA-lite design. bashWrites blind spot unchanged (19 Bash-redirect writes out of replay scope v1, reported as coverage).

🤖 Generated with Claude Code

Transcripts record absolute file_path under the runner temp workdir
(.../hg-<taskId>-<rand>/...). inverseApply joined that absolute path
verbatim onto the snapshot dir, so every lookup missed and the whole
replay collapsed to ambiguous (22/23 units in the 2026-11-26 run).
toSnapshotPath now strips everything through the hg-* segment; Write
inverse also no longer reports applied when the file is missing.

First valid attribution on the 2026-11-26 27B run: 23 units, 0
unneeded, 0 ambiguous, unneededRate 0 (below the 15% close line).

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 merged commit 87c4d90 into main Nov 26, 2026
1 check passed
@dahai80
dahai80 deleted the fix-dra-suite-path branch November 26, 2026 23:57
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