Skip to content

fix(test): preserve fixture cleanup custody and runtime ownership - #189948

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/test-node-lifecycle-wait-owner-next100-20261101
Nov 1, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/test-node-lifecycle-wait-owner-next100-20261101

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Test fixtures could lose nested cleanup evidence or resolve an ambient runtime after isolating HOME. The lifecycle test also duplicated process-death policy and could consume an unsafe PID receipt.

Use the canonical reject-on-abort wait and validate PID >1 before group operations. The shared fixture owner recursively classifies cleanup custody after joining registered commands and preserves the containing error/cause identity. Crabbox fixtures resolve pinned pnpm before HOME isolation, then colocate a physical Node executable with its pnpm adapter under the existing suite-owned dependency root. This matters because the real receiver supplies NODE_BIN=dirname(process.execPath), which the selected installer prepends to PATH; a PATH-only adapter or Node symlink falls back to hosted Corepack. All five dependency scenarios now assert the actual private Node path emitted by that installer.

The repeated-pnpm cancellation case uses the existing receipt owner instead of a timing assumption. It preserves real implementation exit130, durable exit receipts and retained-shell launcher143 behavior. Release failures still force/join owned PIDs; receipt-channel close is awaited after fixture custody settles.

Validation:

  • Final complete Crabbox Node owner: 284 pass, 1 existing skip.
  • All five dependency scenarios pass under Node and Bun with a real ambient Node executable and a pnpm sentinel. Actual installer receipts select the private runtime, never the ambient sentinel.
  • The previous PR head fails the same graph scenario by invoking ambient pnpm. Replacing the private Node copy with a symlink fails under Node and Bun for the same reason.
  • Persistent nested aggregate/cause regressions use a real joined command and preserve strict cause identity. The original shallow owner fails both under Node and Bun.
  • Three resistant-child fault modes pass under Node and Bun: injected PID1, cleanup error, and ordered body-plus-cleanup errors. Weakened PID/retention controls fail.
  • Whole Crabbox Bun previously passed 284 tests with 1 existing skip before the final awaited-close/private-Node shape. Final changed dependency scenarios and repeated-pnpm case pass under Bun. No whole final Bun or native Windows claim.
  • Actual receiver-adapter and release-hold mutations fail without overriding genuine child exit behavior. The malformed-receipt negative catches the original aggregate/cause, confirms all six owned PIDs dead after cleanup joins, then rethrows.
  • Both relevant test-type lanes, type-aware lint, formatting and diff checks pass. Independent source review reports no actionable P0-P2 findings.

Production/tooling LOC: 0. Test/support LOC: +139. Removed the local wait implementation and shallow cleanup predicate. Existing timeouts, real dependency installs, graph assertions and production receiver/installer/cancellation policy are preserved. No billed-minute saving is inferred.

@clawsweeper

clawsweeper Bot commented Nov 1, 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.

@vincentkoc vincentkoc self-assigned this Nov 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 1, 2026 01:47
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves nested cleanup evidence and makes test fixtures explicitly own their runtime selection, process waits, and cancellation receipts.

Example: A fixture callback throws an AggregateError containing processTreeState: "indeterminate".

  • Before: The shallow cleanup check deletes the fixture and its evidence file.
  • After: The existing recursive classifier retains the fixture, command output, and original error identity.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused fixture repair is sound on inspection and resolves the earlier finding; evidence is harness-based and exact-head CI is unfinished.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only PR is outside the ordinary contributor proof gate; its reported Node/Bun fixture runs and negative controls support the inspected source changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers can lose failed-fixture diagnostics or encounter dependency tests using an unintended ambient package manager.
Reason: The maintainer-authored direction repairs concrete fixture failures without changing production policy or adding public configuration.

Merge readiness

✅ Ready for maintainer review

The prior NODE_BIN finding is resolved, and no new actionable defects were found. This maintainer-authored PR provides useful fixture repairs; exact-head CI remains pending.

Priority: P2
Reviewed head: ae668bad4919b136e53147e6295e18469aaebed2

Before merge

None.

Findings

None.

Agent review details

How this fits together

These test fixtures launch tooling subprocesses, observe readiness and exit receipts, and decide when temporary inputs can safely be deleted.

flowchart TD
  A[Test scenario] --> B[Shared fixture owner]
  B --> C[Managed commands]
  C --> D[Tooling subprocesses]
  D --> E[Exit and cleanup receipts]
  E --> B
  B --> F[Delete or retain fixture]
Loading

Technical review

Best possible solution:

Keep cleanup classification, process observation, and receipt ownership in the existing shared helpers while binding fixture Node and pnpm together.

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

Current-main source shows nested cleanup markers bypassing retention, and the receiver/installer source explains the ambient-runtime bypass; no target code was executed during this review.

Is this the best way to solve the issue?

The changes repair the fixture owners directly, reuse existing lifecycle helpers, and retain the real dependency-install and cancellation assertions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Fixture retention keeps the original intent (075c1f3: Join registered commands before disposal and preserve inputs and diagnostics when cleanup cannot be confirmed.)
  • Foreign-process observation keeps the original intent (e7dc869: Replace loaded-host polling deadlines with owner-produced signals and test-cancellation-bounded waits.)
  • Receiver dependency fixtures keeps the original intent (b4ed65a: Prove selected-source frozen installation and reject lifecycle mutations before executing payloads.)
  • Repeated pnpm cancellation keeps the original intent (7dbfab8: Distinguish the retained-shell launcher's normalized 143 outcome from the implementation's genuine cancellation exit 130 and cleanup receipts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e7dc869 adds test/scripts/run-node-lifecycle.test.ts:51 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e7dc869d1518; files: test/scripts/run-node-lifecycle.test.ts)

PR surface

Tests +139. Total +139 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 219 80 +139
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 219 80 +139

Review metrics

Metric Value Why it matters
Production versus test growth Production +0/-0; tests and support +219/-80, net +139 Growth supports distinct nested-error regressions and real runtime/cancellation fixtures while removing duplicated cleanup predicates and polling.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Fixture custody and ambient-runtime selection can invalidate tooling tests, with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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-11-01T02:03:43.635Z sha f7cd848 :: needs changes before merge. :: [P2] Make the receiver installer use the captured pnpm executable

Reviewed October 31, 2026, 10:46 PM ET / November 1, 2026, 02:46 UTC (Revision 2).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

head ae668ba

fixed the NODE_BIN finding at the test fixture owner: one physical Node copy is colocated with pinned pnpm under the suite-owned dependency root, and all five cases assert the installer's actual private Node path. the final whole Node owner passes 284 tests with 1 existing skip; all five CI-like ambient-runtime cases pass under Node and Bun. the previous head and a symlink mutation select ambient pnpm and fail. both test-type lanes, type-aware lint, format and diff checks pass. production receiver/installer policy is unchanged; the PR body now records the complete proof.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@vincentkoc
vincentkoc merged commit 767e176 into main Nov 1, 2026
109 of 110 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-node-lifecycle-wait-owner-next100-20261101 branch November 1, 2026 04:39
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…enclaw#189948)

* fix(test): preserve fixture cleanup custody and runtime ownership

* fix(test): keep receiver Node and pnpm in the same private bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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