Skip to content

fix(ci): retain redacted Git ownership failure context - #138034

Merged
steipete merged 1 commit into
mainfrom
steipete/cranky-hertz-aec8e9
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/cranky-hertz-aec8e9

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: native Talk CI bootstrap investigation, specifically the original Windows checkout failure.

Additional instructions

Maintainers can update this same-repository branch.

What Problem This Solves

Resolves a problem where maintainers investigating a failed CI checkout could not distinguish process setup, launch, or cleanup failures: all could collapse to Git ownership/setup failed (PermissionError); refusing reuse or retry, exit 125. A cleanup exception could also hide an earlier operation timeout. Approximately 90 seconds of elapsed time did not establish which path failed.

This repairs the diagnostic gap, not the still-unattributed cause of the original Windows failure. The separate public pre-commit clone dependency was already removed by the network-free security-fast hook repair; this PR does not change hook pins or authentication.

Why This Change Was Made

Use exception evidence already present at the terminal owner boundary instead of adding phase state or wrappers around every operation. Retain the fail-closed annotation and exit 125, then emit a bounded redacted exception chain with known type identifiers, numeric errno/winerror, and proven owner-code function/line locations. Policy frames, data-derived names, messages, paths, arguments, commands, environment, headers, and credentials are excluded; diagnostic failure cannot replace the authoritative exit.

Every existing owner lifecycle function remains AST-identical. Job Object flags, process ownership, cleanup ordering/deadlines, cancellation precedence, retries, lock reclamation, and repository-scoped checkout authentication are unchanged. The one inline workflow copy is regenerated from the maintained owner.

Production: +55/-2 (net +53); generated projection: the same +55/-2 once; tests: +228/-0; docs: +2/-0. Growth is the new bounded observation capability, isolated to terminal formatting rather than distributed lifecycle state. There is no obsolete lifecycle path to delete without changing the protected contract.

User Impact

CI maintainers can identify the failing owner call site and numeric OS error, and see a real timeout when one is present in the exception chain, without exposing sensitive diagnostic text. Existing failures remain failures; uncertain cleanup still fences the owner. A passing rerun is not presented as proof of the original cause. There is no bot/runtime feature or configuration change.

Evidence

  • Unmodified-owner native proof on a fresh Windows 2025 x64 Blacksmith runner: six cases passed. Normal Git success, early-parent exit with descendant extinction, and a real operation timeout retained exits 0/0/124. Real restricted-handle Job setup, invalid-executable process launch, and timeout followed by restricted Job query all produced the same PermissionError/125 annotation; each native denial had errno 13 and winerror 5. The final cleanup-denial case retained genuine FetchTimeout context and a closed owner. Retained kernel handles proved descendant termination; an unrelated sentinel survived. The failed-cleanup case ran last and the lease was retired. Baseline proof run was deliberately stopped after proof; its workflow cancellation is resource cleanup, not a test verdict.
  • Regression proof: 12 targeted cases failed with the unchanged pre-fix owner. The final focused run passed 14 tests, including generator parity. New tests live in the existing Windows/macOS-selected platform checkout suite and exercise the actual isolated owner CLI, including real Windows API denial branches.
  • Post-change local proof: node scripts/run-vitest.mjs test/scripts/ci-platform-checkout.test.ts test/scripts/ci-security-fast-workflow.test.ts — 80 passed. node scripts/run-vitest.mjs test/scripts/ci-git-owner.test.ts -t 'keeps exactly|binds read-only|preserves linked|generic Git|unexpected policy exception' — 5 passed.
  • node scripts/check-changed.mjs -- .github/actions/git-owner/owner.py .github/workflows/ci.yml docs/ci.md test/scripts/ci-platform-checkout.test.ts passed, including full root-test typechecking and selected lint/guards. Generator parity, actionlint, formatting, Python 3.9 grammar/AST preservation, and git diff --check passed. Independent autoreview was scoped-clean at P0.
  • Before any edits, the broader two-file local owner/platform run had 175 passed, 32 skipped, and seven generated-publisher fixture watchdog failures. They stopped at differing incomplete boundaries with successful emergency cleanup; their cause is not attributed to this patch or to host overload. A separate timing investigation is retained. No deadline or assertion was weakened, and no complete two-file post-change success is claimed.

