fix(scripts): cross-runtime compatibility for submit and checkpoint - #9
Open
undivisible wants to merge 2 commits into
Open
fix(scripts): cross-runtime compatibility for submit and checkpoint#9undivisible wants to merge 2 commits into
undivisible wants to merge 2 commits into
Conversation
Rewrote submit.mjs and checkpoint.mjs to use only Node.js standard library (child_process, fs, path, url, readline). No runtime-specific APIs. Works with both `bun scripts/submit.mjs` and `node scripts/submit.mjs`. Fixes: - Missing imports ($, fs, question were undefined) - Relative path resolution (used cd .. from CWD, now uses import.meta.url) - fs-extra APIs (pathExists, move) replaced with node:fs equivalents - Bun Buffer stdout (stdout.trim failed, now uses execSync with encoding) - xargs command line limit (presigned S3 URL too long, now passed directly) - Excludes .venv, __pycache__, .DS_Store, mainrun.log from zip Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
scripts/submit.mjsandscripts/checkpoint.mjsto use only Node.js standard library — works with bothbunandnodeFixes
$,fs,questionused as globals (Bun shell preloads only in.ts, not.mjs)node:child_process,node:fs,node:readlinecd ..relative to CWD, not script locationimport.meta.url+fileURLToPathfs.pathExistsundefinedfs-extraAPI, not innode:fsexistsSyncfromnode:fsfs.moveundefinedfs-extraAPI, not innode:fsfs.renamefromnode:fs/promisesstdout.trimnot a function$returnsBuffer, notstringexecSyncwithencoding: "utf-8"xargs: command line cannot be assembled, too longxargslimitcurlAdditional improvements
.venv,__pycache__and.DS_Storefrom submission zip (was 234MB with venv, now ~10MB)Test plan
node scripts/submit.mjsworks (tested on Node 24)bun scripts/submit.mjsworks (tested on Bun 1.3.14)node scripts/checkpoint.mjsworksbun scripts/checkpoint.mjsworksGenerated with Devin