Skip to content

refactor(cron): publish receipt authority from the Gateway owner (cron 1/3) - #164805

Merged
steipete merged 9 commits into
mainfrom
dbasync/cron1
Oct 4, 2026
Merged

steipete merged 9 commits into
mainfrom
dbasync/cron1

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #162433.

What Problem This Solves

Cron needs one Gateway owner that suspends receipt authority before a writer commits and installs committed facts before acknowledging the mutation. Post-acknowledgment revision notifications cannot establish that boundary for subsequent worker-backed message and execution guards.

Why This Change Was Made

This is the publication foundation for cron 1/3. One canonical receipt/job projection owns physical-database custody, FIFO writer enrollment, nonced pending barriers, and synchronous publication from native COMMIT receipts. Unknown outcomes retain settlement custody until native completion or confirmed worker retirement; writes are never replayed. Failed reconstruction keeps authority unavailable.

Runtime mutations, raw saves, mutable-load repairs, approval mutations, existing native standing-grant consumption, and agent-deletion authority changes enter that gate. Gateway close seals new admission before scheduler cancellation and joins accepted persistence before worker transports close. Standing grants are checked for expiry again after publication settles. Approval guards retain the caller's live scope while guarded consumption of an already-recorded handoff retains its independent settlement scope.

Commit observers remain an internal binding, preserving the released SDK admission-factory shape. Existing message and execution guards remain for their separate consumer cutovers; this PR does not claim an atomic consume-to-native-launch cutover.

User Impact

Receipt revision semantics, force-run eligibility, standing-grant policy, schema versions, ledgers, retention, and offline routing remain unchanged. Live cron writes belong to the Gateway; concurrent direct SQLite writers are unsupported. The file lock coordinates participating owners and does not fence arbitrary older binaries. Hardlink aliases refuse with offline-maintenance guidance. No configuration or data migration is introduced.

No SQL census reduction is claimed. Added OPENCLAW_* names: 0. New receipt guard callbacks add no SQL. Existing deletion lease/journal authority reads at src/agents/agent-lifecycle-registry.ts:206, :216, and :217 stay live inside their native transaction/cleanup grants. Retained consumer debt: src/cron/store/run-receipt-store.ts:557 is the message guard for PR 2; src/gateway/operator-approval-standing-grants.ts:299 is the native grant kernel for PR 3.

Overlaps: #158244 shares the exec caller, but Gateway autoAllowSkills is not adopted. #158888 shares recovery code without changing its semantics; #135889 is adjacent provenance work. #112375's execution-revision reinterpretation is not adopted. Main now contains the identical dashboard publication-drain repair from #164779; no sibling branch was modified. Both main's model-account close owner and cron admission sealing are preserved.

Evidence

Candidate: 6a5411208f6287155550fa1440d73a7e38a32c2c, tree b640557864f4f4e65f75372fc53b41026e9a2635, integrating main through c190df12716a17d23a1c00eaf106044d2f2c9317. Wall times below come from the repository runner with --maxWorkers=1 on a loaded local host; historical proof is labeled rather than presented as current-head CI.

Proof Result
P2 autoreview Complete final staged candidate plus repaired SQLite dependency context: scoped-clean, no actionable P0–P2 findings. Both main repairs also received independent clean P2 reviews.
Native command effects 3/3 passed with unchanged 6a54112 production bytes: allowed native dispatch/output, expiry denial, and source cancellation while publication was held. Denied cases made zero supervisor/broker dispatches and no marker. Details below.
FIFO and expiry Real processGatewayAllowlist consumption and read-worker publication prove FIFO enrollment, no early use, publication before returned authority, and expired denial after held publication. The expiry case failed before repair. The five-case group also passed on the final-head Testbox in 20.915s (Vitest 7.24s). Separate native-effect proof below covers the changed wait; atomic consume-to-spawn redesign remains outside scope.
Reused unchanged-input proof At 2c39da96: 147 tests / 13 files, plus approval-manager lifetime 11/11; final exec/Gateway run 63 tests / 3 files, 398.57s wall, including the full 42-case exec file. The former detached timeout took 128ms.
Shutdown integration Both real cron-publication/finalization and model-account close tests passed: 2/2, 521.35s wrapper wall. The conflict resolution preserves both owners.
Build and static boundaries Runtime-process build graph, compiled-wrapper inventory, packaged-script closure, and worker/reply/cron import closures passed. Production types, 27 selected core-test and 4 root-test graphs, focused lint, and relevant ratchets passed for the publication changes.
Released SDK Source audit against v2026.9.8 found no new PR-owned released signature break. Cron load/save/path signatures and the PR-base admission factory are preserved; the existing observeRequests release difference predates this PR. The canonical comparison for 6a54112 completed successfully, with verified cleanup. Release-wide drift is 1 added/8 removed entrypoints and 2,338 export changes (1,192 reachable, 78 signatures, 61 additions, 1,007 removals), including inherited main changes. There are no additional direct changes versus the earlier candidate; 131 updated reachable fingerprints match incorporated main. Digest: 87d6a2c983aec9c1eb197d2d1d8d751c75670a5b45de98158d12cc7ce477f6fe.
Final CI Passed on exact head 6a54112, run 37196112869. Earlier failures and their fixes are recorded below.
Published-driver update Passed on exact head 6a54112 in Testbox run 37196433144: package/integrity, 5/5 standing-grant cases, 3/3 Doctor consumers, and the 2026.9.8 published-driver × candidate cell. Update finished, installed build matched the candidate, managed service PID changed, and /readyz returned 200. All four phase exits and wrapper exit were 0; lease stopped.
Final-head native-effect and update-cell evidence

The isolated native proof ran on macOS arm64 / Node 24.21.0 with production head 6a5411208f6287155550fa1440d73a7e38a32c2c and tree b640557864f4f4e65f75372fc53b41026e9a2635 verified unchanged. It used real policy resolution, processGatewayAllowlist, SQLite owners, receipt publication/read worker, source execution budget, runExecProcess, supervisor, spawn broker, and native printf/tee. The fixture only held delivery of an actual completed read result, advanced the expiry clock, counted pass-through calls, and installed an unused fail-fast RPC guard. No policy, authority, runtime, supervisor, or broker implementation was replaced.

source=6a5411208f6287155550fa1440d73a7e38a32c2c
production_tree=b640557864f4f4e65f75372fc53b41026e9a2635
production_files_unchanged=true
allowed:   committed_uses=1, supervisor=1, broker=1, marker=true, stdout=cron-native-proof
expired:   committed_uses=1, supervisor=0, broker=0, marker=false, refusal=standing-grant-expired
cancelled: committed_uses=1, supervisor=0, broker=0, marker=false, exact_source_cancellation=true
cancel_order: publication-held -> source-revoked -> release-publication -> native-dispatches:0
fallback_gateway_rpc_calls=0 (all three cells)
Tests: 3 passed; exit=0; all owned command/broker/runner processes exited

Cancellation occurred while publication was held. Its accepted grant use settled and emitted the grant event; the runtime's source guard then rejected the cancelled source before command I/O. Expiry produced the exact (expired) preflight denial. Case times were 5.871s / 2.442s / 4.156s, Vitest 85.56s, complete wrapper 188.36s. This was a synthetic final-effect composition, not a full installed Gateway or an atomic-launch redesign. Temporary changes were limited to the proof test and its existing infra-fork test routing entry; proof patch SHA-256: 05b8ab59238a7781fe558aa5deceef22f5ee3e8b16c3f91c6d8352af462d90f2.

The mandatory Testbox used Linux Node 24.19.0, pnpm 12.5.1, and Docker 28.0.4. The source receiver verified that head/tree before execution. Transport/build commit 45209562e541f76ae690433584f1dd3df2629d78 is the capsule's synthetic carrier for those exact source bytes. Candidate tarball SHA-256: 9bfa6cf1de895ed692d03e22fb082db0fd0c8b06e7c50198f76c4afa3720ff60.

