Skip to content

fix: keep worker creation tied to its original caller across restarts - #197875

Merged
joshavant merged 2 commits into
mainfrom
fix/worker-create-authority-current
Nov 12, 2026
Merged

joshavant merged 2 commits into
mainfrom
fix/worker-create-authority-current

Conversation

@joshavant

@joshavant joshavant commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes pending worker creation continuing with an outdated caller after access changes or a Gateway restart.

User Impact

Worker creation keeps its original caller through preparation, allocation, and initial bootstrap. Retrying the same key cannot replace that caller. Ready workers keep their existing maintenance behavior.

Shared state advances to schema 40. Older readers refuse the upgraded database. Pending legacy creation intents without recoverable caller evidence stop; uncertain allocations retain their cleanup identity. Recreate affected pending work after cleanup settles. Rollback requires the matching pre-upgrade backup and build.

Why This Change Was Made

Store the original caller on the existing allocation intent and restore it through the authentication owner. Confirmed refusals settle unallocated work or request exact cleanup. Temporarily unavailable identity reads leave recovery pending without allocating or destroying resources. Initial bootstrap stays bound to creation until first readiness.

The existing lifecycle owner still handles provisioning and cleanup; the continuation moves to one resume module. No separate authority store or cleanup implementation is added. Migration, recovery, and reader fencing form one complete repair. The 547-line test allocation covers the exact excess above the standard allowance (947 net test lines), for distinct admission, replay/restart, cleanup, transient-reader, migration, reader-fence, and build-swap compatibility contracts.

Historical SQLite catalogs remain resolvable across an in-place build swap, as required by #196800. An already-loaded updater may read the replacement JSON after activation. The generator now retains the immediate pre-provision-source schema and all four runtime variants, alongside the earlier historical inputs. All 112 base catalog layouts are preserved exactly after resolving their generated table indices. Five fixed-hash regression cases fail before regeneration and pass afterward.

The CI repair also restores the wrapper's runtime source closure, removes a type-import cycle without adding another schema owner, fixes canonical test routing, and updates PostgreSQL preparation expectations for schema 40.

Evidence

Validated source: bfb4774af27d3514b7bcc55247f68daf614154dc, tree c2e19f899186c894422056073e9442df9246e249. All 64,467 selected files match the validated snapshot before and after the final build. Build metadata identifies the preceding commit plus that dirty snapshot; its blobs map exactly to this final committed tree.

  • Original regressions fail before the repair. Compiled-app qualification additionally exposed a missing OpenClaw ID origin marker and confirmed-refusal classification; both were repaired and covered by regressions.
  • Final worker, principal, recovery, and SQLite migration batch: 68 tests across seven files pass, two canonical shards, 120.56s wrapper.
  • Catalog equivalence: 200 pass, 3.88s wrapper. Wrapper closure: 23 pass, 29.01s. Cold provisioning/private-state: 32 pass, two capability skips, 357.11s. These run through the canonical wrappers with real fixture Git and state engines.
  • PostgreSQL 17 preparation: three pass, 39.87s wrapper. PostgreSQL migration and old-reader refusal previously passed through the canonical conformance runner. The current build retains that migration unchanged.
  • Previously qualified shared scheduled-work, queued-input, channel-recovery, and service-work consumers: 101 tests across nine files pass. Their code is unchanged by this repair batch.
  • Targeted production/test/tooling types, lint/format, migration SQL inventory, test ownership, generators, and native schema ceiling checks pass. Canonical Madge reports zero import cycles.
  • Full compiled build: passes in 3m 47.9s. Compiled CLI/Control UI composition: passes in 65.909s, using real OTP, owner enrollment, membership approval, UI device removal, same-key retry, graceful restart, abrupt exit, and signed removal through actual Discovery while offline. Valid allocation/destroy controls work before and after.
  • Installed stable 2026.11.3 → candidate compiled Doctor: schema 22 → 40 passes, preserving four synthetic worker rows, preferences, and existing settings. Stable CLI initialized the database and settings; worker/preference rows were seeded offline. All original worker columns remain exact. Doctor adds only its existing missing-skill disables, run bookkeeping, and two migration markers. Candidate config and sessions commands work afterward. The installed stable Doctor then refuses schema 40 (it supports 22).
  • Local autoreview fallback: original complete repair received five P0–P2 passes; this incremental CI/catalog repair received four complete P0–P2 passes, no actionable findings. The final snapshot maps to the committed tree above. Hosted ClawSweeper re-review completed on this exact head: both previous findings resolved, no new actionable findings, ready for maintainer review.
Sanitized terminal and receipt evidence

Actual canonical-check output, with ANSI formatting and local paths removed:

Madge import cycle check: 0 cycle(s).
Wrapper closure: Test Files 1 passed; Tests 23 passed
Provisioning/state: Test Files 2 passed; Tests 32 passed | 2 skipped
Worker/principal/migration: Test Files 1 passed + 6 passed; Tests 1 passed + 67 passed
PostgreSQL preparation: Test Files 1 passed; Tests 3 passed
Catalog equivalence: Test Files 1 passed; Tests 200 passed
[build-all] phase timings: total 3m 47.9s
worker-durable-authority-completed
restart-browser-completed
completed
{"status":"passed","receipt":"[isolated composition receipt]"}

Selected fields from the actual compiled-app receipt (identifiers and paths omitted):

{
  "status": "passed",
  "manualStateInjection": false,
  "scope": "Isolated composition only; external synthetic worker never runs a node",
  "liveRemoval": {
    "state": "failed",
    "leaseId": null,
    "retrySourceUnchanged": true,
    "stateAfterRestart": "failed",
    "retryAfterRestartSourceUnchanged": true,
    "canonicalDeviceAbsent": true
  },
  "offlineRemoval": {
    "state": "failed",
    "leaseId": null,
    "retrySourceUnchanged": true,
    "stateAfterRestart": "failed",
    "retryAfterRestartSourceUnchanged": true,
    "exitSignal": "SIGKILL",
    "discoveryAcceptedStatus": 201,
    "ordering": "Signed removal queued through actual Discovery while Gateway is off; Gateway applies canonical removal after startup. Any replay preparation stays effect-free and held until removal is observed."
  },
  "controls": [
    {
      "label": "before-removal",
      "allocated": true,
      "cleanupState": "destroyed",
      "normalRpcCleanup": true
    },
    {
      "label": "after-crash-removal",
      "allocated": true,
      "cleanupState": "destroyed",
      "normalRpcCleanup": true
    }
  ]
}

Actual upgrade receipt:

{
  "status": "passed",
  "installedStable": "2026.11.3",
  "stateSchemaBefore": 22,
  "stateSchemaAfter": 40,
  "workerRowsPreserved": 4,
  "preferencesExact": true,
  "existingConfigValuesPreserved": true,
  "doctorAddedConfig": [
    "missing-skill disables",
    "wizard run metadata",
    "two migration completion markers"
  ],
  "originalWorkerColumnsExact": true,
  "pendingAndInitialSourceUnavailable": true,
  "uncertainLeaseAndReadyMaintenancePreserved": true,
  "sqliteIntegrity": "ok",
  "foreignKeyFailures": 0,
  "fixtureBoundary": "Stable CLI initialized config and SQLite; worker/preference rows seeded offline. Candidate compiled Doctor upgraded it."
}

The offline composition holds effect-free preparation until canonical removal is observed. It proves refusal after that removal, not that mailbox processing precedes every startup task. The external synthetic worker never provides a runnable node. All execution uses isolated synthetic services; this does not qualify real cloud allocation, deployed services, npm candidate packaging, or native macOS execution.

Final-head CI has completed: 166 jobs passed, 19 skipped, two failed. All branch-related repairs passed, including architecture guards, the previously failing compact-large jobs, and all four PostgreSQL lanes. Separate Swift and iOS Periphery workflows passed. No checks remain pending.

The only failing test is the inherited Codex Bun command-execution assertion. The original six-file shard reproduces identically on this head and original base a3d5baaabd2ce88ace4b5d1c45a9577a61dbc08a (80 pass, one fail; node-app-server.runtime.test.ts:268, expected marker/exit 0, received empty stdout/exit 1). The final source was restored and reverified afterward. The second failed job is the aggregate CI gate. The subsequent automated policy workflow completed successfully; its dependency and sensitive-change checks passed, while its aggregate CI status correctly remains failed because the primary CI gate failed. This inherited failure remains a deferred CI blocker; no unrelated repair or rerun was performed. The first run's inherited workflow-size failure did not recur in the final run.

Hosted review and CI closeout are complete. The PR remains open with auto-merge disabled. No merge is requested.

@clawsweeper

clawsweeper Bot commented Nov 12, 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 size: XL labels Nov 12, 2026
@joshavant
joshavant marked this pull request as ready for review November 12, 2026 19:14
@github-actions

github-actions Bot commented Nov 12, 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: bfb4774af27d3514b7bcc55247f68daf614154dc
  • Maintainer: @joshavant
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/worker-environments/provision-source-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves and restores the original worker-creation caller across preparation, retries, bootstrap, and Gateway restarts.

Example: A worker creation request uses idempotency key caller-authority, then its original device is removed before restart recovery.

  • Before: Recovery can continue the stored provisioning operation without restoring the original caller.
  • After: Recovery refuses the removed caller, prevents new allocation, and retains any uncertain allocation for cleanup.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent repair with supplied production-entry-point and stable-upgrade evidence; both previous blockers are fixed, while hosted CI qualification remains incomplete.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The supplied current-source compiled CLI/Control UI receipts exercise real enrollment, device removal, same-key retry and restart against isolated synthetic services, showing refusal without allocation and successful authorized allocation/cleanup controls; they expressly do not claim real cloud or runnable-node qualification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Pending worker creation can continue under outdated caller authority after access changes or a Gateway restart.
Reason: The maintainer-authored direction repairs caller-bound provisioning using existing owners and explicitly accepts the narrow legacy-pending-work and downgrade consequences.

Merge readiness

✅ Ready for maintainer review

Both earlier findings are resolved, and no new actionable defect was found in this PR. Keep it open for completion of exact-head CI and the author's stated review-only handoff.

Priority: P2
Reviewed head: bfb4774af27d3514b7bcc55247f68daf614154dc

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway admits worker creation, stores its allocation intent in shared state, and drives provider allocation and bootstrap; recovery now restores the intent's original authentication source before continuing.

flowchart TD
  A[Authenticated creation request] --> B[Gateway admission]
  B --> C[Durable worker intent]
  C --> D[Original source restoration]
  D --> E[Provider allocation and bootstrap]
  D --> F[Refusal or pending recovery]
  F --> G[Existing cleanup owner]
Loading

Technical review

Best possible solution:

Retain original caller evidence on the existing allocation intent and restore it through the authentication owner while preserving canonical provisioning and cleanup.

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

Current main shows manual creation entering the durable provisioning path without original caller evidence; the supplied compiled-app receipts exercise removal, replay and restart through the Gateway.

Is this the best way to solve the issue?

The change repairs the existing intent and authentication owners, preserves cleanup custody, and includes the coordinated migration, reader fencing and historical catalogs needed for a complete cutover.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Earlier catalog finding resolved: Read-only comparisons of both generated catalog representations found all 112 base hashes retained with identical resolved layouts and fingerprints; the head contains 117. Generator inputs now retain the immediate predecessor and its four runtime variants. (scripts/lib/sqlite-schema-inputs.mts:66, bfb4774af27d)
  • Earlier wrapper finding resolved: The wrapper source inventory now includes the v40 migration module and the additional runtime imports required by its source closure. (scripts/pr-lib/wrapper-components.txt:2220, bfb4774af27d)
  • Current main still needs the repair: Fetched main's environments.create calls service.create without captured caller evidence, and its provisioning resumer has no durable original-source restoration. (src/gateway/server-methods/environments.ts, 8ef78ec2dc4e)
  • Authority and cleanup boundary: Stored source evidence is restored through the existing authentication owner; confirmed authorization refusals differ from unavailable identity reads, and provisioning cleanup retains the existing operation and resource owners. (src/gateway/worker-environments/provision-source-authority.ts:63, bfb4774af27d)
  • Behavior and upgrade receipts: The full PR body supplies compiled CLI/Control UI receipts covering device removal, same-key retries, graceful restart and abrupt exit, plus installed stable 2026.11.3 Doctor migration from schema 22 to 40 with worker rows, preferences and existing settings preserved. (bfb4774af27d)
  • Accepted upgrade tradeoff: The maintainer-authored PR explicitly accepts older-reader refusal, termination of legacy pending creation without recoverable source evidence, preservation of uncertain cleanup identity, and rollback using the matching backup and build. (src/state/openclaw-state-db-schema-v40-worker-provision-source.ts:15, bfb4774af27d)

PR surface

Source +468, Tests +950, Docs +31, Config 0, Other +16. Total +1465 across 57 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 31 749 281 +468
Tests 17 963 13 +950
Docs 3 33 2 +31
Config 1 1 1 0
Generated 0 0 0 0
Other 5 17 1 +16
Total 57 1763 298 +1465

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Persistence contract Shared-state schema 39 → 40; one nullable column worker_environments.provision_source_json stores original caller evidence and intentionally fences older readers.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded worker-creation and restart-recovery authorization defect.
  • merge-risk: 🚨 compatibility: Schema 40 intentionally refuses older readers and stops legacy pending creation without recoverable caller evidence; the maintainer-authored direction accepts this tradeoff and supplies upgrade preservation evidence.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-12T19:34:36.254Z sha 3b9be2c :: blocked before merge. :: [P1] Preserve the immediate predecessor's schema and runtime catalog hashes | [P2] Include the new migration module in the PR wrapper source inventory

Reviewed November 12, 2026, 3:11 PM ET / 20:11 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Nov 12, 2026
@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

The catalog compatibility and wrapper closure findings are addressed in bfb4774af27d3514b7bcc55247f68daf614154dc. The description now includes sanitized compiled-app and installed-stable upgrade receipts, the historical-catalog explanation, and current CI attribution. Please assess the current head. CI is still running; this is a review request only.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Nov 12, 2026
@clawsweeper clawsweeper Bot added 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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@joshavant
joshavant merged commit 9ecae40 into main Nov 12, 2026
296 of 299 checks passed
@joshavant
joshavant deleted the fix/worker-create-authority-current branch November 12, 2026 22:18
roboclaw-bot added a commit that referenced this pull request Nov 13, 2026
#197985)

* fix(test): align agent artifact worker creation fixture

Update the injected worker service to the request-shaped creation contract introduced in #197875. Preserve idempotency and invoke the supplied authority check before fixture allocation.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* fix(test): agent artifact fixture uses the retired worker creation API

Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 0f327e11-666e-8123-8350-6617f8a9e77a

---------

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

* fix: keep worker creation tied to its original caller across restarts

* fix: retain worker migration catalogs and tooling closure
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
openclaw#197985)

* fix(test): align agent artifact worker creation fixture

Update the injected worker service to the request-shaped creation contract introduced in openclaw#197875. Preserve idempotency and invoke the supplied authority check before fixture allocation.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* fix(test): agent artifact fixture uses the retired worker creation API

Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 0f327e11-666e-8123-8350-6617f8a9e77a

---------

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
roboclaw-bot added a commit that referenced this pull request Nov 13, 2026
Align the old lifetime oracle with #197875: a fresh attempt that never entered allocation becomes failed even after its provisioning transition committed. Preserve both real COMMIT barriers, the original timeout and no-allocation contract; independently assert persisted state and joined settlement.

Co-authored-by: galiniliev <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
roboclaw-bot pushed a commit that referenced this pull request Nov 13, 2026
* fix(github): recover saved repository publications

* fix(test): correct publication recovery test ownership

Keep native publication integration in the database worker lane, preserve canonical registration order, and assert the extended requester capability without weakening exact RPC matching.

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

* test(github): qualify publication authority before credential effects

Exercise current requester roles, live placement reservation, and repository credential admission against a harmless loopback sink. Keep synthetic credential-provider evidence separate from live provider acceptance.

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

* test(github): account for scoped publication regression lines

Allocate exactly 141 net regression lines: 132 real-owner authority proof, eight Vitest ownership assertions, and one RPC requester matcher. The inherited 80-line base debt remains visible; this does not raise the shared scalar or conceal a failing ratchet.

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

* fix(github): repair publication architecture ownership gates

Extract the native workspace transfer operation into a leaf contract so merge transport no longer depends back on its client. Register repository reopen writes only under the existing repositoryMutation authority owner, with both admitted and bypass guard coverage.

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

* test(github): use default publication registry runtime

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

* test(github): compose native publication recovery proof

Exercise real requester admission, receipt recovery, native Git and HTTP transport with a task-owned physical ref CAS oracle. Preserve request and checkpoint identity across a synthetic pre-effect 503 and coordinator reconstruction, with revoked authority, changed requester, moving placement and revoked custody controls.

Reuse the existing synthetic credential fixture and allocate exactly 432 net new test lines. Provider responses, node enrollment and checkpoint input remain test-controlled; this does not claim live-provider or full Gateway restart acceptance. Existing full-ratchet debt remains unresolved.

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

* test(github): prove publication across Gateway process restart

Exercise public repository sessions, authenticated requester admission, dispatched native worker writes, and saved checkpoint publication through a task-local GitHub transport. Restart the actual Gateway OS process while retaining native worker owners, then reopen the original request and verify one physical Git ref CAS. Reject a revoked original requester without additional transport or worker effects.

External publisher/model responses are synthetic; actual profile, placement, credential admission, native Git, HTTP, process custody and durable receipts remain production-owned. Allocate exactly 929 new LF-counted test lines; preserve the inherited 80-line global debt and earlier coordinator-only evidence.

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

* test(github): create process proof diagnostics directory

Address the scoped independent review finding: create the task-local diagnostics parent before cleanup writes so fresh checkouts do not fail with ENOENT. Keep cleanup errors visible and reduce the exact regression allocation by the three removed LF lines.

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

* test(github): preserve isolated publication transport in CI

Bind the fixture-owned PATH explicitly so clean CI startup cannot select a system GitHub CLI instead of the synthetic loopback transport. Preserve real requester, credential, restart, and physical Git CAS assertions.

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

* fix(github): keep personal publisher credentials on the Gateway

Use the normal worker execution identity for repository integration while retaining the selected publisher for Gateway API, ref and PR writes. Check live selection, repository reads and operation lifetime without borrowing a coding turn or changing the worker protocol. Preserve transient throttling recovery and document the execution-reader prerequisite.

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

* fix: wait for private publication cleanup before draining

Join native private publication work before acknowledging workspace drain while preserving concurrent editing. Fund the two success/cancellation regressions with exactly 126 LF; inherited 80-line debt remains separate.

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

* fix: keep editing available while publication drains

Reserve the publication settlement barrier under workspace serialization, then join it outside the editing queue. Exercise editing after drain admission and remove an inert prepared-store spy; reduce the exact allocation to 123 LF.

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

* fix: recover publication with its original dispatch authority

Carry the current publication reader through recorded worker recovery; preserve the chat reader only for callers without an explicit reader. Prove allowed and revoked recovery at the placement/admission boundary.

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

* fix(github): bound recovery after checkpoint capture failures

Include checkpoint capture in the existing publication recovery budget, while
keeping editing admission separate from private integration and settlement.
Preserve earlier failures when reservation contention skips an attempt.

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

* fix(github): cancel publication worker recovery promptly

Forward the existing publication operation signal through placement admission and offline-worker reconnect. Preserve the existing Gateway drain, deadline, current-authority checks and cleanup ownership.

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

* test(workers): follow unallocated timeout settlement

Align the old lifetime oracle with #197875: a fresh attempt that never entered allocation becomes failed even after its provisioning transition committed. Preserve both real COMMIT barriers, the original timeout and no-allocation contract; independently assert persisted state and joined settlement.

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

---------

Co-authored-by: galiniliev <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
* fix(github): recover saved repository publications

* fix(test): correct publication recovery test ownership

Keep native publication integration in the database worker lane, preserve canonical registration order, and assert the extended requester capability without weakening exact RPC matching.

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

* test(github): qualify publication authority before credential effects

Exercise current requester roles, live placement reservation, and repository credential admission against a harmless loopback sink. Keep synthetic credential-provider evidence separate from live provider acceptance.

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

* test(github): account for scoped publication regression lines

Allocate exactly 141 net regression lines: 132 real-owner authority proof, eight Vitest ownership assertions, and one RPC requester matcher. The inherited 80-line base debt remains visible; this does not raise the shared scalar or conceal a failing ratchet.

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

* fix(github): repair publication architecture ownership gates

Extract the native workspace transfer operation into a leaf contract so merge transport no longer depends back on its client. Register repository reopen writes only under the existing repositoryMutation authority owner, with both admitted and bypass guard coverage.

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

* test(github): use default publication registry runtime

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

* test(github): compose native publication recovery proof

Exercise real requester admission, receipt recovery, native Git and HTTP transport with a task-owned physical ref CAS oracle. Preserve request and checkpoint identity across a synthetic pre-effect 503 and coordinator reconstruction, with revoked authority, changed requester, moving placement and revoked custody controls.

Reuse the existing synthetic credential fixture and allocate exactly 432 net new test lines. Provider responses, node enrollment and checkpoint input remain test-controlled; this does not claim live-provider or full Gateway restart acceptance. Existing full-ratchet debt remains unresolved.

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

* test(github): prove publication across Gateway process restart

Exercise public repository sessions, authenticated requester admission, dispatched native worker writes, and saved checkpoint publication through a task-local GitHub transport. Restart the actual Gateway OS process while retaining native worker owners, then reopen the original request and verify one physical Git ref CAS. Reject a revoked original requester without additional transport or worker effects.

External publisher/model responses are synthetic; actual profile, placement, credential admission, native Git, HTTP, process custody and durable receipts remain production-owned. Allocate exactly 929 new LF-counted test lines; preserve the inherited 80-line global debt and earlier coordinator-only evidence.

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

* test(github): create process proof diagnostics directory

Address the scoped independent review finding: create the task-local diagnostics parent before cleanup writes so fresh checkouts do not fail with ENOENT. Keep cleanup errors visible and reduce the exact regression allocation by the three removed LF lines.

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

* test(github): preserve isolated publication transport in CI

Bind the fixture-owned PATH explicitly so clean CI startup cannot select a system GitHub CLI instead of the synthetic loopback transport. Preserve real requester, credential, restart, and physical Git CAS assertions.

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

* fix(github): keep personal publisher credentials on the Gateway

Use the normal worker execution identity for repository integration while retaining the selected publisher for Gateway API, ref and PR writes. Check live selection, repository reads and operation lifetime without borrowing a coding turn or changing the worker protocol. Preserve transient throttling recovery and document the execution-reader prerequisite.

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

* fix: wait for private publication cleanup before draining

Join native private publication work before acknowledging workspace drain while preserving concurrent editing. Fund the two success/cancellation regressions with exactly 126 LF; inherited 80-line debt remains separate.

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

* fix: keep editing available while publication drains

Reserve the publication settlement barrier under workspace serialization, then join it outside the editing queue. Exercise editing after drain admission and remove an inert prepared-store spy; reduce the exact allocation to 123 LF.

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

* fix: recover publication with its original dispatch authority

Carry the current publication reader through recorded worker recovery; preserve the chat reader only for callers without an explicit reader. Prove allowed and revoked recovery at the placement/admission boundary.

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

* fix(github): bound recovery after checkpoint capture failures

Include checkpoint capture in the existing publication recovery budget, while
keeping editing admission separate from private integration and settlement.
Preserve earlier failures when reservation contention skips an attempt.

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

* fix(github): cancel publication worker recovery promptly

Forward the existing publication operation signal through placement admission and offline-worker reconnect. Preserve the existing Gateway drain, deadline, current-authority checks and cleanup ownership.

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

* test(workers): follow unallocated timeout settlement

Align the old lifetime oracle with openclaw#197875: a fresh attempt that never entered allocation becomes failed even after its provisioning transition committed. Preserve both real COMMIT barriers, the original timeout and no-allocation contract; independently assert persisted state and joined settlement.

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

---------

Co-authored-by: galiniliev <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 19, 2026
Carried to the pure candidate (stage 2) from the chain. Upstream's
catalog-equivalence cases (openclaw#197875, new in this merge) pin the source
hashes of upstream's own historical state projections. The pure
candidate's state schema also carries the continuation tables, so all
10 projections hash differently: db:postgres:check failed 10 of 205 at
99016c4, and the received hashes equal the chain's pins exactly (the
pure and chain state schemas match).

The pins are this lineage's real history: bc7e568's own
browser-to-deferred runtime (lazy + journal) hashes to dcde1d20, the
pinned historical value, and the candidate's generated catalogs resolve
all five bc7e568 layouts (raw schema and four runtime projections),
catalog and fingerprint. A layout with one unshipped table resolves
neither. The comment now names bc7e568 in place of the chain's
51ff02d.

Refs openclaw#129388

(cherry picked from commit a377cc6)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed 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