Skip to content

fix(doctor): stop admission fixtures from observing unrelated children - #200310

Merged
vincentkoc merged 4 commits into
mainfrom
fix/doctor-readonly-preload-ipc-20261117
Nov 17, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix/doctor-readonly-preload-ipc-20261117

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

The Doctor admission fixture added an IPC message listener to every child inheriting its preload. Restrict request observation to the canonical SQLite readonly worker marker so unrelated IPC children keep their normal listener state. Native SQLite isolation checks and PID-bound guard witnesses still run in every child.

The regression completes a real readonly session, verifies its database row, then checks an unrelated IPC child's listener count, successful exit, and guard witness. Fixture disposal still verifies the real session requests. Child stderr uses the existing inherited-diagnostics pattern.

Validation

  • Failing baseline, source 43c2926ba69479fdc68f5fccb4fd3a089763c9fb, Node 24.22.1: 16 of 17 warm cases passed; the regression failed specifically with listener count 1 instead of 0 after the session, exit, and witness checks passed.
  • Fixed Node proof, source 58778fd27ca2e8725f30a8fd5aa2da0b1b82a855: all 17 warm cases and all 5 admission-activation/continuation-scope cases passed, with both canonical commands completing and exiting 0.
  • Final-head CI, source 9b3d53e9a2a1623c1a64a4b1ecab7729e8d937e5: 24 jobs passed, 30 skipped, no failures. Doctor types and both required CI gates passed, including security reconciliation.
  • The standard Bun lane exercised the updated regression (662ms), all 17 warm cases (canonical wrapper 16.04s), and both sibling files successfully. Its log includes a heartbeat-close timeout warning; the native owner completed with exit 0.
  • Fresh local ClawSweeper review of the complete final committed range found no actionable correctness or security issues.

This fixture fix does not establish the cause or resolution of the separate Doctor timeout, or qualify the Bun repin in #199959.

@vincentkoc vincentkoc self-assigned this Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 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 commands Command implementations size: S labels Nov 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds a regression checking that Doctor fixture preloads observe read-only worker requests without adding IPC listeners to unrelated children.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A useful, focused baseline regression, with runtime validation pending and the intended fixture repair absent.
Proof confidence 🦪 silver shellfish (2/6) This changes test coverage only, so shipped-entry-point proof is unnecessary; syntax checks and source inspection do not establish regression execution.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Partial
User problem: Developer tests preload an unrelated IPC child with a read-only-worker message observer.
Reason: The maintainer-authored direction addresses a concrete fixture ownership defect, while the current draft intentionally delivers only its regression.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored draft open: it adds a focused regression for a current fixture defect, but the deliberately omitted repair is required before merge.

Priority: P3
Reviewed head: 43c2926ba69479fdc68f5fccb4fd3a089763c9fb

Before merge

  • [P2] Include the fixture repair before merging the regression (P2) - The spawned IPC child inherits the fixture preload, whose unchanged process.on('message') registration adds one listener regardless of child role. Once setup succeeds, this new zero-listener assertion therefore fails. The draft explicitly stages this baseline intentionally, but merging it alone would introduce a failing test without fixing isolation. Add the role guard around request recording in doctor-maintenance.admission.test-support.ts while retaining universal SQL fencing and witnesses.

Findings

  • [P2] [P2] Include the fixture repair before merging the regression — src/commands/doctor-maintenance.admission-warm.test.ts:93

Tests

  • Missing end-to-end proof: The regression has not yet been shown failing at the intended assertion before repair and passing with the fixture guard.
Agent review details

How this fits together

Doctor admission tests preload SQLite isolation guards into subprocesses; the fixture records read-only worker requests and verifies private database witnesses when each test finishes.

flowchart TD
  A[Doctor admission test] --> B[Fixture preload]
  B --> C[Read-only worker session]
  B --> D[Unrelated IPC child]
  C --> E[Request and isolation assertions]
  D --> F[Listener and preload assertions]
Loading

Technical review

Best possible solution:

Gate only request-listener registration in the existing fixture by the canonical read-only child marker, preserving SQL fencing and preload witnesses for every child.

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

Source inspection shows the unrelated child inherits a preload that unconditionally registers a message listener; no target code was executed and the expected assertion failure remains unobserved.

Is this the best way to solve the issue?

The regression targets the existing fixture boundary and preserves real worker recording; completing the narrowly scoped listener guard is the smallest repair.

Full review comments:

  • [P2] [P2] Include the fixture repair before merging the regression — src/commands/doctor-maintenance.admission-warm.test.ts:93
    The spawned IPC child inherits the fixture preload, whose unchanged process.on('message') registration adds one listener regardless of child role. Once setup succeeds, this new zero-listener assertion therefore fails. The draft explicitly stages this baseline intentionally, but merging it alone would introduce a failing test without fixing isolation. Add the role guard around request recording in doctor-maintenance.admission.test-support.ts while retaining universal SQL fencing and witnesses.
    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 e3f8a67bc94d.

Testing

Proof path: none.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/commands/doctor-maintenance.admission-warm.test.ts --maxWorkers=1
  • pnpm test src/commands/doctor-maintenance.admission-freshness.test.ts src/commands/doctor-maintenance.admission-activation.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Tests +76. Total +76 across 1 file. Added test files: 0.

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

Preflight source

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: The demonstrated scope is developer fixture isolation, with no production behavior change or established connection to the separate Doctor timeouts.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed November 16, 2026, 7:00 PM ET / November 17, 2026, 00:00 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 17, 2026 03:30
@vincentkoc
vincentkoc merged commit 42b907f into main Nov 17, 2026
121 of 122 checks passed
@vincentkoc
vincentkoc deleted the fix/doctor-readonly-preload-ipc-20261117 branch November 17, 2026 07:29
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 17, 2026
#200310)

* test(doctor): expose fixture IPC listener leakage

* fix(doctor): scope admission fixture IPC observation

* style(doctor): format admission fixture regression

* test(doctor): inherit diagnostics for the IPC fixture child

(cherry picked from commit 42b907f)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
openclaw#200310)

* test(doctor): expose fixture IPC listener leakage

* fix(doctor): scope admission fixture IPC observation

* style(doctor): format admission fixture regression

* test(doctor): inherit diagnostics for the IPC fixture child
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant