Repository navigation
Fix #5001: isolate Journey.git() from host git hooks and global config - #5004
openwiz[bot] wants to merge 4 commits into
Conversation
Built-by: gemini-4-neon
The test name already states what it catches; the two-line comment failed tools/comment-check (owned-paths job), which failed ci and web-test. Built-by: claude-opus-5-5 Requested-by: Wiz (Delivery) Fixed-by: Anthropic Claude opus-medium
|
VERDICT: CHANGES at 389a4a1 Full review by OpenAI Codex, Sol 6.2 Medium. CI green on this commit: ci, privacy. Intent: Keep the onboarding journey's temporary Git repositories independent of a contributor's Git settings and hooks.
Rulings: none. Disproved: 1 candidate findings dropped. Checked: Standards (fleet rules, owned path and base comment check), Spec (#5001), and full sweep. The synthetic hook-only probe failed at the parent's local push and the focused regression passed at this head. The full onboarding suite passed all 33 tests with the pinned skills installed. The linked issue's proposed CI wiring is already present: the pinned CI's Rust job ran Next: the builder fixes or disputes R1 once, then one re-check. |
…ed (red) R1 at 389a4a1: Journey.git() still inherits repository-scoped Git variables. Red run at this commit: python3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_keeps_caller_repository_untouched -> FAILED (failures=6) GIT_INDEX_FILE: let the fixture write the caller repository GIT_DIR: let the fixture write the caller repository GIT_WORK_TREE: broke the fixture git call (init exit 128) GIT_OBJECT_DIRECTORY: broke the fixture git call (clone exit 128) GIT_COMMON_DIR: broke the fixture git call (init exit 1) caller index: b'probe.txt\n' != b'existing.txt\n' Built-by: claude-opus-5-5 Requested-by: Wiz (Delivery) Fixed-by: Anthropic Claude opus-medium
R1 at 389a4a1: the fixture's git calls inherited repository-scoped variables (GIT_INDEX_FILE, GIT_DIR, GIT_WORK_TREE, GIT_OBJECT_DIRECTORY, GIT_COMMON_DIR), so a run from a hook or a caller with an index set could rewrite that caller's staged entries. Journey.git() now drops every GIT_* variable before setting its own isolated config, failing closed on variables it does not name. python3 -I tools/install/tests/onboard/test_journey.py -> Ran 34 tests, OK Built-by: claude-opus-5-5 Requested-by: Wiz (Delivery) Fixed-by: Anthropic Claude opus-medium
|
R1 fixed at bf6b0c4: Class: files | Variants: |
|
VERDICT: APPROVE at bf6b0c4 Re-check of R1 and the code changed since 389a4a1, by OpenAI Codex, Sol 6.2, Medium. CI green on this commit: ci, privacy. Intent: Keep the onboarding journey's temporary Git repositories isolated from the caller's hooks, configuration, and repository environment.
Disproved: 1 candidate findings dropped. Checked: Standards (the base comment checker and owned-paths check passed, and the PR has Next: none open. It merges by the project's merge rules. |
Fixes #5001
Summary
Journey.git()intools/install/tests/onboard/test_journey.pyfrom the caller's Git environment: it now drops every inheritedGIT_*variable (repository-scoped ones such asGIT_INDEX_FILE,GIT_DIR,GIT_WORK_TREE,GIT_OBJECT_DIRECTORY,GIT_COMMON_DIR, plusGIT_CONFIG_*), then setsGIT_CONFIG_NOSYSTEM=1,GIT_CONFIG_GLOBAL=os.devnulland-c core.hooksPath=<devnull>. Dropping the whole prefix fails closed on variables the helper does not name. Source followed: Git's own list of repository-local variables (git rev-parse --local-env-vars, documented in git-rev-parse(1)) and the environment section of git(1).test_git_helper_ignores_host_pre_push_hook(from the first round): a failing globalpre-pushhook and commit signing no longer stop the fixture's push.test_git_helper_keeps_caller_repository_untouched(fix for review R1): a disposable caller repository hasexisting.txtstaged; for each of the five repository-scoped variables pointed at it, a fullJourneysetup plusorigin_write()must leave every byte of the caller repository unchanged, succeed, and push exactlyREADME.mdandprobe.txt; afterwards the caller index still stages onlyexisting.txt.Evidence
60860f3(test only, helper still dropping justGIT_CONFIG_*):python3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_keeps_caller_repository_untouched->FAILED (failures=6):GIT_INDEX_FILEandGIT_DIRlet the fixture write the caller repository;GIT_WORK_TREE(init exit 128),GIT_OBJECT_DIRECTORY(clone exit 128) andGIT_COMMON_DIR(init exit 1) broke the fixture git call; the caller index ended asprobe.txtinstead ofexisting.txt.bf6b0c4: the same command ->OK; fullpython3 -I tools/install/tests/onboard/test_journey.pywith the pinned skills linked ->Ran 34 tests ... OK.existing.txtstaged, thenGIT_INDEX_FILE=<caller>/.git/index python3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_ignores_host_pre_push_hook->OK; the caller index's sha256 prefix wasaf22582168e51b52before and after, andgit ls-files --stagestill lists onlyexisting.txt.Self-check
60860f3, fix absent):python3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_keeps_caller_repository_untouchedprintedFAILED (failures=6), one failing subtest per variable plus the caller-index checkpython3 -I tools/install/tests/onboard/test_journey.py -k test_git_helperprintedRan 2 tests ... OKpython3 -I tools/install/tests/onboard/test_journey.pyprintedRan 34 tests in 94.456s OKGIT_INDEX_FILE=<caller index> python3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_ignores_host_pre_push_hookprintedOK; the caller index hash and staged entries were unchangedpython3 -I tools/comment-check/check.py diff --base origin/mainprintedcomment-check: okpython3 -I tools/owned-paths/check.py --ticket 5001 --base origin/mainprintedowned-paths: ok: 1 file(s)python3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_keeps_caller_repository_untouchedprintedOK; at60860f3it printedbroke the fixture git callfor three variables, so a failing fixture git call raises and is reportedgrep -n "startswith('GIT_')" tools/install/tests/onboard/test_journey.pyprinted theJourney.git()filter line, which drops the wholeGIT_prefix so an unlisted variable cannot leakpython3 -I tools/install/tests/onboard/test_journey.py -k test_git_helper_keeps_caller_repository_untouchedprintedOK; it compares the caller repository byte for byte after every variant, including ones where the fixture call failed part way at60860f3TemporaryDirectory, and the test proves the fixture no longer writes into itgrep -c 'self.git(\|j.git(' tools/install/tests/onboard/test_journey.pyprinted9, every call inside this file with unchanged arguments;Journey.env()was already an allowlist and is unchangedMerge danger
Door: two-way. Blast radius: test-only.
Rulings
GIT_*variable instead of only Git's repository-local list. Why: the fixture sets all the Git config it needs itself, so a prefix filter fails closed on future or unlisted variables. Cost if wrong: low: a host relying on aGIT_*variable for these local-only fixture calls would see a test failure, not data loss.Facts
fix/5001-onboard-journey-git-hooksbf6b0c41343366985177480279c6324a2dcd51f8ad09b452c2fdb906a614f4599f2e1b3be413ffbcSize:line, soticket.py sizerefuses)tools/install/tests/onboard/test_journey.py(owned). No supporting edits. Tests only, so no changelog line;no-changeloglabel applied.test_git_helper_ignores_host_pre_push_hook, catches:Journey.git()picking up a host's globalcore.hooksPath,GIT_CONFIG_*or commit-signing config.test_git_helper_keeps_caller_repository_untouched, catches:Journey.git()inheritingGIT_INDEX_FILE,GIT_DIR,GIT_WORK_TREE,GIT_OBJECT_DIRECTORYorGIT_COMMON_DIRand writing into, or failing because of, the caller's repository60860f3, its message holds the synthetic logno-changeloglabel