Git guard: a call through --git-dir, --work-tree, GIT_DIR or an alias is judged where it was typed #48

Open
opened 2026-11-22 17:56:41 +00:00 by vesta · 0 comments
Member

Purpose (defect): a call that names another repository or runs through a git alias escapes the workspace guard, because the guard judges it where it was typed and knows no alias.

Refs macula-io/martha#45 (the Git guard row, the three MISSING parts). Part of the crew-tools gap work.

What happens now, at 41e8aacc

  • git --git-dir /other/.git push origin main: read_the_git_calls_in_a_shell_line.ts:120 consumes the word pair, so git's command word is still read — but nothing moves. ask_git_what_a_member_is_about_to_change.ts builds the clone from call.directory, so the branches and the default branch are read at the directory the call was typed in, and guard_workspace's push-onto-default rule does not fire for the repository the call really writes. --work-tree <p> is consumed and ignored the same way.
  • An inline GIT_DIR=/x git push is not read at all: the assignment is just another word.
  • A git alias reaches a guarded verb under another word: git -c alias.nuke='push origin main' nuke reads as command nuke, and a config-file [alias] nuke = push origin main does the same. crew-code resolves both before judging (crew-code/bin/member/git:61-69, which asks the real git for the expansion and caps the hops at ten); Martha has no alias concept.

Done when

  • A call naming --git-dir <p> or --work-tree <p>, or carrying an inline GIT_DIR=<p>, is judged at the repository it names: the branches and the default branch are asked there, and the guard's rules fire as they would had the call been typed in it.
  • A call whose command word is an alias is judged as the command it expands to: given inline with -c alias.<word>=<expansion>, or by the repository's own config, which is asked of the real git with config --get alias.<word> in the call's directory. Expansion follows -c settings and stops past ten hops.
  • Each new guard has a mutant that lets a call through, and the test that kills it fails by name.
  • Slice boundaries hold: the reader does no I/O, and the only I/O this adds is the one resolver in ask_git_what_a_member_is_about_to_change.

No new check (DECIDED 2026-11-19 "No new checks without your yes (Recommended)").

Split out, not built here: former workdirs (CREW_FORMER_WORKSPACES) have their own issue — they need the launcher to export the former places plus a declaration field, and they are ordered behind A9 (the launcher).

Purpose (defect): a call that names another repository or runs through a git alias escapes the workspace guard, because the guard judges it where it was typed and knows no alias. Refs macula-io/martha#45 (the Git guard row, the three MISSING parts). Part of the crew-tools gap work. ## What happens now, at 41e8aacc - `git --git-dir /other/.git push origin main`: `read_the_git_calls_in_a_shell_line.ts:120` consumes the word pair, so git's command word is still read — but nothing moves. `ask_git_what_a_member_is_about_to_change.ts` builds the clone from `call.directory`, so the branches and the default branch are read at the directory the call was typed in, and `guard_workspace`'s push-onto-default rule does not fire for the repository the call really writes. `--work-tree <p>` is consumed and ignored the same way. - An inline `GIT_DIR=/x git push` is not read at all: the assignment is just another word. - A git alias reaches a guarded verb under another word: `git -c alias.nuke='push origin main' nuke` reads as command `nuke`, and a config-file `[alias] nuke = push origin main` does the same. crew-code resolves both before judging (`crew-code/bin/member/git:61-69`, which asks the real git for the expansion and caps the hops at ten); Martha has no alias concept. ## Done when - [ ] A call naming `--git-dir <p>` or `--work-tree <p>`, or carrying an inline `GIT_DIR=<p>`, is judged at the repository it names: the branches and the default branch are asked there, and the guard's rules fire as they would had the call been typed in it. - [ ] A call whose command word is an alias is judged as the command it expands to: given inline with `-c alias.<word>=<expansion>`, or by the repository's own config, which is asked of the real git with `config --get alias.<word>` in the call's directory. Expansion follows `-c` settings and stops past ten hops. - [ ] Each new guard has a mutant that lets a call through, and the test that kills it fails by name. - [ ] Slice boundaries hold: the reader does no I/O, and the only I/O this adds is the one resolver in `ask_git_what_a_member_is_about_to_change`. No new check (DECIDED 2026-11-19 "No new checks without your yes (Recommended)"). Split out, not built here: former workdirs (`CREW_FORMER_WORKSPACES`) have their own issue — they need the launcher to export the former places plus a declaration field, and they are ordered behind A9 (the launcher).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#48
No description provided.