Skip to content

feat(workers): recover retained disks through exact lifecycle intent - #189346

Merged
roboclaw-bot merged 30 commits into
mainfrom
openclaw/s4-retained-disk-lifecycle
Nov 1, 2026
Merged

roboclaw-bot merged 30 commits into
mainfrom
openclaw/s4-retained-disk-lifecycle

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Collaborator

Related: #188796
Depends on #189350 (durable disk Move), above #189263 (current-disk IO), #189106 (disk authority), and #189019 (exact resource receipts). Those prerequisites have landed; this PR now targets main.

Problem and solution

A retained cloud disk needs durable pause/resume intent and exact-resource recovery. A lost provider reply or Gateway restart must not allocate a replacement, extend a work window, discard cleanup custody, or treat resumed compute as a usable worker.

The existing environment writer records immutable acquisition policy and lifecycle operation ID/action/expected claim revision. The provider queue retains the original receipt and operation. Persisted resume intent is custody, not authority: maintenance observes pending resume without replaying it; only a fresh authorized wake or same-key creation retry can reopen compute. Pause and lost-reply settlement keep their existing owners.

Crabbox translates the generic contract into Linux Azure Sandbox capability, identity, policy, and independent readback checks. Pending readiness is polled without starting or renewing compute; closed windows still require explicit recovery. Runtime admission stays fenced until the original node reconnects and its current bundle is verified. Unknown observations preserve custody; explicit deletion remains pending until exact-resource stop confirms it.

Activation remains off. No profile default, idle-sweep selection, workspace mirroring, disk-authority activation, controller adoption, or Crabbox dependency/release change. Released Crabbox cold-boot readiness is not claimed.

Internal integration contract

  • createWithRequest persists explicit retained policy before allocation. A fresh same-key retry revalidates caller/source authority, recovers the original receipt and operation, and resumes provisioning admission.
  • ensureRetainedRunning({environmentId, expectedOwnerEpoch, assertCurrent, signal}) requires exact receipt, live caller/owner authority, finite window, original-node availability, and runtime admission.
  • suspendRetained uses the same owner and durable operation. Stop retains final-save and confirmed deletion semantics.
  • Shared-state 38 → 39, separate from agent schema 39. The nullable retention_json column leaves existing leases unretained. Runtime/Doctor migration, PostgreSQL predecessors, native ceilings, backups and rollback fencing are coordinated. Package-only downgrade is unsafe: settle retained resources and restore the matching backup and binary.

Current candidate and installed-upgrade qualification

Signed head 0b2a51db3fc8c1b161d26562a45b5d8cce862597, tree e670faf0c148fb361ae0470b49ec33c93e8c1a3b, was published through the native proof-only path to this same PR. Installed-upgrade finding R5 is now resolved for this exact candidate, using independently verified recovered evidence and completed native cleanup. Ordinary exact-head review and merge gates still apply; no transport failure has been relabeled green.

The native baseline preserves original hosted 07fe6572370d5223f7f1f15e797925772fa4e61c ancestry and actual landed S7 af7cee29336523d3f8c2f3ae5c6af5f55e570772. Sixty conflict resolutions retain the previously qualified lifecycle content or unchanged landed owners, with disjoint main metadata merged normally. The 88-path +3,226/−396 child patch is unchanged from qualified 0388b96ec623242b36010fefbb9f9efc82a6c241: 85 blobs, including every generated catalog and migration, are identical; only package and two inventory files carry independent main additions. No signature override or unsigned prerequisite side-history was used.

Evidence

Installed latest-stable → exact candidate

  • Immutable package run 41283351382 supplied the exact candidate. Package SHA-256: 4231d674427c56c67110aa71b82e035e5b18a873b3cd93d6b36e97e8ed28eb5e. Actual installed and serving build identities verified the transition from stable 8b18b5578f66eab1501cba4cef2310d88bfb9a41 to this candidate; the unchanged version string alone was not used as proof.
  • In native run 41315369261, the complete installed-upgrade shell finished exit 0 in 346.377s. Shared user_version and primary schema metadata reached 39. Both terminal legacy worker rows retained their original fields and SQL NULL retention; no retention opt-in was fabricated.
  • Existing placement and staged-unaccepted pending-result rows, NULL disk authority, the durable imported session and selected settings survived update, stop, repeated Doctor and cold reopen. Disabled heartbeat intent was verified in completed migration receipts and both canonical job definitions and indexed fields—not by requiring the retired config path to remain.
  • The actual installed workerEnvironmentService.get decoder returned literal retention:null after update and after cold reopen. Reopen used a different process and invocation; final service shutdown recorded the process tree terminated.
  • Recovery and cleanup: the local controller hit its 600s tool limit; its outer wrapper exited143 and the Python reporting aggregate failed with BrokenPipe. Those remain nonpasses. The already-completed proof was not replayed. Documented native download recovered 152 files, independently checked and rehashed after native stop0 and an independent completed/no-host/not-ready/remote-settlement-complete observation. The Actions run is cancelled by cleanup, not reported as a successful workflow. Retained evidence manifest SHA-256: 5187d1694f78dcb610e571ed4cb5a98d56e62c71c550c8c010f26ca3116d9202.
  • The whole-shell exit0 follows its unmasked named-volume deletion EXIT trap; Docker-after observation was empty. The separate post-volume inventory did not execute because of the reporting BrokenPipe and is not claimed. Optional predecessor session_repository_workspaces was absent and remains unexercised; no predecessor DDL was manufactured. Earlier failed proof and admission attempts remain failures.

Current integrated candidate

  • 15 service/store/migration cases across three files passed: 62.49s Vitest, 64.93s wrapper, with compiler cleanup verified. Includes revoked pending resume, explicit same-operation recovery, initial provisioning retry, runtime/Doctor v38→v39 preservation, transactional rollback and PostgreSQL predecessor descriptors.
  • 29 provider-retention cases passed, 9 unrelated cases unselected; 14.56s wrapper. Covers fresh/replayed pending readiness, exact-resource cleanup, missing inspection and policy/identity refusals using fixed command responses—not authenticated cloud I/O.
  • Core and Gateway test typechecks, CI-mode scoped type-aware lint (zero warnings/errors), canonical format, whitespace and test-line ratchet passed. Existing separate regression allocations remain 123 and 82; shared budget unchanged.
  • Complete prior 88-path, five-pass P0–P3 Codex autoreview was scoped-clean with zero findings. It is reused for the mechanically identical child patch after exact blob/patch comparison and inspection of the three main-only metadata differences, not represented as a newly executed full review. The separate eleven-file repair review and red/green defect evidence remain applicable. Generated-catalog partition limitations are preserved; canonical generation and migration evidence cover that cross-catalog contract. The task-only installed-proof observer and cleanup semantics received independent review.
  • Exact-head CI 41281561533, attempt 1 completed successfully: all 173 jobs terminal, 154 success and 19 skipped. Complete PR rollup at qualification: 250 contexts, 195 success, 54 skipped and one neutral; none failed or pending. Required CI-gate surfaces, dependency review and security-sensitive review succeeded. No CI rerun or new source push was needed for installed-proof qualification.

Earlier proof, retained in its original scope

  • Original provider/command/profile/inspection qualification: 187 cases across seven files; later receipt/lifecycle boundary 36 cases, including replay and deletion after missing inspection.
  • Lifecycle repair/integration qualification: 94 affected cases, 171 catalog cases and 23 generator cases passed. A separate provider group had 65 passes and five inherited desktop-fixture failures; those failures remain recorded, not declared repaired by passing unrelated tests.
  • Initial CI repairs removed a static import cycle, supplied missing non-retained performance-fixture fields and restored canonical test ordering. Earlier RPC, materialization/recovery, typing, lint and source-closure checks passed in their recorded scopes.
  • Real PostgreSQL v39: 39 cases across two files passed via the official conformance runner, covering predecessor capture, exact DDL admission, migration, rollback and historical migrations. Used CI-pinned pgvector:pg17 image ac08538c, required extensions and max_locks_per_transaction=512; the task-owned database/container was removed. Current generated/migration blobs are identical to the qualified lifecycle composition.
  • Historical 07fe657 CI 41206460594, attempt 1: 153 passed, 3 failed, 19 skipped—not green. Two runtime shards contained inherited update fixture assertions and the third failure was the aggregate. Its source attribution is not an exact-base replay or current-head waiver.

Limits: no authenticated Azure lifecycle, genuine retained cold-boot reconnect or real-model Gateway flow. Installed synthetic-row preservation and actual decoder/process proof do not establish released Crabbox retained-disk readiness. Release, deployment and controller adoption remain separate. Activation stays off.

Dependency and attribution

Current base is main, with S7 landed as af7cee29336523d3f8c2f3ae5c6af5f55e570772. Original published ancestry and human credit are preserved; qualified repair content was replayed without importing unqualified prerequisite side-history. Earlier evidence retains its original scope. Guarded landing is authorized under the current maintainer instruction; deployment is not part of this change.

Original work and design by @galiniliev; extracted and implemented at the contributor's request.

Work sessions

Worked on by

roboclaw-bot and others added 25 commits October 31, 2026 03:44
Persist immutable provider receipts through the existing environment writer before setup and enrollment. Reuse them for recovery, inspection, and confirmed exact-resource teardown. Retained allocation, pause/resume, and disk-authoritative workspaces remain inactive. Related: #188796.

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

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 79a28e77-6a76-4cd6-bd81-e44cc99064b5
Resolve the package metadata conflict by preserving this prerequisite state schema 37 and current main agent schema 39. Receipt behavior is unchanged; canonical schema generators and all 10 receipt store/migration tests pass after integration.

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

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: fea66917-e69b-4777-b127-03eb548d7c89
Keep the historical migration expectation values unchanged while satisfying no-shadow.

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

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 147bd311-a32a-4cc1-a4c2-116b71affb91
Preserve receipt custody through provisioning failure, select the complete placement row, align PostgreSQL additive column positions, and update schema-bound consumers and regression fixtures.

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

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: aa6ef0fc-2c5f-4e21-94bc-6ead8b0adea2
Persist exact repository disk identity and accepted pending-result authority in shared state v38. Keep mirrored results unchanged, hold missing or replaced disks, and refuse stale file, publication, and materialization fallbacks. Disk mode remains inactive until explicit I/O and lifecycle support follows.

Co-authored-by: galiniliev <[email protected]>
Declare shared-state schema 38 in package admission metadata, include the exact migrated tables in historical scope proofs, preserve canonical test ordering, and close the trusted PR wrapper import inventory.

Co-authored-by: galiniliev <[email protected]>
Rebuild the empty pending-result table alongside worker receipts and preserve incoming foreign keys from installed lazy fragments when restoring historical test schemas.

Co-authored-by: galiniliev <[email protected]>
Compose legacy schema transformations in canonical order, preserve installed PostgreSQL foreign keys in historical fixtures, and settle confirmed deletion after shutdown aborts new effects.

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

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 1cb5a42a-b4a8-43a9-8242-1e75244865d8
Preserve the v38 predecessor schema and installed foreign-key repairs while incorporating confirmed provider teardown settlement from the published prerequisite.

Co-authored-by: galiniliev <[email protected]>
Integrate main 64daa25 to repair the actual provider-lifecycle conflict. Keep the receipt-owned SSH bootstrap extraction and the incoming destructured clock default. Shared-state schema remains 37. Affected receipt, image-intent, teardown-drain, and migration tests: 18 passed; targeted Gateway typing and lifecycle lint passed.

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

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: c1df24cc-0977-428a-bfbc-8ba8a983218b
The published prerequisite now owns five lines previously counted in this child. Reduce the child allocation to its measured 628-line delta.

Co-authored-by: galiniliev <[email protected]>
Keep exact-disk editor writes on the retained owner. Freeze explicit publication captures under durable request refs, and prepare fresh Git-preserving exports without stale mirror fallback. Disk mode and final Move lifecycle remain inactive.

Co-authored-by: galiniliev <[email protected]>
Preserve authority shared-state38 and integrate published receipt8042bdde before lifecycle shared-state39. No manual conflict resolution.

Co-authored-by: galiniliev <[email protected]>
Integrate published receipt head8042bdde and canonical startup/context contracts. Preserve shared-state38 disk authority and all accepted-result recovery invariants.

Co-authored-by: galiniliev <[email protected]>
Keep exact update-admission expectations aligned with the canonical updater and PATH diagnostic suffix, without relaxing no-effect assertions.

Co-authored-by: galiniliev <[email protected]>
Preserve the fresh export fence alongside upstream source cancellation. Integrate canonical context/startup contracts and exact update diagnostics from the published authority prerequisite.

