mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #6239] [Bug] Attached block policy accepts a final capture that becomes service-worker-controlled after its check #3796
Closed
opened 2026-10-31 00:44:08 +00:00 by bsakaguchi
·
1 comment
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#3796
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @coygeek on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6239
Before submitting
Area
Process capture or runtime observation
Observed behavior
With
browser.mode: "connect"andenvironment.service_workers: "block",capture_browser_scenariochecks the selected page for a service-worker controller or registration at the start of each step capture, then takes that step's artifacts without checking again. A service worker registered from another same-origin tab can take control of the selected page while those artifacts are being taken. When that happens during the last step, the scenario succeeds: the final step iscompletedwithcompleteness.status: "complete"andequality_eligible: true, and itsaccessibility,storageand (in most runs)domartifacts contain a response the worker served to the selected page. The output contains no rejection or limitation that reports the worker. When the same thing happens during an earlier step, the next step's check rejects the scenario withservice_worker_blocked.Reproduction
These are the steps as run. They are not minimized. Both tested builds behaved the same way. This reproduced in every
trigger=gaprun (4 of 4).Serve the following four files with
python3 -m http.server <port> --bind 127.0.0.1. Chrome allows service-worker registration on a loopback HTTP origin./probeis a file containingnetwork.sw.js:raceother.html(the second tab; it registers the worker when asked):race.html(the selected page). REA's check callsgetRegistrations()in the page's main world, so the page wraps it to choose when to ask the other tab to register.trigger=gapsignals on the first call that follows a pause of at least 1500 ms, which is the final step's check after the 3000 ms wait. Each final-step capture in these runs took 90–358 ms, well under that gap.trigger=firstsignals on the first call, which is the check right after the start navigation.trigger=nevernever signals. When the page becomes controlled, it fetches/probeand records the result in the DOM and as asessionStoragekey name. The 4,000 rows only make thescreenshotartifact slower.Launch Chrome headless with a fresh profile,
--remote-debugging-port=0, andabout:blank. Read the endpoint fromDevToolsActivePort, and take theabout:blankpage's target id from/json/list.Open the second tab with
PUT /json/new?http://127.0.0.1:<port>/raceother.html.Run
rea capture-browser-scenario scenario.json --format jsonwith:Check the exit status, then the
waitstep'sdomartifact (<p id="out">), whether itsaccessibilityartifact containsservice-worker-intercepted, and the key names in itsstorage.value.session_storage. Repeat withtrigger=firstandtrigger=never.Timer variant, which does not observe REA's check: in
race.html, replace thetrigger/getRegistrationslines withsetTimeout(() => { sessionStorage.setItem("t-signal-" + Math.round(performance.now()), "1"); channel.postMessage("register"); }, Number(new URLSearchParams(location.search).get("delay")));, save it astimer.html, and start attimer.html?delay=<ms>withduration_ms: 500.Expected behavior
docs/browser-scenario-contract.mdlines 18–22 at the tested commit say: "For attached browsers,blockrejects captures when the selected page or its frames are controlled by a service worker or already have a registration, including after navigation. ... Navigation can run destination code before a newly discovered worker is rejected; that rejection does not roll back browser effects." Closed issue #2956, whose fix added the current per-capture check, stated that "a block request should remain meaningful at each capture boundary". The policy could be read as promising only a check at each capture boundary, which the current code performs. However, the documented rule is about the capture itself: it rejects captures taken while the selected page is controlled, and it accepts that destination code can run before the rejection but still promises one. In this case the selected page is controlled while its final step's artifacts are being taken, and they contain content the worker served. The scenario should fail withservice_worker_blocked, as it does when the worker takes control during an earlier step. Alternatively, it should not return those artifacts as a completed, complete, comparison-eligible capture underblock.Impact and scope
Evidence integrity of one step: a successful attached-browser capture under the default
blockpolicy can return a final step whose accessibility, storage and usually DOM artifacts include a service-worker response, while the step reports complete, comparison-eligible completeness and nothing in the output reports the worker. The trigger requires a same-origin registration from outside the selected page (another tab in the attached browser) that takes control during the final step's artifact capture. With an ordinary page timer instead of the deterministic trigger, it occurred in 1 of 12 runs. Earlier steps are caught by the next step's check. Launch mode, other platforms and other browsers were not tested. Attaching to a browser with no other same-origin tabs, or usingbrowser.mode: "launch", avoids the outside registration path used here, but neither workaround was tested.REA version
rea-agents@6.7.0from npm (rea --version:6.7.0), and a source build of292fd532c9e62d0654a5277889f2a25acc96d5f3(also prints6.7.0)Runtime and platform
Node.js v26.12.0; macOS 27.0.1 arm64; headless Google Chrome for Testing 153.0.8010.12 (reported by REA as Chromium 153.0.8010.12)
Target and artifact context
Local loopback HTTP fixture in an attached (connect-mode) browser with a fresh disposable profile; second same-origin tab registers a claiming service worker
Interface
CLI
Earliest failure stage
Capture or observation
Relevant output or evidence
trigger=gap: 3 of 3 source-build runs and 1 of 1 release run exited 0. In all 4 runs, the finalwaitstep'saccessibilityartifact containsservice-worker-intercepted, and itsstorageartifact contains a key such asprobe=service-worker-intercepted;controller=true;t=5134next tot-check-5069. In 3 of the 4 runs, itsdomartifact contains<p id="out">service-worker-intercepted controller=true</p>; in the remaining source-build run the DOM was taken before the page updated and showspending. The step reports"status":"completed","error":nulland"completeness":{"status":"complete","equality_eligible":true,"missing_sections":[],"truncated_sections":[]}. The capture-level completeness isincompleteonly because connect mode always listseventsas missing. In this fixture, the page saw the worker's response 38–65 ms after the signal. The exposure window is longer than that: it covers the whole artifact sequence after the check.trigger=first: 2 of 2 source-build runs and 1 of 1 release run exited 1 withcode: "target_unavailable"andreason: "service_worker_blocked". The worker took control during thescenario_startcapture: that step indetails.partial_observationcontains the worker's response. Thewaitstep's check then rejected the scenario.trigger=never(second tab open, never asked to register): 1 of 1 source-build run exited 0 withpendingin every artifact and no worker key.Timer variant on the source build: 1 of 12 runs (delay 1300 ms) succeeded with no error envelope, and
service-worker-intercepted controller=trueappeared in the final DOM and storage artifacts. 8 runs (delays 700, 900, 1100, 1250, 1350, and 1300 three more times) failed withservice_worker_blocked. 3 runs (1500, 1700, 1900) completed with no worker content in their artifacts. Only the last of the three repeat runs at 1300 ms kept its output file; the other two were observed in the console only.Before the version above,
trigger=gapused a 300 ms gap with a 500 ms wait; it gave the same results (gap 4 of 4 succeeded with worker content, first 3 of 3 rejected, never clean), but a capture can approach 300 ms, so the margin was widened. A still earlier version ofrace.htmlsignalled on the thirdgetRegistrations()call. It gave the same final-step result in 4 of 4 source-build runs, and in one release run with all six artifacts. A second release run requested onlyscreenshot,domandurl; its DOM showedpending, and it requested no artifact that could show whether the worker later took control.Final-step fields from one source-build
trigger=gaprun (exit 0). The fields are copied from the output;session_storage_namesis not an REA field but lists thenamevalues from the step'sartifacts.storage.value.session_storage:The same step's DOM artifact contains
<p id="out">service-worker-intercepted controller=true</p>.Typed outcome or recovery expected
The run should end with
BrowserObservationErrorreasonservice_worker_blocked(code: "target_unavailable"), as thetrigger=firstcontrol does, or otherwise not return worker-influenced artifacts as a completed, complete, comparison-eligible final step. Failing result: withtrigger=gap, the CLI exits 0 and the finalwaitstep iscompletedandcomplete, while its artifacts containservice-worker-intercepted controller=true. Restored result: the same run fails withservice_worker_blocked. Alternatively, it completes, but only with artifacts that showpendingand an uncontrolled page; it never returns a complete final step whose artifacts contain the worker's response. Confirm that the run targeted the final step: thet-check-<ms>key must appear only in the final step'sstorageartifact and not inscenario_start's; if a fix's extra checks make a capture last close to 1500 ms, raise the wait and the gap together. Controls:trigger=firstmust still fail withservice_worker_blocked, andtrigger=nevermust still exit 0 withpendingartifacts, so a fix that rejects every browser with a second same-origin tab does not count as restoration.Analysis or suspected cause
Source-derived reasoning, at the tested commit (not a proposed fix):
PlaywrightScenarioSession.capture()(src/browser/PlaywrightScenarioSession.tslines 446–473) awaitsserviceWorkers.assertBlocked(), thenstorage.settle(), thencapturePlaywrightStepArtifacts(), which takes screenshot, DOM, accessibility, URL, history and storage in sequence. Nothing checks the worker state after the artifacts.src/browser/PlaywrightBrowserScenarioProvider.tscallssession.capture()once per step, so for the final step no later check runs. The policy'sregisterwrapper covers the selected page and its auto-attached iframes. Other same-origin tabs in the attached browser are not covered, and they can register a worker that claims the selected page.Additional context
Related: #2956 (closed) reported that the policy checked only the pre-navigation document, not the captured destination; its fix introduced the per-capture check discussed here. Open PR #5933 changes how
assertBlocked()classifies about:blank, blob: and sandboxed frames; it does not address timing after the check.@XinwangTao commented on GitHub (Oct 22, 2026):
确认这个竞态真实存在:assertBlocked() 之后到 artifact 采集完成之间存在窗口,attached 浏览器里外部同源 tab 注册的 claiming worker 可以在这个窗口接管页面,而最终 step 没有后续检查兜底,导致含 worker 内容的 step 被标记 complete。trigger=gap 4/4、timer 变体 1/12 的比例说明这不是纯理论问题。建议在 capturePlaywrightStepArtifacts() 之后补一次 worker 状态复查(复用 assertBlocked),命中则按 service_worker_blocked 处理;同时保留 trigger=first / trigger=never 两条控制用例防止过度拒绝。若复查放最后导致捕获耗时接近 gap,需同步放宽 wait 与 gap,这点报告里已经写清楚了。