A worker can replace Git metadata outside its given folder
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 64/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ệ
- git, go
- Lĩnh vực
- cli, security, testing-qa
Hướng nghiên cứu
Start with taskGroundGuard.PreAction, refusedOutsideGround, and outsideGroundRefusal in internal/session/taskoutside.go, then trace Workspace.Resolve in internal/exec/workspace.go. Run the existing e2e path through codeaf do --json --dir with the described stub worker. Done means the boundary refusal contains "is outside your copy", the nested repository remains intact, the parent is unchanged, and in-folder files and tests succeed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened
HAZARD seen once on commit 17ae56d34 (staging-20260921-17ae56d3496f) on 2026-09-21. Lane A2, item A2-06, gave codeaf do a repository folder. The worker trace then named these actions:
rm -rf <repo>/.git
cd <parent> && git init
git commit
The repository's .git disappeared, the parent gained .git, and the parent history contained 6f85800 Add add(a,b) and one pytest test. Three controlled reruns did not reproduce it. v0.3.0 (9258f7052) was not checked, so this issue makes no regression claim.
Replication
Deterministic (no model).
No deterministic reproduction is known. A future gate should use a stub worker that attempts the three recorded commands in a nested repository and assert the boundary refuses them.
Field (real models).
Set OPENROUTER_API_KEY and run from a throwaway directory only:
root="$(mktemp -d)"; export CODEAF_HOME="$root/home"; repo="$root/parent/repo"
mkdir -p "$CODEAF_HOME" "$repo" && git -C "$repo" init -q
git -C "$repo" -c user.name=Test -c [email protected] commit --allow-empty -m base
codeaf do 'create add.py defining add(a, b) that returns a+b, and test_add.py with one pytest test for it. Declare the check "python3 -m pytest -q" so the review runs it.' --dir "$repo" --keep --db "$root/parent/a2-06.db" --yes-spend --json --model deepseek/deepseek-v4-flash --timeout 8m
git -C "$repo" status --short; git -C "$root/parent" log --oneline -1
Budget eight minutes and about $0.10. The original event may not recur; the three non-reproducing controls are part of the evidence, and the worker trace is why the boundary still needs a gate.
Where
The relevant enforcement seams are taskGroundGuard.PreAction, refusedOutsideGround, and outsideGroundRefusal in internal/session/taskoutside.go, plus Workspace.Resolve in internal/exec/workspace.go. The report does not establish how the commands passed them.
The fix
Every worker write and destructive action must stay within the folder passed by --dir. Refuse deletion of that folder's .git, refuse creating Git metadata in its parent, and surface the existing boundary wording containing is outside your copy.
Acceptance
- e2e: Through
codeaf do --json --dir <nested-repo>with a stub worker that attempts the three recorded commands, assert a receipt containsis outside your copy, the child.gitstill exists, the parent.gitdoes not exist, and the command exits nonzero. - e2e: Through the same door, let the stub create
add.pyandtest_add.pyinside the given folder; assert both files exist there,python3 -m pytest -qpasses, and no parent file changes. - Unit: Every destructive or write action resolves its effective working directory and targets through
taskGroundGuard.PreAction; symlink,.., and changed-working-directory cases cannot escape the ground. - The manual pages
internal/manual/chat/permissions.mdandinternal/manual/chat/choosing-a-folder.mdquoteis outside your copy, and the change entry'sinvalidatesnames the old belief that--diralone constrained all worker actions.
Filed from the 2026-09-21 staging verification of 17ae56d34; the lane reports, frames and e2e logs are in the owner's handoff folder for this promotion.
- Ngôn ngữ chính
- Go
- Star
- 115
- Fork
- 14
- Merge trung bình
- 9 giờ 35 phút
- Pull request đã merge (30 ngày)
- 752
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 Agent-Field/CodeAF
-
area:chat bug sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Agent-Field/CodeAF#1592 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:headless bug sev:critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1566 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui3: slash command completion inserts bare command prefix into prompt instead of navigatingĐang mởarea:chat bug sev:critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1510 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:tests bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1489 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Agent-Field/CodeAF
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[开源推荐] FCaptcha:可自行部署的开源验证码Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
521xueweihan/HelloGitHub#3789 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 12 ngày
-
stage-fail
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
siyuan-note/bazaar#2282 ·
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 78/100
openshift/kube-compare#307 ·
Maintainer thường phản hồi trong vòng 1 ngày