AllenNeuralDynamics / AllenNeuralDynamics/aind-dynamic-foraging-bfm-dispatcher

Resumable launcher silently records dispatcher_commit: null from a sandbox checkout

Abierto
#109 0 comentarios 0 reacciones 1 asignado Reclamado por @hanhou Ver en GitHub
bug priority:P2
Lenguaje dominante
Python
Estrellas
0
Forks
0
Merge medio
2 h 9 min
PR fusionados (30 d)
31

Descripción

## Context

`launch_beaker_resumable.py` wrote `"dispatcher_commit": null` into the launch record for a
launch made from the Claude Science Mac sandbox (#107), with no warning on stdout. The rest
of the record was correct, and all three runtime REFs pinned to full SHAs normally.

## Root cause

`_git_sha()` (`code/launch_beaker_resumable.py:70-82`) shells out to
`git -C rev-parse HEAD` and swallows every failure into `return None`:

```python
except Exception:
pass
return None
```

The git-session-isolation route the sandbox is required to use puts the repository's
git-dir at a path **not** named `.git` (the sandbox blocks creating any such path), so a
bare `git -C rev-parse HEAD` finds no repository and exits non-zero:

```
fatal: not a git repository (or any of the parent directories): .git
```

Verified both directions on the same checkout: with `GIT_DIR`/`GIT_WORK_TREE` exported the
call returns `d49b4a8…`; without them it fails as above and the record silently gets `null`.

## Why it matters

The launch record is the artifact that says which dispatcher code composed a launch.
`dispatcher_commit: null` is a provenance hole that appears exactly on the documented
sandbox launch path, and it is silent — the launcher prints the record and reports success.
It is also recoverable in practice (`DISPATCHER_REF` in the same record carries a resolved
SHA), which is why it went unnoticed.

## Done when

- [ ] `_git_sha` failure is surfaced, not swallowed — warn on stderr when it returns None
- [ ] The launcher records a dispatcher SHA when run from an external-git-dir checkout
- [ ] `references/sandbox-launch.md` states the `GIT_DIR` requirement, or the launcher
stops needing it

## Notes

Workaround in use meanwhile: export `GIT_DIR`/`GIT_WORK_TREE` before invoking the launcher.
A code fix could prefer `git rev-parse` in the ambient environment before falling back to
`-C`, since the env vars are already set correctly by the isolation helper.

Verified at dispatcher `d49b4a8`.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.