Co-authored-by: galiniliev <[email protected]>
Replace mock admission cases with the real environment, node transport, upload, and Git publication owners. Preserve allowed and rejected effects plus quiescence cleanup across revocation.

Co-authored-by: galiniliev <[email protected]>
…tody

Persist immutable policy and pause/resume intent before effects; preserve exact resource custody through lost replies, expiry, restart and confirmed deletion. Fence admission until the original node and current bundle are verified. Shared-state39 follows repository authority38; activation and mirrored backups remain unchanged.

Co-authored-by: galiniliev <[email protected]>
Authority update changes only two unrelated update refusal fixtures relative to the integrated dependency tree; preserve lifecycle proof and schema ordering.

Co-authored-by: galiniliev <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 31, 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 gateway Gateway runtime scripts Repository scripts extensions: crabbox labels Oct 31, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR persists retained-disk policy and pause/resume intent, adds exact-resource lifecycle recovery, and advances shared-state schema to 39.

Example: A worker with a 600-second compute window loses its resume reply.

  • Before: OpenClaw has no retained-disk lifecycle operation to recover.
  • After: Recovery retains the original disk receipt and resume operation, while runtime admission waits for the original node and matching bundle.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The accepted prerequisite has useful storage coverage, but an authority defect and a demonstrated CI failure remain unresolved.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Partial
User problem: Retained cloud disks need recovery that preserves their identity, bounded compute window, and cleanup custody after lost replies or restarts.
Reason: The maintainer-authored direction and linked accepted design justify this prerequisite while explicitly deferring activation and preserving mirrored defaults.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep this collaborator-authored PR open as an accepted lifecycle prerequisite; replay authority and test-routing defects prevent merging.

Priority: P2
Reviewed head: 3c2676cc9717e3819ec81b21df1f1e3b09cfb2a4

Before merge

  • Add real behavior proof - Authority-chain proof required: the supplied service/store tests mock provider mutation, node reconnect, and bundle installation, while Crabbox command tests mock process results; after repair, provide an allowed resume and a caller revoked after intent persistence that produces no resume subprocess or provider I/O, using real production owners and transport, with sensitive details redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Require live authorization before replaying a pending resume (P1) - If a resume intent commits and provider preparation fails before submitting the resume, the operation remains pending. After the caller is cancelled or its authority is revoked, background reconciliation retries that resume with an empty assertCurrent callback. The remaining checks establish environment identity and operation identity, so the Crabbox adapter can submit resume and open compute without renewed caller authorization. Preserve the operation for observation and settlement, but require a fresh authorized wake before replaying a resume effect.
  • Restore canonical ordering of the new Gateway test entries (P2) - The new provider test is listed among store tests, and store-retained-lifecycle.test.ts precedes store-retained-lifecycle-migration.test.ts. Discovery sorts these paths, while the canonical ownership assertions compare directly against this array. Exact-head CI reports those assertions failing. Move the provider entry beside the other provider tests and put the migration entry before the lifecycle entry.
  • Resolve security concern: Service credentials outlive the requesting principal - The replay defect can incur cloud compute charges under the service's provider credentials; disabled activation limits present exposure but does not make the new lifecycle contract safe.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Require live authorization before replaying a pending resume — src/gateway/worker-environments/provider-retained-lifecycle.ts:165-168
  • [P2] Restore canonical ordering of the new Gateway test entries — test/vitest/vitest.gateway-server-paths.mjs:490-492
  • [medium] Service credentials outlive the requesting principal — src/gateway/worker-environments/provider-retained-lifecycle.ts:168

Tests

  • Missing end-to-end proof: Missing proof covers authorized versus revoked resume at the real provider effect, restart and same-node readiness, and an installed latest-stable upgrade with settings and data preserved.
Agent review details

How this fits together

The Gateway environment service owns lifecycle intent in SQLite, calls generic worker-provider operations, and consumes Crabbox resource observations to control worker admission and cleanup.

flowchart TD
Caller[Authorized lifecycle request] --> Service[Environment service]
Service --> Store[Environment writer]
Store --> Intent[Durable lifecycle intent]
Intent --> Provider[Worker provider]
Provider --> Crabbox[Crabbox CLI]
Crabbox --> Resource[Original cloud resource]
Service --> Node[Original node and bundle admission]
Loading

Technical review

Best possible solution:

Keep recovery in the existing environment owner, defer pending resume effects until live authorization is renewed, and preserve existing installations through the schema upgrade.

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

Source inspection establishes the pending-resume replay path; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Extending the existing environment writer and provider adapter is appropriate, but durable intent must not substitute for current authorization.

Full review comments:

  • [P1] Require live authorization before replaying a pending resume — src/gateway/worker-environments/provider-retained-lifecycle.ts:165-168
    If a resume intent commits and provider preparation fails before submitting the resume, the operation remains pending. After the caller is cancelled or its authority is revoked, background reconciliation retries that resume with an empty assertCurrent callback. The remaining checks establish environment identity and operation identity, so the Crabbox adapter can submit resume and open compute without renewed caller authorization. Preserve the operation for observation and settlement, but require a fresh authorized wake before replaying a resume effect.
    Confidence: 0.96
  • [P2] Restore canonical ordering of the new Gateway test entries — test/vitest/vitest.gateway-server-paths.mjs:490-492
    The new provider test is listed among store tests, and store-retained-lifecycle.test.ts precedes store-retained-lifecycle-migration.test.ts. Discovery sorts these paths, while the canonical ownership assertions compare directly against this array. Exact-head CI reports those assertions failing. Move the provider entry beside the other provider tests and put the migration entry before the lifecycle entry.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Environment lifecycle ownership keeps the original intent (2d6a5d7: Separate provider lifecycle from credential and worker-turn authority while preserving shared serialization and shutdown settlement.)
  • Crabbox lease renewal changes intended behavior with a stated reason (5a0fe22: Keep ordinary active worker leases alive; the new finite retained policy explains why retained leases omit that renewal path.)
  • Retained-allocation refusal changes intended behavior with a stated reason (8ef2d4f: The receipt prerequisite refused retained allocations until an exact lifecycle existed; this PR replaces that blanket refusal with explicit policy and observation validation.)
  • Schema predecessor compatibility keeps the original intent (da0ef0c: Preserve repository disk authority and original pending-result ownership across upgrades and recovery.)
  • Worker terminal settlement keeps the original intent (9a45559: Preserve durable acknowledgement ordering and pending-result custody while moving writes to the database worker.)

Testing

Proof path: in-process harness.

Security

Needs attention: Resume recovery can turn retained intent into a provider effect after caller authorization ends.

Evidence

Security concerns:

  • [medium] Service credentials outlive the requesting principal — src/gateway/worker-environments/provider-retained-lifecycle.ts:168
    The replay defect can incur cloud compute charges under the service's provider credentials; disabled activation limits present exposure but does not make the new lifecycle contract safe.
    Confidence: 0.96

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e4d602c adds src/gateway/worker-environments/provider-owner-lifecycle.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e4d602c6f374; files: src/gateway/worker-environments/provider-owner-lifecycle.ts)
  • RoboClaw: Raw commit b7563b3 adds src/gateway/worker-environments/provider-lifecycle.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b7563b304095; files: src/gateway/worker-environments/provider-lifecycle.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Persistent contract Shared-state 38 → 39; one nullable column The new lifecycle record requires coordinated runtime, Doctor, PostgreSQL, native-reader, and downgrade handling.

Root-cause cluster

Relationship: partial_overlap
Canonical: #188796
Summary: This PR implements the retained-lifecycle slice of the accepted extraction program and depends on separate resource-receipt and repository-authority slices.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: This is an accepted cloud-worker feature prerequisite with activation disabled, rather than an established urgent production outage.
  • add merge-risk: 🚨 compatibility: The PR expands the public worker-provider contract and advances persisted shared-state and native-reader compatibility.
  • add merge-risk: 🚨 security-boundary: Persisted resume intent can reach a provider compute effect after the requesting caller's authority ends.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: This is an accepted cloud-worker feature prerequisite with activation disabled, rather than an established urgent production outage.
  • merge-risk: 🚨 compatibility: The PR expands the public worker-provider contract and advances persisted shared-state and native-reader compatibility.
  • merge-risk: 🚨 security-boundary: Persisted resume intent can reach a provider compute effect after the requesting caller's authority ends.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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 execution lanes are retired.

Reviewed October 31, 2026, 8:26 AM ET / 12:26 UTC.

