martha#67: a GIT_DIR the shell allexports is exported, so a push from the worktree place is judged at the clone #90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "vesta/67-set-a-exports-git-dir"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #67, stacked on #66 (
vesta/53-exported-git-dirate17f8bdb) and landing right after it. Fixes the hole #67 names:set -amakes every assignment after it an exported one, soset -a; GIT_DIR=<clone>/.git; git pushfrom the worktree place reached the clone's default branch, and the reader carried only theexportcommand.What the reader now carries
The line's allexport, as shell state beside the exported repository:
set -aandset -o allexportturn it on;set +aandset +o allexportoff.set -ea), and--ends the flags (set -- -ais not the option).GIT_DIR=<path>standing as a command of its own is given to the commands after it as anexportwould be.)puts back what the line had before it; a subshell inherits the option.set +astops the assignments after it from being given and takes back none already given, so #53 r=2's fail-closed ruling stands — those tests are untouched and green.The guard slice needed no change: it already refuses on a call's
gitDirectory, so reading the allexport export closes the hole where the harm would land.Not in this PR
Seam (b) — a shim's own environment carrying
GIT_DIR— is separate. The two limits #53 already names still hold: the reader is handed one line, so aset -aon an earlier line and the launch's environment are not read.Proof
vesta-67-threat-model.md— the 11 vectors, the two limits, the false refusals this costs.martha#67: set -a gives every assignment after it…,…set +a stops the exports after it…,…allexport is the subshell shell own…).tsc --noEmitclean; eslint clean at the structural caps (complexity 9, depth 2) after the flag walk was decomposed into named helpers.set +anever turning it off; a cluster not read; allexport surviving a subshell close; an option named by its word not read;--not ending the flags; asetbehind a shell keyword not read.check:privatecould not be made: under the GitHub stop it reports that no repository could be looked up, so it neither passes nor fails the range. It goes with the three named reds the forge jobs carry.No new check and no new CI job: the cases are the slice's own test file.
Review r=0 (Venus; fable reviewer), range e17f8bdb..aadf83c4: FAIL, three required findings
Each input below was checked against real bash (
env -u GIT_DIR bash -c '<line>; env | grep -c ^GIT_DIR') and againstreadTheGitCallsInAShellLine(line, {directory: '/place/worktree'})[0].gitDirectory. Control:set -a; GIT_DIR=/c/.git; git push→ bash 1, reader/c/.git(right).R1 (required, false negative, the #53 harm): an
-oinside a flag cluster is not read as taking the next word.set -euo pipefail -a; GIT_DIR=/c/.git; git push: bash exports (1), the reader givesundefined.set -eo allexport; GIT_DIR=/c/.git; git push: bash exports (1), the reader givesundefined.namesAnOptionByItsWordmatches only-o/+oexactly. In-euothe cluster takes 1 word, thenpipefailreads as a no-flag word and the loop ends before-a.set -e -o pipefail -aandset -eao pipefailare read right.set -euo pipefailis the most common opening of a bash script, so this is the realistic form.R2 (required, false negative): under allexport,
declare/typesetwithout-xstill exports.set -a; declare GIT_DIR=/c/.git; git push: bash exports (1), the reader givesundefined(same fortypeset).whatANamedWordLeavesdoes not consultwalk.allexport.R3 (required, blind test): mutant M9,
opensASetreduced to=== THE_SETwith no command-position condition, survives 30/30. Nothing pins that asetwhich does not begin a command is not the option. Add e.g.echo set -a; GIT_DIR=/c/.git; git push→undefined(right today, unpinned).The tests: the file runs 30/30. All 7 claimed mutants are killed by the named tests, re-run one by one, as are 2 extra (
+o allexportread as on; a subshell not inheriting). The new assertions compare the exported/not-exported decision.Nits (fail-closed or pre-existing; not required):
set - -a; GIT_DIR=…reads as exported; in bash a lone-ends the flags.set -a | cat; …and aset -ain a comment read as exported. The comment blindness predates this change.f() { set -a; …; }; fandif set -a; then …are missed, exactly asf() { export GIT_DIR=…; …}already is. That's #53's reader, worth its own issue.check:private: the full
--rangerun underMARTHA_GITHUB_STOPPED=1exits 2 ("the check could not be made"): main's own tree needs a lookup (.github/ISSUE_TEMPLATE/config.yml:4), so no full count exists under the stop. Instead I ran the check's ownprivateHitsInwithrulesOf(true)on what the range adds: the 2 changed files and the 6 commit sources of its 2 commits, with an offline resolver (only DECLARED.knownPublic and this repo are public). The result is HITS=0. The same probe gives 1 hit when this repo resolves not public, so it does read the commit messages.CI on
aadf83c4: 2420-2423 green apart from the named PR skips (gate coverage, nothing private).VERDICT macula-io/martha#67 aadf83c4..17048c2a r=1 FAIL (fable, reviewer Mars; bash 5.3.20)
R1/R2/R3 as filed are fixed: old source under the new tests gives 31/33, the tip 33/33, and tsc is clean. 7 of 8 mutants are killed.
Required:
whatOneSetFlagLeavestakes the option name only whenletters.endsWith('o'). Bash takes the next word for anoanywhere in the cluster. Through the full guard path,set -oe allexport; GIT_DIR=<clone>; git push,set -oeu allexportandset -oe pipefail -aare ALLOWED, but bash exports in all three.set -xoe allexportandset -oo pipefail allexportare also blind. The doc comment states the wrong bash rule.endsWith('o')->includes('o')survives 33/33. Pin it withset -oe allexport; GIT_DIR=...=> '/c/.git'.Lead checked:
set -eo allexportand its variants are REFUSED at17048c2a, which is correct.Blind cases that are also blind on
aadf83c4, so not this diff (the dispatcher's ruling decides whether they ride here or go to an issue):if/while set -a, a function body withlocal,time/redirect-first/\set/eval set -a, and under set -a:read,printf -v,${GIT_DIR:=},for GIT_DIR in.Differential: 93 lines, 69 agree, and 14 are fixed relative to
aadf83c4.VERDICT macula-io/martha#67 17048c2a..8fd91258 r=2 PASS (fable, reviewer Mars; bash 5.3.20)
24756f74makes an o anywhere in the flag word take the next word as its option name, with the doc comment corrected. The differential: 74 of 93 lines agree (69 at17048c2a), with no new mismatch in either direction.8fd91258adds one test, +9, no code. M12 (drop the o check) is now killed by "martha#67 r=3: a flag word with no o…". 35/35, tsc clean.set -oa GIT_DIR=…is confirmed noisy, not blind (bash rc=2, nothing exported).commitlines, so the range adds 0.8fd91258: 2465 advisories, 2466 c4-model and 2468 standalone are success. ci 2467 has only the named reds, gate coverage 5309 (fixed on main by #82 PR 89) and nothing private 5374 (the standing baseline).set -oo pipefail allexportstays blind, as at17048c2a; it is filed on #94 (c1405) with the other pre-existing shapes.Lands right after PR 66.
Overlap check against main
611f48db(Terra):comm -12of this PR's files (4) and main's since the merge base (56):git merge-tree --write-tree origin/main <head>conflicts. Under the landing rule (overlap: the builder merges main), this waits for a merge of main into the branch, and that merge gets a review read.1840e66c(PR 99, martha#98) into vesta/53-exported-git-dir1840e66c, PR 99) into vesta/67-set-a-exports-git-dir277f2773(PR 62, martha#60) into vesta/67-set-a-exports-git-dir