trace: a commit made in the same Bash call as the edit loses the session trailer and attestation
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bash, git, go
- Área
- developer-experience, security
Línea de trabajo
Start with HandleCommitMsgHook, which matches staged files against the AI line attributions, and with the PreToolUse and PostToolUse hooks for Bash that record those attributions. The race is that the commit-msg hook runs before PostToolUse writes the attribution, so check the .git/chainloop-trace/commits/<sha>.json output for a missing session_ids. Open pull request #3631 already targets this, so review it before starting. Done means a commit made in the same Bash call carries the session trailer, or pre-push warns when a session's changes are not in any pushed commit.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
When Claude Code changes a file and commits it in the same Bash tool call, the commit gets no Chainloop-Trace-Sessions trailer. The pre-push hook then finds no traced commit, and the push gives no AI coding session attestation. The session is lost without any message.
Example of a single Bash call that loses the session:
echo "change" >> README.md && git add README.md && git commit -m "..." && git push origin my-branch
Why
Trace records the lines that a Bash call changed in the PostToolUse hook, so only after the whole call ends. The git hooks run while the call is still running:
commit-msgruns.HandleCommitMsgHookmatches the staged files against the AI line attributions, but the attribution for this call does not exist yet. No trailer.pre-pushruns and sees no traced commit. No attestation.- The Bash call ends, and PostToolUse records the attribution for the session. It is too late for this commit.
In the run where we saw this, the commit time was 17:02:07 and the attribution recorded_at was 17:02:08. The record in .git/chainloop-trace/commits/<sha>.json has no session_ids, and the attribution stays pending.
An edit with the Edit or Write tool, followed by a separate Bash commit, works as expected, because PostToolUse of the edit runs before the commit.
Expected
A commit made inside a Bash tool call carries the session trailer when the same call changed the committed files, and the push gives an attestation.
Ideas
- In PreToolUse for Bash, mark the session as having a Bash call in progress.
commit-msgcould then compare the staged files with the PreToolUse snapshot and attribute the changes to that session. - At minimum, have
pre-pushwarn when a session recorded changes that no pushed commit carries, so the loss is visible.
Environment
Chainloop CLI 1.122.0, Claude Code in a Docker Sandbox (sbx v0.47, clone mode). The behavior does not depend on the sandbox.
- Lenguaje dominante
- Go
- Estrellas
- 582
- Forks
- 61
- Merge medio
- 12 h 47 min
- PR fusionados (30 d)
- 137
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de chainloop-dev/chainloop
-
feature-parity trace-provider
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
chainloop-dev/chainloop#3802 ·
Los mantenedores suelen responder en 1 día
-
bug trace-provider
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
chainloop-dev/chainloop#3803 ·
Los mantenedores suelen responder en 1 día
-
feat(trace): support GitHub Copilot (CLI and VS Code) in Chainloop TracePosiblemente ocupada @migmartri la tomó hoy. AbiertoFeature spec trace-provider
chainloop-dev/chainloop#3800 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Allow enabling policy enforcement at the workflow contract levelPosiblemente ocupada @migmartri la tomó hace 10 días. Abiertocomponent/backend new-policy spec
chainloop-dev/chainloop#3762 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
chainloop component/CLI performance trace-provider
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
chainloop-dev/chainloop#3756 ·
Los mantenedores suelen responder en 1 día
Todos los issues de chainloop-dev/chainloop
Issues similares
-
GitHub webhook is not subscribed to release events, so `event: release` never triggersPosiblemente ocupada @qsun la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
woodpecker-ci/woodpecker#7542 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
zilliztech/milvus-backup#1386 ·
Los mantenedores suelen responder en 1 día
-
Pipelined flush no longer observes kill signals after #2042: flush backoffer is built with nil varsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
model:sonnet runtime:claude security size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FootprintAI/Containarium#3624 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día