Repository navigation
Keep the whole Debug mode rule in createBintastic - #372
Merged
Merged
Conversation
scalvert
force-pushed
the
fix/project-lifecycle
branch
from
November 3, 2026 17:05
e70f5c0 to
f1f9339
Compare
The rule for keeping a Project on disk was split across three places: createBintastic marked the Project preserved after a Debug mode Run, the Project lifecycle read BINTASTIC_DEBUG again at teardown, and the lifecycle exposed preserve() and `active` only so that glue could reach in. Merge the lifecycle into createBintastic so one module owns the active Project, its preserved flag, starting Runs, and teardown. planRun stays the pure seam for args, binPath, and Node flags. The one visible change: "Debugging enabled" is logged once per Project, at its first Debug mode Run, not on every Run. Tests now sit at the public interface. project-lifecycle-test.ts and index-test.ts are replaced by create-bintastic-test.ts, with one test per behavior, and the json, text, and BintasticProject tests move to their own files unchanged. CONTEXT.md adds "Preserved Project", and the debugging guide states that a Run's own env can't stop its Project being kept.
- Guide says a Run's env only controls the inspector, but a Run's env that turns Debug mode on also preserves the Project - Usage guide says teardownProject removes the directory, without the debug-mode exception - No test for setupProject after a Debug mode Run without an explicit teardown
scalvert
marked this pull request as ready for review
November 3, 2026 17:07
scalvert
force-pushed
the
refactor/debug-mode-lifecycle
branch
from
November 3, 2026 17:07
4e30dec to
9d8ffc9
Compare
1 of 2 tasks
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.
Stacked on #358.
Problem
The rule for keeping a Project on disk at teardown was split across three places.
createBintasticmarked the Project preserved after a Debug mode Run and logged its path. The Project lifecycle readBINTASTIC_DEBUGagain at teardown. The lifecycle also exposedpreserve()andactiveonly so thatcreateBintasticcould reach in. Understanding Debug mode meant reading all three.Change
project-lifecycle.tsintocreateBintastic. One module now owns the active Project, its preserved flag, starting Runs, and teardown.planRunstays the pure seam for args,binPath, and Node flags.CONTEXT.mdas Preserved Project: a Project is kept when any Run against it was in Debug mode, or whenBINTASTIC_DEBUGis on in the process env at teardown. A Run's ownenvcan turn Debug mode on for that Run, which also preserves its Project, but it can't stop the Project being preserved. This matches the behavior on Keep preserved fixtures across the suite and make teardown safe #358. The debugging and usage guides now say so too.Tests
The tests now run against the public interface, with one test per behavior.
create-bintastic-test.tsreplacesproject-lifecycle-test.tsand thecreateBintasticblock ofindex-test.ts. Fake Projects come in throughcreateProject, and env changes usevi.stubEnv.run-plan-test.tsalready covers (binPathvariants, static args) are no longer repeated end to end.json,text, andBintasticProjecttests move to their own files unchanged.setupProjectright after a Debug mode Run.Verification
npm testpasses: lint, format, docs check, and 73 tests.npm run buildandnpm run test:packagepass.create-bintastic-test.ts.