jaahd: undeclared daemon-uid git ops read

Task 7261 · Done · Coder · created · updated

Found while working on Task 7249 (item 4 audit). 1. `apps/jaahd/microvm_images.py` (~lines 477–501) runs `git clone --branch` with checkout, plus `fetch`, `checkout --force` and `clean -fdx`, as the daemon uid with no `clone_identity.cloning` declaration. Its `_git` helper pins only `core.hooksPath`/`core.fsmonitor`, not the full `git_env.NO_REPO_CODE`. For a daemon-uid caller, `cred_broker._resolve_for` reads `clone_identity.current_repo_declaration()` LIVE. That is process-global, so these ops can be served whichever project another thread has declared at that moment. Declare the right project around the network ops (or refuse to serve them), and pin `NO_REPO_CODE`. 2. Generally: on the non-switch branch (`worktree_mechanics._run_git` without the uid split, and `reconcile._fetch_base_blocking`'s daemon-uid branch), the broker serves daemon-uid callers the live global declaration, not the per-thread one that delegated ops get (`clone_identity._own_declaration`). Make the daemon-uid arm per-thread too, or document why it is safe. Out of scope: the session-user (uid-split) delegated path, which is already per-thread; any credential-format change. Done means: - An undeclared daemon-uid git op is served no credential, even while another thread is inside `cloning("X")`, and a test proves it. - `microvm_images` network git runs declared, with `NO_REPO_CODE` pinned. - `./dc check quick` green.

Outcome

Broker now serves daemon-uid git only its registered declaration (clone_identity.run_own), microvm_images clone/fetch declared with NO_REPO_CODE; tests added. Quick green; full gate had only unrelated failures/timeouts. PR #5940 queued in merge lane; follow-up draft #7322.

Pull request

Artifacts

Activity

  • Created
  • Run
  • Runner started
  • Runner ended (done)