Skip to content

fix(javascript): keep nonfinite values outside JSON lattice - #673

Closed
rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-nonfinite-values-20261006
Closed

rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-nonfinite-values-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

What changed

Keep nonfinite numbers outside the JSON-compatible static value lattice. NaN/Infinity expression results become unknown, and nonfinite numeric literals are not promoted to exact JSON primitives. A candidate set containing an unsupported number remains unknown instead of discarding that branch.

Real application reproduction

A real owned main.mjs with +"not-a-number", 1e308 + 1e308, or 1e309 previously caused the complete built public analyzeJavaScriptApplication workflow to return AnalysisProtocolError while validating its semantic graph. The repaired workflow succeeds, preserves those values as unknown, and keeps the unrelated finite 1 + 2 literal as 3. A separate native Node classification confirms NaN/positive Infinity; JSON's serialization of those numbers as null is not treated as evidence that their values are null.

Verification

  • Five new nonfinite/uncertain-branch regression cases fail before.
  • Focused dataflow + graph tests: 28 passed after.
  • npm run check, npm run check:fast, npm run build:cached passed.
  • Built public analysis: no protocol error; unsupported values have no exact graph literal; finite control preserved.
  • Native Node classification and git diff --check passed.

No new tool/schema or provider authority. Hopper/Ghidra were not exercised: this changes static JavaScript value normalization. AI assistance was used for investigation, implementation and verification.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve: nonfinite values exit the JSON lattice to unknown at the primitive set and NumericLiteral boundary, preventing AnalysisProtocolError/JSON-null confusion. 4 nonfinite + uncertain-branch cases covered. Checks green.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit.

@morluto morluto closed this Oct 6, 2026
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(javascript): keep nonfinite values outside JSON lattice.” I appreciate your contribution to REA.

@morluto morluto added bug Something isn't working area: domain Domain logic, errors, and pure functions labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants