trace: a commit made in the same Bash call as the edit loses the session trailer and attestation
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bash, git, go
- Lĩnh vực
- developer-experience, security
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 582
- Fork
- 61
- Merge trung bình
- 12 giờ 47 phút
- Pull request đã merge (30 ngày)
- 137
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của chainloop-dev/chainloop
-
feature-parity trace-provider
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
chainloop-dev/chainloop#3802 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug trace-provider
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
chainloop-dev/chainloop#3803 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(trace): support GitHub Copilot (CLI and VS Code) in Chainloop TraceCó thể đã có người làm @migmartri đã nhận hôm nay. Đang mởFeature spec trace-provider
chainloop-dev/chainloop#3800 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Allow enabling policy enforcement at the workflow contract levelCó thể đã có người làm @migmartri đã nhận 10 ngày trước. Đang mởcomponent/backend new-policy spec
chainloop-dev/chainloop#3762 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chainloop component/CLI performance trace-provider
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
chainloop-dev/chainloop#3756 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của chainloop-dev/chainloop
Issue tương tự
-
GitHub webhook is not subscribed to release events, so `event: release` never triggersCó thể đã có người làm @qsun đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
woodpecker-ci/woodpecker#7542 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zilliztech/milvus-backup#1386 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pipelined flush no longer observes kill signals after #2042: flush backoffer is built with nil varsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
model:sonnet runtime:claude security size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FootprintAI/Containarium#3624 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày