fingerprint-coherence 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fingerprint_coherence-0.2.0/.github/workflows/ci.yml +31 -0
- fingerprint_coherence-0.2.0/.github/workflows/release.yml +54 -0
- fingerprint_coherence-0.2.0/.gitignore +12 -0
- fingerprint_coherence-0.2.0/CHANGELOG.md +26 -0
- fingerprint_coherence-0.2.0/LICENSE +21 -0
- fingerprint_coherence-0.2.0/PKG-INFO +305 -0
- fingerprint_coherence-0.2.0/README.md +270 -0
- fingerprint_coherence-0.2.0/docs/AFFILIATE.md +52 -0
- fingerprint_coherence-0.2.0/docs/FAQ.md +21 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/__init__.py +22 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/checks.py +297 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/cli.py +257 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/codes.py +40 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/collector.py +156 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/config_loader.py +60 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/deal.py +15 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/engine.py +116 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/mlx.py +234 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/models.py +100 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/rules/__init__.py +1 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/rules/default.yaml +69 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/rulesets/__init__.py +1 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/rulesets/android-chrome.yaml +84 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/rulesets/mac-safari.yaml +84 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/rulesets/windows-chrome.yaml +84 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/schema.py +152 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/scorer.py +29 -0
- fingerprint_coherence-0.2.0/fingerprint_coherence/ua.py +37 -0
- fingerprint_coherence-0.2.0/pyproject.toml +84 -0
- fingerprint_coherence-0.2.0/tests/__init__.py +0 -0
- fingerprint_coherence-0.2.0/tests/checks/test_chrome_version_hints.py +66 -0
- fingerprint_coherence-0.2.0/tests/checks/test_client_hints_mobile.py +50 -0
- fingerprint_coherence-0.2.0/tests/checks/test_client_hints_platform.py +48 -0
- fingerprint_coherence-0.2.0/tests/checks/test_dpr_screen_sanity.py +53 -0
- fingerprint_coherence-0.2.0/tests/checks/test_mobile_screen_alignment.py +65 -0
- fingerprint_coherence-0.2.0/tests/checks/test_platform_matches_ua.py +54 -0
- fingerprint_coherence-0.2.0/tests/checks/test_screen_avail_bounds.py +67 -0
- fingerprint_coherence-0.2.0/tests/checks/test_timezone_language.py +59 -0
- fingerprint_coherence-0.2.0/tests/checks/test_touch_points_mobile.py +46 -0
- fingerprint_coherence-0.2.0/tests/checks/test_ua_required.py +50 -0
- fingerprint_coherence-0.2.0/tests/checks/test_webgl_os_alignment.py +55 -0
- fingerprint_coherence-0.2.0/tests/fixtures/incoherent.yaml +10 -0
- fingerprint_coherence-0.2.0/tests/fixtures/mlx_profile_coherent.json +29 -0
- fingerprint_coherence-0.2.0/tests/fixtures/mlx_profile_incoherent.json +22 -0
- fingerprint_coherence-0.2.0/tests/helpers.py +35 -0
- fingerprint_coherence-0.2.0/tests/test_cli.py +109 -0
- fingerprint_coherence-0.2.0/tests/test_codes.py +9 -0
- fingerprint_coherence-0.2.0/tests/test_collector.py +47 -0
- fingerprint_coherence-0.2.0/tests/test_engine.py +58 -0
- fingerprint_coherence-0.2.0/tests/test_mlx.py +100 -0
- fingerprint_coherence-0.2.0/tests/test_mlx_cli.py +95 -0
- fingerprint_coherence-0.2.0/tests/test_rulesets.py +50 -0
- fingerprint_coherence-0.2.0/tests/test_schema.py +25 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
test:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
|
|
21
|
+
- name: Install package and dev deps
|
|
22
|
+
run: |
|
|
23
|
+
python -m pip install --upgrade pip
|
|
24
|
+
pip install -e ".[dev]"
|
|
25
|
+
playwright install chromium
|
|
26
|
+
|
|
27
|
+
- name: Ruff
|
|
28
|
+
run: ruff check .
|
|
29
|
+
|
|
30
|
+
- name: Pytest
|
|
31
|
+
run: pytest
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up Python 3.12
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
|
|
19
|
+
- name: Install package and dev deps
|
|
20
|
+
run: |
|
|
21
|
+
python -m pip install --upgrade pip
|
|
22
|
+
pip install -e ".[dev]"
|
|
23
|
+
playwright install chromium
|
|
24
|
+
|
|
25
|
+
- name: Ruff
|
|
26
|
+
run: ruff check .
|
|
27
|
+
|
|
28
|
+
- name: Pytest
|
|
29
|
+
run: pytest
|
|
30
|
+
|
|
31
|
+
publish:
|
|
32
|
+
needs: test
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Set up Python 3.12
|
|
38
|
+
uses: actions/setup-python@v5
|
|
39
|
+
with:
|
|
40
|
+
python-version: "3.12"
|
|
41
|
+
|
|
42
|
+
- name: Install build tools
|
|
43
|
+
run: python -m pip install --upgrade pip build twine
|
|
44
|
+
|
|
45
|
+
- name: Build
|
|
46
|
+
run: python -m build
|
|
47
|
+
|
|
48
|
+
- name: Twine check
|
|
49
|
+
run: twine check dist/*
|
|
50
|
+
|
|
51
|
+
- name: Publish to PyPI
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
53
|
+
with:
|
|
54
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v0.2.0 — 2026-06-11
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `fp-coherence mlx-profile --profile-id UUID` — fetch MLX fingerprint via `api.multilogin.com`, run ruleset, report pre-production violations (`[mlx]` extra, raw httpx)
|
|
8
|
+
- Auto ruleset inference from profile `os_type` (windows-chrome / mac-safari / android-chrome)
|
|
9
|
+
- MLX tests with `httpx.MockTransport` and fixture API profile shapes
|
|
10
|
+
|
|
11
|
+
- Bundled platform rulesets: `windows-chrome`, `mac-safari`, `android-chrome`
|
|
12
|
+
- `fp-coherence audit --ruleset RULESET --config my.yaml` (config file or positional path)
|
|
13
|
+
- Stable violation codes (`E001` UA_OS_MISMATCH through `E011` UA_INVALID)
|
|
14
|
+
- `fp-coherence export-schema -o schema.json` (profile, audit, ruleset JSON Schema)
|
|
15
|
+
- 10+ unit tests per built-in check type
|
|
16
|
+
- README: common violations when using playwright-stealth
|
|
17
|
+
- GitHub Actions CI (Python 3.10–3.12)
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Audit JSON and text output include `code` on each violation
|
|
22
|
+
- `mac-safari` ruleset disables Chromium Client Hints checks (Safari-appropriate)
|
|
23
|
+
|
|
24
|
+
## v0.1.0 — 2026-06-01
|
|
25
|
+
|
|
26
|
+
- Initial release: YAML rule engine, CLI audit/score/from-playwright, coherence scoring
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fingerprint-coherence contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fingerprint-coherence
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Contradictory UA and screen signals get profiles flagged — lint fingerprints before create.
|
|
5
|
+
Project-URL: Homepage, https://github.com/fingerprint-coherence/fingerprint-coherence
|
|
6
|
+
Project-URL: Documentation, https://github.com/fingerprint-coherence/fingerprint-coherence#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/fingerprint-coherence/fingerprint-coherence
|
|
8
|
+
Project-URL: Issues, https://github.com/fingerprint-coherence/fingerprint-coherence/issues
|
|
9
|
+
Author: fingerprint-coherence contributors
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: canvas-fingerprint,client-hints,coherence-linter,fingerprint-coherence,playwright-fingerprint,ruleset-audit,screen-fingerprint,timezone-mismatch,ua-validation,user-agent-consistency,webgl-fingerprint,yaml-fingerprint
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: click>=8.1
|
|
25
|
+
Requires-Dist: playwright>=1.40
|
|
26
|
+
Requires-Dist: pyyaml>=6.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: httpx>=0.27; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.8; extra == 'dev'
|
|
32
|
+
Provides-Extra: mlx
|
|
33
|
+
Requires-Dist: httpx>=0.27; extra == 'mlx'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# fingerprint-coherence
|
|
37
|
+
|
|
38
|
+
Python 3.10+ | MLX optional · [Compatibility](../packages/COMPATIBILITY.md)
|
|
39
|
+
|
|
40
|
+
Audit browser fingerprint configurations for **internal coherence** — do UA, `navigator.platform`, screen size, timezone, languages, WebGL, and Client Hints tell the same story?
|
|
41
|
+
|
|
42
|
+
Returns a **0–100 coherence score** and human-readable violations. No antidetect browser required for `audit` and `score`; optional live collection via Playwright.
|
|
43
|
+
|
|
44
|
+
## Problem
|
|
45
|
+
|
|
46
|
+
JS-level fingerprint spoofing often creates contradictions:
|
|
47
|
+
|
|
48
|
+
- iPhone UA with `Win32` platform and 1920×1080 screen
|
|
49
|
+
- `America/New_York` timezone with `ja-JP` as the primary language
|
|
50
|
+
- `sec-ch-ua-platform: "Windows"` on a macOS user agent
|
|
51
|
+
- Apple WebGL renderer on a Windows UA string
|
|
52
|
+
|
|
53
|
+
Bot-detection stacks hunt these mismatches. `fp-coherence` gives developers a fast lint for stealth configs **before** they hit production traffic.
|
|
54
|
+
|
|
55
|
+
## pip install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install fingerprint-coherence
|
|
59
|
+
playwright install chromium # only for from-playwright
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Development:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install fingerprint-coherence[mlx]
|
|
66
|
+
|
|
67
|
+
# Audit MLX Cloud profile before production
|
|
68
|
+
export MLX_TOKEN=your_bearer_token
|
|
69
|
+
fp-coherence mlx-profile --profile-id PROFILE_UUID --strict
|
|
70
|
+
|
|
71
|
+
pip install fingerprint-coherence[dev]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Quick start
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Audit a YAML config with a platform ruleset
|
|
78
|
+
fp-coherence audit --ruleset windows-chrome --config my-profile.yaml
|
|
79
|
+
|
|
80
|
+
# Or pass the config as a positional argument
|
|
81
|
+
fp-coherence audit my-profile.yaml --ruleset windows-chrome --json --strict
|
|
82
|
+
|
|
83
|
+
# Lint explicit fields (no config file)
|
|
84
|
+
fp-coherence audit \
|
|
85
|
+
--ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ..." \
|
|
86
|
+
--screen 1920x1080 \
|
|
87
|
+
--timezone America/New_York \
|
|
88
|
+
--platform Win32 \
|
|
89
|
+
--lang en-US
|
|
90
|
+
|
|
91
|
+
# Export JSON Schema for CI validation
|
|
92
|
+
fp-coherence export-schema -o schema.json
|
|
93
|
+
|
|
94
|
+
# Collect from a real Playwright launch
|
|
95
|
+
fp-coherence from-playwright --url about:blank --ruleset windows-chrome
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## CLI
|
|
99
|
+
|
|
100
|
+
| Command | Description |
|
|
101
|
+
|---------|-------------|
|
|
102
|
+
| `fp-coherence audit --config my.yaml --ruleset windows-chrome` | Audit YAML config with platform ruleset |
|
|
103
|
+
| `fp-coherence audit --ua ... --screen WxH` | Audit CLI-provided fields |
|
|
104
|
+
| `fp-coherence from-playwright --url URL` | Collect live signals + audit |
|
|
105
|
+
| `fp-coherence score config.yaml --ruleset mac-safari` | Score config against ruleset |
|
|
106
|
+
| `fp-coherence export-schema -o schema.json` | Export JSON Schema bundle |
|
|
107
|
+
| `fp-coherence mlx-profile --profile-id UUID` | Fetch MLX fingerprint via API + audit (`[mlx]`) |
|
|
108
|
+
|
|
109
|
+
### Options
|
|
110
|
+
|
|
111
|
+
- `--ruleset NAME\|PATH` — built-in (`windows-chrome`, `mac-safari`, `android-chrome`) or custom YAML path
|
|
112
|
+
- `--json` — machine-readable output (includes violation `code` fields)
|
|
113
|
+
- `--strict` — exit `1` when violations exist
|
|
114
|
+
|
|
115
|
+
### Built-in rulesets
|
|
116
|
+
|
|
117
|
+
| Ruleset | Use when |
|
|
118
|
+
|---------|----------|
|
|
119
|
+
| `windows-chrome` | Desktop Windows + Chromium / Chrome |
|
|
120
|
+
| `mac-safari` | macOS Safari (Client Hints checks disabled) |
|
|
121
|
+
| `android-chrome` | Mobile Android + Chrome |
|
|
122
|
+
|
|
123
|
+
Shipped under `fingerprint_coherence/rulesets/`. Custom rulesets use the same YAML shape as `default.yaml`.
|
|
124
|
+
|
|
125
|
+
### Violation codes
|
|
126
|
+
|
|
127
|
+
| Code | Name | Check |
|
|
128
|
+
|------|------|-------|
|
|
129
|
+
| `E001` | UA_OS_MISMATCH | `platform_matches_ua` |
|
|
130
|
+
| `E002` | SCREEN_IMPOSSIBLE | `mobile_screen_alignment` |
|
|
131
|
+
| `E003` | TIMEZONE_LANG_MISMATCH | `timezone_language` |
|
|
132
|
+
| `E004` | CH_PLATFORM_MISMATCH | `client_hints_platform` |
|
|
133
|
+
| `E005` | CH_MOBILE_MISMATCH | `client_hints_mobile` |
|
|
134
|
+
| `E006` | CHROME_VERSION_MISMATCH | `chrome_version_hints` |
|
|
135
|
+
| `E007` | WEBGL_OS_MISMATCH | `webgl_os_alignment` |
|
|
136
|
+
| `E008` | SCREEN_AVAIL_OVERFLOW | `screen_avail_bounds` |
|
|
137
|
+
| `E009` | TOUCH_POINTS_MISMATCH | `touch_points_mobile` |
|
|
138
|
+
| `E010` | DPR_IMPLAUSIBLE | `dpr_screen_sanity` |
|
|
139
|
+
| `E011` | UA_INVALID | `ua_required` (empty or HeadlessChrome) |
|
|
140
|
+
|
|
141
|
+
Filter in CI: `jq '.violations[] | select(.code == "E001")' audit.json`
|
|
142
|
+
|
|
143
|
+
### Exit codes
|
|
144
|
+
|
|
145
|
+
| Code | Meaning |
|
|
146
|
+
|------|---------|
|
|
147
|
+
| `0` | No violations (or non-strict mode) |
|
|
148
|
+
| `1` | Violations found with `--strict` |
|
|
149
|
+
| `2` | Runtime error |
|
|
150
|
+
|
|
151
|
+
## YAML config format
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ..."
|
|
155
|
+
platform: "Win32"
|
|
156
|
+
screen: 1920x1080
|
|
157
|
+
timezone: America/New_York
|
|
158
|
+
languages:
|
|
159
|
+
- en-US
|
|
160
|
+
webgl_vendor: "Google Inc. (NVIDIA)"
|
|
161
|
+
webgl_renderer: "ANGLE (NVIDIA, ...)"
|
|
162
|
+
client_hints:
|
|
163
|
+
sec_ch_ua: '"Chromium";v="120", "Google Chrome";v="120"'
|
|
164
|
+
sec_ch_ua_platform: '"Windows"'
|
|
165
|
+
sec_ch_ua_mobile: "?0"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Rule engine
|
|
169
|
+
|
|
170
|
+
Bundled ruleset (`fingerprint_coherence/rules/default.yaml`) checks:
|
|
171
|
+
|
|
172
|
+
| Rule | What it validates |
|
|
173
|
+
|------|-------------------|
|
|
174
|
+
| `platform_matches_ua` | `navigator.platform` vs UA OS family |
|
|
175
|
+
| `mobile_screen_alignment` | Mobile UA vs desktop screen widths |
|
|
176
|
+
| `timezone_language` | IANA timezone vs primary language |
|
|
177
|
+
| `client_hints_platform` | `sec-ch-ua-platform` vs UA |
|
|
178
|
+
| `client_hints_mobile` | `sec-ch-ua-mobile` vs form factor |
|
|
179
|
+
| `chrome_version_hints` | Chromium version in UA vs Client Hints |
|
|
180
|
+
| `webgl_os_alignment` | WebGL vendor/renderer vs claimed OS |
|
|
181
|
+
| `screen_avail_bounds` | `availWidth/Height` ≤ screen size |
|
|
182
|
+
| `touch_points_mobile` | `maxTouchPoints` vs mobile/desktop UA |
|
|
183
|
+
| `dpr_screen_sanity` | `devicePixelRatio` plausibility |
|
|
184
|
+
|
|
185
|
+
Custom rulesets reference built-in check names:
|
|
186
|
+
|
|
187
|
+
```yaml
|
|
188
|
+
rules:
|
|
189
|
+
- id: my_rule
|
|
190
|
+
severity: high
|
|
191
|
+
check: platform_matches_ua
|
|
192
|
+
enabled: true
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Scoring
|
|
196
|
+
|
|
197
|
+
Start at **100**, deduct by severity: high **−18**, medium **−10**, low **−5**.
|
|
198
|
+
|
|
199
|
+
| Grade | Score |
|
|
200
|
+
|-------|-------|
|
|
201
|
+
| `coherent` | ≥ 85 |
|
|
202
|
+
| `minor-drift` | 65–84 |
|
|
203
|
+
| `inconsistent` | 40–64 |
|
|
204
|
+
| `contradictory` | < 40 |
|
|
205
|
+
|
|
206
|
+
## API
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
from fingerprint_coherence import CoherenceEngine, FingerprintProfile
|
|
210
|
+
|
|
211
|
+
profile = FingerprintProfile(
|
|
212
|
+
user_agent="Mozilla/5.0 (iPhone; ...) ...",
|
|
213
|
+
platform="Win32",
|
|
214
|
+
screen_width=1920,
|
|
215
|
+
screen_height=1080,
|
|
216
|
+
timezone="America/New_York",
|
|
217
|
+
languages=["en-US"],
|
|
218
|
+
)
|
|
219
|
+
result = CoherenceEngine().audit(profile)
|
|
220
|
+
print(result.score, result.grade)
|
|
221
|
+
for v in result.violations:
|
|
222
|
+
print(v.code, v.rule_id, v.message)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Common violations when using playwright-stealth
|
|
226
|
+
|
|
227
|
+
Libraries like `playwright-stealth` patch individual APIs at runtime. That often fixes `navigator.webdriver` but leaves **cross-signal drift** that `fp-coherence` catches:
|
|
228
|
+
|
|
229
|
+
| Symptom | Typical cause | Code |
|
|
230
|
+
|---------|---------------|------|
|
|
231
|
+
| `HeadlessChrome` still in UA | Stealth plugin not applied before first navigation | `E011` |
|
|
232
|
+
| iPhone UA + `Win32` platform | UA overridden, `navigator.platform` left default | `E001` |
|
|
233
|
+
| Mobile UA + 1920×1080 viewport | Desktop viewport with mobile UA string | `E002` |
|
|
234
|
+
| Windows UA + `sec-ch-ua-platform: "Linux"` | Client Hints not patched to match UA | `E004` |
|
|
235
|
+
| Desktop UA + `sec-ch-ua-mobile: ?1` | Mobile hint left at Chromium default | `E005` |
|
|
236
|
+
| Chrome 120 UA + `v="119"` in sec-ch-ua | Version bump in UA only, hints stale | `E006` |
|
|
237
|
+
| Windows UA + Apple WebGL renderer | WebGL override from wrong OS template | `E007` |
|
|
238
|
+
| `availWidth` > `screen.width` | Taskbar/chrome UI math wrong in screen spoof | `E008` |
|
|
239
|
+
| Android UA + `maxTouchPoints: 0` | Touch API not patched for mobile profile | `E009` |
|
|
240
|
+
| Pixel 7 viewport + `devicePixelRatio: 1` | DPR not aligned with mobile screen | `E010` |
|
|
241
|
+
|
|
242
|
+
**Workflow:** export your intended YAML profile, run `fp-coherence from-playwright --ruleset android-chrome`, compare violations against the target config, then fix the highest-severity codes first (`E001`, `E002`, `E004`, `E007`).
|
|
243
|
+
|
|
244
|
+
## JS spoofing vs profile-level fingerprints
|
|
245
|
+
|
|
246
|
+
**This tool measures logical consistency**, not whether spoofing evades detection.
|
|
247
|
+
|
|
248
|
+
Patching individual JS APIs (`navigator.webdriver`, canvas noise, WebGL overrides) frequently leaves **cross-signal contradictions** — one property updated, another forgotten. That is exactly what `fp-coherence` surfaces.
|
|
249
|
+
|
|
250
|
+
**Antidetect browsers** (e.g. Multilogin X, GoLogin) manage fingerprints at the **profile level** — OS, screen, timezone, WebGL, and Client Hints are provisioned together, which reduces internal drift compared to ad-hoc Playwright patches.
|
|
251
|
+
|
|
252
|
+
Use `fp-coherence` to:
|
|
253
|
+
|
|
254
|
+
1. Lint YAML configs before loading them into automation
|
|
255
|
+
2. Compare a patched Playwright launch (`from-playwright`) against your intended profile
|
|
256
|
+
3. Regression-test rule changes in CI with `--strict`
|
|
257
|
+
|
|
258
|
+
## Production
|
|
259
|
+
|
|
260
|
+
Partner offers, eligibility, and disclosure: [docs/AFFILIATE.md](docs/AFFILIATE.md).
|
|
261
|
+
|
|
262
|
+
At production scale, lint YAML profiles with `fp-coherence` before `profile-factory mlx-create`, then validate live sessions with [playwright-cdp-probe](../playwright-cdp-probe/) on Launcher CDP ports.
|
|
263
|
+
|
|
264
|
+
## Limitations
|
|
265
|
+
|
|
266
|
+
- **Heuristic rules** — timezone/language mapping is simplified, not exhaustive.
|
|
267
|
+
- **Client Hints** — only available in Chromium; `from-playwright` may return null hints in some builds.
|
|
268
|
+
- **Not a bypass tool** — high coherence ≠ undetectable; low coherence ≠ instant block.
|
|
269
|
+
- **No canvas/font audit** — focuses on UA, screen, timezone, WebGL, and Client Hints alignment.
|
|
270
|
+
|
|
271
|
+
## Guides
|
|
272
|
+
|
|
273
|
+
Monorepo playbooks (copy-paste commands, sample output, diagrams):
|
|
274
|
+
|
|
275
|
+
| Guide | Flow |
|
|
276
|
+
|-------|------|
|
|
277
|
+
| [Detection fail → MLX farm](../packages/docs/workflows/WORKFLOW_DETECTED.md) | `cdp-probe` → `cdp-connect` → `farm-runner mlx-pool` |
|
|
278
|
+
| [Competitor migration](../packages/docs/workflows/WORKFLOW_MIGRATION.md) | `antidetect-import` → `profile-factory mlx-create` |
|
|
279
|
+
| [Proxy lane → profile pool](../packages/docs/workflows/WORKFLOW_FARM.md) | `proxy-lane` → `profile-factory` → `farm-runner mlx-pool` |
|
|
280
|
+
|
|
281
|
+
**FAQ:** [docs/FAQ.md](docs/FAQ.md) — fingerprint consistency, Client Hints, WebGL/UA alignment.
|
|
282
|
+
|
|
283
|
+
## Related tools
|
|
284
|
+
|
|
285
|
+
| Tool | Use with |
|
|
286
|
+
|------|----------|
|
|
287
|
+
| [playwright-cdp-probe](../playwright-cdp-probe/) — Score CDP/WebDriver exposure and fingerprint leaks | → [cdp-connect-kit](../cdp-connect-kit/) when probe fails |
|
|
288
|
+
| [cookie-jar-bridge](../cookie-jar-bridge/) — Convert, validate, and merge cookies across formats | → [session-bundle-kit](../session-bundle-kit/) for full session |
|
|
289
|
+
| [proxy-lane-checker](../proxy-lane-checker/) — Batch-check proxies for connectivity, geo, and DNSBL | → [profile-yaml-factory](../profile-yaml-factory/) |
|
|
290
|
+
| [fingerprint-coherence](../fingerprint-coherence/) — Lint fingerprints for cross-signal contradictions | → [profile-yaml-factory](../profile-yaml-factory/) before create |
|
|
291
|
+
| [human-input-kit](../human-input-kit/) — Human-like mouse, scroll, and warmup replay | → [automation-farm-runner](../automation-farm-runner/) |
|
|
292
|
+
| [cdp-connect-kit](../cdp-connect-kit/) — Playwright CDP connect; MLX start/stop helpers | → all packages needing CDP |
|
|
293
|
+
| [session-bundle-kit](../session-bundle-kit/) — Export/import cookies and storage as portable bundles | → [cookie-jar-bridge](../cookie-jar-bridge/) |
|
|
294
|
+
| [profile-yaml-factory](../profile-yaml-factory/) — YAML blueprints → MLX `profile/create` payloads | → [antidetect-importer](../antidetect-importer/) after migration |
|
|
295
|
+
| [antidetect-importer](../antidetect-importer/) — Parse competitor exports and push to MLX | → [profile-yaml-factory](../profile-yaml-factory/) |
|
|
296
|
+
| [automation-farm-runner](../automation-farm-runner/) — YAML job queue and MLX profile-pool runner | → [cdp-connect-kit](../cdp-connect-kit/) `[mlx]` |
|
|
297
|
+
|
|
298
|
+
## License
|
|
299
|
+
|
|
300
|
+
MIT
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
**Production antidetect:** [Multilogin X](https://multilogin.com/?ref=SAAS50) · Code `SAAS50` (-50% browser) · `MIN50` (-50% cloud phone)
|
|
305
|
+
More scripts: [@Multilogin_Scripts_Bot](https://t.me/Multilogin_Scripts_Bot) · [Coupons](https://anti-detect.github.io/)
|