Skip to content

fix(update): unblock source updates after interrupted compiler cleanup - #167219

Open
roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/repair-01-artifact-custody
Open

roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/repair-01-artifact-custody

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes source updates staying blocked after interrupted compiler cleanup leaves an artifact-ownership fence, even when the qualified native work has completely settled.

User Impact

Supported Linux, noninteractive, one-shot source compiler runs can recover an interrupted fence release only when native identity, complete descendant settlement, unchanged inputs and the original lock generation are proven. Unknown custody and legacy identityless fences still refuse with inspection guidance; PID death alone never permits reclamation.

Darwin/Windows, TTY, watch/API/LSP, metrics/preload, generic callback and service-delegating paths retain ordinary explicit release without a recovery certificate. Configuration, history, databases and existing dist outputs are not reset. Integrated compatibility with the published 2026.9.9 source updater remains an external proof gate, not a completed claim.

Native preparation adds overhead separate from compiler work: recent cold samples were 3.9–4.1s, warm preparation 1.84s (852 inputs, 3 outputs), and earlier cold samples 3.8–15s. These are observations, not guarantees. Metadata-only and source-preflight paths do not prepare this runtime.

Why This Change Was Made

Extend the existing artifact owner with process-birth/boot/PID-namespace identity and generation-bound custody. Reuse the compiled Linux subreaper for the fixed compiler entry; require native extinction, drained output, unchanged launch inputs and current lock authority. Recovery checks that the original owner retired and uses fs-safe’s final byte comparison. Generic declaration consumers keep their source graph without loading the optional native bootstrap. Retained ownership emits one actionable diagnostic while preserving raw causes and unexpected filesystem/preparation details.

The new opt-in source-update harness installs immutable published source, uses canonical OS-account state paths in independent COW containers, and records installer-created state without deleting it. Four planned cells cover legacy/escaped-descendant refusal, healthy active update with configuration/history preservation, and stopped/no-restart intent. The fixture uses a real Gateway with a synthetic service-manager adapter; actual Docker execution is still unrun.

The existing generic Docker cleanup owner now retains unresolved container IDs and mounted package inputs after removal failure, including caller cleanup outside logging subshells. Primary failures/timeouts and caller traps/file descriptors are preserved. Seed operations use a private immutable CID; uncertain commit/removal is not automatically retried. Build, logs, wait, commit and cleanup consume absolute budgets. The 270-minute lane and 285-minute outer job are upper envelopes, not measured runtimes. No competing reaper, release, credential, permission, dependency-pin, schema/version or live Gateway change is introduced.

Evidence

  • Real source/native boundary: the pinned baseline refused the interrupted-release fixture; the fixed native entry admitted it while preserving the prior dist sentinel. Linux controls cover escaped independent-stdio descendants, cgroup migration, killed controllers with live descendants, missing/changed settlement, output drainage, cancellation and changed source. PID-reuse/foreign-generation races are modeled, not claimed as forced kernel PID recycling.
  • The update adapter refuses before Git mutation or service stop, preserves the owner/cause chain, and avoids repeated stale-lock display fragments. Unexpected inner EACCES and lease cleanup remain covered.
  • The unmodified published 2026.9.9 guard/config closure (12 source files and three original manifests) rejects the former per-cell paths and admits canonical OS-account paths. This native guard proof performs no service mutation and is not Docker/installed-CLI acceptance.
  • Controlled daemon-boundary proof: the old cleanup owner returned success and lost CID/input after failed removal; the candidate fails and retains both. Forty-eight status/removal/CID/direct-or-subshell combinations and deterministic deadline checks pass. Four source-shell negative cases retain custody without an aggregate success summary.
  • Independent reviews completed. The focused correction review found one P2: normal seed cleanup used the work deadline. It was reproduced, fixed at the existing owner call and verified red/green near cutoff. The original findings/incorrect receipt is retained, not relabeled as a clean post-fix review. Lead qualification found no additional actionable P0–P2. No UI behavior changed.

Remaining qualifications: selected checks still fail on the unchanged inherited Knip export observePlacementAuthority; script exports pass, but the aggregate is not green. The earlier successful full build reported an unattributed nonfatal startup-JS gzip warning (+297B); no baseline UI rebuild was performed. Hosted run 37777739361 at fd84900b completed with 75 successful, three failed (two UI jobs and aggregate), and 23 skipped jobs; the previously failing Node siblings passed. The 14 UI failures are maintainer-reported baseline failures (reported baseline); this task has not verified a raw baseline replay. These are prior-head results, not passing CI for this harness update. ClawSweeper’s prior-head review found no code defect but requested published-source compatibility evidence. Current-head CI/review and actual source-update acceptance remain open; no readiness completion is claimed.

Validation scope and measured cost

Focused tests use node scripts/run-vitest.mjs … --maxWorkers=1, the same runner as pnpm test without dependency reconciliation. Local wall times are not CI timings.

  • New Docker custody suite: two tests covering 48 combinations plus clock/deadline checks, 3.33s wall; no daemon or Gateway boot. Source-shell negative proof: 0.468s; near-cutoff red/green separately verified.
  • Changed Docker helper siblings: 17 selected tests, 31.78s including native test-worker preparation; the entire large helper file was not replayed. Observability sibling: all 11 tests, latest 2.95s wall. Hosted seconds for these changes are pending.
  • Correction guards/format/core-boundary checks passed; four root-test type graphs: 7.69s. Full scripts lint: 1,333 files, zero warnings/errors, 39.1s; five-file typed test lint: zero warnings/errors, 7.2s. Earlier script types (14.01s), unchanged package/SDK/lock guards and 93 planner tests are reused. Knip remains qualified red.
  • Retained production evidence includes three native cells (14.37s), four source-admission/cause cases (25.28s including compilation), 10 relay siblings (6.45s), both complete CI-correction test files (26 tests, 80.48s including preparation), a declaration-boundary regression (3.26s) and 71 watchdog/lint fixture siblings (34.06s).
  • Earlier canonical full build: exit 0, 236.26s, including declarations, native/lazy bootstrap checks, plugins, SDK and UI. It preceded the diagnostic-only follow-up; no new full product build or all-platform matrix is claimed for this harness update.

Proof uses synthetic isolated data. The opt-in Docker cells have not run; resource/ref/source admission and explicit dispatch remain separate from publication.

Worked on by

Work sessions


View the OpenClaw team session

roboclaw-bot and others added 2 commits October 8, 2026 11:53
Recover only generation-bound, native-settled artifact custody while retaining
legacy and uncertain fences with actionable inspection diagnostics.

Co-authored-by: RomneyDa <[email protected]>
Worked on by:
- @RomneyDa

Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: b77f8bc9-e85d-453b-b5c3-0a9b174ab40d
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes scripts Repository scripts size: XL labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 8, 2026, 10:27 AM ET / 14:27 UTC (Revision 4).

ClawSweeper review

What this changes

The PR adds generation-bound recovery for interrupted Linux compiler ownership release, clearer update diagnostics, and an opt-in published-source update harness with stricter Docker cleanup.

Example: Run a source update after an interrupted Linux compiler fence release

  • Before: The retained .artifacts/dist-artifacts.lock blocks the update even after the compiler has completely settled.
  • After: A matching native settlement receipt permits recovery while preserving the existing dist artifacts.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful owner-level repair with native boundary proof, but incomplete published-updater qualification limits merge confidence.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (live_output): Supplied before/after native proof exercises the production compiler entry and descendant supervisor, recovering an interrupted release while preserving prior dist bytes; foreign-root and changed-generation controls retain ownership. That proof remains valid, but the separate published-updater and persisted-record compatibility gate is incomplete because the new installed-source harness has not run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A source update remains blocked after an interrupted compiler cleanup even when all qualified compiler work has stopped.
Reason: Recovering proven-settled work has clear value and remains narrowly restricted to qualified Linux compiler runs.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR addresses a remaining source-update recovery problem, but published-updater compatibility evidence is still incomplete. No definite introduced code defect was found.

Priority: P2
Reviewed head: a74730373fbcd7e6329cc6ec7e21cbf18e042560

Before merge

  • Complete next step (P2) - Record the published v2026.9.9 source updater × candidate compatibility outcome.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

None.

Tests

  • Missing end-to-end proof: The published v2026.9.9 source updater × candidate run remains unexecuted: legacy and escaped-descendant refusal, active update with preserved configuration/history, and stopped --no-restart intent. Native before/after proof is retained separately.
Agent review details

How this fits together

Source builds and updates share checkout artifact ownership so compilers cannot invalidate one another's outputs. This change carries native process-settlement facts into later update admission.

flowchart TD
  A[Linux one-shot typecheck] --> B[Checkout artifact owner]
  B --> C[Native descendant supervisor]
  C --> D[Complete settlement receipt]
  E[Later source update] --> F{Identity and generation match?}
  D --> F
  F -->|Yes| B
  F -->|No| G[Retain fence and explain refusal]
Loading

Technical review

Best possible solution:

Keep recovery with the existing artifact owner and establish interoperability with the published updater without weakening uncertain-writer retention.

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

Yes: current-main source always retains stale artifact fences, and the supplied native interrupted-unlink scenario establishes the failure boundary. This read-only review did not execute it.

Is this the best way to solve the issue?

Yes at the owner boundary: generation-bound native settlement addresses the cause while retaining uncertified work; installed-updater compatibility still needs its recorded outcome.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e2dc6ad93f8a.

Provenance checked

Testing

Proof path: shipped entry point. Added test files: 16.

Security

None.

Evidence

What I checked:

  • Recovery admission: Recovery requires matching boot and namespace scope, a valid process-birth identity, exact settlement bytes, no remaining claims, and retirement of the original process. (scripts/lib/dist-artifact-lock.mts:92, a74730373fbc)
  • Current main still retains interrupted fences: Fetched main uses fail-closed stale recovery without the proposed native settlement recovery path; the central contribution remains necessary. (scripts/lib/dist-artifact-lock.mts, e2dc6ad93f8a)
  • Original ownership contract: fix(update): check artifact ownership before stopping the Gateway on source updates #158849 established admission before Gateway shutdown and explicitly rejected PID-death reclamation because detached writers can survive. This PR retains that constraint for uncertified work. (scripts/lib/dist-artifact-lock.mts, 2ff07dbab332)
  • Native boundary proof: The complete supplied body reports baseline refusal and candidate admission after interrupted unlink, with the prior dist sentinel preserved. Controls exercise escaped descendants, controller loss, changed inputs, cancellation, foreign generations, and output drainage; kernel PID recycling is expressly modeled rather than claimed. Source inspection confirms these scenarios drive the production run-tsgo and native supervisor boundaries. (test/scripts/dist-artifact-custody.test.ts:501, a74730373fbc)
  • Published compatibility remains unrun: The body explicitly says actual Docker execution and installed-CLI acceptance are unrun. The new harness invokes the immutable v2026.9.9 source updater and checks legacy refusal, escaped-descendant refusal, active update, stopped intent, configuration preservation, and durable history. Adding these assertions does not supply their execution result. (scripts/e2e/lib/source-update-custody/driver.mjs:302, a74730373fbc)
  • Dependency recovery contract: The target imports @openclaw/fs-safe/file-lock and changes its stale-removal callbacks, making this dependency authoritative. Verified v0.24.2 source rechecks the observed lock bytes around approval and verifies the exclusive reclaim guard before removal. (src/sidecar-lock-reclaim.ts, 64b21b49a2c0)

Likely related people:

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

PR surface

Source +64, Tests +1419, Docs +30, Config +1, Other +1531. Total +3045 across 51 files.

View PR surface stats
Area Files Added Removed Net
Source 8 73 9 +64
Tests 18 1485 66 +1419
Docs 1 34 4 +30
Config 1 1 0 +1
Generated 0 0 0 0
Other 23 1646 115 +1531
Total 51 3239 194 +3045

Stored data model

Persistent data-model change detected: serialized state: scripts/e2e/lib/source-update-custody/owner.mjs. Confirm migration or upgrade compatibility proof before merge.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The change repairs source-tooling recovery with a limited platform and invocation scope.
  • merge-risk: 🚨 compatibility: Persisted ownership records and recovery admission change, while published-updater interoperability remains unverified.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

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

  • Supply the published-source compatibility receipt with preserved configuration, history, and service intent.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-08T12:04:51.706Z sha f9e2de2 :: needs changes before merge. :: none
  • reviewed 2026-10-08T12:15:04.843Z sha f9e2de2 :: needs changes before merge. :: none
  • reviewed 2026-10-08T12:40:12.474Z sha fd84900 :: needs changes before merge. :: none

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 8, 2026 12:07
roboclaw-bot and others added 2 commits October 8, 2026 12:33
Bind sibling assertions to the owner generation, verify subsequent admission
remains refused, and isolate the synthetic updater checkout from temp ancestors.

Co-authored-by: RomneyDa <[email protected]>
Add bounded opt-in source-update cells and preserve Docker custody after
cleanup failures. Use canonical account state and shared absolute deadlines.

Co-authored-by: RomneyDa <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docker Docker and sandbox tooling docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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