Repository navigation
fix(ci): stop Git descendants before standalone checkout reuse - #132169
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Verified pre-merge boundary finding on In Native Linux proof executed the exact extracted owner with
Original extracted Python SHA-256: Please preserve the canonical ordering verified drain → cancellation decision → timeout/Git result, with cleanup uncertainty still terminal and higher priority. Repair it once in the owner, not with another npm-lock status guard. The scratch fix demonstrates the ordering but is not presented as landed code or complete review of setup-error precedence. Add the during-drain regression before merging; the outside-CI owner extraction will reuse the corrected primitive rather than fork it. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 10:01 PM ET / August 29, 2026, 02:01 UTC. ClawSweeper reviewWhat this changesThe PR moves standalone CI Git checkout and supplemental-fetch paths under one process-tree owner, adds lifecycle regressions, and documents the fail-closed cleanup contract. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer merge judgment: current main still leaves these standalone checkout paths on GNU timeout, so the PR is not redundant; the introduced owner, regression coverage, and supplied exact-head CI evidence show no actionable defect. Priority: P2 Review scores
Verification
How this fits togetherCI jobs fetch revisions into workspaces before later steps consume or delete them. This workflow owner contains each Git process tree so timeout or cancellation cannot authorize reuse until descendant cleanup is verified. flowchart LR
A[CI checkout job] --> B[Git process owner]
B --> C[Fetch or checkout]
C --> D{Timeout or cancellation}
D -->|No| E[Workflow consumer]
D -->|Yes| F[Verify process cleanup]
F -->|Clean| E
F -->|Uncertain| G[Fail CI safely]
Decision needed
Why: The implementation is source-supported and tested, but it changes a cross-job CI process-lifecycle boundary whose operational rollout requires maintainer acceptance. Before merge
Agent review detailsSecurityNone. PR surfaceTests +821, Docs +2, Config -104, Other 0. Total +719 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt the single fail-closed Git owner for the standalone callers while retaining their existing retry, depth, reference, and fallback contracts. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the Linux fixture executes the parsed workflow owner with a real descendant process tree and checks that no consumer runs after cancellation during cleanup. Is this the best way to solve the issue? Yes: centralizing ownership at the Git producer preserves each caller's policy while preventing downstream workspace reuse from compensating for an unjoined process tree. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 81e9f85efca6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Addressed the raw cleanup cancellation finding in 6d0ee7414d4a5061857bfc4adba67efde78d182f. The new regression exposed a real ordering bug, not only missing coverage: a pending The native Linux case signals the raw Python owner only after the complete fake-Git tree exists and actual TERM delivery proves cleanup has started. The fixture revalidates that owner's Linux birth identity and Bash parent immediately before signaling it. Before the fix, the actual npm-lock workflow returned success and launched the full sweep after cancellation. After the fix, it returns 143, invokes no consumer, and records no surviving descendants. A supplementary red/green run used an actual wall-clock timeout (two-second test deadline, with real TERM grace and cleanup), rather than readiness-controlled timeout injection, and produced the same results. All 63 native Linux cases and all 20 macOS shared-checkout cases pass. Changed checks, type/lint checks, workflow validation, formatting and fresh independent P0 autoreview are clean. No cleanup assertion, production timeout, or caller fallback guard was weakened. The earlier CI failures are accounted for: the inherited failed-inspection join gap was repaired in 7c03b6485bb2463746722d77be3e38e51e697ffd; the separate main-side UI shard overflow was fixed by the native-assets and UI-shard repair, PR #132193, without raising the 720-root limit. Fresh merge ref CI run 33222894331 passed all 127 executed jobs on Integrated Linux proof passes all 64 cases. The macOS original-order run passed the 20 existing shared cases and the guards/routing tests; its new retained-zombie case initially hit the fixture's starting-directory containment guard. A one-line test launch correction starts that subprocess inside its owned temporary workspace; the targeted macOS case and complete Linux rerun pass without weakening the guard or assertions. Integrated changed checks and fresh independent P0 review are clean. Production workflow delta is now -104 lines; test/support delta is +751. The rebased CI run 33225195558 passed the Linux and other lanes but failed the Windows shared recovery fixture: an attempt-one PID appeared at harness checkout after five intervening absent observations. That is reuse-shaped evidence, not definitive creation-identity proof or a demonstrated production leak. Direct inspection of the actual CI Node/libuv signal-zero implementation confirms each probe opens a fresh handle by PID. 8790d906143daf7212fc11147f9477370d1235d4 repairs the concrete fixture defect: observed-dead registrations cannot revive when a PID is reused. Retirement is per instance, not per PID, and is persisted across the separate command observers. New registrations remain checked. Windows records death only on ESRCH, keeps EPERM potentially alive, and fails on unexpected probe errors; the checked POSIX census remains. A boundary regression first observes real child termination, then fault-injects a reused live PID while requiring the fresh live instance to remain visible. It failed before the repair and passes afterward. This is fault-injected reuse, not a claim that the OS allocator was forced to reuse a PID. Reuse before the first death observation may still produce a conservative false positive, never an authorized false pass. Current local proof is 65/65 Linux cases and the complete original-order 22/22 macOS suite, plus changed checks and fresh independent P0 autoreview. Production ownership, deadlines and every cleanup assertion are unchanged by this final fixture correction. Final delta: production workflow -104; tests/support +821; docs +2. Main then landed the slow-start cancellation fixture repair, PR #132203, causing another actual conflict before CI could attach. Rebase Final local commands included: node scripts/run-vitest.mjs test/scripts/ci-platform-checkout.test.tsnode scripts/check-changed.mjs -- .github/workflows/ci.yml docs/ci.md scripts/test-projects.test-support.mts test/scripts/ci-linux-git.test.ts test/scripts/ci-platform-checkout.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/fixtures/ci-platform-checkout.mjs test/scripts/test-projects.test.tsnode --import tsx scripts/check-workflows.mtsgit diff --checkWorkflow sanity used installed Python 3.13 on PATH; the initial login-shell Python 3.9 could not install pinned pre-commit. Linux proof ran both checkout suites in the isolated Node 24 Bookworm container with |
6d0ee74 to
bb0797b
Compare
|
Downstream context from #119326: CI33222068278/job99018176316 failed the Linux checkout cleanup-failure case on merge I ran a bounded, secret-free ARM64 Linux container diagnostic using the exact original workflow owner/fixture, the original #132169 group-disappearance correction, and the separate #132204 observer correction. All 80 cases passed, including the original code, with 568 boundary checks and no observed survivors. All cleanup-failure cases remained fatal125 with no retry and preserved the unrelated sentinel. The exit-only diagnostic captured 264 later process observations, all ENOENT. This did not reproduce the CI race and is not RED/GREEN proof or a claim about the failed CI processes. Both owned containers are removed. No competing repair or ownership claim from the history/Buzz lane. Please preserve the producer-side cleanup verification and the separate observer/macOS improvements when integrating them; I will consume the landed correction for downstream validation. This diagnostic predates the newer raw-Git cancellation changes and does not certify those changes. |
8790d90 to
0d7e1c9
Compare
|
Merged via squash.
|
…law#132169) * fix(ci): stop Git descendants before standalone checkout reuse * fix(ci): join Git groups after cleanup inspection failures * fix(ci): preserve cancellation during Git timeout cleanup * test(ci): launch zombie probe inside its owned workspace * test(ci): retain observed checkout process lifetimes
* fix(ci): stop Git descendants before base and ref checks Related: #132183. Builds on canonical Git cleanup prerequisite #132169. This covers the shared owner package, base checks, and six preflight ref lookups; remaining workflow consumers are deferred. * fix(ci): keep Git owner budgets fixed and cover native runners * fix(ci): cover shared checkout helper on native runners * test(ci): consolidate checkout fixture clocks * fix(agents): own apply_patch filesystem initialization * test(agents): track apply_patch temp roots
…#132428) * fix(ci): stop Git descendants before base and ref checks Related: openclaw#132183. Builds on canonical Git cleanup prerequisite openclaw#132169. This covers the shared owner package, base checks, and six preflight ref lookups; remaining workflow consumers are deferred. * fix(ci): keep Git owner budgets fixed and cover native runners * fix(ci): cover shared checkout helper on native runners * test(ci): consolidate checkout fixture clocks * fix(agents): own apply_patch filesystem initialization * test(agents): track apply_patch temp roots
Related: shared Node/platform checkout ownership.
What Problem This Solves
Resolves a problem where Linux CI could delete or reuse a checkout while Git descendants from an earlier attempt were still running. The shared Node/platform checkout was repaired separately, but preflight, manual security, Python skills, ClawHub docs source, Android, and direct supplemental history fetches still had independent timeout paths.
GNU timeout can return when the Git leader exits before its delayed KILL fires. That leaves TERM-resistant descendants alive despite the command having returned. The original network/transport stall cause remains unknown; this fixes process ownership, not that unproven cause.
Why This Change Was Made
Reuse the one existing workflow-owned Python Git owner instead of adding another supervisor. Standalone profiles preserve their different retries, deadlines, shallow-history depths, manual fallback rules, exact-SHA checks, and candidate/trusted-harness identities. Linux retains the bootstrap outside the deletable candidate workspace for later supplemental calls; Windows and macOS keep their stdin bootstrap path.
Cleanup uncertainty and cancellation remain terminal: neither a new checkout attempt nor npm-lock's otherwise-valid full-sweep fallback may reuse an unverified workspace. The complete repair removes 104 production workflow lines relative to current main, including the bounded failed-cleanup correction found by CI, the cancellation checkpoint repair, and integration of the subsequently landed macOS zombie handling. There are no new dependencies or product configuration options.
User Impact
CI maintainers can rely on verified descendant cleanup before workspace deletion, retry, fallback, checkout, or history consumption; uncertain cleanup fails closed instead of continuing. Normal retry counts and history selection do not change. Android still requires an executable candidate Gradle wrapper; preflight and Android retain their distinct trusted-harness checkout arrangements.
The shared 30-second
ensure-base-commitaction, other workflows, and existing unboundedls-remotepaths are separate follow-ups. This does not change SwiftPM or operator Gateway/app/state behavior.Evidence
timeout.csignal handling and leader-only wait/return. The standalone pattern predates the available local Git history; blame reaches a shallow boundary, so its introducing change is unknown rather than attributed to that boundary's author.waitpid(self.pid)contract and Linux's queued signal delivery were inspected directly.finallywas skipped whileFetchTimeoutunwound. The checkpoint now runs after verified cleanup insidefinally. Both the readiness-controlled regression and a real-wall-clock timeout variant show the old workflow returning success and launching the full npm-lock sweep after cancellation; the fixed workflow returns 143, invokes no consumer, and leaves no descendants. The fixture signals only the Git-observed owner after revalidating its Linux birth identity and Bash parent. No production test seam or consumer-only guard was added.6d0ee7414d4a5061857bfc4adba67efde78d182f. Main subsequently landed the macOS zombie and fixture-readiness repair, PR #132204, creating a real conflict in the shared owner. The rebase preserves that repair, its readiness clock and zombie/live-denial assertions, plus this PR's fatal-cleanup and cancellation ordering. Integrated native Linux proof passes all 64 cases. On macOS, all 20 existing shared cases passed in original order; the new zombie case passed after correcting its subprocess to start inside its owned temporary workspace. The containment guard and assertions remain unchanged. The failed-inspection CI witness does not itself establish post-exit writes.249c248285b03eacc1fdcb9153bc47c6c3a2ec20. This PR does not duplicate that repair or raise the ceiling; fresh merge CI must include it.0d7e1c963347964f1e2aed16d5db880587799130, including native Windows recovery and the required gate. The latest exact-head ClawSweeper review has no findings; its hosted-proof rank-up request is satisfied.Local regression command:
Native Linux proof used an isolated local Node 24 Bookworm container with coreutils 9.1, Python, Git, jq, repository-pinned Vitest 4.1.11 and yaml 2.9.0,
--init, and--network noneduring execution. Linux-only cases are skipped on macOS and were separately executed on Linux; that distinction is not hidden in the local aggregate count.AI-assisted implementation and review. No agent transcripts or credentials are included.