Skip to content

Host: durable delegated execution ownership guard - #166475

Open
yaoxiaoyang448 wants to merge 2 commits into
openclaw:mainfrom
yaoxiaoyang448:feat/delegated-execution-ownership-guard-mainline
Open

yaoxiaoyang448 wants to merge 2 commits into
openclaw:mainfrom
yaoxiaoyang448:feat/delegated-execution-ownership-guard-mainline

Conversation

@yaoxiaoyang448

Copy link
Copy Markdown

Summary

Adds a Host-owned durable delegated-execution ownership guard for delegated agent work.

The guard prevents ordinary OpenClaw execution from silently resuming when a delegated
owner/plugin becomes unavailable.

Core properties

  • durable delegated task ownership across Gateway restart
  • Host lock established before delegate handoff
  • fail-closed behavior when the delegate plugin/handler is missing or fails
  • independent model/agent and tool execution gates
  • task lineage propagation through child/subagent execution
  • trusted cross-process lineage via the existing signed Gateway runtime identity
  • trusted-human fallback/revoke bound to ChannelAdmissionEvidence and live CommandOwnerAuthority
  • restart rehydration and downgrade/enforcement-floor protection

Authority composition

This does not replace or duplicate AgentRunDelegatedAuthority.

  • durable delegated ownership = the outer task-level policy gate
  • existing AgentRunDelegatedAuthority = the inner run/claim/lease authority (unchanged)
  • a durable ownership denial cannot be overridden by a valid run authority
  • admission order: resolve durable ownership -> enforce Host Guard -> only if allowed, continue
    into the existing run-authority admission -> both must pass

Schema

Current upstream state schema 20 -> 21.

Migration detection is intentionally limited to direct predecessor shape:

userVersion === 20  and  delegated_execution_ownership missing

to avoid false-positive migration classification of older/legacy databases.

Validation

  • focused delegated-ownership suites (ownership state machine/CAS/release/restart/downgrade,
    establishment, real-path authority composition A-F, cross-process signed carrier,
    trusted-human fallback, v21 detection, delegated-ownership preflight) — all green
    (46 + 71 + 3 passing, 0 failures)
  • src/state/openclaw-state-db.test.ts — 58/58 passing
  • src/state/openclaw-database-preflight.test.ts — 15/15 passing
  • check-native-state-schema-version.test.ts — 2/2 passing
  • subagent-spawn-gateway / in-process-gateway / identity+admission shard runs passing
  • pnpm tsgo:core — exit 0
  • git diff --check — clean

Known unrelated environment issue: the two managed-worktree subagent production-boundary
cases also fail on the unmodified upstream base 6041559b4 (reproduced by restoring the
unmodified subagent-spawn.ts); they are not introduced by this change.

No production deployment is part of this PR.

… mainline

Forward-port of the release-line Host Guard semantics onto current main
(state schema v20 -> v21), preserving behavior rather than file structure.
Uses current-main generated schema infrastructure instead of obsolete
checked-in generated files.

- Block 1: durable registry/state machine, v21 migration, startup rehydration,
  downgrade refusal (userVersion === 20 && !tableExists detection).
- Block 2: Host delegation establishment + agent/tool outer enforcement;
  fail-closed on delegate absence/failure.
- Block 3: lineage propagation + child inheritance + signed cross-process
  transport on the trusted Gateway execution identity.
- Block 4: trusted-human fallback/revoke via ChannelAdmissionEvidence and
  CommandOwnerAuthority.

Authority composition is one-way: durable Host Guard (outer) runs before the
existing AgentRunDelegatedAuthority admission (inner); durable denial wins.
Native Swift max schema version aligned to v21; package.json metadata bumped.
@clawsweeper

clawsweeper Bot commented Oct 7, 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 gateway Gateway runtime agents Agent runtime and tooling size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds persistent ownership reservations for delegated tasks, plugin-driven establishment, agent and tool guards, child-run lineage transport, and a shared-state database migration.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The proposal has useful implementation substance, but unresolved authority defects and test-only proof prevent merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Merge readiness

⛔ Blocked before merge - 24 items remain

The new plugin entrypoint makes establishment reachable, but substantial authorization and lifecycle defects remain. Current main does not implement this durable task guard, and the earlier submission closed unmerged.

Priority: P2
Reviewed head: 65ada41a1b2f5d7acab74d12574541f1b95fb043
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should OpenClaw adopt a new durable task-level delegation contract and public establishment API, including schema 21 and its recovery lifecycle?
  • Recommendation: Narrow the contract first: Define the missing production use case and lifecycle against existing admission ownership before committing to new persistence and public API.
  • Why: This adds persistent authority and a public plugin capability beyond existing run leases; repository policy requires design acceptance, and no recorded acceptance covers it.

Before merge

  • Add real behavior proof - Authority-chain proof required: supplied tests do not show the production dispatch and wrapped-tool owners allowing authorized work while rejecting another delegate, unauthorized release, closed-handler acquisition, and authority retired during waits before final I/O. Provide redacted after-fix terminal traces or logs; diagnostic screenshots or recordings also count. Existing-state upgrade compatibility is independently unproven. Remove credentials and private identifiers, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.
  • [P1] Restrict dispatch to the reserved delegate owner (P1) - The explicit intent path still invokes every eligible before_dispatch handler rather than selecting the reserved owner. The new plugin path also continues the hook loop when plugin A establishes ownership and then declines or throws, allowing plugin B to handle the task without establishing anything. Dispatch accepts B's handled result before checking the slot. Stop continuation once ownership is established and select the exact owner for intent-driven handoff.
  • [P1] Validate live authority inside terminal release (P1) - releaseDelegatedExecutionOwnership still accepts HUMAN_REVOKED_DELEGATION directly without the capability required by the revoke wrapper. Defaulting expected owner fields to the stored row authenticates no caller; actor and authority strings are merely recorded. Require the event-specific live human or delegate authority at the mutation boundary before setting RELEASED.
  • [P1] Preserve private bindings through tool-context copies (P1) - The real wrapper passes { ...ctx, toolOwnerPluginId } to policy, while lineage and fallback authority are non-enumerable. A context-bound locked task consequently loses its lineage and is treated as unrelated DIRECT execution; an ambient fallback loses its capability and is denied. Preserve both opaque bindings through the wrapper and validate the wrapped tool path.
  • [P1] Recheck ownership at the final tool-effect boundary (P1) - This ownership check precedes awaited plugin policies, approvals, validation, and steering. If fallback authority retires or the task becomes locked during those waits, the earlier allowed decision still reaches the implementation: the final source guard does not contain this new policy. Capture the exact ownership binding and revalidate it immediately before execution.
  • [P1] Propagate plugin-established lineage into child launches (P1) - The new entrypoint binds lineage only to frame.context, which production supplies as the dispatch state. It never enters the delegated execution scope. Child launch code reads that ambient scope, and plugins do not receive the bound state object, so a plugin that establishes ownership and then launches a subagent sends no delegated lineage. Propagate the established lineage through the actual plugin continuation and child launch boundary.
  • [P1] Revalidate the active handler after admission awaits (P1) - The frame is checked only before awaiting assertCurrent. A handler can start establishment without awaiting it, or time out while that assertion is pending; its frame then closes, but the retained operation continues and writes a reservation. Recheck the exact frame's activity and current admission after awaited work and immediately before acquisition.
  • [P1] Publish fail-closed state when acquisition commits (P1) - The slot becomes authoritative only after the entire establishment operation resolves. That operation commits acquisition first, then binds context and records availability. A failure after acquisition leaves a durable lock but an unestablished slot; the hook runner catches the error and dispatch can continue ordinarily. Publish the reservation outcome at acquisition, and preserve refusal through all later failures.
  • [P1] Connect completion and human recovery to production consumers (P1) - The supported plugin surface can establish a persistent lock but provides no completion or release operation. Production searches likewise find no terminal-event consumer, human fallback minting entrypoint, or fallback binding consumer. A plugin cannot finish or recover its reservation through supported contracts, leaving the advertised lifecycle incomplete. Wire authenticated completion and human recovery into the owning production paths.
  • [P2] Move runtime ownership queries into the database worker (P2) - Every bound agent or tool admission synchronously opens the shared database, probes registry tables, and reads all live reservations before filtering. These new runtime reads run on the calling event loop and scale with unrelated tasks. Use the existing worker owner, admitted schema facts, and an indexed exact-lineage query.
  • [P2] Bound event IDs independently of delegation references (P2) - The schema accepts a 256-character delegation reference and limits event IDs to 256 characters, but this generator appends event, revision, and timestamp to the entire reference. A valid long reference therefore violates the event constraint and rolls back acquisition or transition. Generate a bounded independent ID or hash while retaining the full delegation reference separately.
  • Resolve security concern: Release bypasses capability validation - A direct terminal-release request can release ownership using descriptive actor fields without proving current human or delegate authority.
  • Resolve security concern: Tool execution loses or outlives ownership authority - Context copying drops the private bindings, and awaited policy work can outlive the ownership decision before final tool I/O.
  • Resolve security concern: Reserved work can reach another plugin or unbound child - The hook chain can continue under another principal after reservation, while plugin-established child work does not inherit the scope consumed by the guards.
  • Resolve security concern: Closed handler can still acquire persistent authority - Establishment resumes after its admission await without checking whether the handler frame closed, allowing delayed acquisition after handler settlement or timeout.
  • Resolve merge risk - The new public delegation API and schema-21 persistent authority contract lack recorded maintainer acceptance.
  • Resolve merge risk - Existing installations would acquire a newer database contract that older runtimes refuse; published-updater, populated-state upgrade, and recovery compatibility remain unproven.
  • Resolve merge risk - Persisted reservations have no integrated production completion or human recovery flow, leaving their restart and operator-recovery behavior incomplete.
  • Complete next step - Resolve the supported findings, obtain acceptance for the durable plugin contract, and supply final-effect and existing-state upgrade proof.
  • Improve patch quality - Repair exact-owner dispatch, live release validation, lineage propagation, and final-effect enforcement.
  • Improve patch quality - Show allowed and nearest-forbidden production effects, including revocation and handler closure during awaited work.
  • Improve patch quality - Provide published-updater and populated-state compatibility evidence for the accepted persistent contract.
  • Resolve maintainer decision - Resolve the maintainer decision shown above 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

  • [P1] [P1] Restrict dispatch to the reserved delegate owner — src/auto-reply/reply/dispatch-from-config.choose-route.ts:634
  • [P1] [P1] Validate live authority inside terminal release — src/delegation/delegated-execution-ownership.ts:430-441
  • [P1] [P1] Preserve private bindings through tool-context copies — src/delegation/delegated-execution-lineage.ts:20-24
  • [high] Release bypasses capability validation — src/delegation/delegated-execution-ownership.ts:430
  • [high] Tool execution loses or outlives ownership authority — src/agents/agent-tools.before-tool-call.policy.ts:124
  • [high] Reserved work can reach another plugin or unbound child — src/plugins/hooks.ts:859
Agent review details

How this fits together

Inbound dispatch lets plugins take responsibility for a task. The proposed ownership registry then controls whether OpenClaw may run agents or tools for that task, including child executions and recovery after restart.

flowchart TD
  A[Inbound task] --> B[Plugin handoff]
  B --> C[Durable ownership registry]
  C --> D[Agent and tool guards]
  D --> E[Allowed execution or refusal]
  B --> F[Child execution lineage]
  F --> D
  G[Human recovery or delegate completion] --> C
Loading

Technical review

Best possible solution:

Use an accepted task-ownership contract with exact-owner dispatch, worker-owned storage, live final-effect checks, and visible completion and human recovery.

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

Yes, the patch defects have concrete source-backed triggers involving direct release, context copying, ownership changes during awaited policy work, and multi-plugin dispatch. No runtime reproduction or tests were executed.

Is this the best way to solve the issue?

No, the current patch does not enforce its ownership invariant through the complete production lifecycle. The new task contract needs integrated recovery and enforcement at the final effect boundary.

Full review comments:

  • [P1] [P1] Restrict dispatch to the reserved delegate owner — src/auto-reply/reply/dispatch-from-config.choose-route.ts:634
    The explicit intent path still invokes every eligible before_dispatch handler rather than selecting the reserved owner. The new plugin path also continues the hook loop when plugin A establishes ownership and then declines or throws, allowing plugin B to handle the task without establishing anything. Dispatch accepts B's handled result before checking the slot. Stop continuation once ownership is established and select the exact owner for intent-driven handoff.
    Confidence: 0.99
  • [P1] [P1] Validate live authority inside terminal release — src/delegation/delegated-execution-ownership.ts:430-441
    releaseDelegatedExecutionOwnership still accepts HUMAN_REVOKED_DELEGATION directly without the capability required by the revoke wrapper. Defaulting expected owner fields to the stored row authenticates no caller; actor and authority strings are merely recorded. Require the event-specific live human or delegate authority at the mutation boundary before setting RELEASED.
    Confidence: 0.99
  • [P1] [P1] Preserve private bindings through tool-context copies — src/delegation/delegated-execution-lineage.ts:20-24
    The real wrapper passes { ...ctx, toolOwnerPluginId } to policy, while lineage and fallback authority are non-enumerable. A context-bound locked task consequently loses its lineage and is treated as unrelated DIRECT execution; an ambient fallback loses its capability and is denied. Preserve both opaque bindings through the wrapper and validate the wrapped tool path.
    Confidence: 0.99
  • [P1] [P1] Recheck ownership at the final tool-effect boundary — src/agents/agent-tools.before-tool-call.policy.ts:121-124
    This ownership check precedes awaited plugin policies, approvals, validation, and steering. If fallback authority retires or the task becomes locked during those waits, the earlier allowed decision still reaches the implementation: the final source guard does not contain this new policy. Capture the exact ownership binding and revalidate it immediately before execution.
    Confidence: 0.99
  • [P1] [P1] Propagate plugin-established lineage into child launches — src/plugins/before-dispatch-delegation.ts:212-218
    The new entrypoint binds lineage only to frame.context, which production supplies as the dispatch state. It never enters the delegated execution scope. Child launch code reads that ambient scope, and plugins do not receive the bound state object, so a plugin that establishes ownership and then launches a subagent sends no delegated lineage. Propagate the established lineage through the actual plugin continuation and child launch boundary.
    Confidence: 0.98
  • [P1] [P1] Revalidate the active handler after admission awaits — src/plugins/before-dispatch-delegation.ts:174-178
    The frame is checked only before awaiting assertCurrent. A handler can start establishment without awaiting it, or time out while that assertion is pending; its frame then closes, but the retained operation continues and writes a reservation. Recheck the exact frame's activity and current admission after awaited work and immediately before acquisition.
    Confidence: 0.98
  • [P1] [P1] Publish fail-closed state when acquisition commits — src/plugins/before-dispatch-delegation.ts:222-226
    The slot becomes authoritative only after the entire establishment operation resolves. That operation commits acquisition first, then binds context and records availability. A failure after acquisition leaves a durable lock but an unestablished slot; the hook runner catches the error and dispatch can continue ordinarily. Publish the reservation outcome at acquisition, and preserve refusal through all later failures.
    Confidence: 0.98
  • [P1] [P1] Connect completion and human recovery to production consumers — src/plugins/runtime/types.ts:149-157
    The supported plugin surface can establish a persistent lock but provides no completion or release operation. Production searches likewise find no terminal-event consumer, human fallback minting entrypoint, or fallback binding consumer. A plugin cannot finish or recover its reservation through supported contracts, leaving the advertised lifecycle incomplete. Wire authenticated completion and human recovery into the owning production paths.
    Confidence: 0.97
  • [P2] [P2] Move runtime ownership queries into the database worker — src/delegation/delegated-execution-ownership-guard.ts:69-79
    Every bound agent or tool admission synchronously opens the shared database, probes registry tables, and reads all live reservations before filtering. These new runtime reads run on the calling event loop and scale with unrelated tasks. Use the existing worker owner, admitted schema facts, and an indexed exact-lineage query.
    Confidence: 0.99
  • [P2] [P2] Bound event IDs independently of delegation references — src/delegation/delegated-execution-ownership.ts:98-103
    The schema accepts a 256-character delegation reference and limits event IDs to 256 characters, but this generator appends event, revision, and timestamp to the entire reference. A valid long reference therefore violates the event constraint and rolls back acquisition or transition. Generate a bounded independent ID or hash while retaining the full delegation reference separately.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Settle the ownership contract (recommended)
    Narrow the proposal to an accepted production lifecycle before retaining the new schema and public capability.
  2. Complete a sponsored implementation
    After design acceptance, repair the authorization defects and demonstrate final-effect rejection, restart recovery, and existing-state upgrade compatibility.

Security

Needs attention: The proposed persistent authority boundary has reachable release, wrong-owner, lineage-loss, and stale-operation defects; no unrelated supply-chain change was identified.

Evidence

Security concerns:

  • [high] Release bypasses capability validation — src/delegation/delegated-execution-ownership.ts:430
    A direct terminal-release request can release ownership using descriptive actor fields without proving current human or delegate authority.
    Confidence: 0.99
  • [high] Tool execution loses or outlives ownership authority — src/agents/agent-tools.before-tool-call.policy.ts:124
    Context copying drops the private bindings, and awaited policy work can outlive the ownership decision before final tool I/O.
    Confidence: 0.99
  • [high] Reserved work can reach another plugin or unbound child — src/plugins/hooks.ts:859
    The hook chain can continue under another principal after reservation, while plugin-established child work does not inherit the scope consumed by the guards.
    Confidence: 0.98
  • [medium] Closed handler can still acquire persistent authority — src/plugins/before-dispatch-delegation.ts:174
    Establishment resumes after its admission await without checking whether the handler frame closed, allowing delayed acquisition after handler settlement or timeout.
    Confidence: 0.98

What I checked:

  • Pinned introduced changes: Reviewed the merge-base-to-head introduced changes and current source. Some historical blob reads failed with HTTP 403; GitHub REST commit patches provided the updated commit's changes. No stale test-merge comparison was used to infer removal of main behavior. (65ada41a1b2f)
  • Re-review continuity: The previous completed review's full comment supplied the seventh finding omitted from the projection: oversized event IDs. The updated plugin API addresses the absence of an establishment entrypoint. Release validation, binding preservation, final-effect enforcement, runtime database scans, and event-ID generation remain unchanged. (src/delegation/delegated-execution-ownership.ts:422, 65ada41a1b2f)
  • Current-main necessity: Fetched main still declares shared-state schema 20 and its run admission validates existing run leases without this durable task gate. Tree inspection found no src/delegation directory on fetched main or v2026.9.8. The canonical search established no merged replacement. (src/state/openclaw-state-db-contract.ts:22, de38a0454825)
  • Earlier submission is reference only: GitHub confirms Host: durable delegated execution ownership guard #166243 closed unmerged. Its author explicitly identified this mainline forward-port as its replacement; that earlier branch is not an implemented fix or safe alternative landing target.
  • Wrong-owner continuation: The claiming-hook loop continues after a handler establishes ownership and declines or throws. A later plugin can handle the request without establishing ownership; dispatch accepts that result before considering the establishment slot. The explicit intent path also invokes the aggregate hook chain without selecting its reserved owner. (src/plugins/hooks.ts:859, 65ada41a1b2f)
  • Release lacks current authority: Terminal release permits a human-revoke event directly and derives expected owner fields from the stored row. The operation records actor and authority strings without validating an event-specific live capability before changing the row to RELEASED. (src/delegation/delegated-execution-ownership.ts:430, 65ada41a1b2f)

PR surface

Source +2830, Tests +2708, Docs +34, Config 0. Total +5572 across 50 files.

View PR surface stats
Area Files Added Removed Net
Source 36 2896 66 +2830
Tests 11 2708 0 +2708
Docs 2 59 25 +34
Config 1 1 1 0
Generated 0 0 0 0
Other 0 0 0 0
Total 50 5664 92 +5572

Review metrics

Metric Value Why it matters
Persistent contract Schema 20 → 21; 2 durable tables The change establishes persistent authorization state and an older-runtime compatibility fence.
Public plugin capability 1 new runtime namespace with 1 establishment operation The supported plugin API exposes acquisition without an integrated completion or recovery lifecycle.

Root-cause cluster

Relationship: canonical
Canonical: #166475
Summary: The author explicitly replaced the earlier release-line submission with this mainline proposal; neither has merged.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This proposes a substantial new capability without evidence of an urgent regression affecting existing users.
  • merge-risk: 🚨 security-boundary: Release, wrong-owner continuation, lost lineage, and stale checks can bypass the proposed authority boundary.
  • merge-risk: 🚨 compatibility: The public API and schema bump change persistent contracts without accepted upgrade and recovery evidence.
  • merge-risk: 🚨 availability: Runtime database scans and reservations without integrated recovery can stall or indefinitely refuse delegated execution.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

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

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-07T06:10:31.374Z sha 1840f2a :: needs real behavior proof before merge. :: [P1] [P1] Supply delegation intent from the production owner | [P1] [P1] Restrict the handoff to the reserved delegate owner | [P1] [P1] Validate current authority inside terminal release | [P1] [P1] Preserve private bindings through tool-context copies | [P1] [P1] Recheck ownership immediately before the tool effect | [P2] [P2] Move runtime ownership reads into the database worker

Reviewed October 7, 2026, 7:24 AM ET / 11:24 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: file-transfer labels Oct 7, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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. labels Oct 7, 2026
steipete added a commit that referenced this pull request Nov 5, 2026
## What Problem This Solves

A repeat captured Doctor still performs two full generation observations around shared-state readability even when no catalog or orphan repair is needed. Its readability helper also opens two empty immediate transactions on that clean path.

The existing schema-repair owner now returns its prepared `needed` fact with `apply`. The prepared schema-repair owner owns its catalog repair transaction and exposes the same prepared apply operation to the generator. The generator consumes the needed fact once. Clean, artifact-free readability can finish without an attributed write phase; retained WAL/journal still use the original initial envelope, and catalog/orphan repair still resumes through capture before writing. The superseded forwarding helper is deleted.

Full Doctor still invokes `apply` unconditionally inside its write transaction, retaining the ownership check after `BEGIN`. Actual repair still checks live authority at effect; original generation baseline, untouched-path final comparison, source custody, cancellation, awaited credentials and closure, and separate state/agent commits remain. No `capture.accept`, `openedSqlitePaths` shortcut, new cache, schema, generation, dependency or finalizer change.

## Acceptance rule (before count runs)

Flow: repeat captured Doctor through committed `scripts/perf/doctor-captured-pass.mts`, starting from the same migrated four-agent/4096-session synthetic fixture at the same absolute path. Baseline must contain landed B1; candidate differs only by the readability owner simplification. Keep the retained-WAL native update flow as a separate compatibility cohort.

Counts first, one matched base/candidate pair: clean no-companion readability removes one before/after generation observation pair (2 generation workers and 2 size workers), its 22 inspection SQL statements, and two empty immediate transactions; measure the remaining SQL/read/request deltas rather than assigning all totals to the deletion. Existing WAL or journal retains the initial envelope. Dirty catalog/orphan repair still enters the original capture before its first write; no skipped path calls capture.accept or marks itself opened. Full Doctor still executes the prepared ownership check unconditionally after BEGIN.

Win: at least the two redundant readability observations removed in the actual repeat flow, total SQL/requests and runtime Gateway MAIN hold or improve, source/refusal/restoration/cleanup behavior unchanged, production net <=0 and test net <=0. Counts for main threads across child processes are labeled separately from runtime Gateway MAIN. No timing result from an instrumented profile is treated as a speedup.

Timing: the campaign timing deadline expired at 2026-11-05T07:08:34Z. This PR uses deterministic worker/SQL/copied-byte counts only; it claims no CPU or wall-time speedup. The retained-WAL native update is a distinct compatibility cohort and is not timed for performance acceptance.

Proof: red/green clean readability transaction/worker counts adapted into existing tests; retain same/different-content outside-write refusal, empty reader transition, malformed catalog plus preserved orphan recovery, synchronous and asynchronous behavior, and full Doctor post-BEGIN authority. Two isolated reviews, PG checklist and approval for exact head, matched native retained-WAL update, exact-head CI including three PG shards and published-driver cell, peer overlap audit.

Expected remaining generation observations after the bounded cut: inventory 3; quick-index 2; readability 0; shared-state/credential opens 6; additive-agent schemas 8; legacy/schema/credential repair 6; total 25. Confirm with the production run; do not infer savings from source alone.

The parameterized migration tests retain direct full-Doctor and readability-first routes for both synchronous SDK and asynchronous Doctor entrypoints. Malformed catalog, preserved orphan payload/BigInt/export, integrity, current version, refusal, and repeat-repair idempotency assertions remain. Production net -8 LOC; tests net -5 LOC.

## Evidence

Current integration head: `e489ad6e51aa7775961d485eda51d7e501e4035a`. Merged current main `f34fb556b7ba6abdeedf102730b9214d61db299d` once to include the auth fake-clock fixture fix from #193451. All six B2 file blobs and B2’s diff against main are identical to the reviewed `e5ede773` patch. Count, native-update and published-driver evidence below therefore carry forward; the new normal pull-request [CI run42024239906](https://github.com/openclaw/openclaw/actions/runs/42024239906) passed, including all three PostgreSQL shards, static checks and the affected Node test groups. Required `openclaw/ci-gate`, dependency-review and security-sensitive-review are successful on this exact head. The prior auth-timer failure did not recur; no rerun was needed. No bypass will be used. Exact-head PostgreSQL review was carried by the coordinator after verifying the unchanged six B2 blobs.

One matched repeat-Doctor pair on Node26.12.1/macOS restored the same pristine four-agent/4096-session synthetic fixture at its original absolute path (1,190files/428,490,104bytes; SHA256 `38f500c594546a577e093b58b3956dc42e3e85ef6d593b6acf15a84c98eadd34`). Both arms passed product/restoration checks and cleaned the fixture.

| Scope | SQL base → candidate | Process-main SQL | Worker SQL | Requests | Copied bytes |
|---|---:|---:|---:|---:|---:|
| Doctor | 118,284 → 117,672 | 117,696 → 117,084 | 588 → 588 | 271 → 271 | 1,066,041,712 → 1,062,633,960 |
| Parent/other | 4,321 → 4,321 | 4,302 → 4,302 | 19 → 19 | 18 → 18 | 427,888,640 → 427,888,640 |
| Whole | 122,605 → 121,993 | 121,998 → 121,386 | 607 → 607 | 289 → 289 | 1,493,930,352 → 1,490,522,600 |

Doctor generation/size27/27→25/25; whole32/32→30/30; process starts184→180. Open/close/execute/task request deltas all0. Process-main is CLI/child thread0, not runtime Gateway MAIN. SQL−612 is the observed pair result; the fixed deletion is22 inspection statements plus two empty transactions, with remaining authority/lease work dependent on elapsed progress. After normalizing elapsed busy_timeout values,34 SQL shapes decrease and none increases. Doctor main copy−3,428,352bytes, WAL prefix+20,600bytes, journal unchanged; total−3,407,752bytes. No timing saving is inferred.

Remaining25 observations: inventory/settlement3, quick-index2, shared-state/credential opens6, additive-agent schemas8, legacy/schema/credential repair6. Readability pair2→0; other categories unchanged. No process/SQL ancestry gaps or PID reuse. The offline comparator initially omitted the four source .ts generation workers per arm; an independent spawn/lifetime audit confirmed them, and accepting only the exact .js/.ts entrypoints fixed comparison without changing raw records or rerunning either product arm. Historical B1 SQL totals are not directly comparable because this baseline includes inherited plugin-preparation work.

The separate retained-WAL native update pair passed exact activation/build identity, deferred-to-completed retirement, real Gateway transport, process stop and zero cleanup errors. Both arms started with identical main/WAL byte counts and identical three Doctor WAL/SHM boundaries.

| Native scope | SQL base → candidate | Requests base → candidate | Generation / size processes base → candidate |
|---|---:|---:|---:|
| Whole flow | 296,063 → 294,567 | 155,714 → 155,716 | 68 / 65 → 64 / 61 |
| Preflight Doctor | 3,608 → 3,580 | 119 → 119 | 0 / 0 → 0 / 0 |
| Installed Doctor | 146,880 → 146,269 | 351 → 351 | 32 / 32 → 30 / 30 |
| Final Doctor | 121,076 → 120,464 | 166 → 166 | 21 / 21 → 19 / 19 |

Direct runtime Gateway MAIN holds: canary 44→44; final Gateway 53→53 (startup/readiness48 + shutdown5). Whole process-main SQL290,019→288,520 is a different metric; workerSQL6,044→6,047. Whole-flow SQL is cadence-dependent, not a fixed per-invocation saving. Native copied bytes are unmeasured, not zero; no CPU/wall speedup or warm-steady claim.

All adverse native movements remain counted: one Doctor lease heartbeat; a shutdown plugin-catalog cache task/read; one canary sandboxRegistry.list schema-version read; and a final startup-integrity completion followed by its database open. Outside-Doctor cache scan0→1 and cache_size2→3 are disclosed. All12 relevant owners are blob-identical base/head. These are timing-dependent background progress differences, cause not proven. The coordinator explicitly accepted +2requests/+3workerSQL and the new cells after source attribution; none is subtracted as noise.

Two raw macOS leaf PIDs were each reused in disjoint process lifetimes. A strict offline split preserves all2,850 process events and62 affected SQL records, every raw hash and total. An isolated independent audit reconciles294,567SQL/155,716requests. Unobserved shell parents leave an ancestry coverage gap; all observed children remain counted (598SQL/0requests each arm, before Doctor).

Validation:132 owner tests passed on the production-equivalent head, including retained artifacts, outside-write refusal, empty readers, credential preparation/close and retirement. The B1 red control performs2 observations versus expected0; B2 passes. Final4 ownership cases, typed lint, format and line-cap pass. Two full isolated Codex reviews plus required production-delta/test corrections are clean. Exact-head PostgreSQL approval is recorded. Local broad check:changed was canceled143 and is not a pass; CI supplies broad gates.

Original proof-head CI run [42003968887](https://github.com/openclaw/openclaw/actions/runs/42003968887) passed all three PostgreSQL shards, types, typed lint, source contracts, ratchets, SDK API diff and the [published-driver/native-systemd cell](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127173500397). The run is not reported green: its original auth timer, deferred-project marker and UI timeout failures remain recorded. The single approved projects retry [127208432932](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127208432932) passed (11:08:56–11:34:54Z). The original marker ENOENT remains disclosed; no source fix or weakened assertion was introduced. The corrected PR body also passed its context/evidence check [127216156959](https://github.com/openclaw/openclaw/actions/runs/42018847897/job/127216156959).

The auth retry reproduced a leftover fake timer at `auth-controller.test.ts:226` and a separate cleanup-authority timeout. After the single Testbox allocation queued and was stopped without executing tests, the coordinator authorized one exact 19-file Node24.22.1/macOS replay per arm, with CI's three workers and isolation configuration unchanged. Both base and candidate reproduce the same timer assertion (base377pass/1fail; candidate382pass/1fail); all other18files pass, and worker cleanup completes. All source archive bytes verified before/after. This establishes matching-signature baseline evidence on macOS, not a Linux result, a fix, or a green suite. The follow-up #193451 attributed this timer to tsx disk-cache initialization captured by the fake clock and prepares it before the clock starts, retaining all assertions. That test-only fix is now included by the main merge; the new normal CI must confirm it on this integration head. The source-identical90s cleanup timeout remains disclosed. No assertion or timeout was weakened.

The UI timeout has no assertion failure and is coordinator-dispositioned as unrelated. Knip's sole `handleUpgradeRequest` export finding is independently reproduced in scheduled main run41994726590/job127135524057, then fixed on main by73145; the prospective merge retains the exact fixed blob. No new static findings are accepted.

Production net−8 LOC; tests net−5 LOC. Benchmark +12 lines adds a freshly created explicit scratch root so arms run at the same absolute path; default path and cleanup are unchanged. No B2 file changes followed final review; the current head additionally contains the unchanged main merge described above.

Overlap refreshed on the integrated head through the shared PR index: #193393 at `f545ae3d` merges cleanly both before and after B2; #192228/#188492/#166475/#149882/#146868 add no conflicts (7/34/18/92/7 inherited paths respectively). #192698 retains 2,751 conflicting paths in both arms and no new conflict relation. The repair-owner block is resegmented inside its already-conflicted file, covered by the coordinator’s explicit standing disposition for that draft. The previous 2,912-path count belonged to the earlier base. No per-PR census was used.

Acceptance marker: `DOCTORGEN-B2-COUNTS-e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`. Measured candidate: `e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`; exact base: `ef81b2545c8cf6f20f1b2723628fc5291d45bde0`. The same existing migrated fixture is restored at one path for each count arm; the native retained-WAL cohort is separately restored at its own fixed path.

Final test-only correction restores the baseline DatabaseSync.exec descriptor capture after typed lint rejected the direct unbound method reference. Four ownership-injection cases pass; an isolated delta review is clean. Production is byte-identical to the PostgreSQL-approved 24a93d8 head. The earlier CI runner also hit a documented 8 GiB fixture disk requirement with only 7.2–7.3 GiB free; this is retained as environment evidence, not claimed as a passing test. The final exact-head CI outcomes and their dispositions are recorded above.


Count setup correction (before the replacement pair): the first baseline ran 39 generation/size processes because moving the byte-identical migrated fixture invalidated its existing absolute-path daemon-runtime-pin receipt, adding six migration envelopes. That attempt is excluded from repeat-Doctor acceptance. Candidate attempts stopped before repair because the temporary artifact observer matched only a single-line repair initializer. B2 emits that initializer over multiple lines; the observer crashed the child during import, and its parent correctly refused the exited process identity. A small direct module import reproduced the observer error. The corrected bounded multiline observer imports both exact repair-owner modules successfully; no product authority behavior changed. The replacement pair restores the unchanged pristine fixture at its original path for both arms. The original 27→25 projection and all acceptance thresholds remain unchanged. The canceled second attempt stopped during preflight and executed no Doctor.

Final landing check: current main includes #193393. Its additive standing-advisories benchmark changes merge cleanly with B2; all five reviewed production/test files remain byte-identical. This is main-owned benchmark integration only; B2 head and its own diff have not changed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
…193360)

## What Problem This Solves

A repeat captured Doctor still performs two full generation observations around shared-state readability even when no catalog or orphan repair is needed. Its readability helper also opens two empty immediate transactions on that clean path.

The existing schema-repair owner now returns its prepared `needed` fact with `apply`. The prepared schema-repair owner owns its catalog repair transaction and exposes the same prepared apply operation to the generator. The generator consumes the needed fact once. Clean, artifact-free readability can finish without an attributed write phase; retained WAL/journal still use the original initial envelope, and catalog/orphan repair still resumes through capture before writing. The superseded forwarding helper is deleted.

Full Doctor still invokes `apply` unconditionally inside its write transaction, retaining the ownership check after `BEGIN`. Actual repair still checks live authority at effect; original generation baseline, untouched-path final comparison, source custody, cancellation, awaited credentials and closure, and separate state/agent commits remain. No `capture.accept`, `openedSqlitePaths` shortcut, new cache, schema, generation, dependency or finalizer change.

## Acceptance rule (before count runs)

Flow: repeat captured Doctor through committed `scripts/perf/doctor-captured-pass.mts`, starting from the same migrated four-agent/4096-session synthetic fixture at the same absolute path. Baseline must contain landed B1; candidate differs only by the readability owner simplification. Keep the retained-WAL native update flow as a separate compatibility cohort.

Counts first, one matched base/candidate pair: clean no-companion readability removes one before/after generation observation pair (2 generation workers and 2 size workers), its 22 inspection SQL statements, and two empty immediate transactions; measure the remaining SQL/read/request deltas rather than assigning all totals to the deletion. Existing WAL or journal retains the initial envelope. Dirty catalog/orphan repair still enters the original capture before its first write; no skipped path calls capture.accept or marks itself opened. Full Doctor still executes the prepared ownership check unconditionally after BEGIN.

Win: at least the two redundant readability observations removed in the actual repeat flow, total SQL/requests and runtime Gateway MAIN hold or improve, source/refusal/restoration/cleanup behavior unchanged, production net <=0 and test net <=0. Counts for main threads across child processes are labeled separately from runtime Gateway MAIN. No timing result from an instrumented profile is treated as a speedup.

Timing: the campaign timing deadline expired at 2026-11-05T07:08:34Z. This PR uses deterministic worker/SQL/copied-byte counts only; it claims no CPU or wall-time speedup. The retained-WAL native update is a distinct compatibility cohort and is not timed for performance acceptance.

Proof: red/green clean readability transaction/worker counts adapted into existing tests; retain same/different-content outside-write refusal, empty reader transition, malformed catalog plus preserved orphan recovery, synchronous and asynchronous behavior, and full Doctor post-BEGIN authority. Two isolated reviews, PG checklist and approval for exact head, matched native retained-WAL update, exact-head CI including three PG shards and published-driver cell, peer overlap audit.

Expected remaining generation observations after the bounded cut: inventory 3; quick-index 2; readability 0; shared-state/credential opens 6; additive-agent schemas 8; legacy/schema/credential repair 6; total 25. Confirm with the production run; do not infer savings from source alone.

The parameterized migration tests retain direct full-Doctor and readability-first routes for both synchronous SDK and asynchronous Doctor entrypoints. Malformed catalog, preserved orphan payload/BigInt/export, integrity, current version, refusal, and repeat-repair idempotency assertions remain. Production net -8 LOC; tests net -5 LOC.

## Evidence

Current integration head: `e489ad6e51aa7775961d485eda51d7e501e4035a`. Merged current main `5166bef057aecf7c139598ad0d1ce3ac53cbd626` once to include the auth fake-clock fixture fix from openclaw#193451. All six B2 file blobs and B2’s diff against main are identical to the reviewed `e5ede773` patch. Count, native-update and published-driver evidence below therefore carry forward; the new normal pull-request [CI run42024239906](https://github.com/openclaw/openclaw/actions/runs/42024239906) passed, including all three PostgreSQL shards, static checks and the affected Node test groups. Required `openclaw/ci-gate`, dependency-review and security-sensitive-review are successful on this exact head. The prior auth-timer failure did not recur; no rerun was needed. No bypass will be used. Exact-head PostgreSQL review was carried by the coordinator after verifying the unchanged six B2 blobs.

One matched repeat-Doctor pair on Node26.12.1/macOS restored the same pristine four-agent/4096-session synthetic fixture at its original absolute path (1,190files/428,490,104bytes; SHA256 `38f500c594546a577e093b58b3956dc42e3e85ef6d593b6acf15a84c98eadd34`). Both arms passed product/restoration checks and cleaned the fixture.

| Scope | SQL base → candidate | Process-main SQL | Worker SQL | Requests | Copied bytes |
|---|---:|---:|---:|---:|---:|
| Doctor | 118,284 → 117,672 | 117,696 → 117,084 | 588 → 588 | 271 → 271 | 1,066,041,712 → 1,062,633,960 |
| Parent/other | 4,321 → 4,321 | 4,302 → 4,302 | 19 → 19 | 18 → 18 | 427,888,640 → 427,888,640 |
| Whole | 122,605 → 121,993 | 121,998 → 121,386 | 607 → 607 | 289 → 289 | 1,493,930,352 → 1,490,522,600 |

Doctor generation/size27/27→25/25; whole32/32→30/30; process starts184→180. Open/close/execute/task request deltas all0. Process-main is CLI/child thread0, not runtime Gateway MAIN. SQL−612 is the observed pair result; the fixed deletion is22 inspection statements plus two empty transactions, with remaining authority/lease work dependent on elapsed progress. After normalizing elapsed busy_timeout values,34 SQL shapes decrease and none increases. Doctor main copy−3,428,352bytes, WAL prefix+20,600bytes, journal unchanged; total−3,407,752bytes. No timing saving is inferred.

Remaining25 observations: inventory/settlement3, quick-index2, shared-state/credential opens6, additive-agent schemas8, legacy/schema/credential repair6. Readability pair2→0; other categories unchanged. No process/SQL ancestry gaps or PID reuse. The offline comparator initially omitted the four source .ts generation workers per arm; an independent spawn/lifetime audit confirmed them, and accepting only the exact .js/.ts entrypoints fixed comparison without changing raw records or rerunning either product arm. Historical B1 SQL totals are not directly comparable because this baseline includes inherited plugin-preparation work.

The separate retained-WAL native update pair passed exact activation/build identity, deferred-to-completed retirement, real Gateway transport, process stop and zero cleanup errors. Both arms started with identical main/WAL byte counts and identical three Doctor WAL/SHM boundaries.

| Native scope | SQL base → candidate | Requests base → candidate | Generation / size processes base → candidate |
|---|---:|---:|---:|
| Whole flow | 296,063 → 294,567 | 155,714 → 155,716 | 68 / 65 → 64 / 61 |
| Preflight Doctor | 3,608 → 3,580 | 119 → 119 | 0 / 0 → 0 / 0 |
| Installed Doctor | 146,880 → 146,269 | 351 → 351 | 32 / 32 → 30 / 30 |
| Final Doctor | 121,076 → 120,464 | 166 → 166 | 21 / 21 → 19 / 19 |

Direct runtime Gateway MAIN holds: canary 44→44; final Gateway 53→53 (startup/readiness48 + shutdown5). Whole process-main SQL290,019→288,520 is a different metric; workerSQL6,044→6,047. Whole-flow SQL is cadence-dependent, not a fixed per-invocation saving. Native copied bytes are unmeasured, not zero; no CPU/wall speedup or warm-steady claim.

All adverse native movements remain counted: one Doctor lease heartbeat; a shutdown plugin-catalog cache task/read; one canary sandboxRegistry.list schema-version read; and a final startup-integrity completion followed by its database open. Outside-Doctor cache scan0→1 and cache_size2→3 are disclosed. All12 relevant owners are blob-identical base/head. These are timing-dependent background progress differences, cause not proven. The coordinator explicitly accepted +2requests/+3workerSQL and the new cells after source attribution; none is subtracted as noise.

Two raw macOS leaf PIDs were each reused in disjoint process lifetimes. A strict offline split preserves all2,850 process events and62 affected SQL records, every raw hash and total. An isolated independent audit reconciles294,567SQL/155,716requests. Unobserved shell parents leave an ancestry coverage gap; all observed children remain counted (598SQL/0requests each arm, before Doctor).

Validation:132 owner tests passed on the production-equivalent head, including retained artifacts, outside-write refusal, empty readers, credential preparation/close and retirement. The B1 red control performs2 observations versus expected0; B2 passes. Final4 ownership cases, typed lint, format and line-cap pass. Two full isolated Codex reviews plus required production-delta/test corrections are clean. Exact-head PostgreSQL approval is recorded. Local broad check:changed was canceled143 and is not a pass; CI supplies broad gates.

Original proof-head CI run [42003968887](https://github.com/openclaw/openclaw/actions/runs/42003968887) passed all three PostgreSQL shards, types, typed lint, source contracts, ratchets, SDK API diff and the [published-driver/native-systemd cell](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127173500397). The run is not reported green: its original auth timer, deferred-project marker and UI timeout failures remain recorded. The single approved projects retry [127208432932](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127208432932) passed (11:08:56–11:34:54Z). The original marker ENOENT remains disclosed; no source fix or weakened assertion was introduced. The corrected PR body also passed its context/evidence check [127216156959](https://github.com/openclaw/openclaw/actions/runs/42018847897/job/127216156959).

The auth retry reproduced a leftover fake timer at `auth-controller.test.ts:226` and a separate cleanup-authority timeout. After the single Testbox allocation queued and was stopped without executing tests, the coordinator authorized one exact 19-file Node24.22.1/macOS replay per arm, with CI's three workers and isolation configuration unchanged. Both base and candidate reproduce the same timer assertion (base377pass/1fail; candidate382pass/1fail); all other18files pass, and worker cleanup completes. All source archive bytes verified before/after. This establishes matching-signature baseline evidence on macOS, not a Linux result, a fix, or a green suite. The follow-up openclaw#193451 attributed this timer to tsx disk-cache initialization captured by the fake clock and prepares it before the clock starts, retaining all assertions. That test-only fix is now included by the main merge; the new normal CI must confirm it on this integration head. The source-identical90s cleanup timeout remains disclosed. No assertion or timeout was weakened.

The UI timeout has no assertion failure and is coordinator-dispositioned as unrelated. Knip's sole `handleUpgradeRequest` export finding is independently reproduced in scheduled main run41994726590/job127135524057, then fixed on main by73145; the prospective merge retains the exact fixed blob. No new static findings are accepted.

Production net−8 LOC; tests net−5 LOC. Benchmark +12 lines adds a freshly created explicit scratch root so arms run at the same absolute path; default path and cleanup are unchanged. No B2 file changes followed final review; the current head additionally contains the unchanged main merge described above.

Overlap refreshed on the integrated head through the shared PR index: openclaw#193393 at `f545ae3d` merges cleanly both before and after B2; openclaw#192228/openclaw#188492/openclaw#166475/openclaw#149882/openclaw#146868 add no conflicts (7/34/18/92/7 inherited paths respectively). openclaw#192698 retains 2,751 conflicting paths in both arms and no new conflict relation. The repair-owner block is resegmented inside its already-conflicted file, covered by the coordinator’s explicit standing disposition for that draft. The previous 2,912-path count belonged to the earlier base. No per-PR census was used.

Acceptance marker: `DOCTORGEN-B2-COUNTS-e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`. Measured candidate: `e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`; exact base: `3a560c82e47ad5d8283886b4a17601a0dc8ddf67`. The same existing migrated fixture is restored at one path for each count arm; the native retained-WAL cohort is separately restored at its own fixed path.

Final test-only correction restores the baseline DatabaseSync.exec descriptor capture after typed lint rejected the direct unbound method reference. Four ownership-injection cases pass; an isolated delta review is clean. Production is byte-identical to the PostgreSQL-approved 24a93d8 head. The earlier CI runner also hit a documented 8 GiB fixture disk requirement with only 7.2–7.3 GiB free; this is retained as environment evidence, not claimed as a passing test. The final exact-head CI outcomes and their dispositions are recorded above.


Count setup correction (before the replacement pair): the first baseline ran 39 generation/size processes because moving the byte-identical migrated fixture invalidated its existing absolute-path daemon-runtime-pin receipt, adding six migration envelopes. That attempt is excluded from repeat-Doctor acceptance. Candidate attempts stopped before repair because the temporary artifact observer matched only a single-line repair initializer. B2 emits that initializer over multiple lines; the observer crashed the child during import, and its parent correctly refused the exited process identity. A small direct module import reproduced the observer error. The corrected bounded multiline observer imports both exact repair-owner modules successfully; no product authority behavior changed. The replacement pair restores the unchanged pristine fixture at its original path for both arms. The original 27→25 projection and all acceptance thresholds remain unchanged. The canceled second attempt stopped during preflight and executed no Doctor.

Final landing check: current main includes openclaw#193393. Its additive standing-advisories benchmark changes merge cleanly with B2; all five reviewed production/test files remain byte-identical. This is main-owned benchmark integration only; B2 head and its own diff have not changed.

This branch has not been deployed

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant