Repository navigation
feat(minimald): ship a git credential helper in grant boxes (T50) - #2547
norrietaylor merged 11 commits into
Conversation
BEP-015: git sends an Authorization header only when a credential helper answers. A grant box now carries a helper that answers for the GitHub hosts with the box's sealed value, which the Box Egress Proxy substitutes. The helper's configuration is included from the box's XDG git config, so the box's own ~/.gitconfig stays as it is.
BEP-015 gains the requirement for the helper that Gatehouse 6.4 names: it answers git for the GitHub module's hosts with the sealed value.
bep_git_credential_helper_sends_header runs git from a grant box with no helper of its own. It records NOT RUN off macOS, without a sign-in or without E2E_BEP_PRIVATE_REPO (#2500).
…-credential-helper-in-grant-boxes-so-g
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The helper answers with the sealed value for the GitHub hosts only, and that part conforms. Gatehouse §6.4 line 718 also says that the helper must be git's sole helper, with store and cache disabled. The change does not do this. Git reads the included config before ~/.gitconfig and the repository config. A store helper in either one writes the sealed value to ~/.git-credentials. C1 moves the helper to git's command scope with an empty reset, and adds a test. C2 adds the rule to the spec. C3 files an issue for the copied host set.
Ruled at cfa1ae9 against gominimal/arch@109541a48c31 by claude-opus-5-5.
The box user owns its home, so each directory the helper writes is checked for a symbolic link, and files open with O_NOFOLLOW. A start without a usable grant now removes a helper an earlier start wrote.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 9 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_actor/bep_git_helper.rs:218, minimal-foundry[bot] crates/minimald/src/box_actor/bep_git_helper.rs, minimal-foundry[bot] crates/minimald/src/box_actor/bep_git_helper.rs:203, minimal-foundry[bot] crates/minimald/src/box_actor/bep_git_helper.rs, minimal-arch[bot] crates/minimald/src/box_actor/bep_git_helper.rs:245, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
In a grant box with no git configuration of its own, Notes from the agent: Revise round 1. The helper now checks each directory it writes under the box home for a symbolic link and refuses one. It makes temporary files with O_EXCL and O_NOFOLLOW, and it opens the XDG git config with O_NOFOLLOW and requires a regular file. A start with no grant, or with a refused value, removes the helper and its config file. The include line stays, because git ignores an include of a missing file. A small race between the symbolic link check and the write on a directory is still possible. A full fix needs openat-relative writes. The e2e case recorded NOT RUN, because this box has no sign-in and no E2E_BEP_PRIVATE_REPO, so the clone and push proof is not observed. I did not run just clippy-strict. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The helper is not git's sole credential helper. Gatehouse §6.4 line 718 requires that, with store and cache disabled. A credential.helper = store in ~/.gitconfig still runs and writes the sealed value to ~/.git-credentials. I checked this with a real git. A reset in the XDG include does not fix it, because git reads ~/.gitconfig later. C1 sets the helper at command scope through the box environment, and C3 puts the rule in the spec. C2 reads the host set from bep::module::GITHUB, because §6.10 line 851 makes the host set versioned BEP code.
Ruled at f5a3805 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
/revise Round 2 of #2547, on the arch ruling at f5a3805. No round is in flight. T50's layers were widened on 2026-10-25 for this ruling:
One or two commits, Conventional Commits subjects, body lines at most 100 characters. Generated by Claude Code |
…-credential-helper-in-grant-boxes-so-g
The launch now sets GIT_CONFIG_COUNT, GIT_CONFIG_KEY_<n> and GIT_CONFIG_VALUE_<n> for a box whose grant gave it the helper. For each host there is an empty helper, which clears the list, and then the shipped helper. git reads command scope after ~/.gitconfig and the repository config, so a store or cache helper there does not run for a grant host (Gatehouse §6.4). The include in ~/.config/git/config is gone. The host set now comes from bep::module::GITHUB, so minimald depends on bep. Cargo.lock records the new edge.
BEP-015 gains the design's rule from Gatehouse §6.4 line 718. The shipped helper is git's sole credential helper for each host in the GitHub module's host set, and store and cache do not run for those hosts. The minimald test that pins the rule is its verify line. The e2e case now accepts only helpers that git reads at command scope.
|
Round 2 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
A grant box with no git configuration of its own gets the shipped helper as git's sole credential helper for each GitHub host. The launch sets it at command scope (GIT_CONFIG_COUNT), so git clone and git push send an Authorization header with the sealed value for the proxy to substitute. A store helper in ~/.gitconfig or in a repository config does not run for those hosts. The unit test shows this with git credential fill and approve. The live clone and push case is in scripts/session-e2e.sh, but it did not run on this box (NOT RUN, #2500 owns the lane). Notes from the agent: Cargo.lock changed because minimald now depends on bep. It is not in the layers, but the Cargo.toml change needs it. The launcher sets the GIT_CONFIG_* pairs when the box home holds the helper that install() wrote from record.sealed_deliveries. It does not read the record directly, because SandboxLauncher is built in crates/minimald/src/box_actor/launcher.rs, which is outside the layers. This also skips the reset for a box whose sealed value was refused, so that box keeps its own helpers. The pairs start after any GIT_CONFIG_COUNT that the composition sets. I assume that |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The change now conforms to Gatehouse §6.4 line 718 and §6.10 line 851. The helper reads its hosts from bep::module::GITHUB. The launch makes it git's sole helper for those hosts with command-scope GIT_CONFIG_COUNT entries. The minimald test proves that a store helper writes nothing for a grant host. The live clone and push leg is NOT RUN. C1 keeps it open until the macOS lane in #2500 records PASS.
Ruled at 97259d3 against gominimal/arch@109541a48c31 by claude-opus-5-5.
Each directory under the box home is opened relative to the one before it with O_NOFOLLOW. Every file operation then uses that descriptor (openat, renameat, unlinkat), so a symlink that the box swaps in after the check is not followed. A failed write now removes the helper from an earlier start, so the launch does not make a stale helper git's sole helper. The helper log moves to git-credential.log.1 when it is larger than 64 KiB.
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The new commit makes the helper writes safe from symbolic links. It also removes an old helper when a write fails, so a failed write leaves no stale helper. This conforms to Gatehouse §6.4 line 718. The rest of the change keeps the status of the ruling on 97259d3e. One item stays open: the e2e clone and push case records NOT RUN on this lane. C1 records a pass on the macOS lane that #2500 owns.
Ruled at be96fe4 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 3 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
2 threads were already answered in earlier rounds, with nothing new on them since. In a grant box with no git configuration of its own, git uses the shipped helper as its sole helper for the GitHub hosts. Notes from the agent: Round 3. The two minimal-arch threads (C2 host set from bep::module::GITHUB, C3 sole-helper rule in BEP-015) were already fixed by commits c3b970a and 97259d3 at the branch head. This round changed nothing for them. The three minimal-foundry findings are fixed in be96fe4. The file work in the helper module now uses directory descriptors through libc, because the nix 0.31 sources were not on this box to check its API. The e2e case still owes its evidence on the macOS lane with a sign-in and E2E_BEP_PRIVATE_REPO. just clippy-strict was not run. |
|
Round 4 of 10 on a failed check suite: the coder changed nothing. Revise round 4. I changed nothing and made no commit. Failed check Failed check Review threads the coder judged:
|
|
/revise Round 5 of #2547, on the red native lane at be96fe4. No round is in flight. Round 4 found no failing test in the excerpt it saw; the full job log names it.
One commit, Conventional Commits subject, body lines at most 100 characters. Generated by Claude Code |
…-credential-helper-in-grant-boxes-so-g
The launch now names the git credential helper only when the helper file answers with a sealed value that this launch places in the box environment. A helper from an earlier start that a failed removal left behind no longer becomes git's sole helper. A GIT_CONFIG_COUNT that is not a number now adds no helper pairs and logs a warning, so the pairs the box set are not replaced. The e2e case reads the helper log with $HOME in single quotes on purpose, so it carries the SC2016 directive that the other cases use.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 4 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:11800, minimal-arch[bot] scripts/session-e2e.sh:11795, minimal-foundry[bot] crates/minimald/src/box_actor/bep_git_helper.rs:249, minimal-foundry[bot] crates/minimald/src/box_runtime/launcher.rs. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The new commit names the git helper only when the helper file answers with a sealed value that this launch places. A stale helper from an earlier start no longer becomes git's sole helper. That conforms to Gatehouse §6.4 line 718. The host set still comes from bep::module::GITHUB. One item stays open: the live e2e case records NOT RUN, and #2500 owns it (C1).
Ruled at aa9a161 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 5 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
A grant box with no git configuration of its own gets the shipped helper as git's sole helper for the GitHub hosts, and the helper answers with the sealed value, which the proxy substitutes. The unit test shows this. A person still cannot see a live git clone and git push through the proxy on this branch. The e2e case records NOT RUN here, and it needs a sign-in and E2E_BEP_PRIVATE_REPO on the macOS lane of #2500. Notes from the agent: Round 5, one commit (aa9a161). Item 1: the SC2016 hit on the helper-log read in proof_bep_git_credential_helper_sends_header now carries the '# shellcheck disable=SC2016' directive. The single quotes are deliberate, because $HOME must expand in the box. Item 2: the NOT RUN row and its reason stay, and the C1 threads stay open. Item 3: the review bot opened no lint thread, so there is nothing to reply on. The fix commit is aa9a161. The commitlint check fails on two earlier commits: 7de1cc4 (footer-leading-blank warning) and be96fe4 (a body line over 100 characters). The rules forbid a rewrite of commits already on the branch, so those stay. The new commit keeps its body lines under 100 characters. The removed DirFd::is_file had no other caller. I did not run just clippy-strict. |
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of aa9a161f71e4 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
aa9a161 to
50caf46
Compare
|
Reworded Generated by Claude Code |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
This head has the same tree as aa9a161f, so the earlier PASS_WITH_CONDITIONS stands. The shipped helper answers only for the GitHub module's hosts. It is git's sole helper for those hosts, as Gatehouse §6.4 line 718 requires. One condition stays open. The e2e leg bep_git_credential_helper_sends_header is NOT RUN on this lane. C1 keeps it open until the macOS lane records PASS on #2563.
Ruled at 50caf46 against gominimal/arch@109541a48c31 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 50caf4605cf7 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter approval at 50caf46: every merge gate passes at this head (arch PASS at 50caf46, zero open threads, every lane aggregator green). Squash title feat(minimald): ship a git credential helper in grant boxes (T50) and the squashed message pass commitlint. Queued for squash merge.
Generated by Claude Code
…ring (gominimal#2765) * test(e2e): give the BEP grant seeds a GitHub scope and proxy_env steering Five live Box Egress Proxy cases declared `source = "broker"` with no `github:` scope. SecretGrant::is_github needs that scope, so these boxes were credentialed upstreams but not GitHub grants: nothing was minted, and with no steering declared they resolved to `dns`, which has no box-zone resolver yet. None of them could pass on a lane that runs them. - bep_second_box_needs_no_sign_in, bep_box_env_holds_sealed_value_only: add the scope and proxy_env, and start the boxes own_ip with --credentialed-upstream as bep_first_slice_end_to_end does. - bep_git_and_gh_against_private_repo, bep_git_credential_helper_sends_header: add the scope, and admit uploads.github.com, which a GitHub grant's egress must admit (BEP-008). - bep_trust_box_files (the trust-store cases): add the scope and proxy_env. Also corrects two comments that said no box ships a git credential helper; gominimal#2547 shipped it. * test(e2e): start the trust-store grant box with its own IP and a credentialed upstream
T50 — Ship a git credential helper in grant boxes so git sends a header the proxy substitutes
slice: S9
kind: task
covers: BEP-015
size: M
est: 160 code, 180 tests
executor: agent
difficulty: needs care
model: standard
diagnostics:
git credential fillinside a grant box answers for the grant's hosts with the placeholder, andmin box speclists the helper under the grantobservability: one debug log line per helper answer naming the host, never the value
layers:
- spec:
- docs/specs/24-spec-box-egress-proxy/24-spec-box-egress-proxy.md: adds the requirement for the git credential helper a grant box carries (Gatehouse §6.4 line 718), under BEP-015
- box:
- crates/minimald/src/box_actor.rs: declares the new module
- crates/minimald/src/box_actor/tests.rs: the helper's tests
- crates/minimald/src/box_actor/bep_git_helper.rs (new): writes the helper and its
git config credential.helperline into a grant box at creation, for the grant's hosts only, with the sealed value as the placeholder the proxy substitutestest: cargo nextest run -p minimald grant_box_git_credential_helper_answers_for_grant_hosts
- e2e:
- scripts/session-e2e.sh: a case that clones and pushes from a grant box with the shipped helper and no helper of its own; records NOT RUN off macOS, without a sign-in or without E2E_BEP_PRIVATE_REPO (#2500)
test: ./scripts/session-e2e.sh bep_git_credential_helper_sends_header
produces: none
consumes:
- crates/bep/src/forward.rs
proof: From a grant box with no git configuration of its own, git clone and git push send an Authorization header the proxy substitutes.
depends on:
- blocked by T11
- blocked by T18
Proof
A GitHub grant box now carries a git credential helper from its start, written by minimald into the box home. In the box,
git credential fillfor github.com, api.github.com, uploads.github.com or codeload.github.com answers username=x-access-token and the box's sealed value as the password. No other host gets an answer. So git clone and git push send a Basic Authorization header that holds the sealed value, and the proxy substitutes it. The minimald test proves this with a real git. The live clone and push against a private repository are in the e2e case bep_git_credential_helper_sends_header, which this Linux box records as NOT RUN. The macOS lane in #2500 owes that evidence.Notes from the agent: Design: the helper is a POSIX sh script at ~/.local/state/minimal/git-credential-minimal (mode 0700, because it holds the sealed value). Its config is ~/.local/state/minimal/git-credential.gitconfig, with one [credential "https://"] section for each GitHub host. minimald adds one [include] line to ~/.config/git/config and does not touch ~/.gitconfig, so a .gitconfig patch from a composition stays. BoxActor::run writes the helper on every actor start, after create_dirs, so a resumed box gets it too. A write failure is logged as a warning and does not stop the box. A sealed value with characters outside base64url and dots is refused, and no helper is written.
Known limits: (1) minimald does not depend on the bep crate, and Cargo.toml is not in this task's layers. So bep_git_helper.rs repeats the four hosts of bep::module::GITHUB. A change to the host set must change both places. (2) If XDG_CONFIG_HOME is set inside the box, git does not read ~/.config/git/config, and the helper is not found. The box baseline environment does not set it today. (3) A composition patch that writes ~/.config/git/config after the actor starts replaces the include line until the next start.
Observability: the helper adds one line to ~/.local/state/minimal/git-credential.log…[truncated]
Tests
cargo nextest run -p minimald grant_box_git_credential_helper_answers_for_grant_hosts./scripts/session-e2e.sh bep_git_credential_helper_sends_headerVerify
min task run agent-verifyexited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.Base
The base branch moved while the coder worked; it was merged in before the tests ran.
Residuals
mainon the manual macOS lane of T82 — Run the Box Egress Proxy legs on the macOS lane #2500 (epic owner's decision, 2026-10-25; arch's conditions on the legs).Closes #2531
Generated by Claude Code