Skip to content

fix(ci): repair snapshot ownership proof after native cutover - #161271

Merged
roboclaw-bot merged 1 commit into
mainfrom
fix/test-mcp-worker-spy
Sep 29, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
fix/test-mcp-worker-spy

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #160946, #161074, #160922

What Problem This Solves

The snapshot ownership test spies on caller-realm process creation even though token processes now launch inside the native owner, causing CI to fail.

User Impact

No production behavior change. Restore the regression test while preserving its one-physical-process budget, concurrent/nested lifetimes, off-host SQLite requirement, and joined cleanup.

Why This Change Was Made

A scoped Node preload records startup only inside matching physical SQLite session processes. The test still requires exactly one real token child across three concurrent allocations and a nested fourth allocation. It checks every directory and verifies the recorded process is alive while held and gone after child-before-parent cleanup. A Worker-handle count does not substitute for this evidence.

The deliberately unreceipted allocation is separated from this healthy-lifetime scenario: the canonical native-resource tests already require cleanup to fail closed unless native not-started proof exists. That production policy is unchanged. Every successful sibling allocation retains cleanup custody, and scoped environment restoration follows joined cleanup. All 14 ownership cases remain.

Main independently landed the MCP fixture repair in 1d0efa48d3a84. This PR keeps that implementation unchanged and drops its superseded MCP commit, resolving the overlap. Only src/infra/sqlite-snapshot-staging.ownership.test.ts now differs from main.

Evidence

  • The original ownership file reproduced the CI failure locally: 1 failed, 13 passed. Temporary diagnostics, restored afterward, exposed the obsolete host count (zero) masked by intentional missing-receipt cleanup refusal. Main’s separate module-reload cleanup fix did not fix the stale observation.

  • The revised healthy case passed with one actual token child and joined process exit. A temporary production mutation disabled session reuse: the test failed at the intended four physical PIDs versus one assertion. Production was restored byte-for-byte; no fake PID count, shortened timeout, or new production hook supplies the proof.

  • Before conflict resolution, 66 tests passed across six files, with one existing Windows-only skip, including both canonical missing-receipt/not-started cases. Full changed-file checks passed: types, typed lint, formatting, guards, and all three dead-export scans. Independent P0–P2 review was scoped-clean.

  • Conflict resolution replays only the snapshot commit onto 114c92cb458dd8bda09670950f85302dc0293d4a; git range-diff confirms that this remaining patch is identical. New head: 0d5361a98507cc21a0f64de2c5eaf2877985e296. Current-head validation passed 37 tests: all 14 snapshot ownership cases, 20 MCP migration cases using main’s retained implementation, and all 3 lint-suppression cases (72.09 s combined wrapper, including cold worker preparation). Current formatting, typed lint and git diff --check pass. The earlier full static checks, sibling tests, negative control and independent review are reused for the unchanged remaining patch; they are not relabeled as newly executed.

  • Prior CI 36596233011, attempt 1 failed on the original snapshot case and cancelled 19 jobs. Subsequent head 1d48703… received no CI run while conflicting with main’s MCP repair; its completed ClawSweeper review found no code defect but required conflict resolution and retention of the physical-PID witness. Neither cancelled coverage nor the absent run is represented as green. New-head hosted gates remain required.

  • Current-head CI 36604065213, attempt 1 passed: 17 successful jobs, 26 scoped skips, no failed or cancelled CI jobs. Actual tested merge adeaa4a2a473d2246c1a2bce142094617a357794 combines base c4735dd1b1169862df1f9b7c03772d617c07bf4f with head 0d5361a98507cc21a0f64de2c5eaf2877985e296. Ownership 14/14 passed: physical-process case 513 ms, file Vitest 10.65 s, supported wrapper 12.39 s. Boundary siblings: 140 tests / 12 files passed. These are observed costs, not a speedup claim. Exact-head ClawSweeper completed cleanly at 17:28 UTC; both enforced CI gate projections are green.

Worked on by

Work sessions


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 29, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 29, 2026 16:14
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 29, 2026, 1:28 PM ET / 17:28 UTC (Revision 4).

ClawSweeper review

What this changes

The branch updates the SQLite snapshot ownership test to record physical token-child processes and check session reuse, directory cleanup, and child exit.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still uses a caller-realm spawn spy that cannot observe the native child, while the pinned test-merge result contains the focused replacement. The earlier MCP fixture conflict is absent, and I found no actionable patch defect.

Priority: P2
Reviewed head: 0d5361a98507cc21a0f64de2c5eaf2877985e296

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The focused patch has a direct physical-process witness and a reported causal negative control, with no actionable defect found.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The production staging owner launches a real SQLite child through the native resource. The captured PR body reports an after-fix run observing one child alive across the allocations and gone after cleanup, plus a reuse-disabled control observing four PIDs; current-head focused tests are also reported passing. The diff changes no stored-data contract.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The production staging owner launches a real SQLite child through the native resource. The captured PR body reports an after-fix run observing one child alive across the allocations and gone after cleanup, plus a reuse-disabled control observing four PIDs; current-head focused tests are also reported passing. The diff changes no stored-data contract.
Evidence reviewed 9 items Current-main test still uses the stale observation: At fetched main, the ownership case spies on the caller's child-process spawn and expects one session; the native resource now launches that child elsewhere.
Native launch boundary: The native resource creates the scoped SQLite child session, whose launch arguments include the read-only child marker and session mode.
Session argument contract: The production launcher supplies the same child marker and session argument that the new preload recognizes.
Findings None None.
Security None None.

How this fits together

OpenClaw stages temporary SQLite snapshots for read-only work. A native child holds the snapshot tokens; the staging owner returns directories to callers and joins their cleanup before releasing the child.

flowchart LR
A[Snapshot requests] --> B[Staging owner]
B --> C{Reuse native session?}
C --> D[Read-only child]
D --> E[Token-held directories]
E --> F[Joined cleanup]
F --> G[Child exits]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +18. Total +18 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 65 47 +18
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 65 47 +18

Review metrics

Metric Value Why it matters
Physical-process control 1 PID expected; 4 reported with reuse disabled The reported negative control shows that the test can detect a real session-reuse regression.

Technical review

Best possible solution:

Keep one physical-process ownership regression at the staging boundary, with joined retirement and separate fail-closed allocation coverage.

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

Yes. Current main's host spawn spy cannot observe the child launched by the native resource; the ownership test is a focused reproduction path. This read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Observing the physical child through its real launch arguments repairs the test at the relevant boundary, while separate native-resource cases preserve the missing-receipt policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f7741c38ce7c.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a focused CI regression repair with no production behavior change.
  • merge-risk: 🚨 automation: The patch changes how CI observes native child startup, so a mistaken witness could weaken or falsely fail the ownership gate.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The production staging owner launches a real SQLite child through the native resource. The captured PR body reports an after-fix run observing one child alive across the allocations and gone after cleanup, plus a reuse-disabled control observing four PIDs; current-head focused tests are also reported passing. The diff changes no stored-data contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The production staging owner launches a real SQLite child through the native resource. The captured PR body reports an after-fix run observing one child alive across the allocations and gone after cleanup, plus a reuse-disabled control observing four PIDs; current-head focused tests are also reported passing. The diff changes no stored-data contract.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9c93bc3 adds src/infra/sqlite-readonly-native-resource.ts:293 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9c93bc347cec; files: src/infra/sqlite-readonly-native-resource.ts)
  • Vincent Koc: 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 (3 earlier review cycles)
  • reviewed 2026-09-29T16:22:51.928Z sha e68f9eb32494ca67a4c89d7ebcb3ba9d44295a6c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T16:45:41.923Z sha e68f9eb32494ca67a4c89d7ebcb3ba9d44295a6c :: blocked before merge. :: none
  • reviewed 2026-09-29T16:56:56.346Z sha 1d48703 :: blocked before merge. :: none

@roboclaw-bot
roboclaw-bot force-pushed the fix/test-mcp-worker-spy branch from e68f9eb to 1d48703 Compare September 29, 2026 16:49
@roboclaw-bot roboclaw-bot changed the title fix(ci): restore lint guard after MCP migration coverage fix(ci): update fixtures for native worker ownership Sep 29, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 29, 2026
@roboclaw-bot
roboclaw-bot force-pushed the fix/test-mcp-worker-spy branch from 1d48703 to 0d5361a Compare September 29, 2026 17:18
@roboclaw-bot roboclaw-bot changed the title fix(ci): update fixtures for native worker ownership fix(ci): repair snapshot ownership proof after native cutover Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 29, 2026
@roboclaw-bot
roboclaw-bot merged commit 9b2da92 into main Sep 29, 2026
112 of 114 checks passed
@roboclaw-bot
roboclaw-bot deleted the fix/test-mcp-worker-spy branch September 29, 2026 17:35
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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