Skip to content

javascript logpoints: a } inside a regular-expression literal or a block comment ends the field early, and a valid message is refused #1359

Backlog

Description

@debugmcpdev

Found on 2026-11-28 while the logpoint path of every engine was being measured for a design note. Measured through the built server on main's JavaScript logpoint splitter (packages/shared/src/utils/js-logpoint.ts).

What happens

The server splits a JavaScript logpoint message into text and {…} fields with its own scanner before it compiles the fields. The scanner does not know JavaScript's comments or regular-expression literals, so a closing brace inside one ends the field early, and the message is refused although it is valid:

  • {/}/.source}: a regular-expression literal that contains }.
  • {x /* } */}: a block comment that contains }.

Expected

Where a field ends is decided by a JavaScript parser, not by counting braces: a parser that can parse one expression starting at an offset and say where it ended. A rule tried in the design work, "the field ends at the first } before which the text compiles", was reviewed twice and is wrong (a } inside a line comment ends the field early and changes which expressions run), so the repair needs a real parser's ranges and is its own small design.

Class: a verdict computed by our own model of a language's syntax (the same class as the Python logpoint check in #1334 and #1346). Path: edge (a regular expression or a comment with a brace inside a logpoint field).

Activity

  1. added
    bug
    javascript
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugjavascript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions