Skip to content

fix(github): recover saved repository publications - #193873

Merged
roboclaw-bot merged 20 commits into
mainfrom
galiniliev/Main6-publication-recovery
Nov 13, 2026
Merged

roboclaw-bot merged 20 commits into
mainfrom
galiniliev/Main6-publication-recovery

Conversation

@galiniliev

@galiniliev galiniliev commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repository-backed sessions can publish against their selected source branch instead of the current default branch, and saved publication requests cannot recover from pre-effect outages or retained-worker reconnects. Native integration also forwarded the selected personal publisher credential to the worker instead of using the normal execution identity. Capture failures could bypass bounded recovery and leave a request pending indefinitely.

User Impact

Publication integrates the accepted checkpoint with one observed target tip in private worker Git state while preserving later edits, the editing index, the original request and existing PR metadata. Explicit retries revalidate the original requester and publisher; they never force-push or adopt an unmatched external head.

Repository-only publication requires the normal worker execution account to read the source/head and target/base roles: one repository in the common case, or fork and upstream when applicable. Actual read checks remain mandatory. My GitHub stays Gateway-held for final API/ref/PR writes and attribution. Missing execution credentials or access fail closed without personal-token fallback, anonymous fallback, new App requirements or broader grants. Ordinary worker Git/PR/issue capabilities are unchanged.

New capture still requires authoritative disk custody. Installed-upgrade and live private-provider/model qualification remain unperformed; these specific limitations were explicitly acknowledged in the landing direction below.

Why This Change Was Made

Reuse the existing checkpoint, receipt, placement/runtime recovery, transfer and native Git owners. Capture holds editing custody; merge work stays private. Failure receipts retain bounded transport facts, not command output. Worker execution credentials have a bounded publication-operation lifetime independent of the API publisher, with acquisition rotation, committed selection, expiry, requester and placement checks. Native drain joins private publication and awaited cleanup outside the editing queue.

Reclaimed recovery carries the publication's existing live startup reader through the normal placement owner, without fabricating a chat turn or substituting credentials after denial. Capture errors use the existing cooldown and three-attempt/one-hour terminal policy. Healthy checkpoint waits remain exempt; busy work preserves previous failures. Terminal settlement rereads the current receipt under workspace exclusion without recapture or Git replay. The existing operation signal reaches placement and reconnect waits. No database schema, protocol extension, broader grant or new recovery owner was added.

Contributors: @galiniliev and @vyctorbrzezowski.

Work sessions

Linked for team reference; these sessions aren’t public.

Evidence

Exact T and independent landing disposition

Published head 0feb33f12155b29bb824b6ecaf2d707067be9698, tree 119568553410ac8ed89106d60e92f3ed23635533. All85 scoped modes/blobs, signatures, ordered parents and both human trailers were verified. Historical source-for-proof receipt 3acf53eaea9e14f4d0ef9025875d6030c7c2e942 retains its original review 1fde21bc0a30cb7946ff5265c6346110e3260a3f; it was not restamped as landing proof.

On November13 at22:29UTC the requester explicitly directed landing with the named installed-upgrade, live-private recovery and full-helper qualification gaps acknowledged, at the actual hosted3/3/4. A fresh independent ordinary correction review considered that new scope, current green CI and the actual source-bound evidence. Its verdict is READY FOR /prepare-pr, review OID 8913c2a135c58314f4a80375bd49ee3cfdf0fcda, SHA256 fd550aafa1907c9760ac6ec2137127e198c8c348488d8bf03bde54c7bd7b8a33. Unmodified canonical validation passed before and after installation. This is independent review disposition, not a claim that native preparation or merge has completed; current authority, source, CI/security and landing checks still apply.

The reviewer traced permitted behavior/authority/credential/drain owners and inspected actual execution evidence:57 manifest entries,54 CI-log hashes and201 named proof lines. The behavioral assessment was completed; no new runtime test execution was claimed. All37 historical finding IDs across42 retained reviews, including originalR1–R5/NCI1, have explicit dispositions. Installed/live/helper gaps remain honestly recorded; the three investigated local HTTP failures remain tests.result:fail with their investigation records. No denied source was accessed, and no review/policy/receipt bypass was used.

CI and hosted review

Exact-T CI43492565015/1 PASSED November13 at19:54:52UTC:108 jobs,81 success/27 skipped/zero failed or active. Both required CI-gate forms and sensitive/dependency statuses succeed. The terminal post-review rollup has182 contexts:116 success/65 skipped/1 neutral. No rerun, new allocation credit or CI exception was used.

The exact-T hosted assessment, revision11, remains 3/6 readiness · 3/6 proof · 4/6 patch, zero concrete code findings; Security:None. Receiver43498247711/1, job132136926198, reviewed at20:11:26.361UTC. The single request6863558487 was accepted/completed; finalizer43499508888 was not another review. No higher rating is claimed or requested.

Hosted sourceRevision e5a2a9dc844a9e50eb9a628cc74882c73233b7ecc523f8d3545a5c3054ddd0f1 binds exact T and its earlier16007-byte body, SHA256 dbfc4ceeb8fbdd0a070b41386d14a251f7a57f77ace7e89d293670b346af8eab. Later factual status/landing-direction updates are not silently claimed covered by that sourceRevision. The new ordinary review is separate; source remains T.

Actions executed merge 6ce32d561d1ce8f2538d0c6e124c06bd66dc1438, tree 07624509c3d2553ae4f1a3d8e3b48fb4ba278e35, parents main 77a0a8426513a024f2220c78085ddbd5731a059c then T.83/85 product paths equal T; newer main supplies the shared-request-specific recovery dispatcher and two test registrations. Both differences and the complete dispatcher owner were inspected; sequential recovery, stop/empty checks, selected-shared isolation and aggregate-error handling remain. This is merge-ref evidence, not standalone byte equivalence.

Orchestration was Node24.22.1; workers Bun1.4.4-canary.1+191755ec1/bun-all; Vitest5.0.5. Security publisher43496642175/1 explicitly binds T and CI attempt1; required contexts were independently checked. Exact-T notice identifies Maintain authority and requires no additional SecOps approval. Effect-time enforcement remains separate from any accepted qualification gap.

Local and hosted proof

Check Actual result
Local committed-T composition 176/176 passed,11 files,271.62s wrapper: repaired assertions, startup success/genuine failure, caller/replay, native Git/CAS, capture/checkpoint, cancellation and drain/editability
Local committed-T OS restart 2/2 together,75.598s tests/296.70s build-inclusive wrapper; real Gateway replacement, original receipt/checkpoint, native Git/HTTP, physical CAS1 allowed/0 revoked
Hosted contracts Memory3/3, lifetime39/39, startup12, capture/recovery45, requester50, native/credential25, preparation7, drain15, native ancestry and OS restart2/2 pass; OS tests70.844s
Static/accounting Types/lint/format/whitespace and hosted gates pass; 3180 net /400 allowance /2785 unchanged credit,5 remaining; no extra25 grant
Earlier source review Full85 permitted composition; canonical R→S1file/16contexts/299372bytes, source verified, no actionable P0–P3 findings—not a complete-helper receipt

Selected Control UI E2E and four PostgreSQL conformance jobs pass. Skips are not coverage and overlapping counts are not summed. External GitHub/model/provider responses are synthetic. The process command was:

OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/github-publication-process.e2e.test.ts --maxWorkers=1

T's parents are signed S fd45e4facd6bc3486808d8402a3aedb75262cfbd and selected main a48a3175600e3cad5554128a4cf0012c4e65d9ad. Native integration included official #198153, without duplicate patch or history rewrite. All85 standalone product modes/blobs equal reviewed S; outside scope equals selected main.

Repaired failures and retained history

R CI43382208321/1 remains failed108 jobs79/3/26, merge71bcaed5/main42f933c7+R. Both assertions reproduced on R under pinned Bun:40 pass/2 fail,110.34s wrapper—not full-hosted-merge/base replay. Memory count1/actual0 was corrected by upstream #198153/16663ca0869f5f3e7b53324dbe796ed308a6bf70 to match #195369 cache retirement while preserving indexed text/executor/drain/leases. The provisioning-timeout fixture now follows #197875's never-allocated failure contract, retaining real COMMIT barriers, original5ms timeout, no allocation, exact error and joined settlement. Production behavior was unchanged.

S final39/39 passed71.62s wrapper; earlier56/56 preceded equivalent coalescing. Two mutation controls failed state/error contracts on earlier fixture bytes, not final coalesced bytes; production was restored. Net test change−1LF. Original UNKNOWN classification and historical failures were not relabeled by T success.

Q integrated #197929's startup fix; Q199 passes/23 optional PostgreSQL skips remain Q facts. R's existing-signal propagation fixed delayed cancellation, not credential exposure/authority bypass: redQ, then54/54 and stronger7/7; canonical2paths/19contexts320128bytes was scoped-clean. R's local OS evidence was source-equivalent staged94c972c4; T has its own committed proof.

P CI43305753294 remains failed107 jobs78/3/26; its startup oracle was corrected by #197929, while ratchet-runner communication loss/rawlog404 still has no established assertion/OOM/timeout cause. O CI43295300207 passed108 jobs81/27. Hosted success does not erase historical local Node proxy502 failures or establish runtime equivalence.

J CI43168237254 failed retired global25 budget/downstream gate. #197602 introduced the per-change owner; all six allocation blobs remain unchanged, with no extra25/scalar restoration. Historical local80 debt from #191554/35702b4 stays dated evidence. P160 passes/23 optional PostgreSQL skips/capture reds/OS2 remain P facts. H proved personal custody after redG; J fixed drain/I editing-lock defects. I's interrupted aggregate is not two completed red cases. F HTTP401, G identity_changed/cloud-wire closure and F interrupted build-inclusive proof remain recorded; a local Bun panic never established cloud-wire cause. Earlier103/32/5 and all revision-specific counts remain separate.

Immutable historical F process-proof trace

Captured before F publication; publication fields describe that capture time, not current head. JSON SHA-256 including its terminal newline: a1bb5e77fdf1c673b72e6bb3956a48c89e80581da9efd89518e1373240ddaafd.

{
  "kind": "public-safe-local-process-proof",
  "candidateCommit": "f2b6d8782559b7838ea05d91d731c495355383fb",
  "candidateTree": "3596775de1ac22999c058c5238f0095d08cd6141",
  "testSourceSha256": "5c45205d282043e8127f413a58e96330411019e2e7379c91f2282cb248b18dbc",
  "runtimeBuiltFrom": "12815829c422c8664891ec7345713b8182d89ce6",
  "runtimeInputSignature": "8a1d7e34ebf18c8b905fb6e4b8003e45aa480968f444433e63fa43a046e85c1b",
  "runtimeNodeVersion": "v26.12.1",
  "publishedHeadAtLastObservation": "7a4185da18076093594a8122005d1bc8bc483aa0",
  "sourcePublication": "not performed",
  "cases": [
    {
      "scenario": "allowed",
      "gatewayPidBefore": 527009,
      "gatewayPidAfter": 540742,
      "oldProcessExtinctionVerified": true,
      "requestId": "50c23983-cf69-4b61-b560-97c48554322f",
      "checkpointRef": "refs/openclaw/worker-results/5b1a4c22-b690-4601-a1e6-a09b9da70650",
      "checkpointDigest": "sha256:1999c9a99704c1c1f4c822cdbf056cedcbc1bf9822091d3cef114a00e9ab9fd4",
      "requestAndCheckpointPreserved": true,
      "physicalRefCasCount": 1,
      "syntheticPullRequestCount": 1,
      "durableStatus": "published",
      "gitObjectWrites": 5,
      "publishedFixtureHead": "864de466ed94aeecff3f3956b62a0c14133adad5",
      "gitContentsAndAncestryVerified": true
    },
    {
      "scenario": "revoked",
      "gatewayPidBefore": 607304,
      "gatewayPidAfter": 625525,
      "oldProcessExtinctionVerified": true,
      "requestId": "2184ef9e-f832-40e9-a122-6096118c33e4",
      "checkpointRef": "refs/openclaw/worker-results/aac6f693-ae4c-4d96-b1b9-92858898152d",
      "checkpointDigest": "sha256:457e956e90b49e2d5980637ae0196fd00140a47a958018bacb9d28c51360c591",
      "requestAndCheckpointPreserved": true,
      "physicalRefCasCount": 0,
      "syntheticPullRequestCount": 0,
      "durableStatus": "failed",
      "gitObjectWrites": 0,
      "actualRefusal": "FORBIDDEN: missing scope: operator.sessions.write",
      "additionalRetryEffects": 0,
      "durableErrorCode": "unavailable"
    }
  ],
  "qualification": {
    "finalSourceCaseResults": "both cases passed separately",
    "postRepairAggregate": "interrupted by outer build-inclusive deadline after allowed passed; not aggregate green",
    "siblingTestsPassed": 8,
    "targetedTypesLintFormat": "passed",
    "independentCodeReview": "one cleanup-directory P2 accepted, repaired and validated; findings resolved, not retroactively scoped-clean",
    "ownNewTestLineAllocation": 926,
    "fullTestLineBudget": "RED: inherited80 remains"
  },
  "limits": [
    "External GitHub and model responses are synthetic. No real GitHub PR was created.",
    "The Gateway crosses real OS-process boundaries; retained native node owners live in the fixture process with real worker children.",
    "Revocation is a real original-requester ingress rejection; no claim that a revoked retry reached credential dispatch.",
    "Latest-stable upgrade, real-model/private-provider acceptance and hosted CI on F remain unproven.",
    "Earlier103/32/5 evidence stays separately source-bound and is not summed into these cases."
  ]
}

Explicitly accepted qualification limitations

The November13 landing direction accepted these named gaps; the fresh independent review records them without claiming completion:

  • Installed latest-stable upgrade: not performed. Preservation of real installed receipts/checkpoints/settings/targets is not established by same-version OS restart or seeded older-version tests.
  • Live private-provider/real-model recovery: not performed. External responses in the executed boundary fixtures are synthetic.
  • Complete helper coverage: incomplete. Denied secrets/allocation contents remain unread; no copied/renamed source, omitted-required-context trick or alternate engine was used.
  • Hosted score remains3/3/4. The requester expressly changed the earlier numeric landing objective for this PR; no higher score was fabricated.

Historical local HTTP failures remain failed with their investigated limitations. Last verified stable reference v2026.11.3 is a prior observation, not a fresh release check; no package-age bypass, new fixture/account/provider/model resource or deployment was authorized or performed. Accepted qualifications do not waive current native source, permission, CI/security, enforced review or exact-head merge checks.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: XL labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 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: 0feb33f12155b29bb824b6ecaf2d707067be9698
  • Maintainer: @galiniliev
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/server-methods/github-personal-authorization.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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. 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 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR recovers saved repository publications, integrates checkpoints against the default branch, and separates worker execution credentials from the final publisher.

Example: A session sourced from topic saves a publication request before a temporary HTTP 503.

  • Before: Publication can target topic, and repeating the failed request cannot resume its saved checkpoint.
  • After: New publication targets main, and an eligible explicit retry retains the original request and checkpoint.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Substantial production-path and CI evidence supports the repair, but installed-upgrade compatibility for github_repository_publication_requests and retained checkpoints is not established.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Repository publication can choose the source branch as its base or strand saved work after an outage or worker reconnect.
Reason: The maintainer-authored repair addresses owned failures, preserves saved work and existing PR metadata, and explicitly records the execution-reader prerequisite.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: it repairs concrete publication failures still present on main, and the earlier code findings appear resolved.

Priority: P2
Reviewed head: 0feb33f12155b29bb824b6ecaf2d707067be9698

Before merge

  • 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

None.

Tests

  • Missing end-to-end proof: Provide redacted live execution-provider/model recovery evidence and a latest-stable installed upgrade preserving existing receipts, checkpoints, settings, and publication targets.
Agent review details

How this fits together

The Gateway admits publication requests and stores receipts; workers integrate immutable checkpoints, then the Gateway performs GitHub branch and PR writes.

flowchart LR
  A[Authenticated requester] --> B[Gateway publication coordinator]
  B --> C[SQLite receipts and checkpoints]
  C --> D[Placement recovery]
  D --> E[Private worker Git integration]
  E --> F[Gateway publisher]
  F --> G[GitHub branch and pull request]
Loading

Technical review

Best possible solution:

Retain the existing receipt, checkpoint, placement, and transfer owners while qualifying the completed recovery path before merge.

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

Current-main source establishes source-ref base selection and terminal failed receipts without this reopening path; supplied native and process regressions exercise the repair, but this read-only review ran no reproduction.

Is this the best way to solve the issue?

The repair uses existing authoritative owners, preserves immutable input and exact branch updates, and addresses the prior findings without establishing another concrete code defect.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Repository publication target and immutable checkpoint changes intended behavior with a stated reason (140d9e7: Repository-backed sessions publish accepted checkpoints without creating a Gateway checkout; source refs previously influenced non-fork PR bases.)
  • Bounded automatic recovery keeps the original intent (4633c4d: Stop unconfirmed recovery after three failed attempts or an age-bounded final attempt while retaining saved work and recorded effects.)
  • Inherited workflow authority keeps the original intent (e0466ff: Permit verified inherited upstream workflows without permitting guest-authored workflow changes.)
  • Awaited publication worker ownership keeps the original intent (aec8993: Route publication lifecycle and typed-source mutations through awaited worker-owned operations.)
  • Native workspace retention and drain keeps the original intent (d913796: Retain durably owned workspace generations and in-flight operations across reconnect and collection.)
  • Enterprise host routing keeps the original intent (db01f6d: Preserve host-bound repository identity and authority through publication and worker preparation.)
  • Unallocated worker timeout test keeps the original intent (fix: keep worker creation tied to its original caller across restarts #197875: Fresh creation that never entered allocation now fails rather than remaining provisioning; the adjusted oracle retains transition barriers and joined settlement.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main retains the affected behavior: Fetched main still derives a non-fork publication base from the selected source ref; the introduced patch selects the repository default and preserves previously recorded continuation targets. (src/gateway/github-repository-publication-executor.ts:97, df0d49f58d1f)
  • Saved-request recovery uses the existing state owner: Reopening updates github_repository_publication_requests through its worker transaction, requires a typed source, and rejects receipts with prepared or recorded effects. (src/gateway/github-repository-publication-store.worker.ts:309, 0feb33f12155)
  • Previous findings addressed: The process fixture pins its isolated transport; worker integration receives the execution credential; native drain joins publication cleanup outside editing serialization; checkpoint capture now participates in bounded recovery. (src/node-host/node-worker-workspace.ts:640, 0feb33f12155)
  • Substantial process proof with explicit limits: The complete PR body reports current-head Gateway PID replacement, preserved request/checkpoint identity, one allowed physical ref update and zero revoked updates, while explicitly retaining synthetic external responses and incomplete live and installed-upgrade qualification. (test/e2e/qa-lab/runtime/github-publication-process.e2e.test.ts:50, 0feb33f12155)
  • Accepted execution-reader prerequisite: The maintainer-authored direction explicitly requires the execution account to read source and target repositories and rejects personal-token or anonymous fallback; this operator tradeoff is already recorded. Public docs: docs/concepts/user-model.md. (docs/concepts/user-model.md:471, 0feb33f12155)
  • Security approval state: The current-head security notice verifies Maintain access and explicitly states that additional SecOps approval is unnecessary. (0feb33f12155)

Likely related people:

  • Peter Steinberger: Raw commit 140d9e7 adds src/gateway/github-repository-publication-executor.ts:139 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 140d9e705ea3; files: src/gateway/github-repository-publication-executor.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Saved publication recovery and branch targeting are concrete bugs on a bounded GitHub workflow.
  • merge-risk: 🚨 compatibility: Publication now requires a separate execution reader and changes new-request base selection; the maintainer-authored direction accepts these changes, while installed-state compatibility remains separately unproven.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Rank-up moves

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

  • Complete the live recovery and installed-upgrade qualification identified in the proof assessment.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-11-09T04:57:08.021Z sha 7a4185d :: blocked before merge. :: none
  • reviewed 2026-11-09T17:07:53.182Z sha f2b6d87 :: blocked before merge. :: [P2] Repair authentication in the new process-restart fixture
  • reviewed 2026-11-09T18:00:47.705Z sha b6d47fb :: blocked before merge. :: [P1] Keep personal publication tokens out of worker integration
  • reviewed 2026-11-12T05:10:43.949Z sha 61e9313 :: blocked before merge. :: [P2] Join private publication work before acknowledging workspace drain
  • reviewed 2026-11-12T05:19:47.102Z sha 61e9313 :: blocked before merge. :: [P2] Join private publication work before acknowledging workspace drain
  • reviewed 2026-11-12T06:37:39.516Z sha ac28fe8 :: blocked before merge. :: none
  • reviewed 2026-11-12T20:07:07.233Z sha 27c4692 :: blocked before merge. :: [P2] Keep checkpoint capture inside bounded publication recovery
  • reviewed 2026-11-12T21:08:53.537Z sha c2feb7d :: blocked before merge. :: none

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

roboclaw-bot and others added 4 commits November 6, 2026 02:54
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]>
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]>
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]>
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]>
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 12, 2026
roboclaw-bot and others added 2 commits November 12, 2026 19:20
Baseline-Refresh: 587054c7a73f1b1565b0be250152e9792a266af0
Co-authored-by: galiniliev <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
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]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. label Nov 12, 2026
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]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. label Nov 12, 2026
roboclaw-bot and others added 4 commits November 13, 2026 05:26
Baseline-Refresh: 36cb321ff9320f75866fa5580d8a2bdff6bf4bd0
Co-authored-by: galiniliev <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
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]>
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]>
Baseline-Refresh: 5075bd497b68844d3b445e62379cb978ea5aeaa8
Co-authored-by: galiniliev <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot merged commit 8e6768f into main Nov 13, 2026
200 checks passed
@roboclaw-bot
roboclaw-bot deleted the galiniliev/Main6-publication-recovery branch November 13, 2026 22:57
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

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]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Allow initial guest PR preparation from the recorded project's published
history while preserving unpublished work and original PR identity.

(cherry picked from commit 2757947)

Stable adaptation: preserve the existing linked-identity fixture; expand
its options type and allocate exactly 89 regression LF instead of 84.
Production and documentation patches are unchanged from the source.

Companions: #188785 is present-equivalent. Later #188784, #190223,
#190576, #190542, #195413, #197229, #197243, #199717, #195787,
#197510, #193664, #199851, #199864, #197656, #198851, #193873,
#197594, #189006, #188904, #194025, #196200, #192283, #189010,
#188816 and e0466ff are not prerequisites to this scoped repair;
retain their separate intake dispositions. No later PR-number mentions.

Proof: baseline 4 failed/20 passed through registered agent action;
fixed 41/41 across preparation, refresh and base-action suites.
Type-aware lint4, formatting5, docs MDX1419 and diff check pass.
No live GitHub or full release qualification claim.

Co-authored-by: RomneyDa <[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 gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants