Skip to content

feat(server): wire SensorNativeSolver into solve dispatcher - #15

Merged
KeyCode17 merged 1 commit into
mainfrom
v1.8.0/p1-native-overlay
May 19, 2026
Merged

feat(server): wire SensorNativeSolver into solve dispatcher#15
KeyCode17 merged 1 commit into
mainfrom
v1.8.0/p1-native-overlay

Conversation

@KeyCode17

Copy link
Copy Markdown
Owner

Summary

v1.8.0 phase 1 (ADR-0024). Wires the existing native cipher core into /v1/solve via an opt-in PX_NATIVE_PROFILES env flag and a NativeFirstHandler decorator.

Wiring

PX_NATIVE_PROFILES=pedidosya.com.ar=px-native/profiles/eT15wiaE.toml

  • Loads the tenant profile from disk.
  • Instantiates SensorNativeSolver.
  • Wraps it as a ChallengeHandler via NativePxHandler.
  • Decorates the existing per-domain entry in the routing dispatcher with NativeFirstHandler (native first, fall back to whatever was already wired — Camoufox or the PX default).

If the env flag is unset, behaviour is unchanged from v1.7.0.

Tests

  • 129 workspace tests pass, 0 failures (2 new in native_first, 1 new in handler, 3 new in native_routes).
  • cargo clippy --workspace --all-targets --all-features -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented clean.
  • All files ≤200 LOC (handler.rs split into handler.rs + native_first.rs).

What this does NOT prove

This PR ships only the wiring. No live _px3 has been issued by the native path yet, and we have no XHR-hook ground truth to calibrate default_batch against. P2 (XHR hook in Camoufox) and P3 (field grammar calibration) follow.

🤖 Generated with Claude Code

ADR-0024 v1.8.0 P1. Adds a `PX_NATIVE_PROFILES` env loader that parses
`domain=path/to/profile.toml` pairs and decorates the existing
per-domain solve handler with a `NativeFirstHandler` (native first,
fall back to Camoufox/PerimeterxHandler on error or non-solved
status).

px-native:
- `infrastructure/handler.rs` — `NativePxHandler` wraps a
  `SensorNativeSolver` as a `ChallengeHandler`. Default fingerprint
  embedded for now; real fingerprints flow in from the SolveContext
  once the synthetic-user pool is wired (v1.9+).
- `infrastructure/native_first.rs` — `NativeFirstHandler` decorator.
- `lib.rs` re-exports `SensorNativeSolver`.
- Cargo: depends on `px-pipeline`; adds `tokio` as a dev-dep.

px-server:
- `bootstrap/native_routes.rs` — `parse_native_routes` + overlay.
- `bootstrap/dispatchers.rs` — `build_dispatchers` takes a third
  arg `Vec<NativeRoute>` and applies the overlay regardless of CF
  route presence.
- `application/routing.rs` — exposes `handler_for(domain)` and
  `default_handler()` so overlays can wrap the existing route.
- `main.rs` reads `PX_NATIVE_PROFILES` at startup.

Wiring is conservative — operator must opt-in via env. Camoufox
path is untouched. 129 workspace tests pass; clippy clean.

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