Extract the existing Move row codec/read operation and reuse the existing pure result owner. Migrate callers, close wrapper extraction over the required leaf, record worker-only SQL callers, and restore canonical test ordering.

Co-authored-by: galiniliev <[email protected]>
Merge published S7 f9176e0 without peer writes or history flattening. Repair the lifecycle static-import cycle, explicit benchmark retention fields, and canonical test ordering. 36 joined recovery tests, 45 Bun RPC tests, ownership checks, script typing, cycle guards, and 39 real PostgreSQL conformance tests passed.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot
roboclaw-bot changed the base branch from openclaw/s5-workspace-disk-authority to openclaw/s7-disk-gateway-move October 31, 2026 13:39
Base automatically changed from openclaw/s7-disk-gateway-move to main November 1, 2026 06:23
@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call cli CLI command changes labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 0b2a51db3fc8c1b161d26562a45b5d8cce862597
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/worker-environments/credential-broker.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

roboclaw-bot and others added 2 commits November 1, 2026 06:30
Baseline-Refresh: ab25e672e4f517415bd1406f383f014dbd4bbc74
Co-authored-by: galiniliev <[email protected]>
Replay the already-reviewed live-authority and initial-provision recovery repairs on the native baseline built from the original hosted lifecycle head and actual landed Move prerequisite. Preserve exact qualified lifecycle content, canonical state-v39 catalogs and independent main metadata without importing unsigned prerequisite history.

Co-authored-by: galiniliev <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot removed channel: voice-call Channel integration: voice-call cli CLI command changes labels Nov 1, 2026
@roboclaw-bot
roboclaw-bot merged commit 632dced into main Nov 1, 2026
268 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@roboclaw-bot
roboclaw-bot deleted the openclaw/s4-retained-disk-lifecycle branch November 1, 2026 14:40
roboclaw-bot added a commit that referenced this pull request Nov 1, 2026
## What Problem This Solves

Fixes the `check-dependencies` failure in [main run 41321208299, job 124891892863](https://github.com/openclaw/openclaw/actions/runs/41321208299/job/124891892863) caused by three unused retention-schema exports in `src/plugins/worker-retention.ts`.

## User Impact

Restores the dependency gate with no runtime, config, schema, or public SDK behavior change.

## Why This Change Was Made

`632dced4affb7a338d0def2b7059c246ed33b0af` (#189346) introduced `workerRetentionPolicySchema`, `workerRetentionOperationSchema`, and `workerRetentionObservationSchema` as exports. Their consumers are all in the same module. Keep those schemas private while preserving the three exported parsing functions. This removes exactly three export keywords: one file, +3/-3 lines, no test changes or allowlists.

This is a maintainer-directed repair of main CI. Fresh main `4e4342b9f82de8e7159a73f280948f8def7ecb7f` still contains the exports; targeted retention/dependency PR discovery and the 100 newest open PRs found no competing repair. Rebased the reviewed lane-l211 fix onto that main commit.

## Evidence

- Failure signature: production Knip and the production/full-tree export scans independently report exactly `workerRetentionPolicySchema`, `workerRetentionOperationSchema`, and `workerRetentionObservationSchema` as unused exports in `src/plugins/worker-retention.ts`. Original job logs were unavailable; this signature comes from independent remote diagnostics, not an original-log quotation.
- Remote red baseline on Blacksmith Testbox ([hydration workflow 41324118722](https://github.com/openclaw/openclaw/actions/runs/41324118722)): `CI=1 pnpm deadcode:dependencies` and `CI=1 pnpm deadcode:exports` both failed on those three exports. The relevant module and analyzer inputs were verified identical to failed head `2775e24f749f7ab823e7278f7837adb5cd112157`.
- Remote candidate proof before rebase on Blacksmith Testbox ([hydration workflow 41324536502](https://github.com/openclaw/openclaw/actions/runs/41324536502)): production root-workspace Knip exports scan passed; touched-file typecheck, typed lint, and formatting passed; `CI=1 node scripts/run-vitest.mjs src/gateway/worker-environments/provider-retained-lifecycle.test.ts --maxWorkers=1` passed all 8 tests. Hydration workflow SHAs are not candidate SHAs; native sync and the changed-file SHA-256 verified candidate inputs.
- Independent Codex autoreview of the complete local delta against `33c6ccee140558528f1c410d5c3a032fe26deaba`: scoped-clean, no P0-P2 findings. Simplification pass confirms the three keyword removals are the smallest complete fix. The rebase preserved the reviewed patch exactly.
- After rebase: `git diff --check` passed; source search confirms all three schema names remain module-local; changed-file SHA-256 remains `b6d0c21b3c846fd68c000cb43b151996df6c242cd18c38b4716f7552918c95c1`.

## Blockers

Post-rebase focused Knip, named consumer tests, and touched-file lint were not rerun: the fresh Testbox lease was granted but its runner remained queued, so the task-owned allocation was stopped. This host is the production Team Gateway and has no installed test dependencies in this worktree; staging or broad checks here are prohibited. PR CI supplies current-head proof. Prior validation above is explicitly pre-rebase evidence. No CI reruns or dispatch requests are part of this repair.

Co-authored-by: steipete <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…penclaw#189346)

* feat(workers): bind cleanup to recorded cloud resources

Persist immutable provider receipts through the existing environment writer before setup and enrollment. Reuse them for recovery, inspection, and confirmed exact-resource teardown. Retained allocation, pause/resume, and disk-authoritative workspaces remain inactive. Related: openclaw#188796.

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

* feat(workers): bind cleanup to recorded cloud resources

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 79a28e77-6a76-4cd6-bd81-e44cc99064b5

* Publish openclaw/s4-retained-session-disk

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: fea66917-e69b-4777-b127-03eb548d7c89

* test(state): avoid shadowing the migration fixture path import

Keep the historical migration expectation values unchanged while satisfying no-shadow.

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

* Publish openclaw/s4-retained-session-disk

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 147bd311-a32a-4cc1-a4c2-116b71affb91

* fix(workers): complete resource receipt consumers and migration parity

Preserve receipt custody through provisioning failure, select the complete placement row, align PostgreSQL additive column positions, and update schema-bound consumers and regression fixtures.

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

* Publish openclaw/s4-retained-session-disk

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: aa6ef0fc-2c5f-4e21-94bc-6ead8b0adea2

* feat: retain repository disk authority through recovery

Persist exact repository disk identity and accepted pending-result authority in shared state v38. Keep mirrored results unchanged, hold missing or replaced disks, and refuse stale file, publication, and materialization fallbacks. Disk mode remains inactive until explicit I/O and lifecycle support follows.

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

* fix: complete disk authority migration consumers

Declare shared-state schema 38 in package admission metadata, include the exact migrated tables in historical scope proofs, preserve canonical test ordering, and close the trusted PR wrapper import inventory.

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

* test: preserve exact PostgreSQL disk authority predecessors

Rebuild the empty pending-result table alongside worker receipts and preserve incoming foreign keys from installed lazy fragments when restoring historical test schemas.

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

* fix(workers): retain teardown settlement and predecessor contracts

Compose legacy schema transformations in canonical order, preserve installed PostgreSQL foreign keys in historical fixtures, and settle confirmed deletion after shutdown aborts new effects.

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

* Publish openclaw/s4-retained-session-disk

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 1cb5a42a-b4a8-43a9-8242-1e75244865d8

* Publish openclaw/s4-retained-session-disk

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: c1df24cc-0977-428a-bfbc-8ba8a983218b

* test: align disk authority allocation with repaired prerequisite

The published prerequisite now owns five lines previously counted in this child. Reduce the child allocation to its measured 628-line delta.

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

* feat: capture explicit repository disk snapshots

Keep exact-disk editor writes on the retained owner. Freeze explicit publication captures under durable request refs, and prepare fresh Git-preserving exports without stale mirror fallback. Disk mode and final Move lifecycle remain inactive.

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

* test: preserve complete runtime refusal diagnostics

Keep exact update-admission expectations aligned with the canonical updater and PATH diagnostic suffix, without relaxing no-effect assertions.

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

* test: qualify exact disk capture at native effects

Replace mock admission cases with the real environment, node transport, upload, and Git publication owners. Preserve allowed and rejected effects plus quiescence cleanup across revocation.

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

* feat(workers): replay retained disk lifecycle through environment custody

Persist immutable policy and pause/resume intent before effects; preserve exact resource custody through lost replies, expiry, restart and confirmed deletion. Fence admission until the original node and current bundle are verified. Shared-state39 follows repository authority38; activation and mirrored backups remain unchanged.

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

* feat: hand repository disk custody to Gateway worktrees

Use fresh Git-preserving export for explicit disk Moves, retain the original receipt across interrupted handoff, and retire source custody only after verified local binding. Resume teardown without recapturing or overwriting local edits. Keep disk activation and paused preparation separate.

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

* fix: keep disk Move data contracts outside mutation cycles

Extract the existing Move row codec/read operation and reuse the existing pure result owner. Migrate callers, close wrapper extraction over the required leaf, record worker-only SQL callers, and restore canonical test ordering.

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

* fix(workers): preserve reviewed retained lifecycle authority

Replay the already-reviewed live-authority and initial-provision recovery repairs on the native baseline built from the original hosted lifecycle head and actual landed Move prerequisite. Preserve exact qualified lifecycle content, canonical state-v39 catalogs and independent main metadata without importing unsigned prerequisite history.

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

---------

Co-authored-by: galiniliev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
## What Problem This Solves

Fixes the `check-dependencies` failure in [main run 41321208299, job 124891892863](https://github.com/openclaw/openclaw/actions/runs/41321208299/job/124891892863) caused by three unused retention-schema exports in `src/plugins/worker-retention.ts`.

## User Impact

Restores the dependency gate with no runtime, config, schema, or public SDK behavior change.

## Why This Change Was Made

`ac31d7ca47e82f003586c37156e229c5f17d4e86` (openclaw#189346) introduced `workerRetentionPolicySchema`, `workerRetentionOperationSchema`, and `workerRetentionObservationSchema` as exports. Their consumers are all in the same module. Keep those schemas private while preserving the three exported parsing functions. This removes exactly three export keywords: one file, +3/-3 lines, no test changes or allowlists.

This is a maintainer-directed repair of main CI. Fresh main `b95273cca4ae6dd903ee7f78adc449bd6d744aba` still contains the exports; targeted retention/dependency PR discovery and the 100 newest open PRs found no competing repair. Rebased the reviewed lane-l211 fix onto that main commit.

## Evidence

- Failure signature: production Knip and the production/full-tree export scans independently report exactly `workerRetentionPolicySchema`, `workerRetentionOperationSchema`, and `workerRetentionObservationSchema` as unused exports in `src/plugins/worker-retention.ts`. Original job logs were unavailable; this signature comes from independent remote diagnostics, not an original-log quotation.
- Remote red baseline on Blacksmith Testbox ([hydration workflow 41324118722](https://github.com/openclaw/openclaw/actions/runs/41324118722)): `CI=1 pnpm deadcode:dependencies` and `CI=1 pnpm deadcode:exports` both failed on those three exports. The relevant module and analyzer inputs were verified identical to failed head `3273ea9f991eb20066fc957fc25f6c51e0f6a5ff`.
- Remote candidate proof before rebase on Blacksmith Testbox ([hydration workflow 41324536502](https://github.com/openclaw/openclaw/actions/runs/41324536502)): production root-workspace Knip exports scan passed; touched-file typecheck, typed lint, and formatting passed; `CI=1 node scripts/run-vitest.mjs src/gateway/worker-environments/provider-retained-lifecycle.test.ts --maxWorkers=1` passed all 8 tests. Hydration workflow SHAs are not candidate SHAs; native sync and the changed-file SHA-256 verified candidate inputs.
- Independent Codex autoreview of the complete local delta against `34d1cebf954882f0ea83aa8bb151d9b96c9665cd`: scoped-clean, no P0-P2 findings. Simplification pass confirms the three keyword removals are the smallest complete fix. The rebase preserved the reviewed patch exactly.
- After rebase: `git diff --check` passed; source search confirms all three schema names remain module-local; changed-file SHA-256 remains `b6d0c21b3c846fd68c000cb43b151996df6c242cd18c38b4716f7552918c95c1`.

## Blockers

Post-rebase focused Knip, named consumer tests, and touched-file lint were not rerun: the fresh Testbox lease was granted but its runner remained queued, so the task-owned allocation was stopped. This host is the production Team Gateway and has no installed test dependencies in this worktree; staging or broad checks here are prohibited. PR CI supplies current-head proof. Prior validation above is explicitly pre-rebase evidence. No CI reruns or dispatch requests are part of this repair.

Co-authored-by: steipete <[email protected]>
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 extensions: crabbox gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant