Let the last two bin/ scripts run without PYTHONPATH, like the others - #224
Merged
Merged
Conversation
Four of the six bin/ scripts bootstrap their own sys.path, so they run from
anywhere. `embeddings_manager` and `retrieval_baseline` did not, and failed:
$ ./bin/embeddings_manager ls
ModuleNotFoundError: No module named 'data_generation'
The Dockerfile and CI both set PYTHONPATH (`/app/src`, `./bin:./src`), so these
worked there and nowhere else -- including in their own documented usage. That
is the same defect fixed for `evaluate` and `probe_model_temperature` in
cbe20fc; these two were missed.
**The cost of leaving it was not hypothetical.** On 2026-09-14 I hit exactly
this on `embeddings_manager`, worked around it with a PYTHONPATH prefix rather
than fixing it, and then -- because the tool felt awkward -- bypassed it
entirely and called `generate_userguide_embeddings` directly. That skipped the
`use()` call which registers a bundle, so 16 MB of correctly generated user
guide sat on disk invisible to the app, and it took a wasted deploy and a
round trip with Adam to notice. A tool that does not run as documented gets
worked around, and the workaround is where the bug was.
All six now run without PYTHONPATH.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 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.
Four of the six
bin/scripts bootstrap their ownsys.pathand run from anywhere.embeddings_managerandretrieval_baselinedid not:The Dockerfile and CI both set
PYTHONPATH(/app/src,./bin:./src), so these worked there and nowhere else — including in their own documented usage. Same defect fixed forevaluateandprobe_model_temperatureincbe20fc; these two were missed.The cost of leaving it wasn't hypothetical
On 2026-09-14 I hit exactly this on
embeddings_manager, worked around it with aPYTHONPATH=srcprefix rather than fixing it, and then — because the tool felt awkward — bypassed it entirely and calledgenerate_userguide_embeddingsdirectly.That skipped the
use()call which registers a bundle. So 16 MB of correctly-generated user guide sat on disk, invisible to the app, and it took a wasted deploy and a round trip with Adam to notice.A tool that doesn't run as documented gets worked around, and the workaround is where the bug was.
After
ruff,mypyclean; full suite passes.🤖 Generated with Claude Code