Repository navigation
Conversation
pull_request_target loads this file from the default branch, so the trusted base gate on every pull request into codex/thesis-ledger-facts runs from main's copy. That copy starts the base gate with the base's scripts/ on PYTHONPATH and as sys.path[0]. scripts/ is mostly off the gate surface, so a data proposal can add a scripts/tempfile.py or a scripts/receipt/ package unnamed, and from then on it stands in for one the gate imports. This is the ledger branch's version of the file from #459, byte for byte. Every start of the base gate, both --help questions included, uses python -I and sets no PYTHONPATH. Today's base gate still starts this way: it finds its pins as scripts.receipt_pins through the base root that the editable project install appends to sys.path. #459's own Append gate job ran this pairing on ubuntu against base ca7c6fc and accepted the proposal. A base gate from #459 on loads its pins by path. So this copy can land before or after #459, and neither order leaves a window in which a run breaks. The file also picks up the ledger branch's existing tests/test_production_tsa_pins.py line in the push-path test list, which no main run uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carries the thesis-ledger branch's append workflow to main byte for byte, because pull_request_target reads main's copy. The base gate's environment no longer installs this project, so the base checkout's root is off its sys.path, and every start stays `python -I` with no PYTHONPATH. A base gate that still imports its pins by name gets the project installed, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carries the thesis-ledger branch's comment changes to main byte for byte: the legacy branch keeps scripts/ off sys.path but puts the root on it, last, so a module an old gate looks up there still reaches it, and its deletion condition is now one that can be met. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carries #459's workflow change into main, byte for byte, because pull_request_target runs main's copy. Both pull request jobs check the base commit out with --attr-source set to the empty tree, so the judge runs from its committed bytes. A .gitattributes anywhere in the base can no longer stop that checkout partway (a boolean working-tree-encoding, a required filter whose smudge fails), which would fail the trusted job on every later pull request, the one that removes the file included. Nor can it rewrite the gate's scripts or trust anchors. The candidate keeps its attributes. #459 holds the step tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
force-pushed
the
fix/gate-no-scripts-imports-main
branch
from
December 1, 2026 20:05
a4f197b to
c8e4c06
Compare
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.
Draft. Companion to #459.
pull_request_targetloads.github/workflows/thesis-facts-append.ymlfrom the default branch. So the trusted base gate on every pull request intocodex/thesis-ledger-factsruns from main's copy. This PR carries #459's version of that file, byte for byte, as #242 did for--commit.Change
Main's current copy starts the base gate with the base's
scripts/onPYTHONPATHand assys.path[0], in an environment where uv installed the project editable, which puts the base checkout's root onsys.path. Most ofscripts/and the root are off the gate surface, so a data proposal can add ascripts/tempfile.py, ascripts/receipt/package or a rootsitecustomize/package unnamed. From then on that module stands in for one the gate imports, or runs at its startup.The new copy builds the base gate's environment with
uv sync --no-install-projectand starts it withuv run --no-sync ... python -I, with noPYTHONPATH. That applies to every start, both--helpquestions included. #459 has the full account and the end-to-end tests.The new copy also checks the base out with an empty attribute tree (
git -C "$base_gate" --attr-source="$empty_tree" checkout ...), in both pull request jobs. A.gitattributesanywhere in the base, such as a booleanworking-tree-encodingthat two pull requests passing alone can merge in, can then neither stop that checkout, which would fail the trusted job on every later pull request until an admin stepped in, nor rewrite the gate's scripts or trust anchors. The candidate keeps its attributes. #459 has the step tests.Landing order
Land this before #459. Until main carries this copy, the trusted job starts every base gate the old way. A base gate from #459 then loads its pins by path, but
scripts/tempfile.py,scripts/receipt/andscripts/sitecustomize/still reach it, and so does a rootsitecustomize/package where the interpreter has none of its own. The trusted check closes only once this copy is on main.Either order still runs, because this copy is correct against base gates on both sides of #459:
from scripts.receipt_pins importline in the base checkout's copy of the gate and installs the project for that base, as before, still starting it withpython -I. Such a base keeps that gate's limits:scripts/stays offsys.path, but the root is on it, last, so a rootreceipt_pins.py, ascripts/__init__.pyor ascripts/receipt_pins/package still reaches the old gate, and a rootsitecustomize/package runs wherever the interpreter has nositecustomizeof its own. The workflow's comments say so.#459's tests run this file's step scripts against both kinds of base gate, and check that every start runs the base's gate, never the candidate's.
The file also picks up the ledger branch's existing
tests/test_production_tsa_pins.pyline in the push-path test list. No main run uses that list: thepull_requestandpushtriggers only fire forcodex/thesis-ledger-facts.🤖 Generated with Claude Code