[PR #1096] [MERGED] fix(browser): keep initiator callsites out of script coordinate guidance #2643

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

📋 Pull Request Information

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

Base: main ← Head: fix/web-runtime-initiator-callsites


📝 Commits (1)

  • c0dfb55 fix(browser): keep initiator callsites out of script coordinate guidance

📊 Changes

3 files changed (+18 additions, -9 deletions)

View changed files

📝 docs/web-runtime.md (+2 -2)
📝 src/domain/webRuntime.test.ts (+6 -1)
📝 src/domain/webRuntime.ts (+10 -6)

📄 Description

Follow-up to #1085. This addresses the review comment posted on #1085 (discussion r4221153214), which merged before the fix was pushed.

Problem

observe_web_execution builds callsites from two sources:

  • script call frames, which carry a script_id;
  • the request's reported Network.Initiator position, which CdpRuntimeRequests records with "" as the script ID. Examples are an image the parser found in HTML, or a module import.

#1085 described every webRuntimeLocationSchema position as relative to "the script's enclosing resource", and the docs' conversion formulas did not exclude initiator callsites. An initiator position points at the initiating resource, such as parser markup, and has no script or resource_start. Converting it for trace_web_source_location is meaningless.

Change

  • line_number/column_number are described as zero-based positions in the resource named by url. With a script_id, that is the script's enclosing resource (the script file, or the HTML document for an inline script). With an empty script_id, it is the initiator's reported position.
  • script_id is described too, and documents the empty initiator case.
  • docs/web-runtime.md explains empty-script-ID callsites and limits the conversion formulas to positions with a nonempty script_id.

Only schema descriptions and docs change; values are unchanged.

Verification

  • npm run test:focused -- src/domain/webRuntime.test.ts tests/acceptance/webRuntimeCli.test.ts: passed. The contract test now also checks the script_id description.
  • 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/1096 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/web-runtime-initiator-callsites` --- ### 📝 Commits (1) - [`c0dfb55`](https://github.com/morluto/rea/commit/c0dfb55a839f1c1246a0f643582b80f056b3973c) fix(browser): keep initiator callsites out of script coordinate guidance ### 📊 Changes **3 files changed** (+18 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/web-runtime.md` (+2 -2) 📝 `src/domain/webRuntime.test.ts` (+6 -1) 📝 `src/domain/webRuntime.ts` (+10 -6) </details> ### 📄 Description Follow-up to #1085. This addresses the review comment posted on #1085 (discussion r4221153214), which merged before the fix was pushed. ## Problem `observe_web_execution` builds callsites from two sources: - script call frames, which carry a `script_id`; - the request's reported `Network.Initiator` position, which `CdpRuntimeRequests` records with `""` as the script ID. Examples are an image the parser found in HTML, or a module import. #1085 described every `webRuntimeLocationSchema` position as relative to "the script's enclosing resource", and the docs' conversion formulas did not exclude initiator callsites. An initiator position points at the initiating resource, such as parser markup, and has no script or `resource_start`. Converting it for `trace_web_source_location` is meaningless. ## Change - `line_number`/`column_number` are described as zero-based positions in the resource named by `url`. With a `script_id`, that is the script's enclosing resource (the script file, or the HTML document for an inline script). With an empty `script_id`, it is the initiator's reported position. - `script_id` is described too, and documents the empty initiator case. - `docs/web-runtime.md` explains empty-script-ID callsites and limits the conversion formulas to positions with a nonempty `script_id`. Only schema descriptions and docs change; values are unchanged. ## Verification - `npm run test:focused -- src/domain/webRuntime.test.ts tests/acceptance/webRuntimeCli.test.ts`: passed. The contract test now also checks the `script_id` description. - `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:33 +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#2643
No description provided.