Native candidate proof completed

Exact-head CI run 33849195943, head 595044d7651526c2cc70ec397ef98269c4c74dc2, completed both Windows jobs and all three macOS Node jobs successfully. Windows test-2 job 100948069217 executed all 14 new native diagnostic cases, including the real setup, launch, and timeout-drain failures, at 07:50:48–07:50:49 UTC on September 4. Existing platform lifecycle cases passed too.

The job log records checkout of test merge 401433059ee6f5b45578112180be4d2e1ac40673. Its owner SHA-256 is 7184aee343854a2c44a92d0196911b47415fd5cceae23de8016e133e2d9032af, byte-identical to the reviewed candidate. The tests capture and assert the diagnostic payload rather than dumping it: native errno 13/winerror 5; setup/launch PermissionError; timeout-drain terminal RuntimeError with PermissionError and genuine FetchTimeout context; positive owner-source frame locations; preserved exit 125; and bounded, redacted output. This is actual candidate-native execution, not the unmodified baseline or an unexecuted Testbox attempt. It addresses the fresh ClawSweeper native-proof request and rank-up move. It does not establish the original incident's cause.

CI recovery status

The first complete CI attempt failed only security-fast's production dependency audit and its aggregate gate. npm bulk did not return complete advisory results within the existing 240-second budget; no audit clearance was obtained. All other selected jobs passed. A single unchanged local recovery probe also returned incomplete/exit 2; no policy, deadline, payload, or assertion was weakened.

A later main-branch security job 100953350038 successfully obtained npm bulk results at 07:57:05 UTC. Its lockfile and audit implementation have the same Git blob IDs as this PR (2a435324ebc072a9d3bf672a84ca0c040cbf1053 and e359d4f6db79114c11fb1f48a2edef75be62cb1d). On that newer recovery evidence, one failed-job-only recovery was requested for the unchanged PR head. Attempt 2 completed successfully; the exact-head CI rollup is green. Security-fast job 100956399903 completed the unchanged audit successfully at 08:11:39 UTC. This is operational recovery, not a root-cause claim or a retry-until-green loop. The audit remains fail-closed; no source or policy change was made to obtain this result.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 4, 2026
@steipete
steipete marked this pull request as ready for review September 4, 2026 07:32
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 4, 2026
@steipete steipete self-assigned this Sep 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 3:42 AM ET / 07:42 UTC.

ClawSweeper review

What this changes

Adds bounded, redacted exception details to CI Git process failures, updates the generated workflow copy, and documents and tests the diagnostic output.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: current main lacks these diagnostics, and the related merged PRs solve different problems. No blocking correctness or security defect was identified.

Priority: P2
Reviewed head: 595044d7651526c2cc70ec397ef98269c4c74dc2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable diagnostic enhancement with meaningful boundary coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR. The captured body reports after-change local CLI checks but leaves native candidate diagnostics pending; the Windows baseline proves only pre-fix behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR. The captured body reports after-change local CLI checks but leaves native candidate diagnostics pending; the Windows baseline proves only pre-fix behavior.
Evidence reviewed 10 items Introduced scope verified: The recorded head has parent a922cf8. The test merge has the pinned base followed by that exact head as parents; its base-relative result contains only the four diagnostic-related files, excluding cloud-worker endpoint drift.
Current main still lacks diagnostic context: The current-main terminal handler prints only the exception class and exits 125; it does not retain the exception chain, numeric OS errors, or owner call sites.
Redaction and terminal behavior: The formatter permits known exception identifiers, bounded exact integers, and frames identified by owner code identity and globals. It limits chains to four exceptions and traceback traversal to 256 frames per exception; formatting failures retain exit 125.
Findings None None.
Security None None.

How this fits together

The CI Git process owner runs checkout and fetch commands while controlling child-process cleanup. Its terminal error boundary supplies failure annotations and exit codes to GitHub Actions.

flowchart TD
A[CI checkout or fetch policy] --> B[Git process owner]
B --> C[Git and operating system]
C --> D[Terminal exception]
D --> E[Bounded redacted diagnostics]
E --> F[CI annotation and diagnostic log]
D --> G[Exit 125]
Loading

Before merge

  • Resolve merge risk (P1) - The captured evidence does not yet demonstrate the new diagnostic output on Windows; the completed native baseline cannot establish candidate behavior.
  • Complete next step (P2) - Complete the PR's stated native candidate validation and attach redacted Windows diagnostic results before landing.
Agent review details

Security

None.

PR surface

Tests +228, Docs +2, Config +106. Total +336 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 228 0 +228
Docs 1 2 0 +2
Config 2 110 4 +106
Generated 0 0 0 0
Other 0 0 0 0
Total 4 340 4 +336

Review metrics

Metric Value Why it matters
Production versus tests Maintained production +53; tests +228; generated projection +53; docs +2 The production growth implements bounded redacted observation at one boundary; the generated copy is not a second maintained implementation.
Lifecycle preservation 16 existing functions unchanged; 1 diagnostic formatter added AST comparison supports the stated separation between diagnostic changes and process lifecycle behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one bounded redacting formatter at the terminal owner boundary, with native confirmation that failure locations become distinguishable while existing exits and cleanup behavior remain intact.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one bounded redacting formatter at the terminal owner boundary, with native confirmation that failure locations become distinguishable while existing exits and cleanup behavior remain intact.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a new diagnostic capability; current source confirms the information gap, while the underlying historical Windows failure remains unattributed.

Is this the best way to solve the issue?

Yes: the terminal owner already holds the exception chain, making it the appropriate observation boundary. Raw traceback formatting would expose sensitive text, while per-operation phase wrappers would unnecessarily alter lifecycle code.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 57b86b840158.

Labels

Label changes:

  • add P2: This improves diagnosis of real CI checkout failures without changing bot runtime behavior or establishing an urgent regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR. The captured body reports after-change local CLI checks but leaves native candidate diagnostics pending; the Windows baseline proves only pre-fix behavior.

Label justifications:

  • P2: This improves diagnosis of real CI checkout failures without changing bot runtime behavior or establishing an urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR. The captured body reports after-change local CLI checks but leaves native candidate diagnostics pending; the Windows baseline proves only pre-fix behavior.

Evidence

What I checked:

  • Introduced scope verified: The recorded head has parent a922cf8. The test merge has the pinned base followed by that exact head as parents; its base-relative result contains only the four diagnostic-related files, excluding cloud-worker endpoint drift. (401433059ee6)
  • Current main still lacks diagnostic context: The current-main terminal handler prints only the exception class and exits 125; it does not retain the exception chain, numeric OS errors, or owner call sites. (.github/actions/git-owner/owner.py:517, 57b86b840158)
  • Redaction and terminal behavior: The formatter permits known exception identifiers, bounded exact integers, and frames identified by owner code identity and globals. It limits chains to four exceptions and traceback traversal to 256 frames per exception; formatting failures retain exit 125. (.github/actions/git-owner/owner.py:512, 595044d76515)
  • Lifecycle preservation and generated parity: A read-only AST comparison found all 16 existing top-level functions unchanged and only terminal_diagnostic added. A separate text comparison confirmed the single inline workflow projection matches owner.py; Python 3.9 grammar parsing passed. No target code or tests were executed. (.github/actions/git-owner/owner.py:512, 595044d76515)
  • Entry points, callers, and siblings: The standalone action copies trusted owner bytes outside the checkout; the workflow embeds the generated copy. Checkout, direct Git, and trusted policy entry points share the terminal boundary. The base-fetch policy catches only ordinary Git failures and timeouts, allowing ownership failures to reach that boundary. These paths use Python's standard library and Git, with no Codex runtime or protocol dependency. Public docs: docs/ci.md. (docs/ci.md:299, 595044d76515)
  • Boundary regression coverage: The added tests invoke the isolated owner CLI and check cause ordering, cycles, redaction, frame limits, malformed metadata, and native failure sites. Existing coverage separately protects generated parity and credential cleanup after unexpected policy exceptions. Windows and macOS CI inventories include the changed platform suite. (test/scripts/ci-platform-checkout.test.ts:984, 595044d76515)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach the promised redacted Windows candidate results showing setup, launch, and timeout-cleanup diagnostics with preserved terminal exits.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Native candidate proof is complete for 595044d7651526c2cc70ec397ef98269c4c74dc2, addressing the ClawSweeper native-proof request and rank-up move.

