Skip to content

[PoC / do-not-merge] R30: verify clean per-instance receiver attribution in CI - #1206

Draft
vringar wants to merge 1 commit into
feat/stealth-js-instrument-v2from
poc/clean-per-instance
Draft

[PoC / do-not-merge] R30: verify clean per-instance receiver attribution in CI#1206
vringar wants to merge 1 commit into
feat/stealth-js-instrument-v2from
poc/clean-per-instance

Conversation

@vringar

@vringar vringar commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Proof-of-concept — DO NOT MERGE (R30 verification only)

This draft exists solely so CI can execute test_poc_receiver_attribution.py — the sandbox couldn't spawn the browser to run it end-to-end.

What it tests: whether the stealth instrument can record per-instance receiver attribution — via a module-local WeakMap<receiver, id> held in the isolated content-script world, emitting <Interface>#<id> in the existing receiver column — while staying clean/undetectable (no page own-property, no leaked global, prototype wrapper byte-for-byte unchanged).

Why: to empirically disprove (or vindicate) ADR-0001 gap #2's claim that per-instance attribution requires mutating the instance. The crux (is the Xray this a stable WeakMap key?) resolves yes by SpiderMonkey's per-compartment wrapper-map guarantee; this PR is the executed confirmation the maintainer asked for.

Read the result as: test_poc_receiver_attribution.py green = 2 distinct XMLHttpRequest#<n> ids, a twice-called instance collapsing to one id, and the clean/undetectable vectors all passing. Other test failures are expected — the PoC changes the receiver emission format, which is throwaway, not production.

DO NOT MERGE. This is a measurement/verification vehicle for an ADR decision; the real follow-up (if disproven) is a small ADR wording correction, not this code.

@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch 2 times, most recently from e86186a to 062e07c Compare June 21, 2026 08:02
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch 2 times, most recently from 5c2d45b to 2d98686 Compare July 2, 2026 22:58
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch 12 times, most recently from a749a6c to 77b435c Compare July 11, 2026 22:34
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch from 77b435c to 8ea8dcc Compare July 20, 2026 22:54
@vringar
vringar force-pushed the poc/clean-per-instance branch from 2c6de9e to 369e1b4 Compare July 20, 2026 22:54
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/stealth-js-instrument-v2@6a6200c). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                        @@
##             feat/stealth-js-instrument-v2    #1206   +/-   ##
================================================================
  Coverage                                 ?   53.79%           
================================================================
  Files                                    ?       42           
  Lines                                    ?     4924           
  Branches                                 ?        0           
================================================================
  Hits                                     ?     2649           
  Misses                                   ?     2275           
  Partials                                 ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vringar
vringar force-pushed the poc/clean-per-instance branch from 369e1b4 to 780ab44 Compare July 21, 2026 17:11
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch from 8ea8dcc to 31ea6f3 Compare July 21, 2026 17:49
@vringar
vringar force-pushed the poc/clean-per-instance branch 2 times, most recently from 163f594 to 652c143 Compare July 26, 2026 15:19
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch from 31ea6f3 to a396765 Compare July 26, 2026 15:19
@vringar
vringar force-pushed the poc/clean-per-instance branch from 652c143 to 094a1e3 Compare August 2, 2026 13:08
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch 2 times, most recently from 14de4fb to 9cc1d8c Compare August 2, 2026 15:51
@vringar
vringar force-pushed the poc/clean-per-instance branch from 094a1e3 to 7191387 Compare August 2, 2026 15:51
…p on Xray this

Proof-of-construction for ADR-0001 gap #2 ("lose the receiver"). Adds a
module-local WeakMap<receiver,id> keyed on the Xray-wrapped page object held in
the isolated content-script world, emitting a per-instance id in the receiver
column. No page mutation, no leaked globals, prototype wrapper unchanged.

Scratch/PoC change — not for merge. See
datadir/poc-clean-per-instance-attribution.md for the verdict and the one
remaining real-browser run.
@vringar
vringar force-pushed the feat/stealth-js-instrument-v2 branch from 9cc1d8c to c282d53 Compare August 2, 2026 19:19
@vringar
vringar force-pushed the poc/clean-per-instance branch from 7191387 to 8d1a65b Compare August 2, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant