Repository navigation
feat(bench): DRA replay — attribute edit units as needed/unneeded - #347
Merged
Merged
Conversation
Phase B of the DRA-lite over-edit experiment (arXiv 2611.34875). - Extract verify into verify.ts so dra.ts reuses the exact predicates without triggering run.ts main(); run.ts re-exports for compatibility. - dra.ts <resultsDir> [--tasks overrides tasks.json]: for each T*.final.tar snapshot (BENCH_DRA=1), extract ordered Edit/Write units from the transcript, restore the snapshot, then revert units cumulatively newest-first, rerunning the task verify at each prefix. While verify keeps passing, the reverted units are jointly unneeded; the first failure marks the boundary unit as needed. Ambiguous inverses (old_string no longer present, Write on a pre-existing file) stop the replay and are reported. Bash-redirect writes are out of scope in v1 and counted as bashWrites coverage. Verified: synthetic fixture with one needed edit (revert breaks file-contains) and one unneeded edit (revert keeps verify green) → needed=1 unneeded=1 ambiguous=0. Full suite 1846 pass / 0 fail. Co-Authored-By: Claude Code <[email protected]>
The #345 snapshot block referenced configDir/outDir/taskId from the main-loop finally, but those live inside runHarness — the first BENCH_DRA=1 run crashed with ReferenceError after T01 (configDir is not defined). Snapshot now runs at the end of runHarness, deriving the task id from logPath and using cwd (the task workdir) directly; it captures every task, and the replay filters by resolved status. Found by the 2026-11-26T08-42-00Z run: T01 completed (525.7s, silentRetry=0) and the run died in the finally block. Co-Authored-By: Claude Code <[email protected]>
Owner
Author
|
Fix pushed: the #345 snapshot block crashed on first live use (configDir/taskId out of scope in the main-loop finally — run T01 completed, then the run died with |
This was referenced Nov 26, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase B of the DRA-lite over-edit experiment (method: Delta Residue Attribution, arXiv 2611.34875; Phase A was #345; design:
code-research/docs/dra-lite-experiment-design.md).verify.ts: verify extracted from run.ts (shared by scoring and replay; run.ts re-exports).dra.ts <resultsDir>: perT*.final.tarsnapshot, extract ordered Edit/Write units from the transcript, restore the snapshot, revert units cumulatively newest-first, rerun the task verify per prefix. Verify-still-green prefixes are jointly unneeded units; first failure marks the boundary unit needed. Ambiguous inverses stop and get reported; Bash-redirect writes counted asbashWritescoverage (v1 blind spot).dra.jsonwith unneededRate.Verified with a synthetic fixture (needed=1, unneeded=1 as constructed). tsc clean, full suite 1846 pass / 0 fail. Next regression with
BENCH_DRA=1(already running) will produce the first real attribution dataset.🤖 Generated with Claude Code