Skip to content

fix: preflight ipynb-py-convert before generate deletes anything - #331

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/generate-converter-preflight
Nov 4, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/generate-converter-preflight

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Before this fix, autohands generate <project> deleted the tracked root start_here*.ipynb before calling ipynb-py-convert. When that converter wasn't on PATH (it is missing from the PyAuto313 venv), the run failed partway, leaving start_here.ipynb deleted and a stray temp.py. This happened to 3 workspaces on 2026-11-04.

  • Preflight check: generate.py now checks shutil.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".
  • Stale-assistant warning: a new build_util.assistant_behind_origin(root) counts how far the assistant checkout is behind origin/main, using local refs only and never fetching. generate.py warns, without stopping, when it is behind. A stale assistant silently rewrote the Gemini context of 239 notebooks in the same session.
  • The converter name is now one constant, build_util.NOTEBOOK_CONVERTER.

Closes #330.

Tests

  • test_missing_converter_exits_nonzero_without_touching_anything runs generate with a PATH that has no converter. It asserts a non-zero exit, a clean git status, start_here.ipynb still present, and no temp.py. Control check: it fails against the old generate.py.
  • test_assistant_behind_origin_* covers lag counting and the non-git case.
  • The full suite gives 587 passed and 4 failed. The 4 failures are test_tombstone.py sdist-build tests, which fail identically on unmodified main, so they're unrelated.

🤖 Generated with Claude Code

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>
@Jammy2211
Jammy2211 merged commit ac5e2da into main Nov 4, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/generate-converter-preflight branch November 4, 2026 21:42
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.

fix: autohands generate deletes start_here.ipynb when ipynb-py-convert is missing

1 participant