Windows test-2 job 100948069217 passed all 14 new diagnostic cases and the existing platform lifecycle cases. The log records test merge 401433059ee6f5b45578112180be4d2e1ac40673; the owner at that revision hashes to 7184aee343854a2c44a92d0196911b47415fd5cceae23de8016e133e2d9032af, exactly the reviewed candidate. Both Windows jobs and all three macOS Node jobs passed.

Controlled native failure Verified diagnostic contract Exit
Job setup denial PermissionError; errno 13; winerror 5; owner source frame 125
Process launch denial PermissionError; errno 13; winerror 5; owner source frame 125
Timeout then cleanup-query denial Terminal RuntimeError from the closed-owner policy fence, followed by PermissionError and genuine FetchTimeout context; errno 13/winerror 5 on the denial; run_git/drain source frames 125

These are values asserted by the actual Windows CLI tests; the payload is captured and checked inside the test process, not dumped wholesale into the log. The job shows the setup, launch, and timeout-drain cases passing at 07:50:49 UTC on September 4. Redaction, numeric bounds, cause ordering, frame provenance, and diagnostic-failure exit preservation also passed. This does not attribute the original historical Windows failure.

The complete first CI attempt failed only the npm production audit and aggregate gate. After a later main security job obtained results with an identical audit implementation and lockfile, I requested one failed-job-only recovery on this unchanged head. Attempt 2 completed successfully; the exact-head CI rollup is green. The recovered security job completed the audit at 08:11:39 UTC. No audit bypass, timeout/retry-policy change, or bootstrap behavior change was made. The PR body now contains the proof and successful gate status.

@steipete
steipete merged commit 2cbacb8 into main Sep 4, 2026
321 of 324 checks passed
@steipete
steipete deleted the steipete/cranky-hertz-aec8e9 branch September 4, 2026 08:50
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 4, 2026
Reduce unrelated host-process enumeration during owned Git cleanup while preserving zombie handling, native observation failures, cancellation, and terminal fencing. Keep the initial absent-group fast path and validate native group/session selection with real-process regression coverage.

Controlled native Mac proof reduced system CPU by about 23% with only a modest wall-time change. Current-base owner/platform tests pass without altered watchdogs or assertions. Related: #138034, #138189.
steipete added a commit that referenced this pull request Sep 4, 2026
Reduce unrelated host-process enumeration during owned Git cleanup while preserving zombie handling, native observation failures, cancellation, and terminal fencing. Keep the initial absent-group fast path and validate native group/session selection with real-process regression coverage.

Controlled native Mac proof reduced system CPU by about 23% with only a modest wall-time change. Current-base owner/platform tests pass without altered watchdogs or assertions. Related: #138034, #138189.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
Reduce unrelated host-process enumeration during owned Git cleanup while preserving zombie handling, native observation failures, cancellation, and terminal fencing. Keep the initial absent-group fast path and validate native group/session selection with real-process regression coverage.

Controlled native Mac proof reduced system CPU by about 23% with only a modest wall-time change. Current-base owner/platform tests pass without altered watchdogs or assertions. Related: openclaw#138034, openclaw#138189.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant