fix(canary): keep a passing smoke's verdict when a Windows fixture holds read-only git objects #6716
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6716"
general
weight: 0.35
JasonBuildAI
Goal And Delivered Outcome
evidence.
per-check fixture root that contained a git object store. Git marks every loose object and
pack read-only, and Windows refuses to unlink a read-only file, so
shutil.rmtreeraisedPermissionError[WinError 5]; the runner then recorded the check as failed although itscommand had exited 0, retained the tree, and put the cleanup error in the check's
reason. The pre-merge gate this repository requires contributors to run(
loopx canary premerge --from-git-diff) attaches thecanary-runnerrisk profile to everycontrol_planepath, so on Windows it reported a failure the diff did not cause for everycontrol-plane diff, and the same host behaviour aborted the shipped issue-fix
repo-branch-fixturecommand, two public reviewer smokes, and the documented pytest facadein
tests/test_smoke_suite.py.invocation of the canary runner reported
status: failed/ok: false/returncode: 0with reason
fixture cleanup failed; retained <TEMP>\loopx-smoke-…before, and reportsstatus: passed/ok: true/failure_count: 0after. See thereal_entrypointandregression_parityrows below.main.Author Declaration
model_agent— an AI agent running in DeepSeek Harness (modeldeepseek-v4.1-flash).AI disclosure: this change was drafted with AI assistance at my request, under my direction
and review. I set the constraints (one host behaviour, both owners it reaches, no unrelated
cleanup or refactor) and reviewed the diff, the failing-before evidence and the check output
before submission.
Implemented against
teardown; the basis is the reproduced defect and its acceptance criteria in
#6710, against base revision
fdf03ec61.| Criterion (spec clause) | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
| A check whose command exited 0 is reported as passed | implemented |
loopx/canary/runner.py::_remove_fixture_root|tests/canary/test_smoke_fixture_cleanup.py::test_a_passing_check_survives_a_read_only_fixture_member;real_entrypointrow || The owned fixture root is removed instead of retained | implemented |
loopx/extensions/process_runtime.py::remove_owned_tree| same test asserts the reported root no longer exists || Cleanup that cannot be confirmed still fails the check and retains the tree | implemented |
loopx/canary/runner.pycleanup-error path |tests/canary/test_smoke_fixture_cleanup.py::test_the_runner_still_reports_cleanup_that_cannot_be_confirmed|| The issue-fix packet's temporary repository teardown no longer raises | implemented |
loopx/capabilities/issue_fix/acceptance_loop.py::_remove_temporary_git_workspace|tests/capabilities/test_issue_fix_temporary_workspace.py;python examples/issue-fix-workflow-e2e-smoke.py|| POSIX deletion behaviour is unchanged | implemented |
remove_owned_treeacts only onos.name == "nt"for attributes; a linked root is refused on every host | the new regression tests pass on POSIX with and without the fix; no POSIX-only path changed || Teardown never changes permissions outside the owned tree | implemented |
remove_owned_treelinked-root guard;_clear_windows_read_only_filesskips linked directories |tests/extensions/test_process_runtime.pysymlink and native-Windows junction no-mutation regressions || A shared hard-linked object is never modified by teardown | implemented |
_clear_windows_read_only_filesleaves any file withst_nlink > 1untouched and letsrmtreefail closed |tests/extensions/test_process_runtime.pyhard-link regression;tests/canary/test_smoke_fixture_cleanup.pyreal-runner regression || Public smokes that carried their own copy of the teardown use the shared owner | implemented |
examples/issue-fix-reviewer-recommendation-smoke.py,examples/issue-fix-reviewer-request-smoke.py|loopx canary smoke-suite --suite full-public --script …sweep row |that attaches
canary-runnerto control-plane diffs; ran the real entrypoints before andafter; confirmed the three remaining
tests/canaryfailures and the fourWinError 32smoke failures are present on the untouched base revision (evidence below) and deliberately
left them out of scope.
remove_owned_treesits inloopx/extensions/process_runtime.pybesideterminate_process_tree, the module thatalready owns teardown of an owned, previously isolated host resource and is imported by
loopx/canary/runner.py,loopx/control_plane/runtime/validation_command.py,loopx/chat_agent.pyandloopx/zcode_goal_mode/diagnostics.py. A new top-level modulewould spend part of the pinned top-level module budget (see #5685) for one stdlib-only
function, and a home under
loopx/canary/would make a capability import the gate it isvalidated by.
Scope And Continuation
touched:
- Four other control-plane smokes fail on native Windows with
WinError 32because a livehelper still holds the directory; that is a different root cause and is already reported
as #6642 (PR #6652).
-
loopx/capabilities/integration_branch/core.pyremoves a git worktree root withshutil.rmtree(..., ignore_errors=True), so on Windows it silently leaves the treebehind. It is a leak rather than a failure and no shipped gate reads it, so it is left
for a separate change.
-
examples/issue-fix-reviewer-request-smoke.pyhas an unrelated pre-existing Windowsfailure (
trusted_clock["secondary_notification_status"]); this PR only stops theteardown error from masking it.
- Other pre-existing native-Windows smoke failures (
bash-dependent installer checks,unprivileged symlink creation, extension doctor readiness,
loopx-update-smoke) remainand are outside this defect.
have their own owner or are named as separate work.
97756955e(value, scope, logic and edge cases, abstraction, test sufficiency, checkplausibility) returned APPROVE WITH NOTES and reproduced the before/after verdict, the two
smoke entrypoints, the facade and the pre-existing failures on the untouched base. Its two
findings are fixed here: (1) the three regression suites ran on no hosted Windows lane, so
the guard was inert where the bug reproduces —
.github/workflows/python-tests.ymlnowqualifies them on
windows-latest; (2) one canary test monkeypatched a symbol this PRintroduces and therefore tested nothing pre-fix — it is now a fail-closed contract test over
the teardown seam (
remove_owned_tree), and the tautologicalshutil.rmtreemock test wasdropped. The reviewer's residual nits are deliberately not applied: the pre-existing
ten-attempt loops in the two example smokes and the five-attempt loop in the issue-fix
teardown keep their transient-race handling, and each attempt now re-walks the tree, which is
bounded by the size of the owned fixture.
d1062324creturnedCHANGES_REQUESTED with one P2 —
os.walkstarts at a root that is itself a directory symlinkor Windows junction, so the Windows attribute pass cleared read-only bits in the link target
before
shutil.rmtreerefused the link (base/head counterfactual through the real runner:target file
0444throughout on base versus0444→0666on head). Fixed at this head:remove_owned_treerefuses a linked or junction root before any attribute change, and theWindows walk now prunes linked directories so a nested junction is not rewritten either. New
regressions cover a directory symlink and a native Windows junction and assert the external
file keeps both its bytes and its read-only attribute. The reviewer's native-Windows and
junction qualification limits are addressed for junction roots by running that regression on
the shipped
windows-powershelllane; a directory-symlink case still skips on hosts withoutsymlink privilege, where the junction case is the discriminator.
5c7f2d9c1returnedCHANGES_REQUESTED with one P2 — a normal local git clone hard-links loose objects, so the
clone object and the source object are one file with one read-only attribute; the Windows
attribute pass cleared that shared bit outside the fixture while teardown still reported
success. Fixed at this head:
_clear_windows_read_only_filesleaves every file withst_nlink > 1untouched, soshutil.rmtreefails closed and the caller retains the fixtureinstead of changing another owner's object. Regressions cover the helper with a hard-link
fixture and the real canary runner (command exits 0, cleanup failure is reported, the fixture
is retained, and the external object keeps
0444and its bytes). Native-Windowscounterfactual: the pre-fix helper returned success and moved the source object
0444→0666; the fixed helper raisesPermissionErrorand leaves it0444. Disclosed tradeoff:a fixture that leaves read-only hard-linked objects behind now reports cleanup failure and is
retained; that is the fail-closed boundary. The shipped issue-fix repository fixture creates
its own objects with
git init(link count 1), so its passing path is unchanged.Validation
803c0e242(basef9bdae675). Independent adversarial reviews wereperformed at
97756955e,d1062324cand5c7f2d9c1; every finding is fixed in this head andnamed under Scope And Continuation.
| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
static|passed|python -m ruff checkover every touched file:All checks passed!.scripts/generate_semantic_inventory.py --changed-from HEAD: no supported new vocabulary carriers (the change introduces no enum, literal or closed set). ||
unit|passed|tests/canary/test_smoke_fixture_cleanup.py3 passed;tests/capabilities/test_issue_fix_temporary_workspace.py1 passed;tests/extensions/test_process_runtime.py9 passed / 27 skipped (the 26 existing POSIX-only process-group regressions plus the directory-symlink case, which needs symlink privilege on this host; the native junction and hard-link cases run and pass here). ||
regression_parity|passed| A hard link to a read-only object outside the fixture, run through the realremove_owned_treeon native Windows: pre-fix the call returned success and the source object went0444→0666; at this head the call raisesPermissionError, the source object stays0444with its bytes unchanged, and the fixture is retained.test_remove_owned_tree_never_clears_a_shared_hard_link_attributefails on the pre-fix helper and passes here;test_a_shared_hard_link_is_not_rewritten_outside_the_fixturepins the same input throughrun_canary_smoke_check(returncode 0,ok: false, cleanup reason, retained root). ||
regression_parity|passed| A root junction to a directory holding a read-only.git/objects-shaped file, run through the realremove_owned_treeon native Windows: pre-fix the file went0444→0666and the helper then raisedCannot call rmtree on a symbolic link; at this head the same call raisesrefusing to remove linked tree rootbefore the walk and the file stays0444with its bytes unchanged.test_remove_owned_tree_refuses_a_junction_root_without_touching_its_targettherefore fails on the pre-fix helper and passes here; the symlink case pins the same contract cross-host. ||
regression_parity|passed| Substituting a plainshutil.rmtreeat the two call sites (the pre-fix behaviour) on native Windows makestest_a_passing_check_survives_a_read_only_fixture_memberandtest_temporary_git_workspace_teardown_removes_read_only_objectsfail withPermissionError[WinError 5] on a.git/objectspath, and makes the pytest-facade check fail withassert False is True. With the owner they pass. On POSIX the same tests pass either way, because unlink ignores the read-only bit there; the Windows host is the discriminator. ||
real_entrypoint|passed|loopx canary smoke-suite --suite full-public --script examples/canary/catalog-planner-smoke.py: beforestatus failed,ok false,returncode 0, reasonfixture cleanup failed … [WinError 5] … .git\objects\…; afterstatus passed,ok true,failure_count 0,stdout_tailcatalog-canary-planner-smoke ok. ||
real_entrypoint|passed|python examples/issue-fix-workflow-e2e-smoke.py: beforePermissionError[WinError 5] fromacceptance_loop._remove_temporary_git_workspace; afterissue-fix-workflow-e2e-smoke: ok, exit 0. ||
real_entrypoint|passed|python -m pytest tests/test_smoke_suite.py --loopx-smoke-script examples/canary/catalog-planner-smoke.py: before 1 failed / 1 passed withassert False is True; after 2 passed. ||
integration|passed| Native Windows sweep of the 33 of 514full-publicchecks that invoke a git object write (loopx canary smoke-suite --suite full-public --jobs 4): failures 20 → 18; checks whose failure mentioned read-only unlink 4 → 0; verdicts changed failure → pass:catalog-planner-smokeandissue-fix-reviewer-recommendation-smoke; no check changed pass → failure. Two checks (issue-fix-acceptance-loop-smoke,issue-fix-reviewer-request-smoke) stay failing for their own, unrelated assertion once the teardown error stops masking it. ||
manual|failed|loopx canary premerge --from-git-diff --git-diff-base f9bdae675on this 9-file diff: 6 direct checks 0 failures (diff hygiene, RFC bilingual,py_compile, module ceiling);risk_profile_run8 executed / 0 failures;boundary_run1 executed / 0 failures;catalog_run8 of 10 passed. The two catalog failures are environment-bound and pre-existing on this host:cli-output-budget-regression-smokeexceeds the 120 s per-check budget (direct run: 202 s, then the knownPermissionError[WinError 32] on a temp root held by a live helper, tracked by #6642 / PR #6652), andissue-fix-json-input-boundary-smokehits a GBK console decode while capturing a UTF-8 child, unrelated to teardown. Aggregateok: falsefor those two; neither touches code changed here. The before run (fix absent, scratch control-plane diff) failed the same section with 3 failures, one of which wascatalog-planner-smokereportingreturncode 0as failed with the read-only reason. ||
static|passed|python -m mypy --platform linux:Success: no issues found in 17 source files(the Windows junction attribute is read withgetattr, so the cross-platformstat_resulttype is not widened).ruff checkover every touched file:All checks passed!; the semantic inventory advisory reports no supported new vocabulary carriers..github/workflows/python-tests.ymladds onewindows-powershellstep that runs the three regression files onwindows-latest, andscripts/ci/test_windows_lane_coverage.pystill passes (2 passed, 12 subtests). Without that step the new suites pass trivially on Ubuntu and never run on the host where the defect reproduces. ||
unit|failed|tests/canaryon this Windows host: 3 pre-existing failures (test_example_symlink_cannot_escape_selected_checkout,test_telemetry_isolation.py::test_update_smoke_minimal_environment_keeps_opt_out,test_telemetry_isolation.py::test_smokes_isolate_routes_and_home_in_serial_and_parallel). Proof they are not from this diff: the same 3 tests fail the same way on the untouched base revisionfdf03ec61in a clean worktree (unprivileged symlink creation, a POSIX-HOMEassumption inPath.home(), and the unrelatedloopx-update-smokeplan assertion). |entrypoint runs on the host where the defect reproduces. Not covered by construction: none of
the read-only-member tests can discriminate on POSIX, where unlink ignores the read-only bit,
so the native-Windows lane is the discriminator and this PR adds the three suites to its
qualification step. The linked-root guard is covered on POSIX by the directory-symlink case,
and discriminatingly on Windows by the junction case, which needs no symlink privilege. The
shared-hard-link guard is covered twice: the helper-level hard-link regression and the
real-runner case, both asserting the external object keeps
0444and its bytes. Itslimitation is deliberate: a fixture that retains read-only hard-linked objects fails closed and
is kept rather than silently rewriting the source. CI on head
5c7f2d9c1passedkernel-static-checks(includingmypy),windows-powershell,typescript-core,dashboard-browser,stage2c, bothbuildjobs and the other lanes; itstest-shardjobswere still pending when this head replaced it, and they are rerunning here. The earlier
d1062324cshard failures weretests/architecture/test_top_level_module_budget.py(amain-side budget mismatch:
loopx/workflow_skill_install.pyis the 146th top-level modulewhile the pinned budget is 145, which reproduces on this head without any diff in that path)
plus two assertions in
tests/test_managed_effect_runtime_fixture.pyandtests/presentation/test_codex_attached_conversation.pythat pass locally on this head andlive in files this diff does not change. This head is rebased onto
f9bdae675, so CI rerunson the exact requested head.
Frontend / Visual Evidence
surface changed.
Type of Change
LoopX Area
Primary area: Build, packaging, installer, or CI (the canary pre-merge/smoke-suite gate); the
shared teardown owner and the issue-fix call site are why Host or runtime integration is also
marked.
Technical Direction
no roadmap S/G/R, milestone card or RFC section is claimed.
Shared-authority RFC fixture impact
contract is touched.
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md). Absolute host paths in the quoted evidence are shown as<TEMP>.python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).