[PR #3456] [MERGED] fix(javascript): keep overflowing timer delays unknown #5749

Closed
opened 2026-10-31 01:09:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3456
Author: @HawkForge
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/timer-nonfinite-delay


📝 Commits (3)

  • e76985f fix(javascript): keep overflowing timer delays unknown
  • 30936f7 test(javascript): keep the IR-level overflowing timer assertion
  • e487a52 fix(javascript): retain JSON-safe timer facts through CLI and MCP

📊 Changes

3 files changed (+131 additions, -1 deletions)

View changed files

📝 src/domain/javascript/javascriptSemanticAnalysis.runtime_boundaries.test.ts (+17 -0)
📝 src/domain/javascript/javascriptSemanticAsyncEffects.ts (+5 -1)
➕ tests/boundary/mcp/javascriptTimerDelay.test.ts (+109 -0)

📄 Description

Summary

Fixes #3400. A numeric literal such as 1e999 becomes Infinity in the parsed AST. The timer fact producer passed it into JSON-backed properties; projecting one timer then failed the file's analysis and discarded unrelated function facts.

The existing timerDelay owner now emits the established unknown value (null) for a non-finite literal. It preserves the timer, method, binding resolution, source range and file digest. Finite values, including 1e308, remain unchanged. CLI and MCP consume this same representation; no downstream sanitization, schema relaxation or cache is added.

A public CLI/stdio-MCP regression covers six timer cases, exact unknown-vs-omitted semantics, an unrelated exported function, source SHA-256, unchanged input and equal Evidence/node identities across adapters. The redundant new graph-only test is replaced by that stronger public workflow; the domain IR test retains its distinct binding-resolution assertion. Existing graph-consumer tests still run.

Executed validation

Pinned baseline eac296a7d, Linux x64, Node 24.18.0, npm 11.16.0:

  • 111 targeted tests passed, covering runtime boundaries, dataflow, graph resources and the real CLI/MCP worker path. Full npm run check passed; docs:check passed, including 5 consistency tests.
  • Integration with newer main f5d1012fa, tree b219b2d6a6d3e8c3adec070ff81028ba1da97a92: the public CLI/MCP regression passes again, and the real-package workflow retains the same 176 nodes / 4 selected rows with verified cleanup (21.868 s elapsed, 19.831 s CPU, 1,077.8 MiB peak). Main subsequently added only an unrelated Kuna test (7b2087e44), leaving production code unchanged.
  • The new public regression fails on exact main at the CLI success assertion. Independent real CLI runs reproduce unreadable_output / JSON numbers must be finite for both overflowing setTimeout and setInterval: main retains one module node and no timer or greet; candidate returns 14 nodes, the unknown delay and greet for each unchanged source.
  • Six real CLI cases on each revision cover 1e999, 1e309, 100, 1e308, the Infinity identifier and a standalone overflowing literal. Healthy controls retain identical Evidence IDs between main and candidate. Source bytes remain unchanged; all owned temporary roots are empty.
  • Actual public MCP SDK 2026-07-28 on unmodified installed fast-deep-equal 3.1.3, selected index.js (1,177 bytes, SHA-256 eb469e206280321a3878f2335ec98aa2104a155079d8ed83a23029098dccd215): two summary analyses, a batch of 4 selected observation rows, then full Evidence export. The retained graph has 176 semantic nodes, including source function equal, with stable parent Evidence identity. Coverage remains partial: eight unselected files and 137 semantic unknowns are explicit. This is a small real package, not a complex-application performance claim.

REA uses static source analysis; selected target files remain unchanged. The issue's original macOS/Node 26 environment was not separately exercised.

Performance and context

One CPU, 8-GiB hard / 7-GiB early process-family memory bounds, no swap. Equivalent completed package workflows include catalog discovery, two summaries, selected facts, Evidence export and shutdown:

Revision Total elapsed Family CPU Peak family memory First / repeat analysis
Main 19.856 s 18.743 s 1,075.4 MiB 9.429 / 1.090 s
Candidate 20.967 s 18.640 s 1,147.9 MiB 10.341 / 1.110 s

The repeat uses the same MCP session and immutable input; internal reuse is uninstrumented. No new cache is introduced. OS caches and shared-host load are uncontrolled; these samples establish no general speedup or precise latency effect. All completed tasks confirm cleanup and no OOM.

The six-case CLI qualification bundles take 19.859 / 24.020 s, CPU 18.237 / 21.525 s, peak 384.5 / 384.3 MiB (main/candidate). They intentionally differ in recovered facts, so their totals are not equivalent successful-workflow speed comparisons.

cl100k_base estimates: compact input catalog 44,607 / 44,607 tokens, selected analysis input 245 / 245; the two summaries cost 2,338 tokens each, selected facts 3,647, and complete captured post-connect JSON traffic 732,048 / 732,051. The 148,881-token complete Evidence file is retained locally rather than delivered inline. Captured protocol includes output schemas; these are protocol/proxy estimates, not actual model context/usage. Initialization outside capture hooks and downstream prompts are unmeasured. Source selection, summary delivery and requested property keys bound work and inline detail while preserving full Evidence access.

CI/review assessment and authorized bypass

Latest head e487a52ac: Codex review completes with no findings. No actionable latest-head finding is open. Greptile's new run is still in progress; its earlier 5/5 is not claimed as a review of this head. Fork workflow approvals were supplied, but current classification/readiness/title jobs remain queued without completed test results.

The task owner explicitly authorized bypass once independently qualified. Merge uses completed full checks, 111 targeted tests, docs checks, exact-base CLI failures, successful CLI/MCP regression, real-package analysis and newer-main integration. No queued CI or pending Greptile result is claimed as passing; subsequent results remain subject to assessment.

Post-merge CI assessment: 35 latest-head checks succeeded; shard 1 failed only the existing protobufCapture.test.ts malformed-gRPC-web public workflow at its 30-second test timeout. Exact filtered controls reproduce the same timeout on pre-change main cf5194f68 and candidate e487a52ac; the protobuf workflow is outside this diff. Other shards were cancelled or queued. No full CI pass is claimed.

Latest Greptile review is 4/5. Its outside-diff wrapped-timer cancellation lookup finding targets line 295, unchanged by this PR and already introduced on main in 6183544e8b. The only production diff here is the timerDelay finite-number guard. The separate main concern is acknowledged with source attribution; it is not a bug introduced by this PR and is left outside this fix as the task owner requested. Codex has no findings.

Author readiness

Human owner: @gensokyo-dev

The task owner explicitly delegated validation, readiness declarations and merge to this agent. These declarations are supplied under that authorization; no separate new manual human review by the original author is asserted.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Shared producer semantics and caller identity preserved; no new authority or schema changes.
  • Relevant tests, real public workflows, performance and context costs verified; no local reports, binaries, credentials or dependencies in the diff.
  • Available latest-head CI/review state and actionable findings assessed; queued work and bypass authorization recorded above.

🔄 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/morluto/rea/pull/3456 **Author:** [@HawkForge](https://github.com/HawkForge) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/timer-nonfinite-delay` --- ### 📝 Commits (3) - [`e76985f`](https://github.com/morluto/rea/commit/e76985fd938978822d18c782a286a1a205cac918) fix(javascript): keep overflowing timer delays unknown - [`30936f7`](https://github.com/morluto/rea/commit/30936f76b54902a280d1569b93028a78a34516e4) test(javascript): keep the IR-level overflowing timer assertion - [`e487a52`](https://github.com/morluto/rea/commit/e487a52ac86a4b3fb3f8882f619be88017cf6765) fix(javascript): retain JSON-safe timer facts through CLI and MCP ### 📊 Changes **3 files changed** (+131 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSemanticAnalysis.runtime_boundaries.test.ts` (+17 -0) 📝 `src/domain/javascript/javascriptSemanticAsyncEffects.ts` (+5 -1) ➕ `tests/boundary/mcp/javascriptTimerDelay.test.ts` (+109 -0) </details> ### 📄 Description ## Summary Fixes #3400. A numeric literal such as `1e999` becomes `Infinity` in the parsed AST. The timer fact producer passed it into JSON-backed properties; projecting one timer then failed the file's analysis and discarded unrelated function facts. The existing `timerDelay` owner now emits the established unknown value (`null`) for a non-finite literal. It preserves the timer, method, binding resolution, source range and file digest. Finite values, including `1e308`, remain unchanged. CLI and MCP consume this same representation; no downstream sanitization, schema relaxation or cache is added. A public CLI/stdio-MCP regression covers six timer cases, exact unknown-vs-omitted semantics, an unrelated exported function, source SHA-256, unchanged input and equal Evidence/node identities across adapters. The redundant new graph-only test is replaced by that stronger public workflow; the domain IR test retains its distinct binding-resolution assertion. Existing graph-consumer tests still run. ## Executed validation Pinned baseline **eac296a7d**, Linux x64, Node **24.18.0**, npm **11.16.0**: - **111 targeted tests passed**, covering runtime boundaries, dataflow, graph resources and the real CLI/MCP worker path. Full `npm run check` passed; `docs:check` passed, including **5 consistency tests**. - Integration with newer main **f5d1012fa**, tree `b219b2d6a6d3e8c3adec070ff81028ba1da97a92`: the public CLI/MCP regression passes again, and the real-package workflow retains the same 176 nodes / 4 selected rows with verified cleanup (**21.868 s** elapsed, **19.831 s** CPU, **1,077.8 MiB** peak). Main subsequently added only an unrelated Kuna test (`7b2087e44`), leaving production code unchanged. - The new public regression fails on exact main at the CLI success assertion. Independent real CLI runs reproduce `unreadable_output` / `JSON numbers must be finite` for both overflowing `setTimeout` and `setInterval`: main retains one module node and no timer or `greet`; candidate returns **14 nodes**, the unknown delay and `greet` for each unchanged source. - Six real CLI cases on each revision cover `1e999`, `1e309`, `100`, `1e308`, the `Infinity` identifier and a standalone overflowing literal. Healthy controls retain identical Evidence IDs between main and candidate. Source bytes remain unchanged; all owned temporary roots are empty. - Actual public MCP SDK **2026-07-28** on unmodified installed **fast-deep-equal 3.1.3**, selected `index.js` (**1,177 bytes**, SHA-256 `eb469e206280321a3878f2335ec98aa2104a155079d8ed83a23029098dccd215`): two summary analyses, a batch of **4 selected observation rows**, then full Evidence export. The retained graph has **176 semantic nodes**, including source function `equal`, with stable parent Evidence identity. Coverage remains **partial**: eight unselected files and 137 semantic unknowns are explicit. This is a small real package, not a complex-application performance claim. REA uses static source analysis; selected target files remain unchanged. The issue's original macOS/Node 26 environment was not separately exercised. ## Performance and context One CPU, 8-GiB hard / 7-GiB early process-family memory bounds, no swap. Equivalent completed package workflows include catalog discovery, two summaries, selected facts, Evidence export and shutdown: | Revision | Total elapsed | Family CPU | Peak family memory | First / repeat analysis | | --- | ---: | ---: | ---: | ---: | | Main | 19.856 s | 18.743 s | 1,075.4 MiB | 9.429 / 1.090 s | | Candidate | 20.967 s | 18.640 s | 1,147.9 MiB | 10.341 / 1.110 s | The repeat uses the same MCP session and immutable input; internal reuse is uninstrumented. No new cache is introduced. OS caches and shared-host load are uncontrolled; these samples establish no general speedup or precise latency effect. All completed tasks confirm cleanup and no OOM. The six-case CLI qualification bundles take **19.859 / 24.020 s**, CPU **18.237 / 21.525 s**, peak **384.5 / 384.3 MiB** (main/candidate). They intentionally differ in recovered facts, so their totals are not equivalent successful-workflow speed comparisons. `cl100k_base` estimates: compact input catalog **44,607 / 44,607 tokens**, selected analysis input **245 / 245**; the two summaries cost **2,338 tokens each**, selected facts **3,647**, and complete captured post-connect JSON traffic **732,048 / 732,051**. The **148,881-token** complete Evidence file is retained locally rather than delivered inline. Captured protocol includes output schemas; these are protocol/proxy estimates, not actual model context/usage. Initialization outside capture hooks and downstream prompts are unmeasured. Source selection, summary delivery and requested property keys bound work and inline detail while preserving full Evidence access. ## CI/review assessment and authorized bypass Latest head `e487a52ac`: Codex review completes with **no findings**. No actionable latest-head finding is open. Greptile's new run is still in progress; its earlier 5/5 is not claimed as a review of this head. Fork workflow approvals were supplied, but current classification/readiness/title jobs remain queued without completed test results. The task owner explicitly authorized bypass once independently qualified. Merge uses completed full checks, 111 targeted tests, docs checks, exact-base CLI failures, successful CLI/MCP regression, real-package analysis and newer-main integration. No queued CI or pending Greptile result is claimed as passing; subsequent results remain subject to assessment. Post-merge CI assessment: 35 latest-head checks succeeded; shard 1 failed only the existing `protobufCapture.test.ts` malformed-gRPC-web public workflow at its 30-second test timeout. Exact filtered controls reproduce the same timeout on pre-change main `cf5194f68` and candidate `e487a52ac`; the protobuf workflow is outside this diff. Other shards were cancelled or queued. No full CI pass is claimed. Latest Greptile review is **4/5**. Its outside-diff wrapped-timer cancellation lookup finding targets line 295, unchanged by this PR and already introduced on main in `6183544e8b`. The only production diff here is the `timerDelay` finite-number guard. The separate main concern is acknowledged with source attribution; it is not a bug introduced by this PR and is left outside this fix as the task owner requested. Codex has no findings. ## Author readiness Human owner: @gensokyo-dev The task owner explicitly delegated validation, readiness declarations and merge to this agent. These declarations are supplied under that authorization; no separate new manual human review by the original author is asserted. - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] Shared producer semantics and caller identity preserved; no new authority or schema changes. - [x] Relevant tests, real public workflows, performance and context costs verified; no local reports, binaries, credentials or dependencies in the diff. - [x] Available latest-head CI/review state and actionable findings assessed; queued work and bypass authorization recorded above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:09:08 +00: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
morluto/rea#5749
No description provided.