Sandbox routing test fails when TMPDIR lies under ~/.cache (C6 overlap with the per-launch cache projection)
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
- 48/100
Hướng nghiên cứu
Read tests/test_sandbox_routing.py::test_an_all_pi_run_is_sandboxed_in_every_child and the _place_declared Bind branch in src/autoforge/sandbox.py. Reproduce with TMPDIR=$HOME/.cache/tmp on a host that can enforce the sandbox, then inspect how the test chooses its fake Pi install path. Done means make check passes in that setup, the enforced all-Pi run remains covered, and a regression test confirms C6 still refuses a provider path inside a projected location.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Artifact: follow-up defect report (test hermeticity). Found while verifying PRs #296–#300 on 2026-10-23. An AI agent session filed it on the maintainer's instruction, through the maintainer's gh login.
Problem
tests/test_sandbox_routing.py::test_an_all_pi_run_is_sandboxed_in_every_child fails on any host where TMPDIR (and therefore pytest's tmp_path_factory root) lies under $HOME/.cache. The other tests pass there. The test passes on CI, whose runners use /tmp. It fails the same way on an unmodified main (12e10f4), so make check cannot go green on such a host for reasons unrelated to the change under test.
autoforge.errors.SandboxPolicyError: sandbox policy refuses ~/.cache/tmp/pytest-of-<user>/pytest-<n>/pi-install0: C6 overlaps: ~/.cache/tmp/pytest-of-<user>/pytest-<n>/pi-install0 (provider) overlaps the projection ~/.cache/tmp/pytest-of-<user>/pytest-<n>/test_an_all_pi_run_is_sandboxe0/.git/autoforge/sandbox/2/cache
src/autoforge/sandbox.py:1151: SandboxPolicyError
Cause
- The test places the fake Pi command in
tmp_path_factory.mktemp("pi-install")(tests/test_sandbox_routing.py:955). - Under
required, a launch projects its per-launch cache directory (<git common dir>/autoforge/sandbox/<n>/cache) onto the cache location inside the sandbox. - With
TMPDIRunder~/.cache, the provider path falls inside that bind's target._place_declared(src/autoforge/sandbox.py, theisinstance(outer, Bind)branch) then correctly refuses it as C6. - The refusal is the policy working as designed. The test assumes its temporary tree is outside every sandbox projection, which the host decides.
A secondary diagnostic point: the message names the bind's source (…/sandbox/2/cache), not its target (the cache location inside the sandbox). The two paths shown do not overlap literally, which makes the refusal hard to read. An operator whose provider command lives under ~/.cache would see the same message.
Reproduce
TMPDIR=$HOME/.cache/tmp uv run pytest -q "tests/test_sandbox_routing.py::test_an_all_pi_run_is_sandboxed_in_every_child" # fails (needs a host that can enforce the sandbox)
uv run pytest -q --basetemp=/some/dir/outside/home/.cache "tests/test_sandbox_routing.py::test_an_all_pi_run_is_sandboxed_in_every_child" # passes
Proposed fix
- Make the test independent of
TMPDIR: place the fake Pi install directory outside every path the sandbox projects, or skip with a stated reason whentmp_path_factory's root lies under a projected location. Do not weaken the C6 check. - Optionally, name the bind's target as well as its source in the C6 message.
Acceptance
-
make checkpasses on a capable host withTMPDIRunder~/.cache, and the test still exercises an enforced all-Pi run where the host allows it. - The C6 policy is unchanged; a regression test pins the refusal of a provider path inside a projected location.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 0
- Merge trung bình
- 5 giờ 42 phút
- Pull request đã merge (30 ngày)
- 64
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: 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 iceboundrock/AutoForge
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
iceboundrock/AutoForge#304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
iceboundrock/AutoForge#303 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
iceboundrock/AutoForge#302 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
iceboundrock/AutoForge#295 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[ENV-C5] Network egress mediation and model-endpoint allow-listing for container backends (post-MVP)Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
iceboundrock/AutoForge#294 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của iceboundrock/AutoForge
Issue tương tự
-
Project submission:Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slavakurilyak/awesome-ai-agents#845 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdifficulty:2 enhancement good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
MakazhanAlpamys/Soup#2178 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
scverse/rapids-singlecell#854 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLCó thể đã có người làm @ninglinLiu đã nhận hôm nay. Đang mởarea:frontend backend:slang bug direction:input
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 13 ngày