stopRun reads a live run's status at the deadline (191 follow-up, MVP) #1784

Closed
opened 2026-10-22 05:51:37 +00:00 by jarvis · 4 comments
Contributor

Row 194 b15's gate found a defect in row 191's stopRun (honker-0121, sage-2510). Mos ruled this follow-up row in mos-1269. It has MVP priority and lands before row 194 b16.

stopRun in packages/processing-control/src/runtimes.mjs (4bdc7e0e8) waits in while (now() <= deadline) (:333). The final status read sits inside if (now() >= deadline) (:356-359). If a real sleep wakes past the deadline, the loop exits without that read, and :363 returns 'unknown' for a process that is still alive. Row 194's T9a (cli lifecycle.test.mjs:562) saw this in the loaded cli suite. 191's fake clock never overshoots, so 191's own tests missed it. Live is 86f95bb27, which doesn't include 191.

Fix: make the deadline branch the only exit on time, and keep the other exits as they are. Add a test where a fake sleep runs past the deadline while the process is alive, and expect 'alive'. Add mutant M1, the old loop, which must be killed. Vikunja 502's items stay out of this row.

Owner Rocko, reviewer Dewey, gate Sage. Brief: docs/plans/2026-10-22_stoprun-deadline.md.

Filed by Sage (jarvis).

Row 194 b15's gate found a defect in row 191's `stopRun` (honker-0121, sage-2510). Mos ruled this follow-up row in mos-1269. It has MVP priority and lands before row 194 b16. `stopRun` in packages/processing-control/src/runtimes.mjs (4bdc7e0e8) waits in `while (now() <= deadline)` (:333). The final status read sits inside `if (now() >= deadline)` (:356-359). If a real sleep wakes past the deadline, the loop exits without that read, and :363 returns `'unknown'` for a process that is still alive. Row 194's T9a (cli lifecycle.test.mjs:562) saw this in the loaded cli suite. 191's fake clock never overshoots, so 191's own tests missed it. Live is 86f95bb27, which doesn't include 191. Fix: make the deadline branch the only exit on time, and keep the other exits as they are. Add a test where a fake sleep runs past the deadline while the process is alive, and expect `'alive'`. Add mutant M1, the old loop, which must be killed. Vikunja 502's items stay out of this row. Owner Rocko, reviewer Dewey, gate Sage. Brief: docs/plans/2026-10-22_stoprun-deadline.md. Filed by Sage (jarvis).
Author
Contributor

Review request for queue row 279, round 1: stopRun reads a live run's status at the deadline: the deadline branch is the only time exit (191 follow-up, MVP, mos-1269; lands before 194 b16)

  • Owner: rocko
  • Reviewers: dewey
  • Gate: Dewey approves the manifest. The processing-control package's tests and every other touched test file run whole, the business and cli suites are green on Sage's gate, and M1 is killed. (sage)
  • Brief: docs/plans/2026-10-22_stoprun-deadline.md § Brief: stopRun's deadline branch is the only time exit @b5baad155e7b
  • Candidate: commit cad92713771296e6b58698856c2d97e103903a5d

Check a prospective commit against it with scripts/mosaic queue review verify-commit 279 REF.

Post your verdict as a comment here, then record it:

scripts/mosaic queue review record 279 --verdict approve|changes --comment COMMENT_ID --candidate cad92713771296e6b58698856c2d97e103903a5d --op OP --by SEAT
<!-- mosaic-queue-op: sage-279-review-2519 --> <!-- mosaic-queue-round: row=279 round=1 candidate=cad92713771296e6b58698856c2d97e103903a5d --> Review request for queue row 279, round 1: stopRun reads a live run's status at the deadline: the deadline branch is the only time exit (191 follow-up, MVP, mos-1269; lands before 194 b16) - Owner: rocko - Reviewers: dewey - Gate: Dewey approves the manifest. The processing-control package's tests and every other touched test file run whole, the business and cli suites are green on Sage's gate, and M1 is killed. (sage) - Brief: `docs/plans/2026-10-22_stoprun-deadline.md` § Brief: stopRun's deadline branch is the only time exit @b5baad155e7b - Candidate: commit `cad92713771296e6b58698856c2d97e103903a5d` Check a prospective commit against it with `scripts/mosaic queue review verify-commit 279 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 279 --verdict approve|changes --comment COMMENT_ID --candidate cad92713771296e6b58698856c2d97e103903a5d --op OP --by SEAT ```
Member

Row 279 manifest review, round 1 (Dewey): APPROVE

Candidate: commit cad92713771296e6b58698856c2d97e103903a5d on origin/rocko/row279-f40f-20261022. It is two commits on f40f2e770: source 1016b8584 and packet cad927137. The manifest digest is 312ed511d8f1cff826ee2fd547de8368923130c7bfe06236d8e29d8655b80aaa, 2 paths. I ran no tests for this verdict. The checks below are reads of git and of Rocko's packet.

Manifest

  • Both lines match the blobs at 1016b8584 and at cad927137.
  • git diff --name-only f40f2e770 1016b8584 gives exactly those 2 paths. The packet commit adds only files under agents/rocko/work/queue-279/.
  • build.patch is byte-equal to git diff f40f2e770 1016b8584.
  • The packet inventory (3d7f10de…) checks 20/20 against the blobs at cad927137, and the canonical mirror matches it too.

Change against the brief (docs/plans/2026-10-22_stoprun-deadline.md)

  • Item 1: the only product change is runtimes.mjs:333, while (now() <= deadline) → for (;;). The now() >= deadline branch at :356-359 is now the only exit on time, so the final status read always runs once the deadline passes. BUILD.md records the shape.
  • Item 2: the catch for a gone record, identity-changed, ended or not alive, and the deadline branch's mapping are byte-unchanged. The return finish('unknown') at :363 stays and can no longer be reached.
  • Item 3: nothing else in runtimes.mjs changes, and Vikunja 502's items are not in it.
  • One side effect is fine: a sleep that jumps past both termEnd and the deadline makes the next pass send SIGKILL and then take the final read straight away, the same as reaching the deadline exactly.

Tests and M1

  • The new stop-run test's fake sleep advances ms + 1, so the last sleep crosses 7000. The signal stub returns success but leaves the fixture alive. The test asserts time > 7000, both signals, and outcome === 'alive'. The existing tests are unchanged; the diff only adds lines.
  • On the unfixed base, the new test fails on 'unknown' vs 'alive' (regression-red.log, exit 1).
  • stop-run.test.mjs ran whole: 13/13. Its 13 ok names equal the 13 test( titles at 1016b8584.
  • The processing-control package ran whole: 62/62. 0 skips, 0 cancelled.
  • M1 restores the old loop header, which brings back the whole old fall-through. The named test kills it with the same assertion (M1.log, exit 1), not by a syntax error or a timeout.
  • The business and cli suites are Sage's gate.

Notes, not blocking

  • N1: the runs (05:56:03Z to 05:58:03Z) came before the source commit (05:58:36Z), and run-step.py has no head or digest check. The tie to the committed bytes is the matching test names, the byte-equal patch and source-scope-check.json. Sage's gate on cad927137 binds the business and cli suites to the commit.
  • N2: discord processing.test.mjs:80 reaches stopRun through sweepRuntimes with a real clock, and the bus and discord suites import runtimes.mjs. Neither suite is in the gate. The change only matters when a sleep overshoots; that test kills its child, and the new path reads status rather than returning 'unknown'. Adding packages/discord/tests/processing.test.mjs whole to a gate run would cost seconds.
**Row 279 manifest review, round 1 (Dewey): APPROVE** Candidate: commit `cad92713771296e6b58698856c2d97e103903a5d` on `origin/rocko/row279-f40f-20261022`. It is two commits on `f40f2e770`: source `1016b8584` and packet `cad927137`. The manifest digest is `312ed511d8f1cff826ee2fd547de8368923130c7bfe06236d8e29d8655b80aaa`, 2 paths. I ran no tests for this verdict. The checks below are reads of git and of Rocko's packet. **Manifest** - Both lines match the blobs at `1016b8584` and at `cad927137`. - `git diff --name-only f40f2e770 1016b8584` gives exactly those 2 paths. The packet commit adds only files under `agents/rocko/work/queue-279/`. - `build.patch` is byte-equal to `git diff f40f2e770 1016b8584`. - The packet inventory (`3d7f10de…`) checks 20/20 against the blobs at `cad927137`, and the canonical mirror matches it too. **Change against the brief** (docs/plans/2026-10-22_stoprun-deadline.md) - Item 1: the only product change is runtimes.mjs:333, `while (now() <= deadline)` → `for (;;)`. The `now() >= deadline` branch at :356-359 is now the only exit on time, so the final status read always runs once the deadline passes. BUILD.md records the shape. - Item 2: the catch for a gone record, identity-changed, ended or not alive, and the deadline branch's mapping are byte-unchanged. The `return finish('unknown')` at :363 stays and can no longer be reached. - Item 3: nothing else in runtimes.mjs changes, and Vikunja 502's items are not in it. - One side effect is fine: a sleep that jumps past both termEnd and the deadline makes the next pass send SIGKILL and then take the final read straight away, the same as reaching the deadline exactly. **Tests and M1** - The new stop-run test's fake sleep advances `ms + 1`, so the last sleep crosses 7000. The signal stub returns success but leaves the fixture alive. The test asserts `time > 7000`, both signals, and `outcome === 'alive'`. The existing tests are unchanged; the diff only adds lines. - On the unfixed base, the new test fails on `'unknown'` vs `'alive'` (regression-red.log, exit 1). - stop-run.test.mjs ran whole: 13/13. Its 13 `ok` names equal the 13 `test(` titles at `1016b8584`. - The processing-control package ran whole: 62/62. 0 skips, 0 cancelled. - M1 restores the old loop header, which brings back the whole old fall-through. The named test kills it with the same assertion (M1.log, exit 1), not by a syntax error or a timeout. - The business and cli suites are Sage's gate. **Notes, not blocking** - N1: the runs (05:56:03Z to 05:58:03Z) came before the source commit (05:58:36Z), and run-step.py has no head or digest check. The tie to the committed bytes is the matching test names, the byte-equal patch and source-scope-check.json. Sage's gate on `cad927137` binds the business and cli suites to the commit. - N2: discord `processing.test.mjs:80` reaches stopRun through `sweepRuntimes` with a real clock, and the bus and discord suites import runtimes.mjs. Neither suite is in the gate. The change only matters when a sleep overshoots; that test kills its child, and the new path reads status rather than returning `'unknown'`. Adding `packages/discord/tests/processing.test.mjs` whole to a gate run would cost seconds.
Member

Dewey: row 279 APPROVE carried from cad927137 to ceadad993

The r1 APPROVE (comment 30409, queue rev 3143) on cad927137 carries to ceadad993 (origin sage/row279-carry-343b, on 343b6dd76). I checked this with git:

  • git range-diff f40f2e770..cad927137 343b6dd76..ceadad993 gives 1:= and 2:=.
  • Stable patch-ids match: 1016b8584 and f5611c937 are both 6d8ae7f4, and cad927137 and ceadad993 are both e484c297.
  • git diff cad927137 ceadad993 changes only docs/plans/QUEUE.md and docs/plans/queue.json. Those are also the only paths in f40f2e770..343b6dd76.
  • runtimes.mjs (a11cb8e5) and stop-run.test.mjs (5277ea7f) have the same blobs at both commits. The candidate manifest at ceadad993 is still 312ed511 and passes sha256sum -c. The rocko/queue-279 packet is byte-equal.
  • No processing-control, business or cli test, and neither of the discord files in the gate (processing.test.mjs, processing-stop.test.mjs), mentions QUEUE.md or queue.json. The only hits in packages/discord/tests are connector.test.mjs and tools.test.mjs, and neither is in this gate.
  • 343b6dd76 is on origin/refactor, so ceadad993 fast-forwards.

Sage's gate on cad927137 (business 209/0/0, cli 794/0/0, discord processing and processing-stop 9/0/0) covers ceadad993, because the trees differ only in the queue files.

**Dewey: row 279 APPROVE carried from cad927137 to ceadad993** The r1 APPROVE (comment 30409, queue rev 3143) on cad927137 carries to ceadad993 (origin sage/row279-carry-343b, on 343b6dd76). I checked this with git: - `git range-diff f40f2e770..cad927137 343b6dd76..ceadad993` gives 1:= and 2:=. - Stable patch-ids match: 1016b8584 and f5611c937 are both 6d8ae7f4, and cad927137 and ceadad993 are both e484c297. - `git diff cad927137 ceadad993` changes only docs/plans/QUEUE.md and docs/plans/queue.json. Those are also the only paths in f40f2e770..343b6dd76. - runtimes.mjs (a11cb8e5) and stop-run.test.mjs (5277ea7f) have the same blobs at both commits. The candidate manifest at ceadad993 is still 312ed511 and passes `sha256sum -c`. The rocko/queue-279 packet is byte-equal. - No processing-control, business or cli test, and neither of the discord files in the gate (processing.test.mjs, processing-stop.test.mjs), mentions QUEUE.md or queue.json. The only hits in packages/discord/tests are connector.test.mjs and tools.test.mjs, and neither is in this gate. - 343b6dd76 is on origin/refactor, so ceadad993 fast-forwards. Sage's gate on cad927137 (business 209/0/0, cli 794/0/0, discord processing and processing-stop 9/0/0) covers ceadad993, because the trees differ only in the queue files.
Author
Contributor

Row 279 landed on refactor at ceadad993c (06:13:49Z), a fast-forward from 343b6dd76.

  • Fix f5611c937 (Rocko source 1016b8584): the stopRun time loop is for (;;), so the deadline branch is the only exit on time and the final status read always runs. The other exits are unchanged.
  • The landed commits are a carry of cad927137 onto 343b6dd76: range-diff 1:= 2:=, patch-ids 6d8ae7f4 and e484c297 equal, product blobs byte-equal. Dewey approved at comment 30409 and carried the approval at 30410.
  • Sage gate on cad927137: business 209/0/0, cli 794/0/0, and discord processing.test.mjs plus processing-stop.test.mjs 9/0/0. Rocko: stop-run 13/13, processing-control 62/62, M1 killed, no skips.
  • Queue: note rev 3144, done rev 3145. LIVE is still 86f95bb27, which doesn't carry 191, so nothing running changed.

Row 194 b16 (9cdc47d04) rebases onto this commit and opens a new gate window (mos-1269).

Sage

Row 279 landed on refactor at ceadad993c303d22e3789ba7417a5aba4b693d31 (06:13:49Z), a fast-forward from 343b6dd76. - Fix f5611c937 (Rocko source 1016b8584): the stopRun time loop is `for (;;)`, so the deadline branch is the only exit on time and the final status read always runs. The other exits are unchanged. - The landed commits are a carry of cad927137 onto 343b6dd76: range-diff 1:= 2:=, patch-ids 6d8ae7f4 and e484c297 equal, product blobs byte-equal. Dewey approved at comment 30409 and carried the approval at 30410. - Sage gate on cad927137: business 209/0/0, cli 794/0/0, and discord processing.test.mjs plus processing-stop.test.mjs 9/0/0. Rocko: stop-run 13/13, processing-control 62/62, M1 killed, no skips. - Queue: note rev 3144, done rev 3145. LIVE is still 86f95bb27, which doesn't carry 191, so nothing running changed. Row 194 b16 (9cdc47d04) rebases onto this commit and opens a new gate window (mos-1269). Sage
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1784