Skip to content

fix(bench): hoist snapshotWorkdir to module scope - #364

Merged
dahai80 merged 1 commit into
mainfrom
fix-snapshot-workdir-scope
Nov 27, 2026
Merged

dahai80 merged 1 commit into
mainfrom
fix-snapshot-workdir-scope

Conversation

@dahai80

@dahai80 dahai80 commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Problem

#361 shipped with snapshotWorkdir accidentally nested inside runHarness (my insertion anchored after the spawn-promise block instead of at module level). The main loop's timeout-snapshot call therefore throws ReferenceError: snapshotWorkdir is not defined at runtime — observed live on the milestone run (T02 errored, DRA path unaffected because it calls from inside runHarness).

bun build --no-bundle transpiles without type/scope checking, which is how this passed pre-PR verification. Missed by me.

Fix

  • Hoist the helper to module level next to sumTokensFromTranscript, comment updated.
  • Verified with tsc --noEmit (standalone config) — clean; greps confirm a single top-level definition and both call sites resolving.

Process note

Runner changes should be typechecked (bunx tsc --noEmit --ignoreConfig ...) in addition to bun build --no-bundle from now on — transpile-only checks do not catch scope errors.

🤖 Generated with Claude Code

#361 shipped with the helper accidentally nested inside runHarness (the
insertion landed after the spawn-promise block), so the main loop's
timeout-snapshot call at run time threw 'ReferenceError: snapshotWorkdir
is not defined' - observed live on the milestone run (T02). bun build
--no-bundle transpiles without type/scope checks, which is why it slipped
through. Helper is now module-level next to sumTokensFromTranscript;
tsc --noEmit clean.

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 merged commit 9d25d82 into main Nov 27, 2026
1 check passed
@dahai80
dahai80 deleted the fix-snapshot-workdir-scope branch November 27, 2026 01:37
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