Repository navigation
fix: preflight ipynb-py-convert before generate deletes anything - #331
Merged
Merged
Conversation
generate.py removed the tracked root start_here*.ipynb before py_to_notebook shelled out to ipynb-py-convert, so a missing converter failed mid-run with start_here.ipynb deleted and temp.py stranded. Check the converter is on PATH up front, like the unknown-project guard, and warn when the assistant checkout that stamps Gemini context is behind origin/main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
Before this fix,
autohands generate <project>deleted the tracked rootstart_here*.ipynbbefore callingipynb-py-convert. When that converter wasn't onPATH(it is missing from the PyAuto313 venv), the run failed partway, leavingstart_here.ipynbdeleted and a straytemp.py. This happened to 3 workspaces on 2026-11-04.generate.pynow checksshutil.which("ipynb-py-convert")immediately after the unknown-project guard. If the converter is missing, it exits non-zero with an install hint and "Nothing was modified".build_util.assistant_behind_origin(root)counts how far the assistant checkout is behindorigin/main, using local refs only and never fetching.generate.pywarns, without stopping, when it is behind. A stale assistant silently rewrote the Gemini context of 239 notebooks in the same session.build_util.NOTEBOOK_CONVERTER.Closes #330.
Tests
test_missing_converter_exits_nonzero_without_touching_anythingruns generate with aPATHthat has no converter. It asserts a non-zero exit, a cleangit status,start_here.ipynbstill present, and notemp.py. Control check: it fails against the oldgenerate.py.test_assistant_behind_origin_*covers lag counting and the non-git case.test_tombstone.pysdist-build tests, which fail identically on unmodified main, so they're unrelated.🤖 Generated with Claude Code