Package phase: 559.328s; standing grants: 20.915s; Doctor consumers: 619.428s; published-driver cell: 207.756s (actual update 172.003s). Wrapper total: 26m31s. The published driver and candidate both carry version 2026.9.8; the cell also verifies installed build metadata and managed-service replacement, so this is not merely a same-version label check. Lease tbx_01m438ajcamptg3ezevb0nzghb is verified completed.

CI attribution and repair proof

The original PR integration failures were repaired in 2c39da9600191c6faf295ca42d797fe6ea29ed5d: preserve canonical admission identity in fault fixtures, await async custody before reopen/child/Doctor handoff, retire the cron singleton with its SQLite generation, and distinguish fixture preparation from cleanup. Standing-grant expiry is rechecked after awaited publication. Crash, foreign-owner, rollback, and close-settlement coverage remains.

The detached-exec timeout is inherited fixture cold-loading. Plain main reproduced it; five original-base and five original-head runs each yielded one timeout and four slow passes. An irrelevant Feishu initiating surface loaded bundled channel runtime. Changing only that generic fixture surface to webchat preserved every assertion and explicit agent-followup mode; controlled main probes took 199/220ms. All 42 exec cases passed after the six fixture substitutions. No timeout was raised or passing replay presented as a fix.

Main repair 8cabfb2814f4bcf9bca9666ee51a246ab4ae2c69 fixes three fixtures affected by #164490's operation-owned freshness: push-target table visibility, standing-grant companion rollback/retry visibility, and launch-store dataVersion probes. Each reproduced 5/5 on unchanged main. Reads now enter the existing admission owner, preserving same-handle ordering and the expected 9 probes. Repaired files: 89 passed, 544.71s wrapper wall; scoped checks 1191.73s; P2 clean.

The dashboard test closed storage while its accepted row publication was still pending. It now drains that publication before its durability probe, preserving all close/reopen and revocation assertions. 34/34 passed, 241.25s wall, P2 clean. This repair was committed here as 557f93ea and is now identical to main's #164779 fix. Five head and five main controls passed before repair; those passes were not called inherited-failure proof.

CI at ca821d76 finished with 73 successful jobs, 22 skipped, one failed test job and its dependent aggregate gate, no cancellations. The remaining node-turn uniqueness failure independently reproduces on unmodified main under official Node 24.19. The turn was durably completed, but the schema-tracking generator had left its native iterator open after a stepping error. Closing the already-closed outer generator could not reset the cached native statement. The newer Kysely all() path did not exercise this bug; a direct tracked-iterator probe reproduced it on newer Node too.

Main repair c190df12716a17d23a1c00eaf106044d2f2c9317 closes the native delegate at the producer while preserving the original error and existing bookkeeping. The new 14-line owner regression fails before repair and passes afterward. 188 tests passed across four files on Node 24.19, with two existing capability skips; 286.80s wrapper wall, new regression 16ms, original caller 3813ms. Production/test types, lint, formatting, line limits, and P2 review passed. The repair is integrated into this candidate.

Earlier Testbox attempts produced no package/update proof. Local source preparation exhausted an old lease's idle window; a later proof-harness assertion incorrectly expected the source SHA as transported Git HEAD. The supported capsule uses a synthetic carrier. The corrected payload verifies the exact tree, physical checkout, and clean tracked source, and records the carrier alongside the wrapper-verified source SHA. Superseded attempts and owned leases were stopped; the final-head run uses preparation before allocation.

@clawsweeper

clawsweeper Bot commented Oct 4, 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 commands Command implementations agents Agent runtime and tooling size: XL labels Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 7:24 AM ET / 11:24 UTC (Revision 7).

ClawSweeper review

What this changes

The branch coordinates cron writes, approval changes, agent deletion, and shutdown through a Gateway-owned barrier that publishes committed receipt facts before returning.

Merge readiness

✅ Ready for maintainer review

This PR remains useful and is not implemented on current main. The prior expiry finding is fixed, and the new native-effect and update evidence satisfies the previous proof requests; no actionable introduced defect remains.

Likely related people: steipete and Jacob Tomlinson, based on prior cron and approval work.

Priority: P2
Reviewed head: 6a5411208f6287155550fa1440d73a7e38a32c2c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent ownership refactor with strong scoped runtime evidence and no remaining actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head macOS terminal evidence exercises the real grant, publication, exec-runtime, supervisor, and broker owners: allowed execution produces output, while expiry and source cancellation during held publication cause zero dispatches and no marker. The prior final-effect request is satisfied. The Linux published-driver receipt covers candidate installation and readiness. No stored-data model changes were identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Exact-head macOS terminal evidence exercises the real grant, publication, exec-runtime, supervisor, and broker owners: allowed execution produces output, while expiry and source cancellation during held publication cause zero dispatches and no marker. The prior final-effect request is satisfied. The Linux published-driver receipt covers candidate installation and readiness. No stored-data model changes were identified.
Evidence reviewed 10 items Pinned introduction and clean checkout: Reviewed the introduced c190df1..6a54112 delta. Raw head records match the supplied two parents and production tree b640557864f4f4e65f75372fc53b41026e9a2635. Final git status remained clean and diff whitespace checks passed. The stale test merge was not used to infer removal of current-main behavior.
Work remains necessary: Fetched main has no receipt-authority-owner module, and its runtime mutation owner still lacks the new publication gate. The merged session and schema work supplies adjacent foundations rather than this cron cutover.
Publication and uncertain-outcome ownership: The new owner suspends observations before admission, installs nonced committed facts, and retains the barrier until native settlement or confirmed retirement. Reconciliation reads committed state without replaying the write; failed reconstruction keeps authority unavailable.
Findings None None.
Security None None.

How this fits together

Cron schedules automated work and records each run in SQLite. Its receipt authority connects job and approval mutations to the guards that permit subsequent messaging and command execution.

flowchart TD
  A[Job and approval changes] --> B[Gateway receipt owner]
  B --> C[FIFO writer admission]
  C --> D[SQLite transaction]
  D --> E[Committed receipt facts]
  E --> B
  B --> F[Message and execution guards]
  G[Gateway shutdown] --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1017, Tests +1282, Docs +21. Total +2320 across 64 files.

View PR surface stats
Area Files Added Removed Net
Source 35 1163 146 +1017
Tests 28 1655 373 +1282
Docs 1 21 0 +21
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 64 2839 519 +2320

Review metrics

Metric Value Why it matters
Production versus test growth production +1,017 net; tests/support +1,282 net Production growth establishes the explicitly justified publication, custody, and settlement owner rather than claiming a code-size or SQL reduction.

Technical review

Best possible solution:

Retain one publication owner for canonical cron writes, preserve existing receipt and grant policies, and keep the subsequent consumer cutovers separately scoped.

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

Not applicable to the central refactor. Source inspection and supplied production-boundary traces establish the changed ordering; this read-only review ran no target code.

Is this the best way to solve the issue?

Yes. The gate extends the existing SQLite writers and settlement contracts while preserving final consumer guards, avoiding a competing durable authority store.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Exact-head macOS terminal evidence exercises the real grant, publication, exec-runtime, supervisor, and broker owners: allowed execution produces output, while expiry and source cancellation during held publication cause zero dispatches and no marker. The prior final-effect request is satisfied. The Linux published-driver receipt covers candidate installation and readiness. No stored-data model changes were identified.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Exact-head macOS terminal evidence exercises the real grant, publication, exec-runtime, supervisor, and broker owners: allowed execution produces output, while expiry and source cancellation during held publication cause zero dispatches and no marker. The prior final-effect request is satisfied. The Linux published-driver receipt covers candidate installation and readiness. No stored-data model changes were identified.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 security-boundary: Current PR review merge-risk labels are merge-risk: 🚨 compatibility.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded internal cron authority and persistence improvement without an established urgent user-facing outage.
  • merge-risk: 🚨 compatibility: The declared single-host custody and hardlink refusal narrow live-write concurrency; the proposal documents that tradeoff and supplies published-driver upgrade evidence.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Exact-head macOS terminal evidence exercises the real grant, publication, exec-runtime, supervisor, and broker owners: allowed execution produces output, while expiry and source cancellation during held publication cause zero dispatches and no marker. The prior final-effect request is satisfied. The Linux published-driver receipt covers candidate installation and readiness. No stored-data model changes were identified.
  • proof: sufficient: Contributor real behavior proof is sufficient. Exact-head macOS terminal evidence exercises the real grant, publication, exec-runtime, supervisor, and broker owners: allowed execution produces output, while expiry and source cancellation during held publication cause zero dispatches and no marker. The prior final-effect request is satisfied. The Linux published-driver receipt covers candidate installation and readiness. No stored-data model changes were identified.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the introduced c190df1..6a54112 delta. Raw head records match the supplied two parents and production tree b640557864f4f4e65f75372fc53b41026e9a2635. Final git status remained clean and diff whitespace checks passed. The stale test merge was not used to infer removal of current-main behavior. (6a5411208f62)
  • Work remains necessary: Fetched main has no receipt-authority-owner module, and its runtime mutation owner still lacks the new publication gate. The merged session and schema work supplies adjacent foundations rather than this cron cutover. (src/cron/service/runtime-mutation.ts:22, 31a1705cca22)
  • Publication and uncertain-outcome ownership: The new owner suspends observations before admission, installs nonced committed facts, and retains the barrier until native settlement or confirmed retirement. Reconciliation reads committed state without replaying the write; failed reconstruction keeps authority unavailable. (src/cron/store/receipt-authority-owner.ts:319, 6a5411208f62)
  • Prior expiry finding resolved: Standing-grant revalidation now checks expiry after awaited consumption and publication. The focused production-owner cases hold an actual read-worker result and verify publication ordering and expired denial. (src/agents/bash-tools.exec-host-gateway.ts:809, 6a5411208f62)
  • Captured body identity and native final-effect proof: Read the complete GitHub body and verified its SHA-256 matches captured source 4273f16c3ba23e9efc5f3d68b1bd2a20f0c0c805671e83edee76844dac5cb99a. Its exact-head macOS trace composes real policy resolution, grant consumption, receipt publication, exec runtime, supervisor, broker, and native file I/O. Allowed execution records one use and one dispatch with output; expiry and source cancellation during held publication record zero supervisor/broker dispatches and no marker. The source guard rechecks after the awaited pre-spawn callback. (src/agents/bash-tools.exec-runtime.ts:794, 6a5411208f62)
  • Published-driver upgrade evidence: The captured final-head receipt reports successful package/integrity checks, five standing-grant cases, three Doctor cases, and the published 2026.9.8 driver updating to the candidate: installed build identity matched, managed-service PID changed, readiness returned 200, and every phase plus wrapper exited zero. https://github.com/openclaw/openclaw/actions/runs/37196433144 is a Testbox carrier workflow with a cancelled lifecycle after the reported lease stop, not an exact-head successful CI run. Its downloadable logs were blocked by the reviewer network allowlist; that limitation does not invalidate the independently supplied execution receipt. (6a5411208f62)

Likely related people:

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

Rating scale

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

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

Workflow

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

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-04T06:41:45.723Z sha 4211d91 :: needs real behavior proof before merge. :: [P1] Revalidate the standing grant after publication settlement
  • reviewed 2026-10-04T06:49:36.651Z sha 4211d91 :: needs real behavior proof before merge. :: [P1] [P1] Revalidate the standing grant after publication settlement
  • reviewed 2026-10-04T08:02:40.066Z sha 2c39da9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-04T09:48:22.837Z sha ca821d7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-04T10:16:45.635Z sha ca821d7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-04T10:49:36.992Z sha 6a54112 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 4, 2026
Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for #164805.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. labels Oct 4, 2026
Merge main to resolve the Gateway close-prelude conflict while retaining
cron receipt admission sealing before scheduler cancellation and main's
model-account shutdown fence and settlement join.

Focused real-close proof: cron receipt publication/finalization and an
accepted personal model-account write both pass (2 tests, 521.35s wrapper
wall on the loaded local host). Receipt semantics, eligibility, and storage
schemas are unchanged.
Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.
steipete added a commit that referenced this pull request Oct 4, 2026
Use the existing read-operation admission owner before raw schema and
launch-receipt reads. Main's schema-facts change in #164490 moved foreign
commit freshness to operation admission, leaving three fixtures reading
stale facts or skipping a required freshness probe.

Preserve same-handle rollback/retry, table visibility, reopen durability,
and the exact nine-probe assertion. Each original failure reproduced five
out of five times on unchanged main. The three repaired files pass all
89 tests (544.71s wrapper wall on the loaded local host), and P2 review is
clean. Found while landing #164805.
Merge main through 8cabfb2, including the
three read-admission fixture fixes proved while investigating this PR's CI.
The merge is conflict-free; only worker-access documentation overlaps the
cron-specific delta, preserving both sections. The cron receipt-authority
delta and package manifests remain unchanged by this integration.

The main repair reproduced all three failures five times each, then passed
89 tests, scoped checks, and P2 review. The earlier close-prelude resolution
passed both real-close regressions, and the dashboard drain passed its full
34-case owner file. Final-head package/update and standing-grant proof remain
required before merge.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

steipete added a commit that referenced this pull request Oct 4, 2026
The schema-tracking generator delegated to native SQLite iterators without
closing the delegate when next() threw. Callers could close only the already
closed outer generator, leaving a cached statement to report the old error
on a later valid write. Close the native delegate at that producer boundary
while preserving the original error and schema/transaction bookkeeping.

The node-turn retry failure reproduces on unchanged main with Node 24.19;
newer Kysely all() calls do not exercise the faulty iterator path. A direct
tracked-iterator regression also reproduces on newer Node. The regression
fails before this fix and passes after it; 188 tests pass across the owner,
Kysely, schema-contract, and node-turn files (two existing capability skips,
286.80s wrapper wall). Production/test types, focused lint, line limits, and
P2 review pass. No signature, schema, dependency, or configuration change.

Found while investigating CI for #164805.
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 4, 2026
@steipete
steipete merged commit 58bcc01 into main Oct 4, 2026
178 checks passed
@steipete
steipete deleted the dbasync/cron1 branch October 4, 2026 11:27
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 4, 2026
…e transports (cron 2a/3) (#164906)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for #164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.
steipete added a commit that referenced this pull request Oct 5, 2026
…elete the native checker (cron 2b/3) (#165129)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for #164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.

* refactor(cron): hold authority across remaining transport handoffs

Complete the bundled message transport cutover and remove the native current-job checker. Preserve exact receipt authority, release at SDK or CLI initiation, and retain refusal identity. Shared SQL kernels remain worker or Doctor owned.

* test(cron): preserve generic authority fixtures

Keep the Nostr handoff fixture generic without a cast and document the WhatsApp SDK initiation window.

* test(cron): normalize transport authority regression fixtures

* test(clickclack): isolate authority handoff regressions

* test(nostr): observe the production relay handoff

* test(cron): keep Synology handoff cases lint-clean

* docs(cron): remove superseded native-checker migration note

* fix(cron): clear receipt cutover lint and documentation gates

Bind the loopback socket writer's call to the original method, retaining the
socket receiver, and remove shadowed bindings. Regenerate the assertion
baseline after the LINE cleanup removes one assertion. Remove the remaining
obsolete statement that final message SQL guards await migration.

The IRC owner tests pass (41 tests, 69.26 seconds overall), and the bounded
P2 review is clean. The assertion baseline shrinks by exactly one. Local
type-aware lint stopped at declaration preparation's 300-second timeout;
the Linux full changed check remains required before merge.

* test(cron): bind native write faults after socket connection

Scope the IRC fault to the real client socket, install it after Node's connect
restores write, and preserve the method's boolean return type. Synchronize
and restore Node's connection-factory exports around the fixture. Use the
canonical Teams channel-result helper when aggregating earlier receipts.

Validation: all 22 IRC client tests pass (46.70 seconds overall), all 26 Teams
outbound tests pass (131.13 seconds overall), and the bounded P2 review is
clean. The full Linux changed check remains required before publication.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Use the existing read-operation admission owner before raw schema and
launch-receipt reads. Main's schema-facts change in openclaw#164490 moved foreign
commit freshness to operation admission, leaving three fixtures reading
stale facts or skipping a required freshness probe.

Preserve same-handle rollback/retry, table visibility, reopen durability,
and the exact nine-probe assertion. Each original failure reproduced five
out of five times on unchanged main. The three repaired files pass all
89 tests (544.71s wrapper wall on the loaded local host), and P2 review is
clean. Found while landing openclaw#164805.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
The schema-tracking generator delegated to native SQLite iterators without
closing the delegate when next() threw. Callers could close only the already
closed outer generator, leaving a cached statement to report the old error
on a later valid write. Close the native delegate at that producer boundary
while preserving the original error and schema/transaction bookkeeping.

The node-turn retry failure reproduces on unchanged main with Node 24.19;
newer Kysely all() calls do not exercise the faulty iterator path. A direct
tracked-iterator regression also reproduces on newer Node. The regression
fails before this fix and passes after it; 188 tests pass across the owner,
Kysely, schema-contract, and node-turn files (two existing capability skips,
286.80s wrapper wall). Production/test types, focused lint, line limits, and
P2 review pass. No signature, schema, dependency, or configuration change.

Found while investigating CI for openclaw#164805.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…n 1/3) (openclaw#164805)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for openclaw#164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…e transports (cron 2a/3) (openclaw#164906)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for openclaw#164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (openclaw#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…elete the native checker (cron 2b/3) (openclaw#165129)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for openclaw#164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (openclaw#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.

* refactor(cron): hold authority across remaining transport handoffs

Complete the bundled message transport cutover and remove the native current-job checker. Preserve exact receipt authority, release at SDK or CLI initiation, and retain refusal identity. Shared SQL kernels remain worker or Doctor owned.

* test(cron): preserve generic authority fixtures

Keep the Nostr handoff fixture generic without a cast and document the WhatsApp SDK initiation window.

* test(cron): normalize transport authority regression fixtures

* test(clickclack): isolate authority handoff regressions

* test(nostr): observe the production relay handoff

* test(cron): keep Synology handoff cases lint-clean

* docs(cron): remove superseded native-checker migration note

* fix(cron): clear receipt cutover lint and documentation gates

Bind the loopback socket writer's call to the original method, retaining the
socket receiver, and remove shadowed bindings. Regenerate the assertion
baseline after the LINE cleanup removes one assertion. Remove the remaining
obsolete statement that final message SQL guards await migration.

The IRC owner tests pass (41 tests, 69.26 seconds overall), and the bounded
P2 review is clean. The assertion baseline shrinks by exactly one. Local
type-aware lint stopped at declaration preparation's 300-second timeout;
the Linux full changed check remains required before merge.

* test(cron): bind native write faults after socket connection

Scope the IRC fault to the real client socket, install it after Node's connect
restores write, and preserve the method's boolean return type. Synchronize
and restore Node's connection-factory exports around the fixture. Use the
canonical Teams channel-result helper when aggregating earlier receipts.

Validation: all 22 IRC client tests pass (46.70 seconds overall), all 26 Teams
outbound tests pass (131.13 seconds overall), and the bounded P2 review is
clean. The full Linux changed check remains required before publication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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. 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