[PR #1097] [MERGED] fix(browser): treat module-import initiator positions as script positions #2646

Closed
opened 2026-10-17 21:08:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1097
Author: @kaoru0822-kitauji
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/web-runtime-script-initiators


📝 Commits (1)

  • 99d31ee fix(browser): treat module-import initiator positions as script positions

📊 Changes

3 files changed (+12 additions, -12 deletions)

View changed files

📝 docs/web-runtime.md (+2 -2)
📝 src/domain/webRuntime.test.ts (+1 -3)
📝 src/domain/webRuntime.ts (+9 -7)

📄 Description

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


🔄 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/1097 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/web-runtime-script-initiators` --- ### 📝 Commits (1) - [`99d31ee`](https://github.com/morluto/rea/commit/99d31ee24ad060babace9eca3325858418e0f55a) fix(browser): treat module-import initiator positions as script positions ### 📊 Changes **3 files changed** (+12 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `docs/web-runtime.md` (+2 -2) 📝 `src/domain/webRuntime.test.ts` (+1 -3) 📝 `src/domain/webRuntime.ts` (+9 -7) </details> ### 📄 Description 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:35 +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#2646
No description provided.