Skip to content

fix(browser): treat module-import initiator positions as script positions - #1097

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/web-runtime-script-initiators
Oct 8, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/web-runtime-script-initiators

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Follow-up to #1096. This addresses its review comment (discussion r4221561065), which was posted after #1096 merged.

Problem

CdpRuntimeRequests records every Network.Initiator position with an empty script_id. That covers parser markup and also script-type initiators such as module imports, whose url is the importing script file. #1096 described every empty-ID callsite as parser markup with "no script position" and limited all conversions to a nonempty script_id. That tells callers to discard a valid external-script coordinate.

Change

  • script_id now says an empty value means no session-script association, so captured source and resource_start cannot be joined. It no longer implies the absence of a position.
  • line_number describes the resource named by url: the script file for an external script, including a module-import initiator, or the HTML document for an inline script or parser markup.
  • In docs/web-runtime.md, the external-script conversion (line_number + 1) applies whenever url is the script file, including empty-script_id initiator positions. The inline conversion still requires a script_id and its resource_start.

Only schema descriptions and docs change.

Verification

  • npm run test:focused -- src/domain/webRuntime.test.ts tests/acceptance/webRuntimeCli.test.ts: passed.
  • npm run check:fast, npm run docs:check

No real Hopper or Ghidra verification was run, because this change does not touch those providers.

🤖 Generated with Claude Code

…ions

An empty script_id also marks a script-type initiator, such as a module
import, whose url is the importing script file. Its position is a real
script position without a session-script association. The previous
wording called every empty-ID callsite parser markup with "no script
position" and excluded it from the external-script conversion. Describe
the empty ID as a missing session-script association, which only rules
out joining captured source or resource_start, and keep the
external-script conversion for script-file positions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed all three files and independently captured Chrome 153 CDP events for parser markup plus inline/external module imports. An empty script ID does not erase the reported resource position; the revised external conversion and inline association requirements match those observations. Values remain unchanged. The Apple DMG cleanup failure is in unchanged production code and is being investigated; all exact-head CI must pass before merge.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit ae0630a into main Oct 8, 2026
44 of 45 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/web-runtime-script-initiators branch October 8, 2026 17:00
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…nitiators

fix(browser): treat module-import initiator positions as script positions
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto morluto added the area: evidence Evidence, artifacts, and reconstruction label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants