[PR #568] [MERGED] Pixelforge harness: a failing run always leaves — watchdog for the park class, bound for the sync child #1026

Closed
opened 2026-10-20 17:33:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/568
Author: @kolacheee
Created: 8/25/2026
Status: ✅ Merged
Merged: 8/25/2026
Merged by: @kolacheee

Base: staging ← Head: fix/554-harness-exit


📝 Commits (2)

  • 4757f9c fix(pixelforge): the harness that could print a failure and then never leave
  • c739a66 test(pixelforge): the one hang the watchdog cannot reach gets its own bound

📊 Changes

1 file changed (+33 additions, -1 deletions)

View changed files

📝 packages/pixelforge/test-brief.mjs (+33 -1)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #554

Why this change

  • #554 reported the pixelforge harness hanging after printing an assertion failure. The hang was observed once and never reproduced (six adversarial attempts all exited promptly — see the issue thread), so this PR takes the issue's own endorsed resolution: make the acceptance bar — any failing run exits non-zero within a bounded time; passing behavior unchanged — true by construction, mooting the unconfirmed incident.
  • Investigation for this fix identified the hang class that actually fits the reported symptom, and it is not the throw path: node force-exits an uncaught AssertionError in the same tick, stray timers or not (measured). The shape that hangs is a parked await under stubbed timers: several lanes stub globalThis.setTimeout to record rather than fire, while two package paths await real backoff timers — a case that reaches one parks forever, printing nothing, with any live handle holding the loop open. Reproduced: at staging the staged park outlives a 150s kill bound; with this fix it exits 1 at the 120s deadline with diagnostics.

What changed

  • Affected package IDs: none shipped — packages/pixelforge/test-brief.mjs only (the manual regression harness; no src/ change, no artifact rebuild).
  • A single unref'd 120s watchdog armed at module load, before any lane can swap the timer globals (it holds an already-armed Timeout, so the stubbing lanes cannot disarm it). unref() is what keeps the green path untouchable — proven load-bearing by negative control. On firing: diagnostic naming #554, process.getActiveResourcesInfo(), exit 1. It adds zero output and zero exit-path changes to a green run (output diffed identical modulo line numbers; runtime 0.96× baseline).
  • The one hang class a watchdog timer cannot reach — the synchronous spawnSync child in the cross-process determinism case — gets its own timeout: 60_000, converting a hung child into a red instead of a block.
  • An uncaught-exception handler was considered and rejected on measurement: it buys no exit promptness and costs node's verbatim red rendering, which the fail-first workflow depends on.

Package and security impact

  • Affected package IDs: none (test harness only)
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Boxes are the human contributor's list. Agent-verified, independently replayed by a second adversarial agent:

  • Forced assertion failures at four depths (early / mid-save-path / post-HUD-state / end): all exit 1 within 2.6s, red output byte-identical to staging's modulo line numbers.
  • Green run: exit 0, output identical to staging's, 0.96× baseline runtime, three runs each tree.
  • The park class: staged live-handle + stubbed-timer park hangs at staging (killed at 150s bound, still alive); exits 1 at 120s with diagnostics on this branch. The watchdog block extracted verbatim into a minimal probe exits 0 in 84ms when the run is healthy — and the negative control (unref removed) kills healthy runs, proving unref() load-bearing.
  • The spawnSync bound: a synthetic never-exiting child is killed at 60s and the case goes red; at staging the same probe blocks past 120s.
  • No red-rendering changes; diff is 33 insertions / 1 deletion, one file, nothing under src/.
  • Nothing to verify in-app — this file never ships in the package artifact.

Documentation impact

  • No documentation changes needed — the watchdog carries its rationale as comments where the next harness author will meet it
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

  • Not applicable — no UI.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Added safeguards to detect and report stalled test harness runs.
    • Added a timeout for compilation processes to prevent indefinite hangs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/568 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/25/2026 **Status:** ✅ Merged **Merged:** 8/25/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/554-harness-exit` --- ### 📝 Commits (2) - [`4757f9c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4757f9cfa71c59c204453aa49885b7e2763f0370) fix(pixelforge): the harness that could print a failure and then never leave - [`c739a66`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c739a661d1597c9a74938363ff0949a08d6c974b) test(pixelforge): the one hang the watchdog cannot reach gets its own bound ### 📊 Changes **1 file changed** (+33 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/pixelforge/test-brief.mjs` (+33 -1) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #554 ## Why this change - #554 reported the pixelforge harness hanging after printing an assertion failure. The hang was observed once and never reproduced (six adversarial attempts all exited promptly — see the issue thread), so this PR takes the issue's own endorsed resolution: make the acceptance bar — *any failing run exits non-zero within a bounded time; passing behavior unchanged* — true **by construction**, mooting the unconfirmed incident. - Investigation for this fix identified the hang class that actually fits the reported symptom, and it is not the throw path: node force-exits an uncaught `AssertionError` in the same tick, stray timers or not (measured). The shape that hangs is a **parked await under stubbed timers**: several lanes stub `globalThis.setTimeout` to record rather than fire, while two package paths await real backoff timers — a case that reaches one parks forever, printing nothing, with any live handle holding the loop open. Reproduced: at `staging` the staged park outlives a 150s kill bound; with this fix it exits 1 at the 120s deadline with diagnostics. ## What changed - Affected package IDs: none shipped — `packages/pixelforge/test-brief.mjs` only (the manual regression harness; no `src/` change, no artifact rebuild). - A single **unref'd 120s watchdog** armed at module load, before any lane can swap the timer globals (it holds an already-armed `Timeout`, so the stubbing lanes cannot disarm it). `unref()` is what keeps the green path untouchable — proven load-bearing by negative control. On firing: diagnostic naming #554, `process.getActiveResourcesInfo()`, exit 1. It adds zero output and zero exit-path changes to a green run (output diffed identical modulo line numbers; runtime 0.96× baseline). - The one hang class a watchdog timer cannot reach — the **synchronous** `spawnSync` child in the cross-process determinism case — gets its own `timeout: 60_000`, converting a hung child into a red instead of a block. - An uncaught-exception handler was considered and **rejected on measurement**: it buys no exit promptness and costs node's verbatim red rendering, which the fail-first workflow depends on. ## Package and security impact - Affected package IDs: none (test harness only) - Engine compatibility impact: none - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Boxes are the human contributor's list. Agent-verified, independently replayed by a second adversarial agent: - Forced assertion failures at four depths (early / mid-save-path / post-HUD-state / end): all exit 1 within 2.6s, red output byte-identical to staging's modulo line numbers. - Green run: exit 0, output identical to staging's, 0.96× baseline runtime, three runs each tree. - The park class: staged live-handle + stubbed-timer park hangs at staging (killed at 150s bound, still alive); exits 1 at 120s with diagnostics on this branch. The watchdog block extracted verbatim into a minimal probe exits 0 in 84ms when the run is healthy — and the negative control (unref removed) kills healthy runs, proving `unref()` load-bearing. - The spawnSync bound: a synthetic never-exiting child is killed at 60s and the case goes red; at staging the same probe blocks past 120s. - No red-rendering changes; diff is 33 insertions / 1 deletion, one file, nothing under `src/`. - Nothing to verify in-app — this file never ships in the package artifact. ## Documentation impact - [x] No documentation changes needed — the watchdog carries its rationale as comments where the next harness author will meet it - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - Not applicable — no UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Added safeguards to detect and report stalled test harness runs. * Added a timeout for compilation processes to prevent indefinite hangs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-20 17:33:21 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1026
No description provided.