Skip to content

feat(native): cipher accepted by PX collector (live-validated) - #19

Merged
KeyCode17 merged 1 commit into
mainfrom
v1.8.0/live-calibration
May 19, 2026
Merged

feat(native): cipher accepted by PX collector (live-validated)#19
KeyCode17 merged 1 commit into
mainfrom
v1.8.0/live-calibration

Conversation

@KeyCode17

Copy link
Copy Markdown
Owner

What's proven (live, via AR proxy from this machine)

  1. PX collector accepts our cipher output. POST to collector-PXeT15wiaE.px-cloud.net/api/v2/collector with body produced by encrypt_sensor(default_batch(), pf, cu) returns HTTP 200 + sensor ACK ({"do":["sid|…","cls|…","sts|…","drc|…"]}).
  2. Calibrate is at 0/0 missing. px-cli calibrate against a live Camoufox capture shows [AzNweUVTcEw=] missing=0 and [egoJQD9rDHs=] missing=0. The native batch shape matches the runtime byte-for-byte (modulo per-call values).

What's still blocked

Customer-domain /eT15wiaE/xhr/b/s returns 403 from Cloudflare (cf-mitigated: challenge). That's the path that issues _px3, and CF blocks any client lacking cf_clearance + __cf_bm. A pure-native end-to-end still needs a Camoufox warmup for those cookies. Hybrid (Camoufox seeds CF cookies, native rotates _px3 on top) is the realistic v2 path.

Changes

  • sensor_capture_hook.jssendBeacon hook with Blob.text() reads, Array.prototype.join hook (since hY() builds JSON manually), diagnostic counters.
  • sensor_capture.rs — spreads synthetic mouse/scroll/keydown nudges; pagehide flush before reading captures.
  • px-native::cipher::decrypt_payload_lossy — strips non-base64, b64-decode, XOR(IS). Recovers the readable JSON prefix.
  • px-cli calibrate — falls back to lossy-decrypting xhr_sends bodies + regex vocab extract when plaintext_events is empty.
  • events::batch::default_batch — rewritten from ground truth: 2 tags + ~90 field keys, all observed in a real capture.

132 tests pass; clippy clean; captures .gitignored.

🤖 Generated with Claude Code

Live run results (curl probes against pedidosya.com.ar via AR proxy):

* PX collector (collector-PXeT15wiaE.px-cloud.net/api/v2/collector
  and /b/s) returns **HTTP 200 + sensor ACK** for our `encrypt_sensor`
  output. The cipher round-trips cleanly to the wire format the
  runtime uses.
* Customer-domain `/eT15wiaE/xhr/b/s` returns 403 from Cloudflare
  (cf-mitigated: challenge). The path that issues `_px3` is behind
  CF, so a pure-native end-to-end still needs a Camoufox warmup for
  cf_clearance + __cf_bm. Hybrid is the realistic shape.

Iteration that got us here:

* `sensor_capture_hook.js`: hooks `sendBeacon` (the actual PX
  channel — XHR was a red herring) including async Blob.text()
  reads. Also hooks `Array.prototype.join` since `hY()` builds JSON
  manually instead of calling `JSON.stringify`. Diagnostic counters.
* `sensor_capture.rs`: spreads mouse/scroll/keydown nudges across
  the wait; triggers pagehide so PX flushes pending sensors.
* `decrypt_payload_lossy`: strips non-base64 chars (heuristic vQ
  inverse), then b64-decode → XOR(IS=50). Recovers JSON prefix.
* `px-cli calibrate`: falls back to lossy-decrypting `xhr_sends`
  bodies + regex extracting tag/key vocab when plaintext_events is
  empty.
* `events::batch::default_batch`: rewritten using ground truth.
  Two stable tags (`AzNweUVTcEw=`, `egoJQD9rDHs=`) and ~90 field
  keys. Calibrate: 0 missing tags, 0 missing keys.

Captures gitignored (proxy egress + session fingerprints).

132 workspace tests pass; clippy clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@KeyCode17
KeyCode17 merged commit a751d0b into main May 19, 2026
6 checks passed
@KeyCode17
KeyCode17 deleted the v1.8.0/live-calibration branch May 19, 2026 21: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