@kya-os/checkpoint-shared 1.5.1 → 1.5.2

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/beacon-nonce/index.d.mts +36 -0
  3. package/dist/beacon-nonce/index.d.mts.map +1 -0
  4. package/dist/beacon-nonce/index.d.ts +36 -0
  5. package/dist/beacon-nonce/index.d.ts.map +1 -0
  6. package/dist/beacon-nonce/index.js +305 -0
  7. package/dist/beacon-nonce/index.mjs +294 -0
  8. package/dist/beacon-nonce/index.mjs.map +1 -0
  9. package/dist/beacon-types/index.d.mts +29 -0
  10. package/dist/beacon-types/index.d.mts.map +1 -1
  11. package/dist/beacon-types/index.d.ts +29 -0
  12. package/dist/beacon-types/index.d.ts.map +1 -1
  13. package/dist/beacon-types/index.js +36 -5
  14. package/dist/beacon-types/index.mjs +33 -6
  15. package/dist/beacon-types/index.mjs.map +1 -1
  16. package/dist/browser-posture-D4j2a5gi.d.ts +169 -0
  17. package/dist/browser-posture-D4j2a5gi.d.ts.map +1 -0
  18. package/dist/browser-posture-DVoHMHjY.d.mts +169 -0
  19. package/dist/browser-posture-DVoHMHjY.d.mts.map +1 -0
  20. package/dist/browser-posture-cookie.d.mts +4 -2
  21. package/dist/browser-posture-cookie.d.mts.map +1 -0
  22. package/dist/browser-posture-cookie.d.ts +4 -2
  23. package/dist/browser-posture-cookie.d.ts.map +1 -0
  24. package/dist/browser-posture-cookie.mjs.map +1 -1
  25. package/dist/browser-posture-proof.d.mts +18 -0
  26. package/dist/browser-posture-proof.d.mts.map +1 -0
  27. package/dist/browser-posture-proof.d.ts +18 -0
  28. package/dist/browser-posture-proof.d.ts.map +1 -0
  29. package/dist/browser-posture-proof.js +66 -0
  30. package/dist/browser-posture-proof.mjs +63 -0
  31. package/dist/browser-posture-proof.mjs.map +1 -0
  32. package/dist/browser-posture-report.d.mts +59 -2
  33. package/dist/browser-posture-report.d.mts.map +1 -1
  34. package/dist/browser-posture-report.d.ts +59 -2
  35. package/dist/browser-posture-report.d.ts.map +1 -1
  36. package/dist/browser-posture-report.js +1 -1
  37. package/dist/browser-posture-report.mjs +1 -1
  38. package/dist/browser-posture-report.mjs.map +1 -1
  39. package/dist/browser-posture.d.mts +2 -85
  40. package/dist/browser-posture.d.ts +2 -85
  41. package/dist/browser-posture.js +205 -43
  42. package/dist/browser-posture.mjs +194 -44
  43. package/dist/browser-posture.mjs.map +1 -1
  44. package/dist/browser.d.mts +0 -8
  45. package/dist/browser.d.mts.map +1 -1
  46. package/dist/browser.d.ts +0 -8
  47. package/dist/browser.d.ts.map +1 -1
  48. package/dist/browser.js +1 -1
  49. package/dist/browser.mjs +1 -1
  50. package/dist/browser.mjs.map +1 -1
  51. package/dist/clearance.d.mts +1 -1
  52. package/dist/clearance.d.ts +1 -1
  53. package/dist/{client-ip-HOfe6ucV.mjs → client-ip-B2Xeo-GK.mjs} +2 -2
  54. package/dist/{client-ip-HOfe6ucV.mjs.map → client-ip-B2Xeo-GK.mjs.map} +1 -1
  55. package/dist/{client-ip-1y2iXAYW.js → client-ip-CW6pRyLf.js} +1 -1
  56. package/dist/consent-handoff.d.mts +41 -0
  57. package/dist/consent-handoff.d.mts.map +1 -0
  58. package/dist/consent-handoff.d.ts +41 -0
  59. package/dist/consent-handoff.d.ts.map +1 -0
  60. package/dist/consent-handoff.js +1 -0
  61. package/dist/consent-handoff.mjs +2 -0
  62. package/dist/consent-handoff.mjs.map +1 -0
  63. package/dist/errors/index.d.mts +138 -0
  64. package/dist/errors/index.d.mts.map +1 -1
  65. package/dist/errors/index.d.ts +138 -0
  66. package/dist/errors/index.d.ts.map +1 -1
  67. package/dist/errors/index.js +441 -9
  68. package/dist/errors/index.mjs +441 -10
  69. package/dist/errors/index.mjs.map +1 -1
  70. package/dist/{external-jr_S4iSS.d.mts → external-Ct8j_hto.d.mts} +2 -2
  71. package/dist/{external-jr_S4iSS.d.mts.map → external-Ct8j_hto.d.mts.map} +1 -1
  72. package/dist/{external-jr_S4iSS.d.ts → external-Ct8j_hto.d.ts} +2 -2
  73. package/dist/{external-jr_S4iSS.d.ts.map → external-Ct8j_hto.d.ts.map} +1 -1
  74. package/dist/gateway-client-ip.d.mts +1 -1
  75. package/dist/gateway-client-ip.d.ts +1 -1
  76. package/dist/gateway-client-ip.js +1 -1
  77. package/dist/gateway-client-ip.mjs +1 -1
  78. package/dist/index.d.mts +5131 -967
  79. package/dist/index.d.mts.map +1 -1
  80. package/dist/index.d.ts +5131 -967
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +3678 -546
  83. package/dist/index.mjs +3446 -534
  84. package/dist/index.mjs.map +1 -1
  85. package/dist/mcpi/approval-grant/index.d.mts +1 -1
  86. package/dist/mcpi/approval-grant/index.d.mts.map +1 -1
  87. package/dist/mcpi/approval-grant/index.d.ts +1 -1
  88. package/dist/mcpi/approval-grant/index.d.ts.map +1 -1
  89. package/dist/mcpi/approval-grant/index.js +48 -48
  90. package/dist/mcpi/approval-grant/index.mjs +48 -48
  91. package/dist/mcpi/approval-grant/index.mjs.map +1 -1
  92. package/dist/posture-origins/index.d.mts +41 -0
  93. package/dist/posture-origins/index.d.mts.map +1 -0
  94. package/dist/posture-origins/index.d.ts +41 -0
  95. package/dist/posture-origins/index.d.ts.map +1 -0
  96. package/dist/posture-origins/index.js +441 -0
  97. package/dist/posture-origins/index.mjs +430 -0
  98. package/dist/posture-origins/index.mjs.map +1 -0
  99. package/dist/posture-origins-CEm83u4D.js +621 -0
  100. package/dist/posture-origins-Dl7i8j93.mjs +533 -0
  101. package/dist/posture-origins-Dl7i8j93.mjs.map +1 -0
  102. package/dist/rules.json +0 -1
  103. package/dist/signals/index.d.mts +75 -55
  104. package/dist/signals/index.d.mts.map +1 -1
  105. package/dist/signals/index.d.ts +75 -55
  106. package/dist/signals/index.d.ts.map +1 -1
  107. package/dist/signals/index.js +246 -2
  108. package/dist/signals/index.mjs +236 -3
  109. package/dist/signals/index.mjs.map +1 -1
  110. package/fixtures/browser-integrity/captured-java-0.2.1-missing-score.json +10 -0
  111. package/fixtures/browser-integrity/null-score.json +11 -0
  112. package/fixtures/browser-integrity/numeric-score.json +11 -0
  113. package/fixtures/browser-posture-claims.json +168 -0
  114. package/fixtures/browser-posture-headers.json +6 -0
  115. package/fixtures/kya-http/README.md +1 -0
  116. package/fixtures/kya-http/consent-handoff.codes.json +34 -0
  117. package/fixtures/workbench/a2a-signed-request.v1.json +255 -0
  118. package/fixtures/workbench/artifact-bindings.v1.json +1003 -0
  119. package/fixtures/workbench/delegation-management.v1.json +507 -0
  120. package/fixtures/workbench/didcomm-task-source.v1.json +191 -0
  121. package/fixtures/workbench/graph-interfaces.v1.json +1887 -0
  122. package/fixtures/workbench/identity-provisioning.v1.json +643 -0
  123. package/fixtures/workbench/linear-installation.v1.json +484 -0
  124. package/fixtures/workbench/management-session.v1.json +716 -0
  125. package/fixtures/workbench/model-credentials.v1.json +630 -0
  126. package/fixtures/workbench/source-claim-pooled.v1.json +50 -0
  127. package/fixtures/workbench/task-grant.v1.json +695 -0
  128. package/fixtures/workbench/task-status-projection.v1.json +591 -0
  129. package/fixtures/workbench/workload-enrollment.v1.json +580 -0
  130. package/package.json +21 -2
  131. package/src/data/compiled/merged-rules.json +2 -9
  132. package/src/data/default-rules.json +0 -1
  133. package/dist/browser-posture-cookie-Dmq9Brf_.d.mts +0 -5
  134. package/dist/browser-posture-cookie-Dmq9Brf_.d.mts.map +0 -1
  135. package/dist/browser-posture-cookie-Dmq9Brf_.d.ts +0 -5
  136. package/dist/browser-posture-cookie-Dmq9Brf_.d.ts.map +0 -1
  137. package/dist/browser-posture.d.mts.map +0 -1
  138. package/dist/browser-posture.d.ts.map +0 -1
  139. package/dist/patterns-CkRVOdtV.js +0 -243
  140. package/dist/patterns-DzkGy_qk.mjs +0 -173
  141. package/dist/patterns-DzkGy_qk.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["versionIndex"],"sources":["../../src/signals/types.ts","../../src/signals/sensitive-attributes.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../../../node_modules/.pnpm/canonicalize@3.0.0/node_modules/canonicalize/lib/canonicalize.js","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts"],"sourcesContent":["import type { SensitiveAttributeReview } from './sensitive-attributes';\n\n/**\n * Signal registry types.\n *\n * A \"signal\" is one named, independently-collected piece of device/browser\n * entropy (e.g. `canvas.geometry`, `platform.timezone`). The registry is the\n * single declarative source of truth for every signal's version range,\n * stability tier, de-noising policy, consent mode, and linkage weight.\n *\n * Core rule: a shipped signal is never edited, only forked. See\n * `immutability.ts` for the mechanism that enforces this.\n */\n\n/**\n * Ordered registry versions. Order matters — it defines \"added\"/\"removed\"\n * comparisons.\n *\n * A new signal is added at a NEW version once fingerprint trees are being\n * stored (P55 pins `registry_version` on every row): `buildFingerprintTree`\n * digests every signal resolved at a version, absent leaves included, so an\n * addition at an existing version would silently change what every tree\n * pinned to that version recomputes to. v3 = the behavioural plane's first\n * entries (interaction physics).\n */\nexport const REGISTRY_VERSIONS = ['v1', 'v2', 'v3'] as const;\n\nexport type RegistryVersion = (typeof REGISTRY_VERSIONS)[number];\n\nexport const CURRENT_REGISTRY_VERSION: RegistryVersion =\n REGISTRY_VERSIONS[REGISTRY_VERSIONS.length - 1];\n\n/**\n * High: agreement above threshold across sessions and browser minor versions,\n * survives driver updates. Weighted heavily in linkage.\n * Medium: stable within a browser major version, may move on OS/driver update.\n * Low: moves within a session or on trivial user action. Collected for\n * contradiction detection, weighted near zero for identity.\n */\nexport type StabilityTier = 'high' | 'medium' | 'low';\n\n/**\n * `open` signals score in the EEA before a consent prompt; `consent` signals\n * do not; `never` signals are collected for contradiction/debug only and\n * never contribute to identity. This is a property of the signal, not the\n * caller, so the two output modes stay enforceable rather than aspirational.\n */\nexport type SignalMode = 'open' | 'consent' | 'never';\n\n/**\n * Where a signal's read sits for Merkle-tree leaf grouping. The tree itself\n * is out of scope here; `plane`/`group` just need to be a lookup future tree\n * code can group leaves by, so \"the rendering sub-tree moved\" is a statement\n * about a set of signals you can look up rather than something re-derived\n * by hand in tree code.\n */\nexport type SignalPlane = 'rendering' | 'platform' | 'transport' | 'behavioural';\n\nexport type DenoisePolicy = { kind: 'none' } | { kind: 'modal'; runs: number };\n\n/**\n * The measured-agreement record behind a tier assignment. `provisional: true`\n * marks a tier assigned by documented judgement ahead of real measurement\n * (e.g. before the prompt-2 stability harness exists) — see\n * `immutability.ts` for how provisional entries may still be updated in\n * place versus frozen ones, which may only be forked.\n */\nexport interface TierMeasurement {\n /** Proportion of reads that agreed, in [0, 1]. Null while provisional. */\n agreementRate: number | null;\n sampleSize: number;\n /** Browsers/versions the measurement covered, e.g. [\"chrome-124\", \"brave-1.68\"]. */\n browsers: string[];\n /** ISO date the measurement was taken. Null while provisional. */\n measuredAt: string | null;\n provisional: boolean;\n notes: string;\n}\n\nexport interface SignalDefinition {\n /** Stable identifier, dotted namespace, e.g. \"canvas.geometry\". */\n id: string;\n /** Registry version this signal was added in. */\n addedVersion: RegistryVersion;\n /** Registry version this signal was removed in, exclusive. Null while live. */\n removedVersion: RegistryVersion | null;\n tier: StabilityTier;\n measurement: TierMeasurement;\n denoise: DenoisePolicy;\n mode: SignalMode;\n plane: SignalPlane;\n /** Finer-grained grouping within a plane, e.g. \"canvas\" within \"rendering\". */\n group: string;\n /** Coincidence probability from the attribute frequency table. Null until populated. */\n u: number | null;\n /** Signal id this one forks from, if any. */\n supersedes: string | null;\n description: string;\n /**\n * Required sensitive-attribute review (P44). Enforced at registration by\n * `registerSignal`/`validateRegistry` in `sensitive-attributes.ts`: every\n * signal must declare this, and it must be reviewed against the current\n * rejection-list version, or registration is rejected.\n */\n review: SensitiveAttributeReview;\n}\n\n/** Fields frozen once a signal has shipped (see immutability.ts). */\nexport const FROZEN_FIELDS = ['id', 'addedVersion', 'denoise', 'mode', 'plane', 'group'] as const;\n\n/**\n * Fields frozen only once the tier has been finalized (`measurement.provisional`\n * flips to `false`). While provisional, tier/measurement may be updated in\n * place as real data comes in; once finalized, any further change requires\n * a fork — mirroring the `BatteryFullCapacity` -> `BatteryFullCapacityV2`\n * precedent, where the read didn't change, only its classification did.\n */\nexport const TIER_LOCKED_FIELDS = ['tier'] as const;\n\n/**\n * The committed, append-only record of a shipped signal's frozen fields.\n * `finalizedTier` and `removedVersion` are both null until set once — a\n * signal's tier is finalized exactly once (see `TierMeasurement.provisional`)\n * and it is marked removed exactly once (at the version that forks it) —\n * and from that point on each is one of the frozen fields.\n */\nexport interface SnapshotRecord {\n id: string;\n addedVersion: RegistryVersion;\n removedVersion: RegistryVersion | null;\n denoise: DenoisePolicy;\n mode: SignalMode;\n plane: SignalPlane;\n group: string;\n finalizedTier: StabilityTier | null;\n}\n","import type { SignalDefinition } from './types';\n\n/**\n * Feature-registration guard: rejects any signal (feature) that derives a\n * Sensitive Data Inference, at registration time.\n *\n * WHY THIS EXISTS (P44)\n * ----------------------\n * Liability under CO/WA/NV/CT attaches at the INFERENCE step, not the\n * collection step. Colorado's rule says this most plainly: raw browsing data\n * may be benign, but browsing data which, alone or combined with other\n * personal data, infers sexual orientation IS sensitive, and sensitive data\n * requires opt-in consent. The same raw signal is therefore benign or\n * regulated depending only on what gets computed from it, so the one place\n * that can actually hold this line is the point where a *derived feature*\n * gets named and shipped, not a data-collection policy doc. Enforcing it\n * here, in the code that builds the live signal registry, means the four\n * regimes below are satisfied by one control instead of four separate ones.\n *\n * DECISION LOG: v1 list contents (needs legal/product sign-off)\n * ----------------------------------------------------------------\n * The category list below seeds from the ticket's own citations: Colorado's\n * Sensitive Data Inference categories (race/ethnicity, religion, mental or\n * physical health, sex life/orientation, citizenship status), plus\n * Washington's My Health My Data Act and Nevada SB 370 (health specifically),\n * plus Connecticut's Data Privacy Act (biometric derivatives and government\n * ID numbers). This is an engineering starting point, not a finished legal\n * determination. The mechanism (versioned list plus forced re-evaluation on\n * version bump, see `findSignalsNeedingReevaluation`) exists precisely so\n * Legal/Product can revise the list in place and have every existing\n * registered feature re-reviewed against the new version before it's\n * considered compliant again. Do not treat v1 as final without that sign-off.\n *\n * ON \"BIOMETRIC\" KEYWORDS: a deliberate omission\n * -------------------------------------------------\n * This module and its neighbors use \"fingerprint\" pervasively to mean\n * *device/browser* fingerprinting (canvas hash, audio hash, WebGL hash), not\n * a human biometric identifier. Connecticut's biometric-data category means\n * data generated from measurements of an individual's *body* (voiceprint,\n * faceprint, iris/retina scan, gait). The keyword list below intentionally\n * avoids the bare words \"fingerprint\"/\"biometric\" for that reason: using\n * them would false-positive on this entire module.\n */\n\n// ---------------------------------------------------------------------------\n// Versioned rejection list\n// ---------------------------------------------------------------------------\n\n/** Ordered rejection-list versions. Order matters: CURRENT is always the last entry. */\nexport const SENSITIVE_REJECTION_LIST_VERSIONS = ['v1'] as const;\n\nexport type SensitiveRejectionListVersion = (typeof SENSITIVE_REJECTION_LIST_VERSIONS)[number];\n\nexport const CURRENT_SENSITIVE_REJECTION_LIST_VERSION: SensitiveRejectionListVersion =\n SENSITIVE_REJECTION_LIST_VERSIONS[SENSITIVE_REJECTION_LIST_VERSIONS.length - 1];\n\n/**\n * Sensitive Data Inference categories, seeded from CO's five base categories\n * plus WA/NV health and CT biometric-derivative/government-ID additions.\n */\nexport type SensitiveAttributeCategory =\n | 'racial-or-ethnic-origin'\n | 'religious-or-philosophical-beliefs'\n | 'mental-or-physical-health-condition-or-diagnosis'\n | 'sex-life-or-sexual-orientation'\n | 'citizenship-or-immigration-status'\n | 'biometric-identifier-or-derivative'\n | 'government-identification-number';\n\nexport interface SensitiveAttributeRule {\n category: SensitiveAttributeCategory;\n description: string;\n /** The regime(s) this category maps to, cited so a rejection points at *why*, not just *that*. */\n regimes: string[];\n /**\n * Lowercase substrings scanned against a candidate signal's id/description/\n * group. Deliberately narrow and phrase-based (not single common words) to\n * avoid false-positiving on unrelated engineering vocabulary: see the\n * \"fingerprint\" note above.\n */\n keywords: string[];\n}\n\nexport const SENSITIVE_ATTRIBUTE_REJECTION_LIST: Record<\n SensitiveRejectionListVersion,\n SensitiveAttributeRule[]\n> = {\n v1: [\n {\n category: 'racial-or-ethnic-origin',\n description: 'Inference indicating racial or ethnic origin.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: ['racial origin', 'ethnic origin', 'race indicator', 'ethnicity indicator'],\n },\n {\n category: 'religious-or-philosophical-beliefs',\n description: 'Inference indicating religious or philosophical beliefs.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: [\n 'religious belief',\n 'religious observance',\n 'philosophical belief',\n 'faith affiliation',\n ],\n },\n {\n category: 'mental-or-physical-health-condition-or-diagnosis',\n description: 'Inference indicating a mental or physical health condition or diagnosis.',\n regimes: [\n 'CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)',\n 'WA My Health My Data Act (RCW 19.373)',\n 'NV SB 370 (consumer health data)',\n ],\n keywords: [\n 'health condition',\n 'medical condition',\n 'health diagnosis',\n 'mental health condition',\n 'mental health diagnosis',\n 'physical health condition',\n 'disability status',\n 'disease indicator',\n 'illness indicator',\n ],\n },\n {\n category: 'sex-life-or-sexual-orientation',\n description: 'Inference indicating sex life or sexual orientation.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: ['sexual orientation', 'sex life', 'gender identity inferred'],\n },\n {\n category: 'citizenship-or-immigration-status',\n description: 'Inference indicating citizenship or citizenship status.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: [\n 'citizenship status',\n 'immigration status',\n 'visa status',\n 'national origin status',\n 'resident alien status',\n ],\n },\n {\n category: 'biometric-identifier-or-derivative',\n description:\n 'A biometric identifier, or a derivative of one, used to identify an individual.',\n regimes: ['CT Data Privacy Act (Public Act 22-15)'],\n keywords: [\n 'voiceprint',\n 'faceprint',\n 'iris scan',\n 'retina scan',\n 'facial geometry',\n 'gait analysis',\n 'palm print',\n 'dna profile',\n 'genetic marker',\n ],\n },\n {\n category: 'government-identification-number',\n description: 'A government-issued identification number.',\n regimes: ['CT Data Privacy Act (Public Act 22-15)'],\n keywords: [\n 'social security number',\n 'ssn',\n 'passport number',\n \"driver's license number\",\n 'driver license number',\n 'national id number',\n 'government id number',\n 'tax id number',\n ],\n },\n ],\n};\n\n// ---------------------------------------------------------------------------\n// Composition-risk table: the \"combination test\"\n// ---------------------------------------------------------------------------\n\n/**\n * Two individually benign signals can compose into a sensitive inference. A\n * purely mechanical keyword check (above) cannot catch this: it has no way\n * to know that reduced-motion + inverted-colors + contrast, combined, name a\n * disability-accommodation profile. So this table exists as the declared,\n * human-reviewed record of *known* composition risks: populating and\n * maintaining it IS the human step the ticket calls for; checking a new\n * registration's declared `combinesWith` set against it IS the code\n * enforcing that the step happened. A composition not yet in this table is\n * not proven safe, it just hasn't been reviewed yet, which is why every\n * `combinesWith` entry still requires a human `reviewedBy` (enforced in\n * `checkReviewRecordIntegrity` below), not only a passing table lookup.\n */\nexport interface CompositionRiskRule {\n id: string;\n category: SensitiveAttributeCategory;\n /** Signal ids known to compose into this category when combined. */\n signalIds: string[];\n /** Minimum number of `signalIds` that must co-occur (this signal + its declared combinesWith) to fire. */\n minMatches: number;\n regimes: string[];\n rationale: string;\n}\n\nexport const COMPOSITION_RISK_RULES: CompositionRiskRule[] = [\n {\n id: 'accessibility-preference-composite',\n category: 'mental-or-physical-health-condition-or-diagnosis',\n signalIds: [\n 'platform.reducedMotion',\n 'platform.invertedColors',\n 'platform.contrast',\n 'platform.forcedColors',\n 'platform.reducedTransparency',\n ],\n minMatches: 2,\n regimes: [\n 'CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)',\n 'WA My Health My Data Act (RCW 19.373)',\n 'NV SB 370 (consumer health data)',\n ],\n rationale:\n 'Two or more OS-level accessibility-preference reads (reduced motion, inverted colors, forced colors, reduced contrast, reduced transparency), combined into one derived feature, reliably identify a disability/health accommodation (e.g. vestibular disorder, low vision, photosensitivity), even though each individual CSS media-feature probe is, alone, a consent-gated, near-zero-weight contradiction signal.',\n },\n {\n id: 'locale-cluster-national-origin-composite',\n category: 'citizenship-or-immigration-status',\n signalIds: ['platform.languages', 'platform.timezone', 'platform.dateTimeLocale'],\n minMatches: 3,\n regimes: [\n 'CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)',\n 'CT Data Privacy Act (Public Act 22-15)',\n ],\n rationale:\n 'Combining accepted-languages, IANA timezone, and resolved locale into one derived \"origin\" feature moves from three individually benign, user-configurable locale reads into a feature whose purpose is inferring likely national origin/immigration status: the \"alone or combined\" inference Colorado\\'s rule targets.',\n },\n];\n\n// ---------------------------------------------------------------------------\n// Review record: the declared human step\n// ---------------------------------------------------------------------------\n\n/**\n * Required on every `SignalDefinition`. `derivesCategory` is where a human\n * reviewer declares, up front, what category (if any) this feature derives:\n * the \"declared feature intent\" half of the combination-test mechanism.\n * Declaring `null` does not bypass the mechanical checks below; it only\n * means the reviewer's own assessment agreed the feature is clear.\n */\nexport interface SensitiveAttributeReview {\n /** Rejection-list version this signal was evaluated against. */\n listVersion: SensitiveRejectionListVersion;\n reviewedBy: string;\n /** ISO date. */\n reviewedAt: string;\n /** Other signal ids this signal is declared to compose with downstream (e.g. in a derived/composite feature). */\n combinesWith: string[];\n /** The reviewer's own declared conclusion; null means \"does not derive a sensitive category\". */\n derivesCategory: SensitiveAttributeCategory | null;\n /** Non-empty: why this signal, alone and in combination with `combinesWith`, does not derive a sensitive attribute. */\n rationale: string;\n}\n\n// ---------------------------------------------------------------------------\n// Checks\n// ---------------------------------------------------------------------------\n\nexport type SensitiveAttributeViolationKind =\n | 'direct'\n | 'composition'\n | 'declared'\n | 'stale-review';\n\nexport interface SensitiveAttributeViolation {\n kind: SensitiveAttributeViolationKind;\n /** Null for a `stale-review` violation: a missing/incomplete/stale review record names no sensitive category, it's a structural completeness failure. */\n category: SensitiveAttributeCategory | null;\n /** Rule id (composition rule id, or the rejection-list category as its own id for direct/declared matches). */\n ruleId: string;\n regimes: string[];\n message: string;\n}\n\n/**\n * Splits a dotted/camelCase/snake_case/kebab-case identifier into\n * space-separated words, so a keyword PHRASE like \"mental health condition\"\n * can match an id like `health.mentalHealthConditionIndicator`, which has\n * no natural word separators at all.\n */\nfunction tokenizeIdentifier(text: string): string {\n return text.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/[._-]+/g, ' ');\n}\n\n/**\n * Two scan surfaces, checked together, not one replacing the other\n * (Cursor Bugbot, PR #4645, two rounds): the RAW lowercased text, where a\n * single fused-case compound like `voicePrint` already contains the\n * single-word keyword \"voiceprint\" via ordinary substring matching with no\n * tokenization needed; and the TOKENIZED text, where a multi-word phrase\n * keyword like \"mental health condition\" can match a camelCase id that\n * spells it with no spaces at all. Tokenizing and discarding the raw form\n * fixed the phrase case while silently breaking the fused-word case: a\n * space inserted between \"voice\" and \"Print\" stops \"voiceprint\" from\n * matching. Neither surface alone is sufficient, so both are scanned.\n */\nfunction scanTexts(signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>): string[] {\n const raw = `${signal.id} ${signal.description} ${signal.group}`.toLowerCase();\n const tokenized =\n `${tokenizeIdentifier(signal.id)} ${tokenizeIdentifier(signal.description)} ${tokenizeIdentifier(signal.group)}`.toLowerCase();\n return [raw, tokenized];\n}\n\n/** Mechanical keyword scan of a signal's own id/description/group against the rejection list. Test 1. */\nexport function checkDirectMatch(\n signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>,\n version: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SensitiveAttributeViolation[] {\n const texts = scanTexts(signal);\n const rules = SENSITIVE_ATTRIBUTE_REJECTION_LIST[version];\n const violations: SensitiveAttributeViolation[] = [];\n for (const rule of rules) {\n const hit = rule.keywords.find((keyword) => texts.some((text) => text.includes(keyword)));\n if (hit) {\n violations.push({\n kind: 'direct',\n category: rule.category,\n ruleId: rule.category,\n regimes: rule.regimes,\n message: `derives \"${rule.category}\" (matched \"${hit}\"): a direct Sensitive Data Inference per ${rule.regimes.join('; ')}.`,\n });\n }\n }\n return violations;\n}\n\n/**\n * The combination test: does this signal's declared `combinesWith` set,\n * together with its own id, cross a known composition-risk rule's\n * minimum-match threshold? Test 4.\n */\nexport function checkCompositionRisk(\n signalId: string,\n combinesWith: string[]\n): SensitiveAttributeViolation[] {\n if (combinesWith.length === 0) return [];\n const combinationSet = new Set([signalId, ...combinesWith]);\n const violations: SensitiveAttributeViolation[] = [];\n for (const rule of COMPOSITION_RISK_RULES) {\n const matches = rule.signalIds.filter((id) => combinationSet.has(id));\n if (matches.length >= rule.minMatches) {\n violations.push({\n kind: 'composition',\n category: rule.category,\n ruleId: rule.id,\n regimes: rule.regimes,\n message: `combination rule \"${rule.id}\" fired: [${matches.join(', ')}] combine into \"${rule.category}\" per ${rule.regimes.join('; ')}. ${rule.rationale}`,\n });\n }\n }\n return violations;\n}\n\n/** A reviewer who declared this feature DOES derive a sensitive category: the honest-disclosure path. */\nexport function checkDeclaredCategory(\n review: Pick<SensitiveAttributeReview, 'derivesCategory'>,\n version: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SensitiveAttributeViolation[] {\n if (review.derivesCategory === null) return [];\n const rule = SENSITIVE_ATTRIBUTE_REJECTION_LIST[version].find(\n (r) => r.category === review.derivesCategory\n );\n const regimes = rule?.regimes ?? [];\n return [\n {\n kind: 'declared',\n category: review.derivesCategory,\n ruleId: review.derivesCategory,\n regimes,\n message: `reviewer declared this feature derives \"${review.derivesCategory}\"${regimes.length ? ` (${regimes.join('; ')})` : ''}.`,\n },\n ];\n}\n\n/**\n * Structural integrity of the review record itself: a missing or stale\n * review is treated as non-compliant, not as \"no violations found\". This is\n * the enforcement half of \"the code needs to enforce that the [human] step\n * happened\": an absent or out-of-date review can't silently read as clear.\n */\nexport function checkReviewRecordIntegrity(\n review: SignalDefinition['review'] | undefined,\n currentVersion: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SensitiveAttributeViolation[] {\n if (!review) {\n return [\n {\n kind: 'stale-review',\n category: null,\n ruleId: 'missing-review',\n regimes: [],\n message: 'has no sensitiveAttributeReview record: every registered signal requires one.',\n },\n ];\n }\n if (!review.reviewedBy || !review.reviewedAt || !review.rationale) {\n return [\n {\n kind: 'stale-review',\n category: null,\n ruleId: 'incomplete-review',\n regimes: [],\n message: 'has an incomplete review record (reviewedBy/reviewedAt/rationale required).',\n },\n ];\n }\n if (review.listVersion !== currentVersion) {\n return [\n {\n kind: 'stale-review',\n category: null,\n ruleId: 'stale-list-version',\n regimes: [],\n message: `was reviewed against rejection-list version \"${review.listVersion}\", but the current version is \"${currentVersion}\": re-evaluation required. See findSignalsNeedingReevaluation().`,\n },\n ];\n }\n return [];\n}\n\n/** The single shared check both `registerSignal` and `validateRegistry` call, so there is no logic drift between entry points. */\nexport function evaluateSensitiveAttributeCompliance(\n signal: SignalDefinition\n): SensitiveAttributeViolation[] {\n return [\n ...checkDirectMatch(signal),\n ...checkCompositionRisk(signal.id, signal.review?.combinesWith ?? []),\n ...(signal.review ? checkDeclaredCategory(signal.review) : []),\n ...checkReviewRecordIntegrity(signal.review),\n ];\n}\n\n// ---------------------------------------------------------------------------\n// Actionable error\n// ---------------------------------------------------------------------------\n\nfunction formatViolation(v: SensitiveAttributeViolation): string {\n return ` - [${v.kind}] ${v.message}`;\n}\n\nexport class SensitiveAttributeRejectionError extends Error {\n readonly signalId: string;\n readonly violations: SensitiveAttributeViolation[];\n\n constructor(signalId: string, violations: SensitiveAttributeViolation[]) {\n const lines = [\n `Feature registration rejected for \"${signalId}\": Sensitive Data Inference constraint(s) fired.`,\n ...violations.map(formatViolation),\n 'This is a legal boundary (see CO Privacy Act Rules Sensitive Data Inferences; WA My Health My Data Act; NV SB 370; CT Data Privacy Act) enforced in code, not documentation.',\n 'To register this feature: resolve the conflict (drop the derivation, or narrow combinesWith) and route the change through the sensitive-attribute review process (see docs/governance/sensitive-attribute-rejection-list.md) before re-registering. Do not bypass by editing SIGNAL_REGISTRY directly: validateRegistry() enforces the same check.',\n ];\n super(lines.join('\\n'));\n this.name = 'SensitiveAttributeRejectionError';\n this.signalId = signalId;\n this.violations = violations;\n }\n}\n\n/**\n * The single approved way to add a signal to the live registry. Throws with\n * an actionable message (naming the exact category/rule and pointing at the\n * review process) rather than a bare \"feature rejected\". Returns the\n * definition unchanged on success so callers can do\n * `RAW.map(registerSignal)`.\n */\nexport function registerSignal(definition: SignalDefinition): SignalDefinition {\n const violations = evaluateSensitiveAttributeCompliance(definition);\n if (violations.length > 0) {\n throw new SensitiveAttributeRejectionError(definition.id, violations);\n }\n return definition;\n}\n\n/**\n * Non-throwing variant used by `validateRegistry` (and directly by anyone\n * validating a whole array) so a bypass of `registerSignal`, such as a\n * hand-edited registry array, is still caught by the same shared logic.\n */\nexport function checkSensitiveAttributeCompliance(signal: SignalDefinition): {\n ok: boolean;\n violations: SensitiveAttributeViolation[];\n} {\n const violations = evaluateSensitiveAttributeCompliance(signal);\n return { ok: violations.length === 0, violations };\n}\n\n/**\n * Signals whose review is pinned to a rejection-list version older than\n * current: the concrete \"changes trigger re-evaluation\" mechanism. Also\n * doubles as the \"which version was a given model trained under\" answer:\n * once this returns empty for a registry snapshot, every feature in it was\n * reviewed against `CURRENT_SENSITIVE_REJECTION_LIST_VERSION`.\n */\nexport function findSignalsNeedingReevaluation(\n signals: SignalDefinition[],\n currentVersion: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SignalDefinition[] {\n return signals.filter((s) => !s.review || s.review.listVersion !== currentVersion);\n}\n","import { CURRENT_SENSITIVE_REJECTION_LIST_VERSION } from './sensitive-attributes';\nimport type { SignalDefinition, TierMeasurement } from './types';\n\n/**\n * The signal registry: single declarative source of truth for every\n * signal's version range, stability tier, de-noise policy, consent mode,\n * and Merkle-tree grouping. Collectors and recomputation reference this —\n * nothing hardcodes a signal name or a denoise run count at a call site.\n *\n * A shipped signal is never edited, only forked (see immutability.ts and\n * `.github/workflows/signal-registry-check.yml`). Adding a new signal or\n * finalizing a still-provisional tier does not need a fork; changing\n * addedVersion/denoise/mode/plane/group, or a tier once finalized, does.\n *\n * Provisional tiers: the stability harness that measures real per-browser\n * agreement rates does not exist yet in this repo (tracked as a follow-on).\n * Every tier below is seeded from documented reasoning about each read's\n * known volatility (farbling, driver/OS dependence, etc.), not from\n * measurement, and is marked `measurement.provisional: true` accordingly.\n * A tier with no measurement behind it is a guess wearing a label — so\n * these are explicitly labelled provisional rather than presented as final.\n * Once the harness lands, finalize these in place (see TIER_LOCKED_FIELDS);\n * finalizing is a one-way door — after that, a re-tiering must fork.\n */\n\nfunction provisional(notes: string): TierMeasurement {\n return {\n agreementRate: null,\n sampleSize: 0,\n browsers: [],\n measuredAt: null,\n provisional: true,\n notes,\n };\n}\n\n/**\n * P44 sensitive-attribute review record shared by every signal below that\n * does not derive a Sensitive Data Inference on its own or in combination\n * (see sensitive-attributes.ts for the versioned rejection list and\n * composition-risk table this is checked against at registration). Every\n * signal here evaluates to `derivesCategory: null` with no known composition\n * risk, so one shared record covers them all instead of 38 near-identical\n * inline literals going stale independently.\n */\nfunction compliantReview(): SignalDefinition['review'] {\n return {\n listVersion: CURRENT_SENSITIVE_REJECTION_LIST_VERSION,\n reviewedBy: 'privacy-review@kya-os.example',\n reviewedAt: '2026-08-19',\n combinesWith: [],\n derivesCategory: null,\n rationale:\n 'Raw device/browser entropy read; no plausible link to a Sensitive Data Inference category, individually or via a known composition-risk rule.',\n };\n}\n\n/** Every interaction-plane id, for each entry's `combinesWith` (the composite reads them all). */\nconst INTERACTION_SIGNAL_IDS = [\n 'interaction.keyDwellUnder5Share',\n 'interaction.keyGapUnder5Share',\n 'interaction.pressUnder10Share',\n 'interaction.zeroTrailClickShare',\n 'interaction.untrustedInputShare',\n 'interaction.mousePerClick',\n] as const;\n\nfunction interactionReview(id: string): SignalDefinition['review'] {\n return {\n listVersion: CURRENT_SENSITIVE_REJECTION_LIST_VERSION,\n reviewedBy: 'privacy-review@kya-os.example',\n reviewedAt: '2026-09-03',\n combinesWith: INTERACTION_SIGNAL_IDS.filter((other) => other !== id),\n derivesCategory: null,\n rationale:\n 'A per-visit share of input events below a physical floor (or a per-visit ratio of two event counts), derived from integer counters; no per-event timing, coordinate, or key identity is collected, so the read cannot reconstruct a typing or pointer rhythm and is not a biometric identifier or a derivative of one (mode: never, so it is excluded from identity linkage regardless). It reads 0 for a person at any speed, ability, or input method, since the floors sit below any hand; it therefore carries no information about a health condition or accommodation. Its only composition is interaction_integrity, a Noisy-OR over the other interaction shares, which derives \"driven by software\" and nothing about the person.',\n };\n}\n\nfunction interactionSignals(): SignalDefinition[] {\n const entry = (\n id: (typeof INTERACTION_SIGNAL_IDS)[number],\n description: string,\n notes: string\n ): SignalDefinition => ({\n id,\n addedVersion: 'v3',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(notes),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'behavioural',\n group: 'interaction',\n u: null,\n supersedes: null,\n description,\n review: interactionReview(id),\n });\n\n return [\n entry(\n 'interaction.keyDwellUnder5Share',\n 'Share of paired keystrokes (keydown to keyup) held under 5ms; IME composition, left/right modifiers, and auto-repeat are not timed, and key timing stops once a finger has touched the page.',\n 'Lab gauntlet, two recordings and three driver rigs against production (plan P0.5): hand minimum dwell 39ms, share 0; CDP drivers 0-1ms on every key, share 1. Playwright type({ delay }) manufactures a hand dwell and reads 0: the timing rungs raise the bar and prove nothing, which is why the ladder ends in a challenge. Seeded from that corpus, not a stability harness; finalize once P3 calibration has the trap populations (IME, dictation, on-screen keyboard, switch access).'\n ),\n entry(\n 'interaction.keyGapUnder5Share',\n 'Share of timed keydown-to-next-keydown gaps within 2s that were under 5ms: a whole string arriving in one tick.',\n 'Same corpus: hand minimum gap 26ms, share 0; CDP drivers 0ms, share 0.97 to 1. AltGr (Control then Alt back to back) is excluded by the modifier guard; a held key auto-repeats without entering the gap count. Provisional pending the trap populations.'\n ),\n entry(\n 'interaction.pressUnder10Share',\n 'Share of primary-pointer presses (pointerdown to pointerup) under 10ms; a second finger is not a press and a cancelled press does not pair with the next release.',\n 'Same corpus: hand minimum press 38ms, share 0; CDP drivers 2-7ms, share 0.8 to 1. Playwright click({ delay }) holds the press and reads 0. Provisional pending the touch and switch-access populations.'\n ),\n entry(\n 'interaction.zeroTrailClickShare',\n 'Of clicks whose own pointerType is mouse and that follow at least one observed pointer move, the share with no mousemove or wheel in the preceding 300ms: a pointer that appeared on its target.',\n 'Same corpus: every hand click approached, share 0; Claude-in-Chrome 8 of 12 unapproached, the cdp rig 0.7. Taps, keyboard-activated buttons, and a click before any move has been seen are outside the denominator, so a cursor already resting on a button is unknown rather than a teleport. Weaker than the timing rungs (the plan weights it 0.4) because a scroll-then-click is an ordinary thing for a hand; provisional.'\n ),\n entry(\n 'interaction.untrustedInputShare',\n 'Share of counted input events (throttled mousemove, keydown, scroll, click, touchstart) dispatched with isTrusted false: input from a script or extension rather than the browser reacting to hardware.',\n \"The content-script rung (#4842). A person's input is always trusted and the flag is browser-set and read-only, so it cannot be forged upward; the content-script rig reads 0.96 with human-shaped timing, and a CDP-driven browser reads 0 because its synthetic input arrives trusted, which is what the timing rungs above are for. Human baseline 0 of 15 windows. Provisional pending the autofill and accessibility-tool populations, whose events are trusted and should read 0.\"\n ),\n entry(\n 'interaction.mousePerClick',\n 'Throttled (50ms) mouse moves per mouse click over the visit; undefined on touch traffic, which fires no mousemove.',\n 'The backstop (#4806): a hand cannot reach a button without dragging the pointer across the screen (measured 33 moves per click) while a driver teleports (measured 2). Noisy on short windows (human 1 to 15 on 4s windows) and undefined for touch, so it is weighted 0.2 in the composite and read only as the mouse-only kinematics reading. Provisional.'\n ),\n ];\n}\n\nexport const SIGNAL_REGISTRY: SignalDefinition[] = [\n // --- rendering plane ---------------------------------------------------\n {\n id: 'canvas.geometry',\n addedVersion: 'v1',\n removedVersion: 'v2',\n tier: 'medium',\n measurement: provisional(\n 'Canvas 2D geometry rasterisation is GPU/driver dependent; expected to move on driver updates, stable otherwise. No modal() de-noising applied yet, so privacy-browser farbling is expected to reduce agreement — this is exactly what the v2 fork below addresses.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'canvas',\n u: null,\n supersedes: null,\n description:\n 'Hash of a rendered 2D canvas shape/text scene. Single-read today; superseded by canvas.geometry.v2 once modal(3) de-noising lands (prompt 2).',\n review: compliantReview(),\n },\n {\n id: 'canvas.geometry.v2',\n addedVersion: 'v2',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Same read as canvas.geometry, sampled 3x and reduced by mode to recover the deterministic render under per-session farbling noise (Brave/Firefox/Safari). Originally a worked fork example proving the versioning mechanism ahead of the real collector; #4256 has since landed the real geometry-only collector (packages/checkpoint-beacon/.../entropy/canvas.ts) with these exact frozen fields (modal(3), consent, rendering/canvas), so this entry is now that signal for real, not just the demo.'\n ),\n denoise: { kind: 'modal', runs: 3 },\n mode: 'consent',\n plane: 'rendering',\n group: 'canvas',\n u: null,\n supersedes: 'canvas.geometry',\n description:\n 'Hash of a rendered 2D canvas GEOMETRY-ONLY scene (overlapping shapes, a bezier stroke); no text is drawn into this read. Forked from canvas.geometry (which conflated shape and text in one read) to apply modal(3) de-noising instead of editing the shipped v1 definition in place. As of #4256/P10, geometry and text are collected and hashed as two fully independent signals (see canvas.text): a font-stack change moves canvas.text and leaves this one untouched, and vice versa for a GPU/driver change.',\n review: compliantReview(),\n },\n {\n id: 'canvas.text',\n addedVersion: 'v2',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"Canvas 2D text rasterisation (mixed fonts, emoji) is materially less stable than canvas geometry: it moves on font-stack changes, emoji font updates, and subpixel antialiasing changes, none of which touch canvas.geometry.v2's arcs/bezier stroke. Hashing geometry and text together (as the pre-#4256 client-side detector did, with a 32-bit DJB2 digest with nowhere near enough entropy to separate devices in the first place) meant any text drift destroyed the geometry evidence too; kept as an independent signal with its own, lower tier instead.\"\n ),\n denoise: { kind: 'modal', runs: 3 },\n mode: 'consent',\n plane: 'rendering',\n group: 'canvas',\n u: null,\n supersedes: null,\n description:\n 'Hash of a rendered 2D canvas TEXT-ONLY scene (mixed fonts, emoji); no geometry primitives are drawn into this read. Collected and hashed independently of canvas.geometry.v2 by the same collector module (packages/checkpoint-beacon/.../entropy/canvas.ts), so a font-stack or emoji-font change moves this signal without disturbing the geometry one.',\n review: compliantReview(),\n },\n {\n id: 'webgl.render',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'WebGL renderer/parameter fingerprint. Moves on GPU driver updates; stable within a driver version. Farbling affects some browsers (notably Samsung Internet).'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'webgl',\n u: null,\n supersedes: null,\n description: 'Hash of WebGL renderer info and a rendered scene.',\n review: compliantReview(),\n },\n {\n id: 'audio.digest',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'AudioContext oscillator/compressor output digest. Deterministic per audio stack; moves on driver/OS audio-subsystem updates.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'audio',\n u: null,\n supersedes: null,\n description: 'Digest of a rendered AudioContext sample buffer.',\n review: compliantReview(),\n },\n {\n id: 'rendering.fonts',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Enumerated available font list. High entropy but moves whenever the OS font stack changes (OS updates, new app installs).'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'fonts',\n u: null,\n supersedes: null,\n description: 'Set of locally-available fonts detected via width-probing.',\n review: compliantReview(),\n },\n {\n id: 'rendering.mathFingerprint',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'Floating-point transcendental function results depend on the JS engine and CPU FPU implementation, not on user state or GPU driver — expected to be stable across sessions and survive most updates, per FingerprintJS/ThumbmarkJS prior art.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'rendering',\n group: 'math',\n u: null,\n supersedes: null,\n description: 'Hash of a battery of Math.* transcendental function results.',\n review: compliantReview(),\n },\n\n // --- platform plane ------------------------------------------------------\n {\n id: 'platform.hardwareConcurrency',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'navigator.hardwareConcurrency reflects physical core count, effectively constant for a given device.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description: 'Reported logical CPU core count.',\n review: compliantReview(),\n },\n {\n id: 'platform.deviceMemory',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'navigator.deviceMemory is a coarse, bucketed value tied to physical RAM; effectively constant for a given device.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description: 'Reported device memory in GB, bucketed by the browser.',\n review: compliantReview(),\n },\n {\n id: 'platform.screenResolution',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Screen resolution is stable per device but changes on external-monitor connect/disconnect or OS display scaling changes.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'screen.width/height and color depth.',\n review: compliantReview(),\n },\n {\n id: 'platform.timezone',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'IANA timezone name. Stable per device/user but changes on travel or explicit user change — a trivial, legitimate user action, so capped at medium rather than high.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'locale',\n u: null,\n supersedes: null,\n description: 'Intl-resolved IANA timezone.',\n review: compliantReview(),\n },\n {\n id: 'platform.languages',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'navigator.languages ordering/content is stable per device but is user-configurable, a trivial action.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'locale',\n u: null,\n supersedes: null,\n description: 'Ordered list of accepted languages.',\n review: compliantReview(),\n },\n {\n id: 'platform.permissions',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Permission grant states (geolocation, notifications, camera, microphone) change whenever the user grants/revokes a permission — moves within a session on a trivial user action. Collected for contradiction detection, weighted near zero for identity.'\n ),\n denoise: { kind: 'modal', runs: 3 },\n mode: 'consent',\n plane: 'platform',\n group: 'permissions',\n u: null,\n supersedes: null,\n description: 'Modal permission state per permission name (Permissions API).',\n review: compliantReview(),\n },\n\n // --- vendored FingerprintJS sources (prompt 9) ---------------------------\n // See packages/checkpoint-beacon/src/vendor/fingerprintjs/VENDORING.md for\n // the pinned commit and the full included/excluded source reasoning.\n {\n id: 'platform.userAgentData',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'User-Agent Client Hints high-entropy values (architecture, bitness, model, platformVersion), Chromium-only. Device model in particular is highly identifying: the same sensitivity Chromium itself recognises by gating getHighEntropyValues() behind a Permissions-Policy check. Effectively device-constant when available.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description:\n 'UA-CH brands/mobile/platform plus high-entropy architecture/bitness/model/platformVersion.',\n review: compliantReview(),\n },\n {\n id: 'rendering.fontPreferences',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Measured widths of a fixed set of font-preset text samples inside an iframe. Stable per OS/browser install; the upstream source itself documents floating-point measurement noise across zoom levels on some browsers, hence medium rather than high pending real measurement.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'fonts',\n u: null,\n supersedes: null,\n description:\n 'Dictionary of measured text-sample widths under a fixed set of font/style presets.',\n review: compliantReview(),\n },\n {\n id: 'platform.osCpu',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.oscpu, Firefox-only and largely redundant with the platform/UA family. Shared by every user of a given Firefox+OS combination, so low uniqueness on its own: contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'navigator.oscpu, when present.',\n review: compliantReview(),\n },\n {\n id: 'platform.colorDepth',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'window.screen.colorDepth is effectively constant (24, occasionally 30) across nearly all modern displays. Very low entropy by itself.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Reported screen color depth in bits.',\n review: compliantReview(),\n },\n {\n id: 'platform.sessionStorage',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Boolean availability of window.sessionStorage. Near-universally true; moves only under specific privacy configurations. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether window.sessionStorage is available.',\n review: compliantReview(),\n },\n {\n id: 'platform.localStorage',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Boolean availability of window.localStorage. Near-universally true; moves only under specific privacy configurations. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether window.localStorage is available.',\n review: compliantReview(),\n },\n {\n id: 'platform.indexedDB',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Boolean availability of window.indexedDB (undefined on IE/Edge in private mode by design, per upstream source comment). Near-universally true elsewhere. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether window.indexedDB is available.',\n review: compliantReview(),\n },\n {\n id: 'platform.navigatorPlatform',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.platform (with the iPad/iPhone WebKit correction upstream applies). Shared by every user of a given OS+browser-mode combination, so low uniqueness alone.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'Reported navigator.platform, WebKit iPad/iPhone-corrected.',\n review: compliantReview(),\n },\n {\n id: 'platform.touchSupport',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'maxTouchPoints + TouchEvent/ontouchstart feature detection. Stable per device and useful for separating phone/tablet from desktop form factors, but shared by every device of the same model.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description: 'maxTouchPoints plus TouchEvent/ontouchstart availability.',\n review: compliantReview(),\n },\n {\n id: 'platform.vendor',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.vendor. A handful of possible values shared by huge populations (e.g. every Chromium user reads \"Google Inc.\"). Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'Reported navigator.vendor.',\n review: compliantReview(),\n },\n {\n id: 'platform.vendorFlavors',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Presence of browser-specific (not engine-specific) global variables (e.g. window.chrome, window.__firefox__). Distinguishes browser flavor within an engine family; still shared by every install of that browser.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'Sorted list of detected browser-specific global variable names.',\n review: compliantReview(),\n },\n {\n id: 'platform.cookiesEnabled',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Live cookie-write/read probe. Near-universally true; moves whenever the user or a privacy extension blocks cookies, a trivial, legitimate action. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether a test cookie can be written and read back.',\n review: compliantReview(),\n },\n {\n id: 'platform.colorGamut',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'CSS color-gamut media-feature probe (srgb/p3/rec2020). Reflects the physical display panel, stable until an external-monitor change.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Widest supported color gamut per the CSS color-gamut media feature.',\n review: compliantReview(),\n },\n {\n id: 'platform.invertedColors',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS inverted-colors media-feature probe: an OS-level accessibility preference, not a display capability. Consent-gated like platform.permissions, since it can correlate with a vision-related accessibility need, so it is collected for contradiction detection only and weighted near zero for identity.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether the OS-level \"invert colors\" accessibility preference is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.forcedColors',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS forced-colors media-feature probe: an OS-level accessibility preference (Windows High Contrast and similar). Consent-gated for the same reason as platform.invertedColors.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether an OS-level forced-colors accessibility mode is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.monochrome',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS monochrome media-feature probe (bits per pixel on a non-color/e-ink-style display, or 0). Reflects display hardware, not a user preference, unlike the accessibility-preference probes above.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description:\n 'Monochrome display bit depth per the CSS monochrome media feature, or undefined if unsupported.',\n review: compliantReview(),\n },\n {\n id: 'platform.contrast',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS prefers-contrast media-feature probe: an OS-level accessibility preference. Consent-gated for the same reason as platform.invertedColors/platform.forcedColors.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'OS-level contrast preference per the CSS prefers-contrast media feature.',\n review: compliantReview(),\n },\n {\n id: 'platform.reducedMotion',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS prefers-reduced-motion media-feature probe: an OS-level accessibility preference that can correlate with a vestibular-disorder accommodation. Consent-gated, contradiction-detection only.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether the OS-level \"reduce motion\" accessibility preference is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.reducedTransparency',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS prefers-reduced-transparency media-feature probe: an OS-level accessibility preference. Consent-gated for the same reason as platform.reducedMotion.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether the OS-level \"reduce transparency\" accessibility preference is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.hdr',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'CSS dynamic-range media-feature probe (high vs standard). Reflects display hardware capability, stable until an external-monitor change.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description:\n 'Whether the display supports high dynamic range per the CSS dynamic-range media feature.',\n review: compliantReview(),\n },\n {\n id: 'platform.pdfViewerEnabled',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.pdfViewerEnabled, Chromium-only. Near-constant true across recent Chromium installs. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: 'Reported navigator.pdfViewerEnabled.',\n review: compliantReview(),\n },\n {\n id: 'platform.architecture',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'Distinguishes x86/x86-64 from other CPU architectures via IEEE 754 NaN sign-bit behaviour on infinity subtraction. Depends on CPU architecture only, effectively device-constant like hardwareConcurrency/deviceMemory.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description:\n 'Single byte distinguishing CPU architecture via a floating-point NaN sign-bit probe.',\n review: compliantReview(),\n },\n {\n id: 'platform.applePay',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'ApplePaySession.canMakePayments() state, Safari-only. Depends on device wallet configuration, which can change independently of the fingerprint; mostly useful for Safari-family detection.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: 'Apple Pay availability/enabled state (Safari only).',\n review: compliantReview(),\n },\n {\n id: 'platform.privateClickMeasurement',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"Presence of Safari's Privacy-Preserving Ad Measurement attribution-source attribute. Safari-only, mostly stable across recent versions.\"\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: \"Whether Safari's private click measurement attribution attribute is present.\",\n review: compliantReview(),\n },\n {\n id: 'rendering.audioBaseLatency',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'AudioContext.baseLatency, a scalar tied to the audio hardware/OS audio stack. Distinct collection mechanism from audio.digest (no oscillator rendering, no shared context), so this does not duplicate that signal.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'rendering',\n group: 'audio',\n u: null,\n supersedes: null,\n description:\n 'Reported AudioContext.baseLatency, or a negative status code when unsupported/disabled.',\n review: compliantReview(),\n },\n {\n id: 'platform.dateTimeLocale',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Intl.DateTimeFormat().resolvedOptions().locale. Stable per device/user but trivially user-configurable, same rationale as platform.timezone/platform.languages.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'locale',\n u: null,\n supersedes: null,\n description: 'Intl-resolved locale string, or a negative status code when unsupported.',\n review: compliantReview(),\n },\n\n // --- ThumbmarkJS-ported sources, prompt 11 ---------------------------\n // Three sources FingerprintJS's 42-source list has no equivalent for at\n // all (see packages/checkpoint-beacon/src/collectors/entropy/webrtc.ts,\n // speech.ts, media-queries.ts for the collectors and the privacy\n // reasoning behind the WebRTC collector in particular).\n {\n id: 'transport.webrtcCodecs',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'RTP header extensions and per-codec (rtpmap/fmtp/rtcp-fb) descriptors parsed from a locally-generated SDP offer. Determined by the WebRTC engine build and codec licensing bundled with a given browser version; stable within a browser version, moves on browser updates that add/remove codec or extension support (e.g. AV1/VP9 profile rollout). Collection never gathers a real ICE candidate: setLocalDescription is never called AND iceCandidatePoolSize is 0, so neither of the two ways gathering can start ever fires (see webrtc.ts).'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'transport',\n group: 'webrtc',\n u: null,\n supersedes: null,\n description:\n 'Counts and digests of RTP extensions (extmap) and per-codec descriptors (rtpmap/fmtp/rtcp-fb) for audio and video, parsed from a locally-generated SDP offer.',\n review: compliantReview(),\n },\n {\n id: 'platform.speechVoices',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n \"speechSynthesis.getVoices() reduced to voiceURI/name/lang/localService/default per voice, sorted, then hashed. Tied to the OS/browser installed voice set: stable per device, moves when the OS installs a language pack or a browser update changes its bundled voice list. No modal() de-noising applies (voice enumeration is not farbled/randomized per call the way canvas/WebGL/audio reads are) — the observed timing nondeterminism is handled by the collector's voiceschanged/timeout race, not by resampling.\"\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: 'Voice count and a digest of the sorted, normalized speechSynthesis voice list.',\n review: compliantReview(),\n },\n {\n id: 'platform.mediaQuerySweep',\n addedVersion: 'v1',\n removedVersion: 'v2',\n tier: 'medium',\n measurement: provisional(\n 'Systematic sweep of every legal value across 11 CSS media-query families (prefers-contrast, any-hover, any-pointer, pointer, hover, update, inverted-colors, prefers-reduced-motion, prefers-reduced-transparency, scripting, forced-colors). Mostly OS/input-hardware driven and stable per device, but a few families (hover/pointer/any-hover/any-pointer) can move on a trivial user action such as docking a touch device to a mouse, capping this at medium rather than high pending real measurement. Deliberately overlaps 5 already-registered vendored-FingerprintJS signals (platform.contrast, platform.invertedColors, platform.reducedMotion, platform.reducedTransparency, platform.forcedColors) as a cross-validation check, not a duplication bug — see media-queries.ts.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description:\n 'Per-family matched value across 11 media-query families (family absent from the result when unsupported, never a false/placeholder value), plus a family count and a digest. Forked to platform.mediaQuerySweep.v2, which narrows this to 6 families: combining the 5 accessibility-preference families into this one derived feature trips the accessibility-preference-composite Sensitive Data Inference composition rule (see sensitive-attributes.ts) — a disability/health-accommodation inference risk, per P44. Collector-only; never wired into scoring, transport, or the identity graph at any point in this signal\\'s v1 lifetime, so no stored device data exists to preserve compatibility with (Cursor Bugbot, PR #4639) — forked anyway, per this file\\'s \"never edited, only forked\" discipline.',\n review: compliantReview(),\n },\n {\n id: 'platform.mediaQuerySweep.v2',\n addedVersion: 'v2',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n \"Systematic sweep of every legal value across 6 CSS media-query families (any-hover, any-pointer, pointer, hover, update, scripting) — none of which any existing collector reads. Mostly OS/input-hardware driven and stable per device, but a few families (hover/pointer/any-hover/any-pointer) can move on a trivial user action such as docking a touch device to a mouse, capping this at medium rather than high pending real measurement. Forked from platform.mediaQuerySweep (v1) to EXCLUDE the 5 media-query families already registered as their own accessibility-preference signals (platform.contrast, platform.invertedColors, platform.reducedMotion, platform.reducedTransparency, platform.forcedColors): combining 2+ of those into one derived feature trips the accessibility-preference-composite Sensitive Data Inference composition rule (see sensitive-attributes.ts) — a disability/health-accommodation inference risk, per P44. See media-queries.ts's module doc.\"\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: 'platform.mediaQuerySweep',\n description:\n 'Per-family matched value across 6 media-query families with no existing collector (family absent from the result when unsupported, never a false/placeholder value), plus a family count and a digest. Excludes the 5 families already covered by their own registered accessibility-preference signals — see measurement notes.',\n review: compliantReview(),\n },\n\n // --- User-Agent Client Hints, contradiction-only (prompt 12) ------------\n // Distinct from platform.userAgentData (prompt 9): that signal is the\n // bundled entropy read FingerprintJS itself needs (mode: consent, one\n // signal). These nine are collected purely to catch a spoofed\n // User-Agent string disagreeing with the browser's real Client Hints —\n // mode: 'never', so none of them ever contribute to identity linkage.\n // See packages/checkpoint-beacon/src/collectors/entropy/client-hints.ts.\n {\n id: 'platform.clientHints.architecture',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"UA-CH high-entropy `architecture` hint (e.g. 'arm', 'x86'). Requested independently of platform.userAgentData's copy of the same hint, specifically so it can feed User-Agent/Client-Hints contradiction detection rather than identity linkage.\"\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy CPU architecture hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.bitness',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"UA-CH high-entropy `bitness` hint (e.g. '64'). Collected for contradiction detection only; see platform.clientHints.architecture.\"\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy CPU bitness hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.model',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `model` hint. Empty string on desktop; device model on mobile. Collected for contradiction detection only; see platform.clientHints.architecture.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy device model hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.platform',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"UA-CH low-entropy `platform` (e.g. 'Windows', 'macOS', 'Linux', 'Android', 'Chrome OS'), read synchronously off navigator.userAgentData rather than requested through getHighEntropyValues(). The half of this collector's output the platform contradiction check actually compares against the User-Agent string's platform.\"\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH low-entropy platform family string.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.platformVersion',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `platformVersion` hint (OS version string). Collected for contradiction detection only; see platform.clientHints.architecture.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy OS version hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.uaFullVersion',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `uaFullVersion` hint — deprecated upstream in favour of `fullVersionList`, but still requested here because a spoofing tool that patches the User-Agent string is more likely to miss this legacy field than the one it actually knows to fake.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy (deprecated) full browser version hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.fullVersionList',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `fullVersionList` hint: brand/full-version pairs, GREASE entries filtered before this signal is ever populated (see the collector for the filter and why an unfiltered read would self-split on every request).'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy brand/full-version list, GREASE-filtered.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.wow64',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `wow64` hint: whether a 32-bit browser is running under WOW64 on 64-bit Windows. Collected for contradiction detection only; see platform.clientHints.architecture.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy Windows WOW64 hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.mobile',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH low-entropy `mobile` flag, read synchronously off navigator.userAgentData rather than requested through getHighEntropyValues(). Collected for contradiction detection only (e.g. against a desktop User-Agent string), not identity linkage.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH low-entropy mobile-device flag.',\n review: compliantReview(),\n },\n\n // --- Interaction physics, contradiction-only (agentic-session plan P1.1) --\n // The behavioural plane's first entries. Each is a per-visit SHARE derived\n // server-side from integer counters the pixel's detector and the beacon's\n // InteractionCollector accumulate (apps/web/lib/detection/timing-physics.ts\n // reads both lanes through one function). They exist to tell a driven\n // browser from a person, never to say WHICH person: mode 'never', so none\n // enters identity linkage or the Merkle tree; tier 'low', because a share\n // of a visit's events is by definition a within-session quantity.\n //\n // The reads are floor-crossings. A hand's shortest measured key dwell on the\n // lab gauntlet was 39ms, its shortest click press 38ms, its shortest\n // inter-key gap 26ms, and every one of its clicks was approached by the\n // pointer; a browser driven over CDP produced 0-1ms dwells, 2-7ms presses,\n // 0ms gaps, and clicks with no approach. The counters bucket at 5ms and 10ms,\n // below any hand, so each share reads 0 for a person whatever their speed\n // and near 1 for a driver. No timestamp, coordinate, or key identity leaves\n // the page; a counter cannot be replayed into a rhythm. The mean dwell and\n // mean press that the same counters also yield are lab-calibration display\n // only and are NOT registered here; promoting either would need its own\n // review, because \"how long a hand holds a key\" is a property of the hand.\n //\n // Combined downstream by `interaction_integrity` (apps/web/lib/detection/\n // interaction-integrity.ts, scorer v1, shadow-only): a Noisy-OR over the\n // keyboard, press, approach, and provenance readings. That composition is\n // declared on every entry below so the P44 combination test evaluates it.\n ...interactionSignals(),\n];\n","import { CURRENT_REGISTRY_VERSION, REGISTRY_VERSIONS } from './types';\nimport type { RegistryVersion, SignalDefinition, SignalPlane } from './types';\n\nfunction versionIndex(version: RegistryVersion): number {\n return REGISTRY_VERSIONS.indexOf(version);\n}\n\nfunction isActiveAt(signal: SignalDefinition, version: RegistryVersion): boolean {\n const at = versionIndex(version);\n const added = versionIndex(signal.addedVersion);\n const removed = signal.removedVersion === null ? Infinity : versionIndex(signal.removedVersion);\n return added <= at && at < removed;\n}\n\n/**\n * The signal set active at a given registry version. This is what\n * recomputation of a stored fingerprint MUST call, keyed off the\n * `registryVersion` pinned on that fingerprint — never the live\n * `SIGNAL_REGISTRY` — or historical records silently stop matching once the\n * registry moves on.\n *\n * Throws on a version outside `REGISTRY_VERSIONS` rather than silently\n * resolving to an empty signal set. A stored `registry_version` reaching\n * here unrecognized (corrupted, truncated, never valid) is exactly the\n * \"historical records silently stop matching\" failure this module exists\n * to prevent — better to fail loud than to hand recomputation zero signals.\n */\nexport function resolveSignalsAt(\n registry: SignalDefinition[],\n version: RegistryVersion = CURRENT_REGISTRY_VERSION\n): SignalDefinition[] {\n if (!REGISTRY_VERSIONS.includes(version)) {\n throw new Error(\n `Unrecognized registry version \"${version}\". Known versions: ${REGISTRY_VERSIONS.join(', ')}.`\n );\n }\n return registry.filter((signal) => isActiveAt(signal, version));\n}\n\nexport function getSignal(\n registry: SignalDefinition[],\n id: string,\n version: RegistryVersion = CURRENT_REGISTRY_VERSION\n): SignalDefinition | undefined {\n return resolveSignalsAt(registry, version).find((signal) => signal.id === id);\n}\n\n/** Every signal that has ever shipped, live or removed — for docs and audits, not for resolving a fingerprint. */\nexport function listShippedSignals(registry: SignalDefinition[]): SignalDefinition[] {\n return [...registry].sort((a, b) => a.id.localeCompare(b.id));\n}\n\nexport type GroupedSignals = Record<SignalPlane, Record<string, SignalDefinition[]>>;\n\n/**\n * Buckets signals by plane then group, matching the shape a Merkle tree's\n * leaf grouping should mirror. This module doesn't build a tree — it just\n * makes the grouping a lookup rather than something re-derived by hand.\n */\nexport function groupSignals(signals: SignalDefinition[]): GroupedSignals {\n const grouped: Partial<GroupedSignals> = {};\n for (const signal of signals) {\n const plane = (grouped[signal.plane] ??= {});\n (plane[signal.group] ??= []).push(signal);\n }\n return grouped as GroupedSignals;\n}\n","export default function canonicalize (object, seen = new Set()) {\n if (typeof object === 'number' && isNaN(object)) {\n throw new Error('NaN is not allowed');\n }\n\n if (typeof object === 'number' && !isFinite(object)) {\n throw new Error('Infinity is not allowed');\n }\n\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(object);\n }\n\n if (typeof object.toJSON === 'function') {\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n const result = canonicalize(object.toJSON(), seen);\n seen.delete(object);\n return result;\n }\n\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n\n let result;\n if (Array.isArray(object)) {\n const values = object.map((cv) => {\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return canonicalize(value, seen);\n });\n result = `[${values.join(',')}]`;\n } else {\n const parts = [];\n for (const key of Object.keys(object).sort()) {\n if (object[key] === undefined || typeof object[key] === 'symbol') {\n continue;\n }\n parts.push(`${canonicalize(key)}:${canonicalize(object[key], seen)}`);\n }\n result = `{${parts.join(',')}}`;\n }\n\n seen.delete(object);\n return result;\n}\n","/**\n * Merkle-tree fingerprint calculator (P8).\n *\n * Replaces a flat, single-digest fingerprint with a tree: one leaf digest\n * per signal, rolled up into a digest per group, rolled up into a digest\n * per plane, rolled up into a root. Every level is independently exposed\n * on the returned `FingerprintTree`, so \"what changed\" is answerable by\n * diffing sub-digests instead of staring at two unrelated flat hashes — a\n * GPU driver update shifts `planes.rendering` and leaves `planes.platform`\n * untouched; a different physical machine shifts nearly everything.\n *\n * Ported from fingerprintjs-ios's `FingerprintTreeCalculator` (MIT):\n * leaf = SHA256(value), node = SHA256(concat of children's hex digests).\n * This module adds the present/absent/error leaf-encoding contract that\n * upstream doesn't need — a native iOS read doesn't get silently blocked\n * the way a privacy browser blocks a web API.\n *\n * Grouping: this module does NOT invent a new taxonomy. `plane`/`group`\n * come straight from the signal registry (#4257) — `FROZEN_FIELDS` in\n * `./types.ts` already locks them once a signal ships, so the grouping\n * used here IS the registry's grouping, not a parallel one re-derived by\n * hand. See the P8 PR description for the plane/group semantics ratified\n * in review.\n *\n * Scope: hashing and storage only (P8). Nothing here consumes a\n * sub-fingerprint for scoring or linkage — that's P21/P31.\n */\n\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex } from '@noble/hashes/utils.js';\nimport canonicalize from 'canonicalize';\n\nimport { groupSignals, resolveSignalsAt } from './resolve';\nimport { CURRENT_REGISTRY_VERSION } from './types';\nimport type { RegistryVersion, SignalDefinition, SignalPlane } from './types';\n\n/**\n * One signal's collected reading, going into exactly one Merkle leaf.\n *\n * `absent` and a `present` reading with an empty/falsy value are DIFFERENT\n * leaves, deliberately. `absent` means the collector never ran or the read\n * was blocked (e.g. a privacy browser refusing WebGL); `present` with an\n * empty value means it ran and genuinely found nothing (e.g. zero\n * installed system fonts). Collapsing those would make a blocked source\n * indistinguishable from a device that legitimately has nothing there —\n * silently, since both would otherwise look identical once stored.\n *\n * `error` collapses every thrown error to one fixed leaf; `message` is\n * carried for logging only and is NEVER hashed. This mirrors\n * FingerprintJS's flattening of thrown errors to the literal string\n * `'error'` before hashing, so error-message churn between browser patch\n * versions can't move the fingerprint.\n *\n * Cross-reference: `EntropyOutcome<T>` in\n * `checkpoint-beacon/src/collectors/entropy/vendored-fingerprint.ts` is\n * the closest existing analog (ok/empty/timeout/absent), scoped to the\n * vendored FingerprintJS sources only. `SignalReading` is the general\n * contract every collector's output must eventually map onto to feed this\n * calculator; that mapping is a separate integration (collectors aren't\n * wired to a transport yet — see `entropy/index.ts`'s module doc) and is\n * out of scope for P8, which is hashing/storage only.\n */\nexport type SignalReading =\n | { kind: 'present'; value: unknown }\n | { kind: 'absent' }\n | { kind: 'error'; message?: string };\n\nexport interface GroupFingerprint {\n /** SHA-256 hex digest over this group's leaf digests, sorted by signal id. */\n digest: string;\n /** Signal id -> leaf digest, this group only. */\n leaves: Record<string, string>;\n}\n\nexport interface PlaneFingerprint {\n /** SHA-256 hex digest over this plane's group digests, sorted by group name. */\n digest: string;\n /**\n * Whether this plane's digest is one of `root`'s inputs. False only for\n * `behavioural` today — see `EXCLUDED_FROM_ROOT`.\n */\n includedInRoot: boolean;\n groups: Record<string, GroupFingerprint>;\n}\n\nexport interface FingerprintTree {\n /** The registry version this tree was resolved against. Pin this on the stored row; recompute WITH it, never with \"current\". */\n registryVersion: RegistryVersion;\n /** SHA-256 hex digest over the `includedInRoot` plane digests, sorted by plane name. */\n root: string;\n /** Every plane with at least one live signal at this registry version, keyed by plane name. */\n planes: Partial<Record<SignalPlane, PlaneFingerprint>>;\n}\n\n/**\n * Planes excluded from the identity root.\n *\n * Behavioural signals (interaction dynamics) change by design on every\n * session — folding them into the root would make the identity root drift\n * constantly rather than only on a genuine device change, defeating the\n * entire point of a stable device identifier. The behavioural subtree is\n * still computed and exposed on `planes.behavioural` for classification\n * use downstream; it just never feeds `root`.\n */\nconst EXCLUDED_FROM_ROOT: ReadonlySet<SignalPlane> = new Set<SignalPlane>(['behavioural']);\n\nconst TAG_PRESENT = 'v:';\nconst TAG_ABSENT = 'a:';\nconst TAG_ERROR = 'e:';\n\nfunction digestHex(bytes: Uint8Array): string {\n return bytesToHex(sha256(bytes));\n}\n\n/**\n * Encodes one reading into the bytes that get hashed for its leaf. Every\n * branch is tag-prefixed with a byte sequence no other branch can ever\n * produce, so absent/error/present-with-any-value never collide.\n */\nfunction leafBytes(reading: SignalReading | undefined): Uint8Array {\n // A signal id with no key at all in `readings` means the same thing as\n // an explicit `{ kind: 'absent' }`: nothing was collected for it.\n if (reading === undefined || reading.kind === 'absent') {\n return new TextEncoder().encode(TAG_ABSENT);\n }\n if (reading.kind === 'error') {\n // `reading.message`, if any, is intentionally never read here.\n return new TextEncoder().encode(`${TAG_ERROR}error`);\n }\n if (reading.value === undefined) {\n throw new Error(\n 'buildFingerprintTree: a \"present\" reading with value `undefined` is not a valid leaf — use { kind: \"absent\" } instead.'\n );\n }\n const json = canonicalize(reading.value);\n if (json === undefined) {\n throw new Error(\n 'buildFingerprintTree: reading value is not JSON-serializable (function, symbol, etc).'\n );\n }\n return new TextEncoder().encode(`${TAG_PRESENT}${json}`);\n}\n\n/**\n * Node digest = SHA256(concat of children's hex digests). Children MUST\n * already be in a caller-determined, key-sorted order — this function\n * does not re-sort, so ordering invariance is guaranteed by always\n * deriving the child list from the registry's sorted keys rather than\n * from a caller-supplied map's iteration order.\n */\nfunction nodeDigest(orderedChildDigests: string[]): string {\n return digestHex(new TextEncoder().encode(orderedChildDigests.join('')));\n}\n\n/**\n * Builds the Merkle fingerprint tree for one collection: a leaf per live\n * signal (present/absent/error), rolled up by group, rolled up by plane,\n * rolled up into a root that excludes `behavioural`.\n *\n * `readings` is keyed by signal id (`SignalDefinition.id`). A signal id\n * with no key at all is treated identically to an explicit\n * `{ kind: 'absent' }` reading.\n *\n * Pure and deterministic: the same `(registry, readings, registryVersion)`\n * always produces the same tree, regardless of `readings`' key order or\n * `registry`'s element order — every level is rebuilt from the registry's\n * own sorted `id`/`group`/`plane` keys, never from a caller's map\n * iteration order. `registryVersion` MUST be the version pinned on the\n * stored fingerprint when recomputing a historical tree; resolving\n * against \"current\" would silently produce a different tree once the\n * registry moves on (see `resolveSignalsAt`).\n */\nexport function buildFingerprintTree(\n registry: SignalDefinition[],\n readings: Record<string, SignalReading>,\n registryVersion: RegistryVersion = CURRENT_REGISTRY_VERSION\n): FingerprintTree {\n const grouped = groupSignals(resolveSignalsAt(registry, registryVersion));\n\n const planes: Partial<Record<SignalPlane, PlaneFingerprint>> = {};\n const rootInputs: string[] = [];\n\n for (const plane of (Object.keys(grouped) as SignalPlane[]).sort()) {\n const groupsForPlane = grouped[plane];\n const groups: Record<string, GroupFingerprint> = {};\n const groupDigests: string[] = [];\n\n for (const groupName of Object.keys(groupsForPlane).sort()) {\n const signalsInGroup = [...groupsForPlane[groupName]].sort((a, b) =>\n a.id.localeCompare(b.id)\n );\n const leaves: Record<string, string> = {};\n const leafDigests: string[] = [];\n for (const signal of signalsInGroup) {\n const digest = digestHex(leafBytes(readings[signal.id]));\n leaves[signal.id] = digest;\n leafDigests.push(digest);\n }\n const groupDigest = nodeDigest(leafDigests);\n groups[groupName] = { digest: groupDigest, leaves };\n groupDigests.push(groupDigest);\n }\n\n const planeDigest = nodeDigest(groupDigests);\n const includedInRoot = !EXCLUDED_FROM_ROOT.has(plane);\n planes[plane] = { digest: planeDigest, includedInRoot, groups };\n if (includedInRoot) rootInputs.push(planeDigest);\n }\n\n return {\n registryVersion,\n root: nodeDigest(rootInputs),\n planes,\n };\n}\n","/**\n * Session-level fingerprint hash (P33).\n *\n * `unified_agent_sessions.fingerprint_hash` has been declared since F-19\n * (migration 0124) — `visitor_id` is a STORED GENERATED column defined as\n * `COALESCE(user_account_id::text, 'unattributed:' || fingerprint_hash)` —\n * but nothing ever wrote it. Every anonymous visitor's `visitor_id`\n * therefore collapsed to the literal constant `'unattributed:'`, so a\n * COUNT(DISTINCT visitor_id) counted every anonymous visitor across an\n * entire org as ONE person. See\n * `docs/architecture/canonical-identity-model.md` (the `visitor_id`\n * correctness trap) for the full write-up.\n *\n * LIMITS (bestbrian, PR #4660): every input to this digest is\n * client-supplied via the pixel, so a hostile client can inflate or\n * collide anonymous visitor counts by varying or replaying its reported\n * attributes — this is inherent to any device-fingerprinting signal, not\n * specific to this implementation. It only affects the anonymous,\n * `'unattributed:'`-prefixed bucket: an authenticated `visitor_id` uses\n * `user_account_id` and never reaches this function, and the\n * `'unattributed:'` prefix keeps every fingerprinted visitor out of the\n * identity-merge graph. Treat anonymous visitor counts as estimate-grade\n * — strictly better than the prior all-collapse-to-one defect, not a\n * precise headcount.\n *\n * WHAT THIS COLUMN HOLDS (read this before changing the algorithm):\n *\n * This is a SHA-256 hex digest over the canonicalized (sorted-key, stable\n * JSON) map of `SignalsEnvelope.client.attributes` — the pixel-collected,\n * per-attribute entropy (device.platform, browser.language, screen\n * resolution, …) persisted verbatim on `detections.signals` by P6. It is\n * NOT the P8 Merkle-tree root (`buildFingerprintTree` in\n * `./merkle.ts`, `fingerprints.root`), even though P8 has landed: that\n * root is built from the formal signal REGISTRY (`./registry.ts`),\n * keyed by registered signal ids\n * (`canvas.geometry`, `platform.hardwareConcurrency`, …), and P8 itself\n * ships with zero callers that map a live collection onto those ids — that\n * mapping is explicitly out of scope for P8 (see its module doc: \"nothing\n * here consumes a sub-fingerprint for scoring or linkage yet — P21/P31\").\n * Inventing that mapping here, unreviewed, to force-fit `buildFingerprintTree`\n * would be worse than not using it: a registry-shaped root computed from a\n * fabricated id mapping is not actually comparable to a future REAL\n * registry-driven root, and callers would have no way to tell the\n * difference by looking at the column.\n *\n * What IS kept forward-compatible with P8, deliberately:\n * - Same primitive: SHA-256 hex, matching `merkle.ts`'s `digestHex`.\n * - Same exclusion principle: only IDENTITY-STABLE signals are hashed.\n * `SignalsEnvelope.behavioural` (mouse movements, scroll depth, time on\n * page) is a different axis from `client` and is never passed in here —\n * mirroring P8's own `EXCLUDED_FROM_ROOT` (`behavioural` is hashed for\n * classification but never rolled into the identity root), for the\n * same reason: behavioural signals churn every session by design, and\n * folding them in would make the \"same device\" hash drift on every\n * visit instead of only on a genuine device change.\n * - Same \"no entropy → no hash\" contract: `null` in, `null` out — this\n * function must NEVER fabricate a value for a session that carried no\n * signals. Downstream, `visitor_id` for such a session correctly stays\n * `'unattributed:'` (an honest bucket for genuinely-unknown visitors,\n * not a bug to paper over).\n *\n * When a real registry-attribute adapter exists (P21/P31), THIS function\n * should be retired in favor of `buildFingerprintTree(...).root`, and\n * `fingerprint_hash` should be repointed at it in one migration-free\n * application change (the column is `text`, so either shape fits) — do not\n * let the two representations coexist silently in the same column.\n */\n\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex } from '@noble/hashes/utils.js';\nimport canonicalize from 'canonicalize';\n\n/**\n * @param clientAttributes Signal-attribute-name -> collected string value —\n * e.g. `SignalsEnvelope.client.attributes` with each `ClientSignalAttribute`\n * unwrapped to its `.value` by the caller (kept decoupled from\n * `@kya-os/checkpoint-wasm-runtime`'s engine types on purpose: that\n * package depends on checkpoint-shared, not the other way around).\n * `null`/`undefined`/`{}` all mean \"no client entropy collected.\"\n * @returns A 64-char lowercase hex SHA-256 digest, or `null` when there is\n * nothing to hash. Never throws — a session with no entropy is a normal,\n * expected input, not an error.\n */\nexport function computeSessionFingerprintHash(\n clientAttributes: Record<string, string> | null | undefined\n): string | null {\n const names = Object.keys(clientAttributes ?? {});\n if (names.length === 0) return null;\n\n // Sort keys before canonicalizing so the digest is independent of\n // insertion order — `canonicalize` already sorts object keys, but the\n // explicit sort here documents the invariant this function's own tests\n // pin, rather than relying solely on the dependency's behavior.\n const sorted: Record<string, string> = {};\n for (const name of names.sort()) sorted[name] = clientAttributes![name];\n\n const json = canonicalize(sorted);\n // Unreachable for a plain string-keyed/string-valued map (every value is\n // JSON-serializable), but canonicalize's return type is `string |\n // undefined` — fail closed rather than hash `\"undefined\"`.\n if (json === undefined) return null;\n\n return bytesToHex(sha256(new TextEncoder().encode(json)));\n}\n","import { checkSensitiveAttributeCompliance } from './sensitive-attributes';\nimport { REGISTRY_VERSIONS } from './types';\nimport type { RegistryVersion, SignalDefinition, SignalMode, StabilityTier } from './types';\n\nconst VALID_TIERS: readonly StabilityTier[] = ['high', 'medium', 'low'];\nconst VALID_MODES: readonly SignalMode[] = ['open', 'consent', 'never'];\n\nexport interface RegistryValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nfunction versionIndex(version: RegistryVersion): number {\n return REGISTRY_VERSIONS.indexOf(version);\n}\n\n/**\n * Runtime validation of the registry's invariants. This exists alongside\n * the TypeScript types (not instead of them) because the enforcement this\n * feature needs — \"CI fails on an untiered signal\" — has to hold even if a\n * signal is constructed dynamically or a type is bypassed with `as any`.\n */\nexport function validateRegistry(signals: SignalDefinition[]): RegistryValidationResult {\n const errors: string[] = [];\n const byId = new Map<string, SignalDefinition>();\n const seenIds = new Set<string>();\n\n for (const signal of signals) {\n const label = signal?.id ?? '<unknown id>';\n\n if (seenIds.has(signal?.id)) {\n errors.push(`Duplicate signal id \"${signal.id}\".`);\n } else if (signal?.id) {\n seenIds.add(signal.id);\n byId.set(signal.id, signal);\n }\n\n if (!signal.tier) {\n errors.push(`Signal \"${label}\" has no tier. Every signal must carry a stability tier.`);\n } else if (!VALID_TIERS.includes(signal.tier)) {\n errors.push(`Signal \"${label}\" has invalid tier \"${signal.tier}\".`);\n }\n\n if (!signal.mode || !VALID_MODES.includes(signal.mode)) {\n errors.push(`Signal \"${label}\" has invalid mode \"${signal.mode}\".`);\n }\n\n if (!REGISTRY_VERSIONS.includes(signal.addedVersion)) {\n errors.push(`Signal \"${label}\" has invalid addedVersion \"${signal.addedVersion}\".`);\n }\n\n if (signal.removedVersion !== null) {\n if (!REGISTRY_VERSIONS.includes(signal.removedVersion)) {\n errors.push(`Signal \"${label}\" has invalid removedVersion \"${signal.removedVersion}\".`);\n } else if (versionIndex(signal.removedVersion) <= versionIndex(signal.addedVersion)) {\n errors.push(\n `Signal \"${label}\" has removedVersion \"${signal.removedVersion}\" at or before its addedVersion \"${signal.addedVersion}\".`\n );\n }\n }\n\n if (!signal.measurement) {\n errors.push(`Signal \"${label}\" has no measurement record for its tier assignment.`);\n } else if (!signal.measurement.provisional) {\n if (signal.measurement.agreementRate === null || signal.measurement.measuredAt === null) {\n errors.push(\n `Signal \"${label}\" has a finalized (non-provisional) tier but no recorded measurement (agreementRate/measuredAt). A tier with no measurement behind it is a guess wearing a label.`\n );\n }\n }\n\n // P44: sensitive-attribute rejection. Wired in here (not only into\n // registerSignal) so this fires unconditionally under validateRegistry,\n // already a load-bearing gate under `pnpm test:unit` (pre-push hook and\n // CI), and can't be bypassed by adding a signal directly to the\n // registry array without going through registerSignal.\n const sensitiveCheck = checkSensitiveAttributeCompliance(signal);\n if (!sensitiveCheck.ok) {\n for (const violation of sensitiveCheck.violations) {\n errors.push(`Signal \"${label}\" ${violation.message}`);\n }\n }\n }\n\n for (const signal of signals) {\n if (signal.supersedes === null) continue;\n const target = byId.get(signal.supersedes);\n if (!target) {\n errors.push(\n `Signal \"${signal.id}\" supersedes \"${signal.supersedes}\", which does not exist in the registry.`\n );\n continue;\n }\n if (\n target.removedVersion === null ||\n versionIndex(target.removedVersion) > versionIndex(signal.addedVersion)\n ) {\n errors.push(\n `Signal \"${signal.id}\" forks \"${signal.supersedes}\" at \"${signal.addedVersion}\", but \"${signal.supersedes}\" has no matching removedVersion. Set removedVersion=\"${signal.addedVersion}\" on \"${signal.supersedes}\" when forking.`\n );\n }\n }\n\n return { valid: errors.length === 0, errors };\n}\n","import type { DenoisePolicy, SignalDefinition, SnapshotRecord } from './types';\n\nexport interface SnapshotViolation {\n id: string;\n kind: 'edited' | 'deleted' | 'unrecorded';\n message: string;\n}\n\nexport interface SnapshotConsistencyResult {\n ok: boolean;\n violations: SnapshotViolation[];\n}\n\nfunction denoiseEqual(a: DenoisePolicy, b: DenoisePolicy): boolean {\n if (a.kind !== b.kind) return false;\n if (a.kind === 'modal' && b.kind === 'modal') return a.runs === b.runs;\n return true;\n}\n\n/**\n * The frozen snapshot of a signal, as it should be recorded in the\n * committed snapshot file. `finalizedTier` stays null until the signal's\n * measurement is no longer provisional (see `TierMeasurement.provisional`),\n * and `removedVersion` stays null until the signal is forked. Each locks in\n * exactly once — see `checkSnapshotConsistency`.\n */\nexport function computeImmutableSnapshot(signal: SignalDefinition): SnapshotRecord {\n return {\n id: signal.id,\n addedVersion: signal.addedVersion,\n removedVersion: signal.removedVersion,\n denoise: signal.denoise,\n mode: signal.mode,\n plane: signal.plane,\n group: signal.group,\n finalizedTier: signal.measurement.provisional ? null : signal.tier,\n };\n}\n\nconst FORK_INSTRUCTION =\n 'Shipped signals are immutable — a signal is never edited, only forked. ' +\n 'Create a new signal (e.g. \"<id>.v2\") with supersedes set to this id and ' +\n 'removedVersion set on this entry, instead of editing it in place.';\n\n/**\n * Compares the committed snapshot (what has already shipped) against the\n * live registry. This is deliberately NOT \"regenerate the snapshot from the\n * live registry and diff\" — that self-referential check would pass even\n * when an existing entry was edited, because the regenerated file would\n * just agree with the edit. Instead every id already in `committed` is\n * pinned, and the live registry is checked against that pin.\n */\nexport function checkSnapshotConsistency(\n committed: SnapshotRecord[],\n live: SignalDefinition[]\n): SnapshotConsistencyResult {\n const violations: SnapshotViolation[] = [];\n const liveById = new Map(live.map((s) => [s.id, s]));\n const committedIds = new Set(committed.map((r) => r.id));\n\n for (const record of committed) {\n const current = liveById.get(record.id);\n if (!current) {\n violations.push({\n id: record.id,\n kind: 'deleted',\n message: `Signal \"${record.id}\" was removed from the registry entirely. Mark it removed with removedVersion instead of deleting it — historical fingerprints still reference it.`,\n });\n continue;\n }\n\n const currentSnapshot = computeImmutableSnapshot(current);\n const frozenMismatch =\n currentSnapshot.addedVersion !== record.addedVersion ||\n !denoiseEqual(currentSnapshot.denoise, record.denoise) ||\n currentSnapshot.mode !== record.mode ||\n currentSnapshot.plane !== record.plane ||\n currentSnapshot.group !== record.group;\n\n // Once a tier is finalized (recorded non-null), it is frozen too. A\n // provisional tier (record.finalizedTier === null) is allowed to move\n // in place, and finalizing it for the first time is allowed.\n const tierMismatch =\n record.finalizedTier !== null && currentSnapshot.finalizedTier !== record.finalizedTier;\n\n // Same one-way lock as finalizedTier: removedVersion is null until the\n // signal is forked, then frozen. Marking it removed for the first time\n // is allowed; changing an already-recorded removedVersion is not.\n const removedVersionMismatch =\n record.removedVersion !== null && currentSnapshot.removedVersion !== record.removedVersion;\n\n if (frozenMismatch || tierMismatch || removedVersionMismatch) {\n violations.push({\n id: record.id,\n kind: 'edited',\n message: `Signal \"${record.id}\" was edited in place. ${FORK_INSTRUCTION} Re-running the snapshot recorder will not fix this — it refuses to overwrite a divergent entry.`,\n });\n }\n }\n\n for (const current of live) {\n if (!committedIds.has(current.id)) {\n violations.push({\n id: current.id,\n kind: 'unrecorded',\n message: `Signal \"${current.id}\" is new and not yet recorded. Run \\`pnpm --filter @kya-os/checkpoint-shared run signals:snapshot -- --write\\` and commit the result.`,\n });\n }\n }\n\n return { ok: violations.length === 0, violations };\n}\n\n/**\n * Snapshot writer: append-only for new signal ids, and refuses (throws)\n * rather than overwrite any existing record that disagrees with the live\n * registry — so running this locally after an in-place edit fails loudly\n * instead of quietly re-recording the edit as the new baseline.\n *\n * Existing records DO get rewritten, deliberately: `checkSnapshotConsistency`\n * having already passed (no violations) means the only way an existing\n * record can still differ from `computeImmutableSnapshot(current)` is one of\n * the two allowed one-way transitions (finalizing a provisional tier,\n * marking a signal removed) — so it's safe to persist the live value.\n * Recording only the truly-new ids and never updating existing ones was the\n * bug: a transition that `checkSnapshotConsistency` correctly allowed was\n * never actually written back, so the committed snapshot stayed at its\n * pre-transition value forever and the lock never engaged (Bugbot, PR #4257).\n */\nexport function recordSnapshot(\n committed: SnapshotRecord[],\n live: SignalDefinition[]\n): SnapshotRecord[] {\n const result = checkSnapshotConsistency(committed, live);\n const editedOrDeleted = result.violations.filter((v) => v.kind !== 'unrecorded');\n if (editedOrDeleted.length > 0) {\n throw new Error(editedOrDeleted.map((v) => v.message).join('\\n'));\n }\n\n const liveById = new Map(live.map((s) => [s.id, s]));\n const committedIds = new Set(committed.map((r) => r.id));\n\n const updated = committed.map((record) => {\n const current = liveById.get(record.id);\n return current ? computeImmutableSnapshot(current) : record;\n });\n\n const additions = live\n .filter((s) => !committedIds.has(s.id))\n .map((s) => computeImmutableSnapshot(s));\n\n return [...updated, ...additions];\n}\n","import { listShippedSignals } from './resolve';\nimport type { DenoisePolicy, SignalDefinition } from './types';\n\nconst GENERATED_HEADER = `<!-- GENERATED FILE — do not hand-edit. -->\n<!-- Generated from \\`packages/checkpoint-shared/src/signals/registry.ts\\` by -->\n<!-- \\`pnpm --filter @kya-os/checkpoint-shared run signals:docs\\`. -->\n<!-- CI rejects a stale copy of this file — see .github/workflows/signal-registry-check.yml. -->\n\n# Signal registry\n\nEvery signal ever shipped, generated from the registry so this can never\ndrift the way \\`fingerprintjs-android\\`'s hand-maintained \\`api_reference.md\\`\ndid (it stayed on \\`V_5\\` after the enum moved to \\`V_6\\`).\n\nA shipped signal is never edited, only forked: when a signal proves\nvolatile or is re-tiered, a new signal is added at the next version and the\nold one is marked removed (exclusive) rather than changed in place, so\nhistorical fingerprints stay reproducible against the version they were\ncomputed under.\n`;\n\nfunction formatDenoise(denoise: DenoisePolicy): string {\n return denoise.kind === 'modal' ? `modal(${denoise.runs})` : 'none';\n}\n\nfunction formatVersion(version: string | null): string {\n return version ?? '—';\n}\n\nfunction formatTier(signal: SignalDefinition): string {\n return signal.measurement.provisional ? `${signal.tier} (provisional)` : signal.tier;\n}\n\nfunction formatRow(signal: SignalDefinition): string {\n const cells = [\n `\\`${signal.id}\\``,\n `${signal.plane}/${signal.group}`,\n formatVersion(signal.addedVersion),\n formatVersion(signal.removedVersion),\n formatTier(signal),\n signal.mode,\n formatDenoise(signal.denoise),\n signal.supersedes ? `\\`${signal.supersedes}\\`` : '—',\n signal.u === null ? '—' : String(signal.u),\n ];\n return `| ${cells.join(' | ')} |`;\n}\n\nconst TABLE_HEADER = [\n '| id | plane/group | added | removed | tier | mode | denoise | supersedes | u |',\n '| --- | --- | --- | --- | --- | --- | --- | --- | --- |',\n].join('\\n');\n\n/**\n * Pure markdown generator over the registry — the doc-generation half of\n * \"generate the docs from the registry rather than maintaining them by\n * hand.\" Deterministic (stable sort, no timestamps) so regeneration\n * produces a clean diff only when the registry actually changed.\n */\nexport function generateRegistryMarkdown(registry: SignalDefinition[]): string {\n const rows = listShippedSignals(registry).map(formatRow);\n return [GENERATED_HEADER, TABLE_HEADER, ...rows, ''].join('\\n');\n}\n"],"x_google_ignoreList":[4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,oBAAoB;CAAC;CAAM;CAAM;AAAI;AAIlD,MAAa,2BACX,kBAAkB,kBAAkB,SAAS;;AA8E/C,MAAa,gBAAgB;CAAC;CAAM;CAAgB;CAAW;CAAQ;CAAS;AAAO;;;;;;;;AASvF,MAAa,qBAAqB,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpEzC,MAAa,oCAAoC,CAAC,IAAI;AAItD,MAAa,2CACX,kCAAkC,kCAAkC,SAAS;AA6B/E,MAAa,qCAGT,EACF,IAAI;CACF;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GAAC;GAAiB;GAAiB;GAAkB;EAAqB;CACtF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GACR;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS;GACP;GACA;GACA;EACF;EACA,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GAAC;GAAsB;GAAY;EAA0B;CACzE;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GACR;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aACE;EACF,SAAS,CAAC,wCAAwC;EAClD,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,wCAAwC;EAClD,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;AACF,EACF;AA8BA,MAAa,yBAAgD,CAC3D;CACE,IAAI;CACJ,UAAU;CACV,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,YAAY;CACZ,SAAS;EACP;EACA;EACA;CACF;CACA,WACE;AACJ,GACA;CACE,IAAI;CACJ,UAAU;CACV,WAAW;EAAC;EAAsB;EAAqB;CAAyB;CAChF,YAAY;CACZ,SAAS,CACP,uEACA,wCACF;CACA,WACE;AACJ,CACF;;;;;;;AAqDA,SAAS,mBAAmB,MAAsB;CAChD,OAAO,KAAK,QAAQ,sBAAsB,OAAO,CAAC,CAAC,QAAQ,WAAW,GAAG;AAC3E;;;;;;;;;;;;;AAcA,SAAS,UAAU,QAA0E;CAI3F,OAAO,CAHK,GAAG,OAAO,GAAG,GAAG,OAAO,YAAY,GAAG,OAAO,QAAQ,YAGvD,GADR,GAAG,mBAAmB,OAAO,EAAE,EAAE,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ACnB,mFACA,yDACF,CAAC,CAAC,KAAK,IAAI;;;;;;;AAQX,SAAgB,yBAAyB,UAAsC;CAC7E,MAAM,OAAO,mBAAmB,QAAQ,CAAC,CAAC,IAAI,SAAS;CACvD,OAAO;EAAC;EAAkB;EAAc,GAAG;EAAM;CAAE,CAAC,CAAC,KAAK,IAAI;AAChE"}
1
+ {"version":3,"file":"index.mjs","names":["versionIndex"],"sources":["../../src/signals/types.ts","../../src/signals/sensitive-attributes.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../../../node_modules/.pnpm/canonicalize@3.0.0/node_modules/canonicalize/lib/canonicalize.js","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/device-fingerprint.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts"],"sourcesContent":["/**\n * Signal registry types.\n *\n * A \"signal\" is one named, independently-collected piece of device/browser\n * entropy (e.g. `canvas.geometry`, `platform.timezone`). The registry is the\n * single declarative source of truth for every signal's version range,\n * stability tier, de-noising policy, consent mode, and linkage weight.\n *\n * Core rule: a shipped signal is never edited, only forked. See\n * `immutability.ts` for the mechanism that enforces this.\n */\n\n/**\n * Ordered registry versions. Order matters — it defines \"added\"/\"removed\"\n * comparisons.\n *\n * A new signal is added at a NEW version once fingerprint trees are being\n * stored (P55 pins `registry_version` on every row): `buildFingerprintTree`\n * digests every signal resolved at a version, absent leaves included, so an\n * addition at an existing version would silently change what every tree\n * pinned to that version recomputes to. v3 = the behavioural plane's first\n * entries (interaction physics).\n */\nexport const REGISTRY_VERSIONS = ['v1', 'v2', 'v3'] as const;\n\nexport type RegistryVersion = (typeof REGISTRY_VERSIONS)[number];\n\nexport const CURRENT_REGISTRY_VERSION: RegistryVersion =\n REGISTRY_VERSIONS[REGISTRY_VERSIONS.length - 1];\n\n/**\n * High: agreement above threshold across sessions and browser minor versions,\n * survives driver updates. Weighted heavily in linkage.\n * Medium: stable within a browser major version, may move on OS/driver update.\n * Low: moves within a session or on trivial user action. Collected for\n * contradiction detection, weighted near zero for identity.\n */\nexport type StabilityTier = 'high' | 'medium' | 'low';\n\n/**\n * `open` signals score in the EEA before a consent prompt; `consent` signals\n * do not; `never` signals are collected for contradiction/debug only and\n * never contribute to identity. This is a property of the signal, not the\n * caller, so the two output modes stay enforceable rather than aspirational.\n */\nexport type SignalMode = 'open' | 'consent' | 'never';\n\n/**\n * Where a signal's read sits for Merkle-tree leaf grouping. The tree itself\n * is out of scope here; `plane`/`group` just need to be a lookup future tree\n * code can group leaves by, so \"the rendering sub-tree moved\" is a statement\n * about a set of signals you can look up rather than something re-derived\n * by hand in tree code.\n */\nexport type SignalPlane = 'rendering' | 'platform' | 'transport' | 'behavioural';\n\nexport type DenoisePolicy = { kind: 'none' } | { kind: 'modal'; runs: number };\n\n/**\n * The measured-agreement record behind a tier assignment. `provisional: true`\n * marks a tier assigned by documented judgement ahead of real measurement\n * (e.g. before the prompt-2 stability harness exists) — see\n * `immutability.ts` for how provisional entries may still be updated in\n * place versus frozen ones, which may only be forked.\n */\nexport interface TierMeasurement {\n /** Proportion of reads that agreed, in [0, 1]. Null while provisional. */\n agreementRate: number | null;\n sampleSize: number;\n /** Browsers/versions the measurement covered, e.g. [\"chrome-124\", \"brave-1.68\"]. */\n browsers: string[];\n /** ISO date the measurement was taken. Null while provisional. */\n measuredAt: string | null;\n provisional: boolean;\n notes: string;\n}\n\n/** Ordered rejection-list versions. Order matters: CURRENT is always the last entry. */\nexport const SENSITIVE_REJECTION_LIST_VERSIONS = ['v1'] as const;\n\nexport type SensitiveRejectionListVersion = (typeof SENSITIVE_REJECTION_LIST_VERSIONS)[number];\n\n/**\n * Sensitive Data Inference categories, seeded from CO's five base categories\n * plus WA/NV health and CT biometric-derivative/government-ID additions.\n */\nexport type SensitiveAttributeCategory =\n | 'racial-or-ethnic-origin'\n | 'religious-or-philosophical-beliefs'\n | 'mental-or-physical-health-condition-or-diagnosis'\n | 'sex-life-or-sexual-orientation'\n | 'citizenship-or-immigration-status'\n | 'biometric-identifier-or-derivative'\n | 'government-identification-number';\n\n/**\n * Required on every `SignalDefinition`. `derivesCategory` is where a human\n * reviewer declares, up front, what category (if any) this feature derives:\n * the \"declared feature intent\" half of the combination-test mechanism.\n * Declaring `null` does not bypass the mechanical checks below; it only\n * means the reviewer's own assessment agreed the feature is clear.\n */\nexport interface SensitiveAttributeReview {\n /** Rejection-list version this signal was evaluated against. */\n listVersion: SensitiveRejectionListVersion;\n reviewedBy: string;\n /** ISO date. */\n reviewedAt: string;\n /** Other signal ids this signal is declared to compose with downstream (e.g. in a derived/composite feature). */\n combinesWith: string[];\n /** The reviewer's own declared conclusion; null means \"does not derive a sensitive category\". */\n derivesCategory: SensitiveAttributeCategory | null;\n /** Non-empty: why this signal, alone and in combination with `combinesWith`, does not derive a sensitive attribute. */\n rationale: string;\n}\n\nexport interface SignalDefinition {\n /** Stable identifier, dotted namespace, e.g. \"canvas.geometry\". */\n id: string;\n /** Registry version this signal was added in. */\n addedVersion: RegistryVersion;\n /** Registry version this signal was removed in, exclusive. Null while live. */\n removedVersion: RegistryVersion | null;\n tier: StabilityTier;\n measurement: TierMeasurement;\n denoise: DenoisePolicy;\n mode: SignalMode;\n plane: SignalPlane;\n /** Finer-grained grouping within a plane, e.g. \"canvas\" within \"rendering\". */\n group: string;\n /** Coincidence probability from the attribute frequency table. Null until populated. */\n u: number | null;\n /** Signal id this one forks from, if any. */\n supersedes: string | null;\n description: string;\n /**\n * Required sensitive-attribute review (P44). Enforced at registration by\n * `registerSignal`/`validateRegistry` in `sensitive-attributes.ts`: every\n * signal must declare this, and it must be reviewed against the current\n * rejection-list version, or registration is rejected.\n */\n review: SensitiveAttributeReview;\n}\n\n/** Fields frozen once a signal has shipped (see immutability.ts). */\nexport const FROZEN_FIELDS = ['id', 'addedVersion', 'denoise', 'mode', 'plane', 'group'] as const;\n\n/**\n * Fields frozen only once the tier has been finalized (`measurement.provisional`\n * flips to `false`). While provisional, tier/measurement may be updated in\n * place as real data comes in; once finalized, any further change requires\n * a fork — mirroring the `BatteryFullCapacity` -> `BatteryFullCapacityV2`\n * precedent, where the read didn't change, only its classification did.\n */\nexport const TIER_LOCKED_FIELDS = ['tier'] as const;\n\n/**\n * The committed, append-only record of a shipped signal's frozen fields.\n * `finalizedTier` and `removedVersion` are both null until set once — a\n * signal's tier is finalized exactly once (see `TierMeasurement.provisional`)\n * and it is marked removed exactly once (at the version that forks it) —\n * and from that point on each is one of the frozen fields.\n */\nexport interface SnapshotRecord {\n id: string;\n addedVersion: RegistryVersion;\n removedVersion: RegistryVersion | null;\n denoise: DenoisePolicy;\n mode: SignalMode;\n plane: SignalPlane;\n group: string;\n finalizedTier: StabilityTier | null;\n}\n","import {\n SENSITIVE_REJECTION_LIST_VERSIONS,\n type SensitiveAttributeCategory,\n type SensitiveAttributeReview,\n type SensitiveRejectionListVersion,\n type SignalDefinition,\n} from './types';\n\n/**\n * Feature-registration guard: rejects any signal (feature) that derives a\n * Sensitive Data Inference, at registration time.\n *\n * WHY THIS EXISTS (P44)\n * ----------------------\n * Liability under CO/WA/NV/CT attaches at the INFERENCE step, not the\n * collection step. Colorado's rule says this most plainly: raw browsing data\n * may be benign, but browsing data which, alone or combined with other\n * personal data, infers sexual orientation IS sensitive, and sensitive data\n * requires opt-in consent. The same raw signal is therefore benign or\n * regulated depending only on what gets computed from it, so the one place\n * that can actually hold this line is the point where a *derived feature*\n * gets named and shipped, not a data-collection policy doc. Enforcing it\n * here, in the code that builds the live signal registry, means the four\n * regimes below are satisfied by one control instead of four separate ones.\n *\n * DECISION LOG: v1 list contents (needs legal/product sign-off)\n * ----------------------------------------------------------------\n * The category list below seeds from the ticket's own citations: Colorado's\n * Sensitive Data Inference categories (race/ethnicity, religion, mental or\n * physical health, sex life/orientation, citizenship status), plus\n * Washington's My Health My Data Act and Nevada SB 370 (health specifically),\n * plus Connecticut's Data Privacy Act (biometric derivatives and government\n * ID numbers). This is an engineering starting point, not a finished legal\n * determination. The mechanism (versioned list plus forced re-evaluation on\n * version bump, see `findSignalsNeedingReevaluation`) exists precisely so\n * Legal/Product can revise the list in place and have every existing\n * registered feature re-reviewed against the new version before it's\n * considered compliant again. Do not treat v1 as final without that sign-off.\n *\n * ON \"BIOMETRIC\" KEYWORDS: a deliberate omission\n * -------------------------------------------------\n * This module and its neighbors use \"fingerprint\" pervasively to mean\n * *device/browser* fingerprinting (canvas hash, audio hash, WebGL hash), not\n * a human biometric identifier. Connecticut's biometric-data category means\n * data generated from measurements of an individual's *body* (voiceprint,\n * faceprint, iris/retina scan, gait). The keyword list below intentionally\n * avoids the bare words \"fingerprint\"/\"biometric\" for that reason: using\n * them would false-positive on this entire module.\n */\n\n// ---------------------------------------------------------------------------\n// Versioned rejection list\n// ---------------------------------------------------------------------------\n\nexport const CURRENT_SENSITIVE_REJECTION_LIST_VERSION: SensitiveRejectionListVersion =\n SENSITIVE_REJECTION_LIST_VERSIONS[SENSITIVE_REJECTION_LIST_VERSIONS.length - 1];\n\nexport interface SensitiveAttributeRule {\n category: SensitiveAttributeCategory;\n description: string;\n /** The regime(s) this category maps to, cited so a rejection points at *why*, not just *that*. */\n regimes: string[];\n /**\n * Lowercase substrings scanned against a candidate signal's id/description/\n * group. Deliberately narrow and phrase-based (not single common words) to\n * avoid false-positiving on unrelated engineering vocabulary: see the\n * \"fingerprint\" note above.\n */\n keywords: string[];\n}\n\nexport const SENSITIVE_ATTRIBUTE_REJECTION_LIST: Record<\n SensitiveRejectionListVersion,\n SensitiveAttributeRule[]\n> = {\n v1: [\n {\n category: 'racial-or-ethnic-origin',\n description: 'Inference indicating racial or ethnic origin.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: ['racial origin', 'ethnic origin', 'race indicator', 'ethnicity indicator'],\n },\n {\n category: 'religious-or-philosophical-beliefs',\n description: 'Inference indicating religious or philosophical beliefs.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: [\n 'religious belief',\n 'religious observance',\n 'philosophical belief',\n 'faith affiliation',\n ],\n },\n {\n category: 'mental-or-physical-health-condition-or-diagnosis',\n description: 'Inference indicating a mental or physical health condition or diagnosis.',\n regimes: [\n 'CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)',\n 'WA My Health My Data Act (RCW 19.373)',\n 'NV SB 370 (consumer health data)',\n ],\n keywords: [\n 'health condition',\n 'medical condition',\n 'health diagnosis',\n 'mental health condition',\n 'mental health diagnosis',\n 'physical health condition',\n 'disability status',\n 'disease indicator',\n 'illness indicator',\n ],\n },\n {\n category: 'sex-life-or-sexual-orientation',\n description: 'Inference indicating sex life or sexual orientation.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: ['sexual orientation', 'sex life', 'gender identity inferred'],\n },\n {\n category: 'citizenship-or-immigration-status',\n description: 'Inference indicating citizenship or citizenship status.',\n regimes: ['CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)'],\n keywords: [\n 'citizenship status',\n 'immigration status',\n 'visa status',\n 'national origin status',\n 'resident alien status',\n ],\n },\n {\n category: 'biometric-identifier-or-derivative',\n description:\n 'A biometric identifier, or a derivative of one, used to identify an individual.',\n regimes: ['CT Data Privacy Act (Public Act 22-15)'],\n keywords: [\n 'voiceprint',\n 'faceprint',\n 'iris scan',\n 'retina scan',\n 'facial geometry',\n 'gait analysis',\n 'palm print',\n 'dna profile',\n 'genetic marker',\n ],\n },\n {\n category: 'government-identification-number',\n description: 'A government-issued identification number.',\n regimes: ['CT Data Privacy Act (Public Act 22-15)'],\n keywords: [\n 'social security number',\n 'ssn',\n 'passport number',\n \"driver's license number\",\n 'driver license number',\n 'national id number',\n 'government id number',\n 'tax id number',\n ],\n },\n ],\n};\n\n// ---------------------------------------------------------------------------\n// Composition-risk table: the \"combination test\"\n// ---------------------------------------------------------------------------\n\n/**\n * Two individually benign signals can compose into a sensitive inference. A\n * purely mechanical keyword check (above) cannot catch this: it has no way\n * to know that reduced-motion + inverted-colors + contrast, combined, name a\n * disability-accommodation profile. So this table exists as the declared,\n * human-reviewed record of *known* composition risks: populating and\n * maintaining it IS the human step the ticket calls for; checking a new\n * registration's declared `combinesWith` set against it IS the code\n * enforcing that the step happened. A composition not yet in this table is\n * not proven safe, it just hasn't been reviewed yet, which is why every\n * `combinesWith` entry still requires a human `reviewedBy` (enforced in\n * `checkReviewRecordIntegrity` below), not only a passing table lookup.\n */\nexport interface CompositionRiskRule {\n id: string;\n category: SensitiveAttributeCategory;\n /** Signal ids known to compose into this category when combined. */\n signalIds: string[];\n /** Minimum number of `signalIds` that must co-occur (this signal + its declared combinesWith) to fire. */\n minMatches: number;\n regimes: string[];\n rationale: string;\n}\n\nexport const COMPOSITION_RISK_RULES: CompositionRiskRule[] = [\n {\n id: 'accessibility-preference-composite',\n category: 'mental-or-physical-health-condition-or-diagnosis',\n signalIds: [\n 'platform.reducedMotion',\n 'platform.invertedColors',\n 'platform.contrast',\n 'platform.forcedColors',\n 'platform.reducedTransparency',\n ],\n minMatches: 2,\n regimes: [\n 'CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)',\n 'WA My Health My Data Act (RCW 19.373)',\n 'NV SB 370 (consumer health data)',\n ],\n rationale:\n 'Two or more OS-level accessibility-preference reads (reduced motion, inverted colors, forced colors, reduced contrast, reduced transparency), combined into one derived feature, reliably identify a disability/health accommodation (e.g. vestibular disorder, low vision, photosensitivity), even though each individual CSS media-feature probe is, alone, a consent-gated, near-zero-weight contradiction signal.',\n },\n {\n id: 'locale-cluster-national-origin-composite',\n category: 'citizenship-or-immigration-status',\n signalIds: ['platform.languages', 'platform.timezone', 'platform.dateTimeLocale'],\n minMatches: 3,\n regimes: [\n 'CO Privacy Act Rules, 4 CCR 904-3 §2.02 (Sensitive Data Inferences)',\n 'CT Data Privacy Act (Public Act 22-15)',\n ],\n rationale:\n 'Combining accepted-languages, IANA timezone, and resolved locale into one derived \"origin\" feature moves from three individually benign, user-configurable locale reads into a feature whose purpose is inferring likely national origin/immigration status: the \"alone or combined\" inference Colorado\\'s rule targets.',\n },\n];\n\n// ---------------------------------------------------------------------------\n// Checks\n// ---------------------------------------------------------------------------\n\nexport type SensitiveAttributeViolationKind =\n | 'direct'\n | 'composition'\n | 'declared'\n | 'stale-review';\n\nexport interface SensitiveAttributeViolation {\n kind: SensitiveAttributeViolationKind;\n /** Null for a `stale-review` violation: a missing/incomplete/stale review record names no sensitive category, it's a structural completeness failure. */\n category: SensitiveAttributeCategory | null;\n /** Rule id (composition rule id, or the rejection-list category as its own id for direct/declared matches). */\n ruleId: string;\n regimes: string[];\n message: string;\n}\n\n/**\n * Splits a dotted/camelCase/snake_case/kebab-case identifier into\n * space-separated words, so a keyword PHRASE like \"mental health condition\"\n * can match an id like `health.mentalHealthConditionIndicator`, which has\n * no natural word separators at all.\n */\nfunction tokenizeIdentifier(text: string): string {\n return text.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/[._-]+/g, ' ');\n}\n\n/**\n * Two scan surfaces, checked together, not one replacing the other\n * (Cursor Bugbot, PR #4645, two rounds): the RAW lowercased text, where a\n * single fused-case compound like `voicePrint` already contains the\n * single-word keyword \"voiceprint\" via ordinary substring matching with no\n * tokenization needed; and the TOKENIZED text, where a multi-word phrase\n * keyword like \"mental health condition\" can match a camelCase id that\n * spells it with no spaces at all. Tokenizing and discarding the raw form\n * fixed the phrase case while silently breaking the fused-word case: a\n * space inserted between \"voice\" and \"Print\" stops \"voiceprint\" from\n * matching. Neither surface alone is sufficient, so both are scanned.\n */\nfunction scanTexts(signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>): string[] {\n const raw = `${signal.id} ${signal.description} ${signal.group}`.toLowerCase();\n const tokenized =\n `${tokenizeIdentifier(signal.id)} ${tokenizeIdentifier(signal.description)} ${tokenizeIdentifier(signal.group)}`.toLowerCase();\n return [raw, tokenized];\n}\n\n/** Mechanical keyword scan of a signal's own id/description/group against the rejection list. Test 1. */\nexport function checkDirectMatch(\n signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>,\n version: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SensitiveAttributeViolation[] {\n const texts = scanTexts(signal);\n const rules = SENSITIVE_ATTRIBUTE_REJECTION_LIST[version];\n const violations: SensitiveAttributeViolation[] = [];\n for (const rule of rules) {\n const hit = rule.keywords.find((keyword) => texts.some((text) => text.includes(keyword)));\n if (hit) {\n violations.push({\n kind: 'direct',\n category: rule.category,\n ruleId: rule.category,\n regimes: rule.regimes,\n message: `derives \"${rule.category}\" (matched \"${hit}\"): a direct Sensitive Data Inference per ${rule.regimes.join('; ')}.`,\n });\n }\n }\n return violations;\n}\n\n/**\n * The combination test: does this signal's declared `combinesWith` set,\n * together with its own id, cross a known composition-risk rule's\n * minimum-match threshold? Test 4.\n */\nexport function checkCompositionRisk(\n signalId: string,\n combinesWith: string[]\n): SensitiveAttributeViolation[] {\n if (combinesWith.length === 0) return [];\n const combinationSet = new Set([signalId, ...combinesWith]);\n const violations: SensitiveAttributeViolation[] = [];\n for (const rule of COMPOSITION_RISK_RULES) {\n const matches = rule.signalIds.filter((id) => combinationSet.has(id));\n if (matches.length >= rule.minMatches) {\n violations.push({\n kind: 'composition',\n category: rule.category,\n ruleId: rule.id,\n regimes: rule.regimes,\n message: `combination rule \"${rule.id}\" fired: [${matches.join(', ')}] combine into \"${rule.category}\" per ${rule.regimes.join('; ')}. ${rule.rationale}`,\n });\n }\n }\n return violations;\n}\n\n/** A reviewer who declared this feature DOES derive a sensitive category: the honest-disclosure path. */\nexport function checkDeclaredCategory(\n review: Pick<SensitiveAttributeReview, 'derivesCategory'>,\n version: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SensitiveAttributeViolation[] {\n if (review.derivesCategory === null) return [];\n const rule = SENSITIVE_ATTRIBUTE_REJECTION_LIST[version].find(\n (r) => r.category === review.derivesCategory\n );\n const regimes = rule?.regimes ?? [];\n return [\n {\n kind: 'declared',\n category: review.derivesCategory,\n ruleId: review.derivesCategory,\n regimes,\n message: `reviewer declared this feature derives \"${review.derivesCategory}\"${regimes.length ? ` (${regimes.join('; ')})` : ''}.`,\n },\n ];\n}\n\n/**\n * Structural integrity of the review record itself: a missing or stale\n * review is treated as non-compliant, not as \"no violations found\". This is\n * the enforcement half of \"the code needs to enforce that the [human] step\n * happened\": an absent or out-of-date review can't silently read as clear.\n */\nexport function checkReviewRecordIntegrity(\n review: SignalDefinition['review'] | undefined,\n currentVersion: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SensitiveAttributeViolation[] {\n if (!review) {\n return [\n {\n kind: 'stale-review',\n category: null,\n ruleId: 'missing-review',\n regimes: [],\n message: 'has no sensitiveAttributeReview record: every registered signal requires one.',\n },\n ];\n }\n if (!review.reviewedBy || !review.reviewedAt || !review.rationale) {\n return [\n {\n kind: 'stale-review',\n category: null,\n ruleId: 'incomplete-review',\n regimes: [],\n message: 'has an incomplete review record (reviewedBy/reviewedAt/rationale required).',\n },\n ];\n }\n if (review.listVersion !== currentVersion) {\n return [\n {\n kind: 'stale-review',\n category: null,\n ruleId: 'stale-list-version',\n regimes: [],\n message: `was reviewed against rejection-list version \"${review.listVersion}\", but the current version is \"${currentVersion}\": re-evaluation required. See findSignalsNeedingReevaluation().`,\n },\n ];\n }\n return [];\n}\n\n/** The single shared check both `registerSignal` and `validateRegistry` call, so there is no logic drift between entry points. */\nexport function evaluateSensitiveAttributeCompliance(\n signal: SignalDefinition\n): SensitiveAttributeViolation[] {\n return [\n ...checkDirectMatch(signal),\n ...checkCompositionRisk(signal.id, signal.review?.combinesWith ?? []),\n ...(signal.review ? checkDeclaredCategory(signal.review) : []),\n ...checkReviewRecordIntegrity(signal.review),\n ];\n}\n\n// ---------------------------------------------------------------------------\n// Actionable error\n// ---------------------------------------------------------------------------\n\nfunction formatViolation(v: SensitiveAttributeViolation): string {\n return ` - [${v.kind}] ${v.message}`;\n}\n\nexport class SensitiveAttributeRejectionError extends Error {\n readonly signalId: string;\n readonly violations: SensitiveAttributeViolation[];\n\n constructor(signalId: string, violations: SensitiveAttributeViolation[]) {\n const lines = [\n `Feature registration rejected for \"${signalId}\": Sensitive Data Inference constraint(s) fired.`,\n ...violations.map(formatViolation),\n 'This is a legal boundary (see CO Privacy Act Rules Sensitive Data Inferences; WA My Health My Data Act; NV SB 370; CT Data Privacy Act) enforced in code, not documentation.',\n 'To register this feature: resolve the conflict (drop the derivation, or narrow combinesWith) and route the change through the sensitive-attribute review process (see docs/governance/sensitive-attribute-rejection-list.md) before re-registering. Do not bypass by editing SIGNAL_REGISTRY directly: validateRegistry() enforces the same check.',\n ];\n super(lines.join('\\n'));\n this.name = 'SensitiveAttributeRejectionError';\n this.signalId = signalId;\n this.violations = violations;\n }\n}\n\n/**\n * The single approved way to add a signal to the live registry. Throws with\n * an actionable message (naming the exact category/rule and pointing at the\n * review process) rather than a bare \"feature rejected\". Returns the\n * definition unchanged on success so callers can do\n * `RAW.map(registerSignal)`.\n */\nexport function registerSignal(definition: SignalDefinition): SignalDefinition {\n const violations = evaluateSensitiveAttributeCompliance(definition);\n if (violations.length > 0) {\n throw new SensitiveAttributeRejectionError(definition.id, violations);\n }\n return definition;\n}\n\n/**\n * Non-throwing variant used by `validateRegistry` (and directly by anyone\n * validating a whole array) so a bypass of `registerSignal`, such as a\n * hand-edited registry array, is still caught by the same shared logic.\n */\nexport function checkSensitiveAttributeCompliance(signal: SignalDefinition): {\n ok: boolean;\n violations: SensitiveAttributeViolation[];\n} {\n const violations = evaluateSensitiveAttributeCompliance(signal);\n return { ok: violations.length === 0, violations };\n}\n\n/**\n * Signals whose review is pinned to a rejection-list version older than\n * current: the concrete \"changes trigger re-evaluation\" mechanism. Also\n * doubles as the \"which version was a given model trained under\" answer:\n * once this returns empty for a registry snapshot, every feature in it was\n * reviewed against `CURRENT_SENSITIVE_REJECTION_LIST_VERSION`.\n */\nexport function findSignalsNeedingReevaluation(\n signals: SignalDefinition[],\n currentVersion: SensitiveRejectionListVersion = CURRENT_SENSITIVE_REJECTION_LIST_VERSION\n): SignalDefinition[] {\n return signals.filter((s) => !s.review || s.review.listVersion !== currentVersion);\n}\n","import { CURRENT_SENSITIVE_REJECTION_LIST_VERSION } from './sensitive-attributes';\nimport type { SignalDefinition, TierMeasurement } from './types';\n\n/**\n * The signal registry: single declarative source of truth for every\n * signal's version range, stability tier, de-noise policy, consent mode,\n * and Merkle-tree grouping. Collectors and recomputation reference this —\n * nothing hardcodes a signal name or a denoise run count at a call site.\n *\n * A shipped signal is never edited, only forked (see immutability.ts and\n * `.github/workflows/signal-registry-check.yml`). Adding a new signal or\n * finalizing a still-provisional tier does not need a fork; changing\n * addedVersion/denoise/mode/plane/group, or a tier once finalized, does.\n *\n * Provisional tiers: the stability harness that measures real per-browser\n * agreement rates does not exist yet in this repo (tracked as a follow-on).\n * Every tier below is seeded from documented reasoning about each read's\n * known volatility (farbling, driver/OS dependence, etc.), not from\n * measurement, and is marked `measurement.provisional: true` accordingly.\n * A tier with no measurement behind it is a guess wearing a label — so\n * these are explicitly labelled provisional rather than presented as final.\n * Once the harness lands, finalize these in place (see TIER_LOCKED_FIELDS);\n * finalizing is a one-way door — after that, a re-tiering must fork.\n */\n\nfunction provisional(notes: string): TierMeasurement {\n return {\n agreementRate: null,\n sampleSize: 0,\n browsers: [],\n measuredAt: null,\n provisional: true,\n notes,\n };\n}\n\n/**\n * P44 sensitive-attribute review record shared by every signal below that\n * does not derive a Sensitive Data Inference on its own or in combination\n * (see sensitive-attributes.ts for the versioned rejection list and\n * composition-risk table this is checked against at registration). Every\n * signal here evaluates to `derivesCategory: null` with no known composition\n * risk, so one shared record covers them all instead of 38 near-identical\n * inline literals going stale independently.\n */\nfunction compliantReview(): SignalDefinition['review'] {\n return {\n listVersion: CURRENT_SENSITIVE_REJECTION_LIST_VERSION,\n reviewedBy: 'privacy-review@kya-os.example',\n reviewedAt: '2026-08-19',\n combinesWith: [],\n derivesCategory: null,\n rationale:\n 'Raw device/browser entropy read; no plausible link to a Sensitive Data Inference category, individually or via a known composition-risk rule.',\n };\n}\n\n/** Every interaction-plane id, for each entry's `combinesWith` (the composite reads them all). */\nconst INTERACTION_SIGNAL_IDS = [\n 'interaction.keyDwellUnder5Share',\n 'interaction.keyGapUnder5Share',\n 'interaction.pressUnder10Share',\n 'interaction.zeroTrailClickShare',\n 'interaction.untrustedInputShare',\n 'interaction.mousePerClick',\n] as const;\n\nfunction interactionReview(id: string): SignalDefinition['review'] {\n return {\n listVersion: CURRENT_SENSITIVE_REJECTION_LIST_VERSION,\n reviewedBy: 'privacy-review@kya-os.example',\n reviewedAt: '2026-09-03',\n combinesWith: INTERACTION_SIGNAL_IDS.filter((other) => other !== id),\n derivesCategory: null,\n rationale:\n 'A per-visit share of input events below a physical floor (or a per-visit ratio of two event counts), derived from integer counters; no per-event timing, coordinate, or key identity is collected, so the read cannot reconstruct a typing or pointer rhythm and is not a biometric identifier or a derivative of one (mode: never, so it is excluded from identity linkage regardless). It reads 0 for a person at any speed, ability, or input method, since the floors sit below any hand; it therefore carries no information about a health condition or accommodation. Its only composition is interaction_integrity, a Noisy-OR over the other interaction shares, which derives \"driven by software\" and nothing about the person.',\n };\n}\n\nfunction interactionSignals(): SignalDefinition[] {\n const entry = (\n id: (typeof INTERACTION_SIGNAL_IDS)[number],\n description: string,\n notes: string\n ): SignalDefinition => ({\n id,\n addedVersion: 'v3',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(notes),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'behavioural',\n group: 'interaction',\n u: null,\n supersedes: null,\n description,\n review: interactionReview(id),\n });\n\n return [\n entry(\n 'interaction.keyDwellUnder5Share',\n 'Share of paired keystrokes (keydown to keyup) held under 5ms; IME composition, left/right modifiers, and auto-repeat are not timed, and key timing stops once a finger has touched the page.',\n 'Lab gauntlet, two recordings and three driver rigs against production (plan P0.5): hand minimum dwell 39ms, share 0; CDP drivers 0-1ms on every key, share 1. Playwright type({ delay }) manufactures a hand dwell and reads 0: the timing rungs raise the bar and prove nothing, which is why the ladder ends in a challenge. Seeded from that corpus, not a stability harness; finalize once P3 calibration has the trap populations (IME, dictation, on-screen keyboard, switch access).'\n ),\n entry(\n 'interaction.keyGapUnder5Share',\n 'Share of timed keydown-to-next-keydown gaps within 2s that were under 5ms: a whole string arriving in one tick.',\n 'Same corpus: hand minimum gap 26ms, share 0; CDP drivers 0ms, share 0.97 to 1. AltGr (Control then Alt back to back) is excluded by the modifier guard; a held key auto-repeats without entering the gap count. Provisional pending the trap populations.'\n ),\n entry(\n 'interaction.pressUnder10Share',\n 'Share of primary-pointer presses (pointerdown to pointerup) under 10ms; a second finger is not a press and a cancelled press does not pair with the next release.',\n 'Same corpus: hand minimum press 38ms, share 0; CDP drivers 2-7ms, share 0.8 to 1. Playwright click({ delay }) holds the press and reads 0. Provisional pending the touch and switch-access populations.'\n ),\n entry(\n 'interaction.zeroTrailClickShare',\n 'Of clicks whose own pointerType is mouse and that follow at least one observed pointer move, the share with no mousemove or wheel in the preceding 300ms: a pointer that appeared on its target.',\n 'Same corpus: every hand click approached, share 0; Claude-in-Chrome 8 of 12 unapproached, the cdp rig 0.7. Taps, keyboard-activated buttons, and a click before any move has been seen are outside the denominator, so a cursor already resting on a button is unknown rather than a teleport. Weaker than the timing rungs (the plan weights it 0.4) because a scroll-then-click is an ordinary thing for a hand; provisional.'\n ),\n entry(\n 'interaction.untrustedInputShare',\n 'Share of counted input events (throttled mousemove, keydown, scroll, click, touchstart) dispatched with isTrusted false: input from a script or extension rather than the browser reacting to hardware.',\n \"The content-script rung (#4842). A person's input is always trusted and the flag is browser-set and read-only, so it cannot be forged upward; the content-script rig reads 0.96 with human-shaped timing, and a CDP-driven browser reads 0 because its synthetic input arrives trusted, which is what the timing rungs above are for. Human baseline 0 of 15 windows. Provisional pending the autofill and accessibility-tool populations, whose events are trusted and should read 0.\"\n ),\n entry(\n 'interaction.mousePerClick',\n 'Throttled (50ms) mouse moves per mouse click over the visit; undefined on touch traffic, which fires no mousemove.',\n 'The backstop (#4806): a hand cannot reach a button without dragging the pointer across the screen (measured 33 moves per click) while a driver teleports (measured 2). Noisy on short windows (human 1 to 15 on 4s windows) and undefined for touch, so it is weighted 0.2 in the composite and read only as the mouse-only kinematics reading. Provisional.'\n ),\n ];\n}\n\nexport const SIGNAL_REGISTRY: SignalDefinition[] = [\n // --- rendering plane ---------------------------------------------------\n {\n id: 'canvas.geometry',\n addedVersion: 'v1',\n removedVersion: 'v2',\n tier: 'medium',\n measurement: provisional(\n 'Canvas 2D geometry rasterisation is GPU/driver dependent; expected to move on driver updates, stable otherwise. No modal() de-noising applied yet, so privacy-browser farbling is expected to reduce agreement — this is exactly what the v2 fork below addresses.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'canvas',\n u: null,\n supersedes: null,\n description:\n 'Hash of a rendered 2D canvas shape/text scene. Single-read today; superseded by canvas.geometry.v2 once modal(3) de-noising lands (prompt 2).',\n review: compliantReview(),\n },\n {\n id: 'canvas.geometry.v2',\n addedVersion: 'v2',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Same read as canvas.geometry, sampled 3x and reduced by mode to recover the deterministic render under per-session farbling noise (Brave/Firefox/Safari). Originally a worked fork example proving the versioning mechanism ahead of the real collector; #4256 has since landed the real geometry-only collector (packages/checkpoint-beacon/.../entropy/canvas.ts) with these exact frozen fields (modal(3), consent, rendering/canvas), so this entry is now that signal for real, not just the demo.'\n ),\n denoise: { kind: 'modal', runs: 3 },\n mode: 'consent',\n plane: 'rendering',\n group: 'canvas',\n u: null,\n supersedes: 'canvas.geometry',\n description:\n 'Hash of a rendered 2D canvas GEOMETRY-ONLY scene (overlapping shapes, a bezier stroke); no text is drawn into this read. Forked from canvas.geometry (which conflated shape and text in one read) to apply modal(3) de-noising instead of editing the shipped v1 definition in place. As of #4256/P10, geometry and text are collected and hashed as two fully independent signals (see canvas.text): a font-stack change moves canvas.text and leaves this one untouched, and vice versa for a GPU/driver change.',\n review: compliantReview(),\n },\n {\n id: 'canvas.text',\n addedVersion: 'v2',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"Canvas 2D text rasterisation (mixed fonts, emoji) is materially less stable than canvas geometry: it moves on font-stack changes, emoji font updates, and subpixel antialiasing changes, none of which touch canvas.geometry.v2's arcs/bezier stroke. Hashing geometry and text together (as the pre-#4256 client-side detector did, with a 32-bit DJB2 digest with nowhere near enough entropy to separate devices in the first place) meant any text drift destroyed the geometry evidence too; kept as an independent signal with its own, lower tier instead.\"\n ),\n denoise: { kind: 'modal', runs: 3 },\n mode: 'consent',\n plane: 'rendering',\n group: 'canvas',\n u: null,\n supersedes: null,\n description:\n 'Hash of a rendered 2D canvas TEXT-ONLY scene (mixed fonts, emoji); no geometry primitives are drawn into this read. Collected and hashed independently of canvas.geometry.v2 by the same collector module (packages/checkpoint-beacon/.../entropy/canvas.ts), so a font-stack or emoji-font change moves this signal without disturbing the geometry one.',\n review: compliantReview(),\n },\n {\n id: 'webgl.render',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'WebGL renderer/parameter fingerprint. Moves on GPU driver updates; stable within a driver version. Farbling affects some browsers (notably Samsung Internet).'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'webgl',\n u: null,\n supersedes: null,\n description: 'Hash of WebGL renderer info and a rendered scene.',\n review: compliantReview(),\n },\n {\n id: 'audio.digest',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'AudioContext oscillator/compressor output digest. Deterministic per audio stack; moves on driver/OS audio-subsystem updates.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'audio',\n u: null,\n supersedes: null,\n description: 'Digest of a rendered AudioContext sample buffer.',\n review: compliantReview(),\n },\n {\n id: 'rendering.fonts',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Enumerated available font list. High entropy but moves whenever the OS font stack changes (OS updates, new app installs).'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'fonts',\n u: null,\n supersedes: null,\n description: 'Set of locally-available fonts detected via width-probing.',\n review: compliantReview(),\n },\n {\n id: 'rendering.mathFingerprint',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'Floating-point transcendental function results depend on the JS engine and CPU FPU implementation, not on user state or GPU driver — expected to be stable across sessions and survive most updates, per FingerprintJS/ThumbmarkJS prior art.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'rendering',\n group: 'math',\n u: null,\n supersedes: null,\n description: 'Hash of a battery of Math.* transcendental function results.',\n review: compliantReview(),\n },\n\n // --- platform plane ------------------------------------------------------\n {\n id: 'platform.hardwareConcurrency',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'navigator.hardwareConcurrency reflects physical core count, effectively constant for a given device.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description: 'Reported logical CPU core count.',\n review: compliantReview(),\n },\n {\n id: 'platform.deviceMemory',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'navigator.deviceMemory is a coarse, bucketed value tied to physical RAM; effectively constant for a given device.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description: 'Reported device memory in GB, bucketed by the browser.',\n review: compliantReview(),\n },\n {\n id: 'platform.screenResolution',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Screen resolution is stable per device but changes on external-monitor connect/disconnect or OS display scaling changes.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'screen.width/height and color depth.',\n review: compliantReview(),\n },\n {\n id: 'platform.timezone',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'IANA timezone name. Stable per device/user but changes on travel or explicit user change — a trivial, legitimate user action, so capped at medium rather than high.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'locale',\n u: null,\n supersedes: null,\n description: 'Intl-resolved IANA timezone.',\n review: compliantReview(),\n },\n {\n id: 'platform.languages',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'navigator.languages ordering/content is stable per device but is user-configurable, a trivial action.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'locale',\n u: null,\n supersedes: null,\n description: 'Ordered list of accepted languages.',\n review: compliantReview(),\n },\n {\n id: 'platform.permissions',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Permission grant states (geolocation, notifications, camera, microphone) change whenever the user grants/revokes a permission — moves within a session on a trivial user action. Collected for contradiction detection, weighted near zero for identity.'\n ),\n denoise: { kind: 'modal', runs: 3 },\n mode: 'consent',\n plane: 'platform',\n group: 'permissions',\n u: null,\n supersedes: null,\n description: 'Modal permission state per permission name (Permissions API).',\n review: compliantReview(),\n },\n\n // --- vendored FingerprintJS sources (prompt 9) ---------------------------\n // See packages/checkpoint-beacon/src/vendor/fingerprintjs/VENDORING.md for\n // the pinned commit and the full included/excluded source reasoning.\n {\n id: 'platform.userAgentData',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'User-Agent Client Hints high-entropy values (architecture, bitness, model, platformVersion), Chromium-only. Device model in particular is highly identifying: the same sensitivity Chromium itself recognises by gating getHighEntropyValues() behind a Permissions-Policy check. Effectively device-constant when available.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description:\n 'UA-CH brands/mobile/platform plus high-entropy architecture/bitness/model/platformVersion.',\n review: compliantReview(),\n },\n {\n id: 'rendering.fontPreferences',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Measured widths of a fixed set of font-preset text samples inside an iframe. Stable per OS/browser install; the upstream source itself documents floating-point measurement noise across zoom levels on some browsers, hence medium rather than high pending real measurement.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'rendering',\n group: 'fonts',\n u: null,\n supersedes: null,\n description:\n 'Dictionary of measured text-sample widths under a fixed set of font/style presets.',\n review: compliantReview(),\n },\n {\n id: 'platform.osCpu',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.oscpu, Firefox-only and largely redundant with the platform/UA family. Shared by every user of a given Firefox+OS combination, so low uniqueness on its own: contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'navigator.oscpu, when present.',\n review: compliantReview(),\n },\n {\n id: 'platform.colorDepth',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'window.screen.colorDepth is effectively constant (24, occasionally 30) across nearly all modern displays. Very low entropy by itself.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Reported screen color depth in bits.',\n review: compliantReview(),\n },\n {\n id: 'platform.sessionStorage',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Boolean availability of window.sessionStorage. Near-universally true; moves only under specific privacy configurations. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether window.sessionStorage is available.',\n review: compliantReview(),\n },\n {\n id: 'platform.localStorage',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Boolean availability of window.localStorage. Near-universally true; moves only under specific privacy configurations. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether window.localStorage is available.',\n review: compliantReview(),\n },\n {\n id: 'platform.indexedDB',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Boolean availability of window.indexedDB (undefined on IE/Edge in private mode by design, per upstream source comment). Near-universally true elsewhere. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether window.indexedDB is available.',\n review: compliantReview(),\n },\n {\n id: 'platform.navigatorPlatform',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.platform (with the iPad/iPhone WebKit correction upstream applies). Shared by every user of a given OS+browser-mode combination, so low uniqueness alone.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'Reported navigator.platform, WebKit iPad/iPhone-corrected.',\n review: compliantReview(),\n },\n {\n id: 'platform.touchSupport',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'maxTouchPoints + TouchEvent/ontouchstart feature detection. Stable per device and useful for separating phone/tablet from desktop form factors, but shared by every device of the same model.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description: 'maxTouchPoints plus TouchEvent/ontouchstart availability.',\n review: compliantReview(),\n },\n {\n id: 'platform.vendor',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.vendor. A handful of possible values shared by huge populations (e.g. every Chromium user reads \"Google Inc.\"). Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'Reported navigator.vendor.',\n review: compliantReview(),\n },\n {\n id: 'platform.vendorFlavors',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Presence of browser-specific (not engine-specific) global variables (e.g. window.chrome, window.__firefox__). Distinguishes browser flavor within an engine family; still shared by every install of that browser.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'identity',\n u: null,\n supersedes: null,\n description: 'Sorted list of detected browser-specific global variable names.',\n review: compliantReview(),\n },\n {\n id: 'platform.cookiesEnabled',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'Live cookie-write/read probe. Near-universally true; moves whenever the user or a privacy extension blocks cookies, a trivial, legitimate action. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'storage',\n u: null,\n supersedes: null,\n description: 'Whether a test cookie can be written and read back.',\n review: compliantReview(),\n },\n {\n id: 'platform.colorGamut',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'CSS color-gamut media-feature probe (srgb/p3/rec2020). Reflects the physical display panel, stable until an external-monitor change.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Widest supported color gamut per the CSS color-gamut media feature.',\n review: compliantReview(),\n },\n {\n id: 'platform.invertedColors',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS inverted-colors media-feature probe: an OS-level accessibility preference, not a display capability. Consent-gated like platform.permissions, since it can correlate with a vision-related accessibility need, so it is collected for contradiction detection only and weighted near zero for identity.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether the OS-level \"invert colors\" accessibility preference is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.forcedColors',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS forced-colors media-feature probe: an OS-level accessibility preference (Windows High Contrast and similar). Consent-gated for the same reason as platform.invertedColors.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether an OS-level forced-colors accessibility mode is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.monochrome',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS monochrome media-feature probe (bits per pixel on a non-color/e-ink-style display, or 0). Reflects display hardware, not a user preference, unlike the accessibility-preference probes above.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description:\n 'Monochrome display bit depth per the CSS monochrome media feature, or undefined if unsupported.',\n review: compliantReview(),\n },\n {\n id: 'platform.contrast',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS prefers-contrast media-feature probe: an OS-level accessibility preference. Consent-gated for the same reason as platform.invertedColors/platform.forcedColors.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'OS-level contrast preference per the CSS prefers-contrast media feature.',\n review: compliantReview(),\n },\n {\n id: 'platform.reducedMotion',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS prefers-reduced-motion media-feature probe: an OS-level accessibility preference that can correlate with a vestibular-disorder accommodation. Consent-gated, contradiction-detection only.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether the OS-level \"reduce motion\" accessibility preference is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.reducedTransparency',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'CSS prefers-reduced-transparency media-feature probe: an OS-level accessibility preference. Consent-gated for the same reason as platform.reducedMotion.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description: 'Whether the OS-level \"reduce transparency\" accessibility preference is active.',\n review: compliantReview(),\n },\n {\n id: 'platform.hdr',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'CSS dynamic-range media-feature probe (high vs standard). Reflects display hardware capability, stable until an external-monitor change.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description:\n 'Whether the display supports high dynamic range per the CSS dynamic-range media feature.',\n review: compliantReview(),\n },\n {\n id: 'platform.pdfViewerEnabled',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'navigator.pdfViewerEnabled, Chromium-only. Near-constant true across recent Chromium installs. Contradiction-detection value only.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: 'Reported navigator.pdfViewerEnabled.',\n review: compliantReview(),\n },\n {\n id: 'platform.architecture',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'high',\n measurement: provisional(\n 'Distinguishes x86/x86-64 from other CPU architectures via IEEE 754 NaN sign-bit behaviour on infinity subtraction. Depends on CPU architecture only, effectively device-constant like hardwareConcurrency/deviceMemory.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'hardware',\n u: null,\n supersedes: null,\n description:\n 'Single byte distinguishing CPU architecture via a floating-point NaN sign-bit probe.',\n review: compliantReview(),\n },\n {\n id: 'platform.applePay',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'ApplePaySession.canMakePayments() state, Safari-only. Depends on device wallet configuration, which can change independently of the fingerprint; mostly useful for Safari-family detection.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: 'Apple Pay availability/enabled state (Safari only).',\n review: compliantReview(),\n },\n {\n id: 'platform.privateClickMeasurement',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"Presence of Safari's Privacy-Preserving Ad Measurement attribution-source attribute. Safari-only, mostly stable across recent versions.\"\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: \"Whether Safari's private click measurement attribution attribute is present.\",\n review: compliantReview(),\n },\n {\n id: 'rendering.audioBaseLatency',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'AudioContext.baseLatency, a scalar tied to the audio hardware/OS audio stack. Distinct collection mechanism from audio.digest (no oscillator rendering, no shared context), so this does not duplicate that signal.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'rendering',\n group: 'audio',\n u: null,\n supersedes: null,\n description:\n 'Reported AudioContext.baseLatency, or a negative status code when unsupported/disabled.',\n review: compliantReview(),\n },\n {\n id: 'platform.dateTimeLocale',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'Intl.DateTimeFormat().resolvedOptions().locale. Stable per device/user but trivially user-configurable, same rationale as platform.timezone/platform.languages.'\n ),\n denoise: { kind: 'none' },\n mode: 'open',\n plane: 'platform',\n group: 'locale',\n u: null,\n supersedes: null,\n description: 'Intl-resolved locale string, or a negative status code when unsupported.',\n review: compliantReview(),\n },\n\n // --- ThumbmarkJS-ported sources, prompt 11 ---------------------------\n // Three sources FingerprintJS's 42-source list has no equivalent for at\n // all (see packages/checkpoint-beacon/src/collectors/entropy/webrtc.ts,\n // speech.ts, media-queries.ts for the collectors and the privacy\n // reasoning behind the WebRTC collector in particular).\n {\n id: 'transport.webrtcCodecs',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n 'RTP header extensions and per-codec (rtpmap/fmtp/rtcp-fb) descriptors parsed from a locally-generated SDP offer. Determined by the WebRTC engine build and codec licensing bundled with a given browser version; stable within a browser version, moves on browser updates that add/remove codec or extension support (e.g. AV1/VP9 profile rollout). Collection never gathers a real ICE candidate: setLocalDescription is never called AND iceCandidatePoolSize is 0, so neither of the two ways gathering can start ever fires (see webrtc.ts).'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'transport',\n group: 'webrtc',\n u: null,\n supersedes: null,\n description:\n 'Counts and digests of RTP extensions (extmap) and per-codec descriptors (rtpmap/fmtp/rtcp-fb) for audio and video, parsed from a locally-generated SDP offer.',\n review: compliantReview(),\n },\n {\n id: 'platform.speechVoices',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n \"speechSynthesis.getVoices() reduced to voiceURI/name/lang/localService/default per voice, sorted, then hashed. Tied to the OS/browser installed voice set: stable per device, moves when the OS installs a language pack or a browser update changes its bundled voice list. No modal() de-noising applies (voice enumeration is not farbled/randomized per call the way canvas/WebGL/audio reads are) — the observed timing nondeterminism is handled by the collector's voiceschanged/timeout race, not by resampling.\"\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'capabilities',\n u: null,\n supersedes: null,\n description: 'Voice count and a digest of the sorted, normalized speechSynthesis voice list.',\n review: compliantReview(),\n },\n {\n id: 'platform.mediaQuerySweep',\n addedVersion: 'v1',\n removedVersion: 'v2',\n tier: 'medium',\n measurement: provisional(\n 'Systematic sweep of every legal value across 11 CSS media-query families (prefers-contrast, any-hover, any-pointer, pointer, hover, update, inverted-colors, prefers-reduced-motion, prefers-reduced-transparency, scripting, forced-colors). Mostly OS/input-hardware driven and stable per device, but a few families (hover/pointer/any-hover/any-pointer) can move on a trivial user action such as docking a touch device to a mouse, capping this at medium rather than high pending real measurement. Deliberately overlaps 5 already-registered vendored-FingerprintJS signals (platform.contrast, platform.invertedColors, platform.reducedMotion, platform.reducedTransparency, platform.forcedColors) as a cross-validation check, not a duplication bug — see media-queries.ts.'\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: null,\n description:\n 'Per-family matched value across 11 media-query families (family absent from the result when unsupported, never a false/placeholder value), plus a family count and a digest. Forked to platform.mediaQuerySweep.v2, which narrows this to 6 families: combining the 5 accessibility-preference families into this one derived feature trips the accessibility-preference-composite Sensitive Data Inference composition rule (see sensitive-attributes.ts) — a disability/health-accommodation inference risk, per P44. Collector-only; never wired into scoring, transport, or the identity graph at any point in this signal\\'s v1 lifetime, so no stored device data exists to preserve compatibility with (Cursor Bugbot, PR #4639) — forked anyway, per this file\\'s \"never edited, only forked\" discipline.',\n review: compliantReview(),\n },\n {\n id: 'platform.mediaQuerySweep.v2',\n addedVersion: 'v2',\n removedVersion: null,\n tier: 'medium',\n measurement: provisional(\n \"Systematic sweep of every legal value across 6 CSS media-query families (any-hover, any-pointer, pointer, hover, update, scripting) — none of which any existing collector reads. Mostly OS/input-hardware driven and stable per device, but a few families (hover/pointer/any-hover/any-pointer) can move on a trivial user action such as docking a touch device to a mouse, capping this at medium rather than high pending real measurement. Forked from platform.mediaQuerySweep (v1) to EXCLUDE the 5 media-query families already registered as their own accessibility-preference signals (platform.contrast, platform.invertedColors, platform.reducedMotion, platform.reducedTransparency, platform.forcedColors): combining 2+ of those into one derived feature trips the accessibility-preference-composite Sensitive Data Inference composition rule (see sensitive-attributes.ts) — a disability/health-accommodation inference risk, per P44. See media-queries.ts's module doc.\"\n ),\n denoise: { kind: 'none' },\n mode: 'consent',\n plane: 'platform',\n group: 'display',\n u: null,\n supersedes: 'platform.mediaQuerySweep',\n description:\n 'Per-family matched value across 6 media-query families with no existing collector (family absent from the result when unsupported, never a false/placeholder value), plus a family count and a digest. Excludes the 5 families already covered by their own registered accessibility-preference signals — see measurement notes.',\n review: compliantReview(),\n },\n\n // --- User-Agent Client Hints, contradiction-only (prompt 12) ------------\n // Distinct from platform.userAgentData (prompt 9): that signal is the\n // bundled entropy read FingerprintJS itself needs (mode: consent, one\n // signal). These nine are collected purely to catch a spoofed\n // User-Agent string disagreeing with the browser's real Client Hints —\n // mode: 'never', so none of them ever contribute to identity linkage.\n // See packages/checkpoint-beacon/src/collectors/entropy/client-hints.ts.\n {\n id: 'platform.clientHints.architecture',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"UA-CH high-entropy `architecture` hint (e.g. 'arm', 'x86'). Requested independently of platform.userAgentData's copy of the same hint, specifically so it can feed User-Agent/Client-Hints contradiction detection rather than identity linkage.\"\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy CPU architecture hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.bitness',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"UA-CH high-entropy `bitness` hint (e.g. '64'). Collected for contradiction detection only; see platform.clientHints.architecture.\"\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy CPU bitness hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.model',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `model` hint. Empty string on desktop; device model on mobile. Collected for contradiction detection only; see platform.clientHints.architecture.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy device model hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.platform',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n \"UA-CH low-entropy `platform` (e.g. 'Windows', 'macOS', 'Linux', 'Android', 'Chrome OS'), read synchronously off navigator.userAgentData rather than requested through getHighEntropyValues(). The half of this collector's output the platform contradiction check actually compares against the User-Agent string's platform.\"\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH low-entropy platform family string.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.platformVersion',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `platformVersion` hint (OS version string). Collected for contradiction detection only; see platform.clientHints.architecture.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy OS version hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.uaFullVersion',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `uaFullVersion` hint — deprecated upstream in favour of `fullVersionList`, but still requested here because a spoofing tool that patches the User-Agent string is more likely to miss this legacy field than the one it actually knows to fake.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy (deprecated) full browser version hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.fullVersionList',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `fullVersionList` hint: brand/full-version pairs, GREASE entries filtered before this signal is ever populated (see the collector for the filter and why an unfiltered read would self-split on every request).'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy brand/full-version list, GREASE-filtered.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.wow64',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH high-entropy `wow64` hint: whether a 32-bit browser is running under WOW64 on 64-bit Windows. Collected for contradiction detection only; see platform.clientHints.architecture.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH high-entropy Windows WOW64 hint.',\n review: compliantReview(),\n },\n {\n id: 'platform.clientHints.mobile',\n addedVersion: 'v1',\n removedVersion: null,\n tier: 'low',\n measurement: provisional(\n 'UA-CH low-entropy `mobile` flag, read synchronously off navigator.userAgentData rather than requested through getHighEntropyValues(). Collected for contradiction detection only (e.g. against a desktop User-Agent string), not identity linkage.'\n ),\n denoise: { kind: 'none' },\n mode: 'never',\n plane: 'platform',\n group: 'clientHints',\n u: null,\n supersedes: null,\n description: 'UA-CH low-entropy mobile-device flag.',\n review: compliantReview(),\n },\n\n // --- Interaction physics, contradiction-only (agentic-session plan P1.1) --\n // The behavioural plane's first entries. Each is a per-visit SHARE derived\n // server-side from integer counters the pixel's detector and the beacon's\n // InteractionCollector accumulate (apps/web/lib/detection/timing-physics.ts\n // reads both lanes through one function). They exist to tell a driven\n // browser from a person, never to say WHICH person: mode 'never', so none\n // enters identity linkage or the Merkle tree; tier 'low', because a share\n // of a visit's events is by definition a within-session quantity.\n //\n // The reads are floor-crossings. A hand's shortest measured key dwell on the\n // lab gauntlet was 39ms, its shortest click press 38ms, its shortest\n // inter-key gap 26ms, and every one of its clicks was approached by the\n // pointer; a browser driven over CDP produced 0-1ms dwells, 2-7ms presses,\n // 0ms gaps, and clicks with no approach. The counters bucket at 5ms and 10ms,\n // below any hand, so each share reads 0 for a person whatever their speed\n // and near 1 for a driver. No timestamp, coordinate, or key identity leaves\n // the page; a counter cannot be replayed into a rhythm. The mean dwell and\n // mean press that the same counters also yield are lab-calibration display\n // only and are NOT registered here; promoting either would need its own\n // review, because \"how long a hand holds a key\" is a property of the hand.\n //\n // Combined downstream by `interaction_integrity` (apps/web/lib/detection/\n // interaction-integrity.ts, scorer v1, shadow-only): a Noisy-OR over the\n // keyboard, press, approach, and provenance readings. That composition is\n // declared on every entry below so the P44 combination test evaluates it.\n ...interactionSignals(),\n];\n","import { CURRENT_REGISTRY_VERSION, REGISTRY_VERSIONS } from './types';\nimport type { RegistryVersion, SignalDefinition, SignalPlane } from './types';\n\nfunction versionIndex(version: RegistryVersion): number {\n return REGISTRY_VERSIONS.indexOf(version);\n}\n\nfunction isActiveAt(signal: SignalDefinition, version: RegistryVersion): boolean {\n const at = versionIndex(version);\n const added = versionIndex(signal.addedVersion);\n const removed = signal.removedVersion === null ? Infinity : versionIndex(signal.removedVersion);\n return added <= at && at < removed;\n}\n\n/**\n * The signal set active at a given registry version. This is what\n * recomputation of a stored fingerprint MUST call, keyed off the\n * `registryVersion` pinned on that fingerprint — never the live\n * `SIGNAL_REGISTRY` — or historical records silently stop matching once the\n * registry moves on.\n *\n * Throws on a version outside `REGISTRY_VERSIONS` rather than silently\n * resolving to an empty signal set. A stored `registry_version` reaching\n * here unrecognized (corrupted, truncated, never valid) is exactly the\n * \"historical records silently stop matching\" failure this module exists\n * to prevent — better to fail loud than to hand recomputation zero signals.\n */\nexport function resolveSignalsAt(\n registry: SignalDefinition[],\n version: RegistryVersion = CURRENT_REGISTRY_VERSION\n): SignalDefinition[] {\n if (!REGISTRY_VERSIONS.includes(version)) {\n throw new Error(\n `Unrecognized registry version \"${version}\". Known versions: ${REGISTRY_VERSIONS.join(', ')}.`\n );\n }\n return registry.filter((signal) => isActiveAt(signal, version));\n}\n\nexport function getSignal(\n registry: SignalDefinition[],\n id: string,\n version: RegistryVersion = CURRENT_REGISTRY_VERSION\n): SignalDefinition | undefined {\n return resolveSignalsAt(registry, version).find((signal) => signal.id === id);\n}\n\n/** Every signal that has ever shipped, live or removed — for docs and audits, not for resolving a fingerprint. */\nexport function listShippedSignals(registry: SignalDefinition[]): SignalDefinition[] {\n return [...registry].sort((a, b) => a.id.localeCompare(b.id));\n}\n\nexport type GroupedSignals = Record<SignalPlane, Record<string, SignalDefinition[]>>;\n\n/**\n * Buckets signals by plane then group, matching the shape a Merkle tree's\n * leaf grouping should mirror. This module doesn't build a tree — it just\n * makes the grouping a lookup rather than something re-derived by hand.\n */\nexport function groupSignals(signals: SignalDefinition[]): GroupedSignals {\n const grouped: Partial<GroupedSignals> = {};\n for (const signal of signals) {\n const plane = (grouped[signal.plane] ??= {});\n (plane[signal.group] ??= []).push(signal);\n }\n return grouped as GroupedSignals;\n}\n","export default function canonicalize (object, seen = new Set()) {\n if (typeof object === 'number' && isNaN(object)) {\n throw new Error('NaN is not allowed');\n }\n\n if (typeof object === 'number' && !isFinite(object)) {\n throw new Error('Infinity is not allowed');\n }\n\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(object);\n }\n\n if (typeof object.toJSON === 'function') {\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n const result = canonicalize(object.toJSON(), seen);\n seen.delete(object);\n return result;\n }\n\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n\n let result;\n if (Array.isArray(object)) {\n const values = object.map((cv) => {\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return canonicalize(value, seen);\n });\n result = `[${values.join(',')}]`;\n } else {\n const parts = [];\n for (const key of Object.keys(object).sort()) {\n if (object[key] === undefined || typeof object[key] === 'symbol') {\n continue;\n }\n parts.push(`${canonicalize(key)}:${canonicalize(object[key], seen)}`);\n }\n result = `{${parts.join(',')}}`;\n }\n\n seen.delete(object);\n return result;\n}\n","/**\n * Merkle-tree fingerprint calculator (P8).\n *\n * Replaces a flat, single-digest fingerprint with a tree: one leaf digest\n * per signal, rolled up into a digest per group, rolled up into a digest\n * per plane, rolled up into a root. Every level is independently exposed\n * on the returned `FingerprintTree`, so \"what changed\" is answerable by\n * diffing sub-digests instead of staring at two unrelated flat hashes — a\n * GPU driver update shifts `planes.rendering` and leaves `planes.platform`\n * untouched; a different physical machine shifts nearly everything.\n *\n * Ported from fingerprintjs-ios's `FingerprintTreeCalculator` (MIT):\n * leaf = SHA256(value), node = SHA256(concat of children's hex digests).\n * This module adds the present/absent/error leaf-encoding contract that\n * upstream doesn't need — a native iOS read doesn't get silently blocked\n * the way a privacy browser blocks a web API.\n *\n * Grouping: this module does NOT invent a new taxonomy. `plane`/`group`\n * come straight from the signal registry (#4257) — `FROZEN_FIELDS` in\n * `./types.ts` already locks them once a signal ships, so the grouping\n * used here IS the registry's grouping, not a parallel one re-derived by\n * hand. See the P8 PR description for the plane/group semantics ratified\n * in review.\n *\n * Scope: hashing and storage only (P8). Nothing here consumes a\n * sub-fingerprint for scoring or linkage — that's P21/P31.\n */\n\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex } from '@noble/hashes/utils.js';\nimport canonicalize from 'canonicalize';\n\nimport { groupSignals, resolveSignalsAt } from './resolve';\nimport { CURRENT_REGISTRY_VERSION } from './types';\nimport type { RegistryVersion, SignalDefinition, SignalPlane } from './types';\n\n/**\n * One signal's collected reading, going into exactly one Merkle leaf.\n *\n * `absent` and a `present` reading with an empty/falsy value are DIFFERENT\n * leaves, deliberately. `absent` means the collector never ran or the read\n * was blocked (e.g. a privacy browser refusing WebGL); `present` with an\n * empty value means it ran and genuinely found nothing (e.g. zero\n * installed system fonts). Collapsing those would make a blocked source\n * indistinguishable from a device that legitimately has nothing there —\n * silently, since both would otherwise look identical once stored.\n *\n * `error` collapses every thrown error to one fixed leaf; `message` is\n * carried for logging only and is NEVER hashed. This mirrors\n * FingerprintJS's flattening of thrown errors to the literal string\n * `'error'` before hashing, so error-message churn between browser patch\n * versions can't move the fingerprint.\n *\n * Cross-reference: `EntropyOutcome<T>` in\n * `checkpoint-beacon/src/collectors/entropy/vendored-fingerprint.ts` is\n * the closest existing analog (ok/empty/timeout/absent), scoped to the\n * vendored FingerprintJS sources only. `SignalReading` is the general\n * contract every collector's output must eventually map onto to feed this\n * calculator; that mapping is a separate integration (collectors aren't\n * wired to a transport yet — see `entropy/index.ts`'s module doc) and is\n * out of scope for P8, which is hashing/storage only.\n */\nexport type SignalReading =\n | { kind: 'present'; value: unknown }\n | { kind: 'absent' }\n | { kind: 'error'; message?: string };\n\nexport interface GroupFingerprint {\n /** SHA-256 hex digest over this group's leaf digests, sorted by signal id. */\n digest: string;\n /** Signal id -> leaf digest, this group only. */\n leaves: Record<string, string>;\n}\n\nexport interface PlaneFingerprint {\n /** SHA-256 hex digest over this plane's group digests, sorted by group name. */\n digest: string;\n /**\n * Whether this plane's digest is one of `root`'s inputs. False only for\n * `behavioural` today — see `EXCLUDED_FROM_ROOT`.\n */\n includedInRoot: boolean;\n groups: Record<string, GroupFingerprint>;\n}\n\nexport interface FingerprintTree {\n /** The registry version this tree was resolved against. Pin this on the stored row; recompute WITH it, never with \"current\". */\n registryVersion: RegistryVersion;\n /** SHA-256 hex digest over the `includedInRoot` plane digests, sorted by plane name. */\n root: string;\n /** Every plane with at least one live signal at this registry version, keyed by plane name. */\n planes: Partial<Record<SignalPlane, PlaneFingerprint>>;\n}\n\n/**\n * Planes excluded from the identity root.\n *\n * Behavioural signals (interaction dynamics) change by design on every\n * session — folding them into the root would make the identity root drift\n * constantly rather than only on a genuine device change, defeating the\n * entire point of a stable device identifier. The behavioural subtree is\n * still computed and exposed on `planes.behavioural` for classification\n * use downstream; it just never feeds `root`.\n */\nconst EXCLUDED_FROM_ROOT: ReadonlySet<SignalPlane> = new Set<SignalPlane>(['behavioural']);\n\nconst TAG_PRESENT = 'v:';\nconst TAG_ABSENT = 'a:';\nconst TAG_ERROR = 'e:';\n\nfunction digestHex(bytes: Uint8Array): string {\n return bytesToHex(sha256(bytes));\n}\n\n/**\n * Encodes one reading into the bytes that get hashed for its leaf. Every\n * branch is tag-prefixed with a byte sequence no other branch can ever\n * produce, so absent/error/present-with-any-value never collide.\n */\nfunction leafBytes(reading: SignalReading | undefined): Uint8Array {\n // A signal id with no key at all in `readings` means the same thing as\n // an explicit `{ kind: 'absent' }`: nothing was collected for it.\n if (reading === undefined || reading.kind === 'absent') {\n return new TextEncoder().encode(TAG_ABSENT);\n }\n if (reading.kind === 'error') {\n // `reading.message`, if any, is intentionally never read here.\n return new TextEncoder().encode(`${TAG_ERROR}error`);\n }\n if (reading.value === undefined) {\n throw new Error(\n 'buildFingerprintTree: a \"present\" reading with value `undefined` is not a valid leaf — use { kind: \"absent\" } instead.'\n );\n }\n const json = canonicalize(reading.value);\n if (json === undefined) {\n throw new Error(\n 'buildFingerprintTree: reading value is not JSON-serializable (function, symbol, etc).'\n );\n }\n return new TextEncoder().encode(`${TAG_PRESENT}${json}`);\n}\n\n/**\n * Node digest = SHA256(concat of children's hex digests). Children MUST\n * already be in a caller-determined, key-sorted order — this function\n * does not re-sort, so ordering invariance is guaranteed by always\n * deriving the child list from the registry's sorted keys rather than\n * from a caller-supplied map's iteration order.\n */\nfunction nodeDigest(orderedChildDigests: string[]): string {\n return digestHex(new TextEncoder().encode(orderedChildDigests.join('')));\n}\n\n/**\n * Builds the Merkle fingerprint tree for one collection: a leaf per live\n * signal (present/absent/error), rolled up by group, rolled up by plane,\n * rolled up into a root that excludes `behavioural`.\n *\n * `readings` is keyed by signal id (`SignalDefinition.id`). A signal id\n * with no key at all is treated identically to an explicit\n * `{ kind: 'absent' }` reading.\n *\n * Pure and deterministic: the same `(registry, readings, registryVersion)`\n * always produces the same tree, regardless of `readings`' key order or\n * `registry`'s element order — every level is rebuilt from the registry's\n * own sorted `id`/`group`/`plane` keys, never from a caller's map\n * iteration order. `registryVersion` MUST be the version pinned on the\n * stored fingerprint when recomputing a historical tree; resolving\n * against \"current\" would silently produce a different tree once the\n * registry moves on (see `resolveSignalsAt`).\n */\nexport function buildFingerprintTree(\n registry: SignalDefinition[],\n readings: Record<string, SignalReading>,\n registryVersion: RegistryVersion = CURRENT_REGISTRY_VERSION\n): FingerprintTree {\n const grouped = groupSignals(resolveSignalsAt(registry, registryVersion));\n\n const planes: Partial<Record<SignalPlane, PlaneFingerprint>> = {};\n const rootInputs: string[] = [];\n\n for (const plane of (Object.keys(grouped) as SignalPlane[]).sort()) {\n const groupsForPlane = grouped[plane];\n const groups: Record<string, GroupFingerprint> = {};\n const groupDigests: string[] = [];\n\n for (const groupName of Object.keys(groupsForPlane).sort()) {\n const signalsInGroup = [...groupsForPlane[groupName]].sort((a, b) =>\n a.id.localeCompare(b.id)\n );\n const leaves: Record<string, string> = {};\n const leafDigests: string[] = [];\n for (const signal of signalsInGroup) {\n const digest = digestHex(leafBytes(readings[signal.id]));\n leaves[signal.id] = digest;\n leafDigests.push(digest);\n }\n const groupDigest = nodeDigest(leafDigests);\n groups[groupName] = { digest: groupDigest, leaves };\n groupDigests.push(groupDigest);\n }\n\n const planeDigest = nodeDigest(groupDigests);\n const includedInRoot = !EXCLUDED_FROM_ROOT.has(plane);\n planes[plane] = { digest: planeDigest, includedInRoot, groups };\n if (includedInRoot) rootInputs.push(planeDigest);\n }\n\n return {\n registryVersion,\n root: nodeDigest(rootInputs),\n planes,\n };\n}\n","/**\n * Session-level fingerprint hash (P33).\n *\n * `unified_agent_sessions.fingerprint_hash` has been declared since F-19\n * (migration 0124) — `visitor_id` is a STORED GENERATED column defined as\n * `COALESCE(user_account_id::text, 'unattributed:' || fingerprint_hash)` —\n * but nothing ever wrote it. Every anonymous visitor's `visitor_id`\n * therefore collapsed to the literal constant `'unattributed:'`, so a\n * COUNT(DISTINCT visitor_id) counted every anonymous visitor across an\n * entire org as ONE person. See\n * `docs/architecture/canonical-identity-model.md` (the `visitor_id`\n * correctness trap) for the full write-up.\n *\n * LIMITS (bestbrian, PR #4660): every input to this digest is\n * client-supplied via the pixel, so a hostile client can inflate or\n * collide anonymous visitor counts by varying or replaying its reported\n * attributes — this is inherent to any device-fingerprinting signal, not\n * specific to this implementation. It only affects the anonymous,\n * `'unattributed:'`-prefixed bucket: an authenticated `visitor_id` uses\n * `user_account_id` and never reaches this function, and the\n * `'unattributed:'` prefix keeps every fingerprinted visitor out of the\n * identity-merge graph. Treat anonymous visitor counts as estimate-grade\n * — strictly better than the prior all-collapse-to-one defect, not a\n * precise headcount.\n *\n * WHAT THIS COLUMN HOLDS (read this before changing the algorithm):\n *\n * This is a SHA-256 hex digest over the canonicalized (sorted-key, stable\n * JSON) map of `SignalsEnvelope.client.attributes` — the pixel-collected,\n * per-attribute entropy (device.platform, browser.language, screen\n * resolution, …) persisted verbatim on `detections.signals` by P6. It is\n * NOT the P8 Merkle-tree root (`buildFingerprintTree` in\n * `./merkle.ts`, `fingerprints.root`), even though P8 has landed: that\n * root is built from the formal signal REGISTRY (`./registry.ts`),\n * keyed by registered signal ids\n * (`canvas.geometry`, `platform.hardwareConcurrency`, …), and P8 itself\n * ships with zero callers that map a live collection onto those ids — that\n * mapping is explicitly out of scope for P8 (see its module doc: \"nothing\n * here consumes a sub-fingerprint for scoring or linkage yet — P21/P31\").\n * Inventing that mapping here, unreviewed, to force-fit `buildFingerprintTree`\n * would be worse than not using it: a registry-shaped root computed from a\n * fabricated id mapping is not actually comparable to a future REAL\n * registry-driven root, and callers would have no way to tell the\n * difference by looking at the column.\n *\n * What IS kept forward-compatible with P8, deliberately:\n * - Same primitive: SHA-256 hex, matching `merkle.ts`'s `digestHex`.\n * - Same exclusion principle: only IDENTITY-STABLE signals are hashed.\n * `SignalsEnvelope.behavioural` (mouse movements, scroll depth, time on\n * page) is a different axis from `client` and is never passed in here —\n * mirroring P8's own `EXCLUDED_FROM_ROOT` (`behavioural` is hashed for\n * classification but never rolled into the identity root), for the\n * same reason: behavioural signals churn every session by design, and\n * folding them in would make the \"same device\" hash drift on every\n * visit instead of only on a genuine device change.\n * - Same \"no entropy → no hash\" contract: `null` in, `null` out — this\n * function must NEVER fabricate a value for a session that carried no\n * signals. Downstream, `visitor_id` for such a session correctly stays\n * `'unattributed:'` (an honest bucket for genuinely-unknown visitors,\n * not a bug to paper over).\n *\n * When a real registry-attribute adapter exists (P21/P31), THIS function\n * should be retired in favor of `buildFingerprintTree(...).root`, and\n * `fingerprint_hash` should be repointed at it in one migration-free\n * application change (the column is `text`, so either shape fits) — do not\n * let the two representations coexist silently in the same column.\n */\n\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex } from '@noble/hashes/utils.js';\nimport canonicalize from 'canonicalize';\n\n/**\n * @param clientAttributes Signal-attribute-name -> collected string value —\n * e.g. `SignalsEnvelope.client.attributes` with each `ClientSignalAttribute`\n * unwrapped to its `.value` by the caller (kept decoupled from\n * `@kya-os/checkpoint-wasm-runtime`'s engine types on purpose: that\n * package depends on checkpoint-shared, not the other way around).\n * `null`/`undefined`/`{}` all mean \"no client entropy collected.\"\n * @returns A 64-char lowercase hex SHA-256 digest, or `null` when there is\n * nothing to hash. Never throws — a session with no entropy is a normal,\n * expected input, not an error.\n */\nexport function computeSessionFingerprintHash(\n clientAttributes: Record<string, string> | null | undefined\n): string | null {\n const names = Object.keys(clientAttributes ?? {});\n if (names.length === 0) return null;\n\n // Sort keys before canonicalizing so the digest is independent of\n // insertion order — `canonicalize` already sorts object keys, but the\n // explicit sort here documents the invariant this function's own tests\n // pin, rather than relying solely on the dependency's behavior.\n const sorted: Record<string, string> = {};\n for (const name of names.sort()) sorted[name] = clientAttributes![name];\n\n const json = canonicalize(sorted);\n // Unreachable for a plain string-keyed/string-valued map (every value is\n // JSON-serializable), but canonicalize's return type is `string |\n // undefined` — fail closed rather than hash `\"undefined\"`.\n if (json === undefined) return null;\n\n return bytesToHex(sha256(new TextEncoder().encode(json)));\n}\n","import { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex } from '@noble/hashes/utils.js';\n\nexport const DEVICE_FINGERPRINT_VERSION = 2;\n\nexport const DEVICE_FINGERPRINT_PREFIX = `fp${DEVICE_FINGERPRINT_VERSION}:`;\n\nexport type FingerprintRole = 'include' | 'exclude-churning';\n\nexport interface ClientAttributeClassification {\n readonly role: FingerprintRole;\n readonly reason: string;\n readonly signalId?: string;\n readonly presenceOnly?: boolean;\n}\n\nconst STABLE_HARDWARE =\n 'Hardware constant for the device (registry tier high): does not move within a visit.';\nconst STABLE_DISPLAY =\n 'Display property fixed for the visit (registry tier medium): moves only on a monitor change.';\nconst STABLE_SETTING =\n 'Browser or OS setting fixed for the visit: moves only on a deliberate user change between visits.';\nconst STABLE_MOBILE =\n 'Mobile SDK device or app field fixed for the install: moves only on an OS or app change.';\nconst LOW_ENTROPY_STABLE =\n 'Low entropy (registry tier low) but fixed for the visit: adds distinctness without adding instability.';\nconst COUNTER =\n 'Event counter that grows through the visit: differs between two page loads of one device.';\nconst PERFORMANCE =\n 'Timing, size or memory reading taken per page load and overwritten by later events in a visit.';\nconst NETWORK_STATE = 'Live network state that flips within a visit (wifi to cellular, offline).';\nconst PROBE_VERDICT =\n 'Automation probe outcome, a verdict about the client rather than a device property; it appears or flips as probes finish.';\nconst ACCESSIBILITY =\n 'Accessibility preference (registry tier low, consent mode, weighted near zero for identity): togglable mid-visit and a proxy for an accommodation, so it never feeds a device hash.';\nconst NEVER_MODE =\n 'Registry mode never: collected for contradiction detection only, never identity linkage.';\nconst BUILD_STAMP =\n 'Detector release stamp: moves on every pixel release for every visitor at once, not a device property.';\n\nexport const LAZY_CHUNK_PRESENCE_REASON =\n 'Presence depends on lazy-chunk timing: the value arrives only after a separately fetched chunk loads, so one device shows it on some rounds and not on others.';\nexport const VENDORED_PRESENCE_REASON =\n 'Reaches the beacon lane only through a vendored collector that can time out, so it is present on the pixel lane and on only some beacon rounds.';\nexport const LANE_ONLY_REASON =\n 'Emitted by only one of the two browser lanes (pixel or beacon), so hashing it would give one browser two fingerprints depending on which lane saw it.';\nconst DAYLIGHT_SAVING =\n 'Moves with daylight saving time between visits, so it differs for one device across the year.';\n\nconst include = (reason: string, signalId?: string): ClientAttributeClassification => ({\n role: 'include',\n reason,\n signalId,\n});\n\nconst churning = (reason: string, signalId?: string): ClientAttributeClassification => ({\n role: 'exclude-churning',\n reason,\n signalId,\n});\n\nconst presence = (reason: string, signalId?: string): ClientAttributeClassification => ({\n role: 'exclude-churning',\n reason,\n signalId,\n presenceOnly: true,\n});\nconst lazy = (signalId: string) => presence(LAZY_CHUNK_PRESENCE_REASON, signalId);\nconst laneOnly = (signalId?: string) => presence(LANE_ONLY_REASON, signalId);\nconst vendoredOnly = (signalId?: string) => presence(VENDORED_PRESENCE_REASON, signalId);\nconst counter = churning(COUNTER);\nconst performance = churning(PERFORMANCE);\n\nexport const CLIENT_ATTRIBUTE_CLASSIFICATION: ReadonlyMap<string, ClientAttributeClassification> =\n new Map<string, ClientAttributeClassification>([\n [\n 'device.id',\n include(\n 'Persistent per-browser cookie id: it keeps identical hardware apart, so visitor_id and the unattributed lookback stay per browser instead of collapsing.'\n ),\n ],\n ['device.platform', include(LOW_ENTROPY_STABLE, 'platform.navigatorPlatform')],\n ['device.vendorSub', laneOnly()],\n ['device.doNotTrackResolved', laneOnly()],\n ['device.locale', include(STABLE_SETTING)],\n ['device.timezone', include(STABLE_SETTING)],\n [\n 'client.screenWidthPt',\n churning(\n 'Screen width swaps with height when the device rotates, so it moves within a visit.'\n ),\n ],\n [\n 'client.screenHeightPt',\n churning(\n 'Screen height swaps with width when the device rotates, so it moves within a visit.'\n ),\n ],\n [\n 'client.screenWidthPx',\n churning(\n 'Screen width swaps with height when the device rotates, so it moves within a visit.'\n ),\n ],\n [\n 'client.screenHeightPx',\n churning(\n 'Screen height swaps with width when the device rotates, so it moves within a visit.'\n ),\n ],\n ['client.screenScale', include(STABLE_DISPLAY)],\n ['client.screenDensity', include(STABLE_DISPLAY)],\n ['device.manufacturer', include(STABLE_MOBILE)],\n ['device.model', include(STABLE_MOBILE)],\n ['device.osVersion', include(STABLE_MOBILE)],\n ['device.emulator', include(STABLE_MOBILE)],\n ['device.rooted', include(STABLE_MOBILE)],\n ['app.id', include(STABLE_MOBILE)],\n ['app.versionName', churning('Bumped for every install at once by an app release.')],\n ['app.versionCode', churning('Bumped for every install at once by an app release.')],\n ['browser.cookiesEnabled', include(LOW_ENTROPY_STABLE, 'platform.cookiesEnabled')],\n ['browser.timezoneOffset', churning(DAYLIGHT_SAVING)],\n ['browser.timezone', include(STABLE_SETTING, 'platform.timezone')],\n ['browser.language', include(STABLE_SETTING, 'platform.languages')],\n ['browser.onLine', churning(NETWORK_STATE)],\n ['network.connectionType', churning(NETWORK_STATE)],\n ['network.connectionSpeed', churning(NETWORK_STATE)],\n ['network.connectionRtt', churning(NETWORK_STATE)],\n ['network.connectionSaveData', churning(NETWORK_STATE)],\n ['client.networkType', churning(NETWORK_STATE)],\n ['screen.resolution', include(STABLE_DISPLAY, 'platform.screenResolution')],\n ['screen.pixelDepth', laneOnly('platform.colorDepth')],\n ['screen.viewport', churning('Window size: changes on resize, rotation and split view.')],\n ['client.hardwareConcurrency', include(STABLE_HARDWARE, 'platform.hardwareConcurrency')],\n ['client.deviceMemory', include(STABLE_HARDWARE, 'platform.deviceMemory')],\n ['client.maxTouchPoints', include(STABLE_DISPLAY, 'platform.touchSupport')],\n ['client.hasTouch', laneOnly('platform.touchSupport')],\n ['client.colorDepth', include(LOW_ENTROPY_STABLE, 'platform.colorDepth')],\n ['client.doNotTrack', laneOnly()],\n ['client.pluginsCount', laneOnly()],\n ['client.languages', vendoredOnly('platform.languages')],\n ['client.localStorageEnabled', vendoredOnly('platform.localStorage')],\n ['client.sessionStorageEnabled', vendoredOnly('platform.sessionStorage')],\n ['client.chrome', laneOnly('platform.vendorFlavors')],\n ['client.vendor', include(LOW_ENTROPY_STABLE, 'platform.vendor')],\n [\n 'client.pixelRatio',\n churning('devicePixelRatio moves with page zoom and when a window changes display.'),\n ],\n [\n 'client.webrtc',\n churning(\n 'Outcome of a one second STUN race (available, timeout, error): depends on the network at load time.'\n ),\n ],\n ['client.automation', churning(PROBE_VERDICT)],\n ['client.automationTag', churning(PROBE_VERDICT)],\n ['client.headless', churning(PROBE_VERDICT)],\n ['client.webdriver', churning(PROBE_VERDICT)],\n ['client.cdpStackAccessed', churning(PROBE_VERDICT)],\n ['client.pluginMimeTypesConsistent', churning(PROBE_VERDICT)],\n ['client.webglUaConsistent', churning(PROBE_VERDICT)],\n ['client.distinctiveProperties', churning(PROBE_VERDICT)],\n ['client.timingVersion', churning(BUILD_STAMP)],\n ['client.kinematicsVersion', churning(BUILD_STAMP)],\n ['client.scrollEvents', counter],\n ['client.keyboardEvents', counter],\n ['client.touchEvents', counter],\n ['client.untrustedEvents', counter],\n ['client.hasInteraction', counter],\n ['client.keyDwellCount', counter],\n ['client.keyDwellUnder5', counter],\n ['client.keyDwellSumMs', counter],\n ['client.keyGapCount', counter],\n ['client.keyGapUnder5', counter],\n ['client.pressCount', counter],\n ['client.pressAdjacencyCount', counter],\n ['client.pressAdjacentUnder5', counter],\n ['client.pressUnder10', counter],\n ['client.pressSumMs', counter],\n ['client.mouseClicks', counter],\n ['client.zeroTrailClicks', counter],\n ['client.pointerMoves', counter],\n ['client.coalescedMoves', counter],\n ['client.stepPairs', counter],\n ['client.equalSteps', counter],\n ['client.straightSteps', counter],\n ['performance.navigation', performance],\n ['performance.navigationType', performance],\n ['performance.pageLoadTime', performance],\n ['performance.domContentLoadedTime', performance],\n ['performance.domInteractiveTime', performance],\n ['performance.dnsLookupTime', performance],\n ['performance.tcpConnectionTime', performance],\n ['performance.serverResponseTime', performance],\n ['performance.transferSize', performance],\n ['performance.encodedBodySize', performance],\n ['performance.decodedBodySize', performance],\n ['performance.redirectCount', performance],\n ['performance.memoryUsedJSHeapSize', performance],\n ['performance.memoryTotalJSHeapSize', performance],\n ['performance.memoryLimitJSHeapSize', performance],\n ['performance.firstPaintTime', performance],\n ['performance.firstContentfulPaintTime', performance],\n ['performance.largestContentfulPaintTime', performance],\n ['canvas.geometry.v2', lazy('canvas.geometry.v2')],\n ['canvas.text', lazy('canvas.text')],\n ['webgl.render', lazy('webgl.render')],\n ['audio.digest', lazy('audio.digest')],\n ['rendering.mathFingerprint', laneOnly('rendering.mathFingerprint')],\n ['rendering.fontPreferences', lazy('rendering.fontPreferences')],\n ['transport.webrtcCodecs', lazy('transport.webrtcCodecs')],\n ['platform.speechVoices', lazy('platform.speechVoices')],\n ['platform.userAgentData', vendoredOnly('platform.userAgentData')],\n ['platform.architecture', laneOnly('platform.architecture')],\n ['platform.hardwareConcurrency', include(STABLE_HARDWARE, 'platform.hardwareConcurrency')],\n ['platform.deviceMemory', include(STABLE_HARDWARE, 'platform.deviceMemory')],\n ['platform.screenResolution', include(STABLE_DISPLAY, 'platform.screenResolution')],\n ['platform.colorGamut', laneOnly('platform.colorGamut')],\n ['platform.hdr', laneOnly('platform.hdr')],\n ['platform.timezone', include(STABLE_SETTING, 'platform.timezone')],\n ['platform.languages', vendoredOnly('platform.languages')],\n ['platform.touchSupport', laneOnly('platform.touchSupport')],\n ['platform.colorDepth', include(LOW_ENTROPY_STABLE, 'platform.colorDepth')],\n ['platform.monochrome', laneOnly('platform.monochrome')],\n ['platform.navigatorPlatform', include(LOW_ENTROPY_STABLE, 'platform.navigatorPlatform')],\n ['platform.vendor', include(LOW_ENTROPY_STABLE, 'platform.vendor')],\n ['platform.osCpu', laneOnly('platform.osCpu')],\n ['platform.cookiesEnabled', include(LOW_ENTROPY_STABLE, 'platform.cookiesEnabled')],\n ['platform.sessionStorage', vendoredOnly('platform.sessionStorage')],\n ['platform.localStorage', vendoredOnly('platform.localStorage')],\n ['platform.indexedDB', laneOnly('platform.indexedDB')],\n ['platform.pdfViewerEnabled', laneOnly('platform.pdfViewerEnabled')],\n [\n 'platform.permissions',\n churning(\n 'Grant state changes within a session on a trivial user action (registry tier low).',\n 'platform.permissions'\n ),\n ],\n ['platform.contrast', churning(ACCESSIBILITY, 'platform.contrast')],\n ['platform.forcedColors', churning(ACCESSIBILITY, 'platform.forcedColors')],\n ['platform.invertedColors', churning(ACCESSIBILITY, 'platform.invertedColors')],\n ['platform.reducedMotion', churning(ACCESSIBILITY, 'platform.reducedMotion')],\n ['platform.reducedTransparency', churning(ACCESSIBILITY, 'platform.reducedTransparency')],\n [\n 'platform.clientHints.architecture',\n churning(NEVER_MODE, 'platform.clientHints.architecture'),\n ],\n ['platform.clientHints.bitness', churning(NEVER_MODE, 'platform.clientHints.bitness')],\n ['platform.clientHints.model', churning(NEVER_MODE, 'platform.clientHints.model')],\n ['platform.clientHints.platform', churning(NEVER_MODE, 'platform.clientHints.platform')],\n [\n 'platform.clientHints.platformVersion',\n churning(NEVER_MODE, 'platform.clientHints.platformVersion'),\n ],\n [\n 'platform.clientHints.uaFullVersion',\n churning(NEVER_MODE, 'platform.clientHints.uaFullVersion'),\n ],\n [\n 'platform.clientHints.fullVersionList',\n churning(NEVER_MODE, 'platform.clientHints.fullVersionList'),\n ],\n ['platform.clientHints.wow64', churning(NEVER_MODE, 'platform.clientHints.wow64')],\n ['platform.clientHints.mobile', churning(NEVER_MODE, 'platform.clientHints.mobile')],\n ]);\n\nexport function isChurningClientAttribute(name: string): boolean {\n const entry = CLIENT_ATTRIBUTE_CLASSIFICATION.get(name);\n return entry?.role === 'exclude-churning' && entry.presenceOnly !== true;\n}\n\nexport function isStatsRecordableClientAttribute(name: string): boolean {\n const entry = CLIENT_ATTRIBUTE_CLASSIFICATION.get(name);\n return entry !== undefined && !isChurningClientAttribute(name);\n}\n\nconst CANONICAL_NAME: ReadonlyMap<string, string> = new Map([\n ['platform.navigatorPlatform', 'device.platform'],\n ['platform.timezone', 'browser.timezone'],\n ['platform.screenResolution', 'screen.resolution'],\n ['platform.cookiesEnabled', 'browser.cookiesEnabled'],\n ['platform.hardwareConcurrency', 'client.hardwareConcurrency'],\n ['platform.deviceMemory', 'client.deviceMemory'],\n ['platform.colorDepth', 'client.colorDepth'],\n ['platform.vendor', 'client.vendor'],\n]);\n\nfunction normalizeResolution(value: string): string {\n const pair = value.match(/^\\[?\\s*(\\d+)\\s*[x,]\\s*(\\d+)\\s*\\]?$/i);\n if (!pair) return value;\n const width = Number(pair[1]);\n const height = Number(pair[2]);\n return `${Math.max(width, height)}x${Math.min(width, height)}`;\n}\n\nconst NORMALIZERS: ReadonlyMap<string, (value: string) => string> = new Map([\n ['screen.resolution', normalizeResolution],\n]);\n\nexport function canonicalizeClientAttributes(\n attributes: Readonly<Record<string, string>> | null | undefined\n): Record<string, string> {\n const source = attributes ?? {};\n const canonical: Record<string, string> = {};\n for (const name of Object.keys(source)) {\n if (!CANONICAL_NAME.has(name)) canonical[name] = source[name];\n }\n for (const name of Object.keys(source)) {\n const target = CANONICAL_NAME.get(name);\n if (target !== undefined && !(target in canonical)) canonical[target] = source[name];\n }\n for (const [name, normalize] of NORMALIZERS) {\n if (name in canonical) canonical[name] = normalize(canonical[name]);\n }\n return canonical;\n}\n\nexport function deviceFingerprintComponents(\n attributes: Readonly<Record<string, string>> | null | undefined\n): Record<string, string> {\n const source = canonicalizeClientAttributes(attributes);\n const components: Record<string, string> = {};\n for (const name of Object.keys(source).sort()) {\n if (CLIENT_ATTRIBUTE_CLASSIFICATION.get(name)?.role === 'include') {\n components[name] = source[name];\n }\n }\n return components;\n}\n\nexport function computeDeviceFingerprint(\n attributes: Readonly<Record<string, string>> | null | undefined\n): string | null {\n const components = deviceFingerprintComponents(attributes);\n const names = Object.keys(components);\n if (names.length === 0) return null;\n const payload = JSON.stringify([\n DEVICE_FINGERPRINT_VERSION,\n names.map((n) => [n, components[n]]),\n ]);\n return bytesToHex(sha256(new TextEncoder().encode(payload)));\n}\n","import { checkSensitiveAttributeCompliance } from './sensitive-attributes';\nimport { REGISTRY_VERSIONS } from './types';\nimport type { RegistryVersion, SignalDefinition, SignalMode, StabilityTier } from './types';\n\nconst VALID_TIERS: readonly StabilityTier[] = ['high', 'medium', 'low'];\nconst VALID_MODES: readonly SignalMode[] = ['open', 'consent', 'never'];\n\nexport interface RegistryValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nfunction versionIndex(version: RegistryVersion): number {\n return REGISTRY_VERSIONS.indexOf(version);\n}\n\n/**\n * Runtime validation of the registry's invariants. This exists alongside\n * the TypeScript types (not instead of them) because the enforcement this\n * feature needs — \"CI fails on an untiered signal\" — has to hold even if a\n * signal is constructed dynamically or a type is bypassed with `as any`.\n */\nexport function validateRegistry(signals: SignalDefinition[]): RegistryValidationResult {\n const errors: string[] = [];\n const byId = new Map<string, SignalDefinition>();\n const seenIds = new Set<string>();\n\n for (const signal of signals) {\n const label = signal?.id ?? '<unknown id>';\n\n if (seenIds.has(signal?.id)) {\n errors.push(`Duplicate signal id \"${signal.id}\".`);\n } else if (signal?.id) {\n seenIds.add(signal.id);\n byId.set(signal.id, signal);\n }\n\n if (!signal.tier) {\n errors.push(`Signal \"${label}\" has no tier. Every signal must carry a stability tier.`);\n } else if (!VALID_TIERS.includes(signal.tier)) {\n errors.push(`Signal \"${label}\" has invalid tier \"${signal.tier}\".`);\n }\n\n if (!signal.mode || !VALID_MODES.includes(signal.mode)) {\n errors.push(`Signal \"${label}\" has invalid mode \"${signal.mode}\".`);\n }\n\n if (!REGISTRY_VERSIONS.includes(signal.addedVersion)) {\n errors.push(`Signal \"${label}\" has invalid addedVersion \"${signal.addedVersion}\".`);\n }\n\n if (signal.removedVersion !== null) {\n if (!REGISTRY_VERSIONS.includes(signal.removedVersion)) {\n errors.push(`Signal \"${label}\" has invalid removedVersion \"${signal.removedVersion}\".`);\n } else if (versionIndex(signal.removedVersion) <= versionIndex(signal.addedVersion)) {\n errors.push(\n `Signal \"${label}\" has removedVersion \"${signal.removedVersion}\" at or before its addedVersion \"${signal.addedVersion}\".`\n );\n }\n }\n\n if (!signal.measurement) {\n errors.push(`Signal \"${label}\" has no measurement record for its tier assignment.`);\n } else if (!signal.measurement.provisional) {\n if (signal.measurement.agreementRate === null || signal.measurement.measuredAt === null) {\n errors.push(\n `Signal \"${label}\" has a finalized (non-provisional) tier but no recorded measurement (agreementRate/measuredAt). A tier with no measurement behind it is a guess wearing a label.`\n );\n }\n }\n\n // P44: sensitive-attribute rejection. Wired in here (not only into\n // registerSignal) so this fires unconditionally under validateRegistry,\n // already a load-bearing gate under `pnpm test:unit` (pre-push hook and\n // CI), and can't be bypassed by adding a signal directly to the\n // registry array without going through registerSignal.\n const sensitiveCheck = checkSensitiveAttributeCompliance(signal);\n if (!sensitiveCheck.ok) {\n for (const violation of sensitiveCheck.violations) {\n errors.push(`Signal \"${label}\" ${violation.message}`);\n }\n }\n }\n\n for (const signal of signals) {\n if (signal.supersedes === null) continue;\n const target = byId.get(signal.supersedes);\n if (!target) {\n errors.push(\n `Signal \"${signal.id}\" supersedes \"${signal.supersedes}\", which does not exist in the registry.`\n );\n continue;\n }\n if (\n target.removedVersion === null ||\n versionIndex(target.removedVersion) > versionIndex(signal.addedVersion)\n ) {\n errors.push(\n `Signal \"${signal.id}\" forks \"${signal.supersedes}\" at \"${signal.addedVersion}\", but \"${signal.supersedes}\" has no matching removedVersion. Set removedVersion=\"${signal.addedVersion}\" on \"${signal.supersedes}\" when forking.`\n );\n }\n }\n\n return { valid: errors.length === 0, errors };\n}\n","import type { DenoisePolicy, SignalDefinition, SnapshotRecord } from './types';\n\nexport interface SnapshotViolation {\n id: string;\n kind: 'edited' | 'deleted' | 'unrecorded';\n message: string;\n}\n\nexport interface SnapshotConsistencyResult {\n ok: boolean;\n violations: SnapshotViolation[];\n}\n\nfunction denoiseEqual(a: DenoisePolicy, b: DenoisePolicy): boolean {\n if (a.kind !== b.kind) return false;\n if (a.kind === 'modal' && b.kind === 'modal') return a.runs === b.runs;\n return true;\n}\n\n/**\n * The frozen snapshot of a signal, as it should be recorded in the\n * committed snapshot file. `finalizedTier` stays null until the signal's\n * measurement is no longer provisional (see `TierMeasurement.provisional`),\n * and `removedVersion` stays null until the signal is forked. Each locks in\n * exactly once — see `checkSnapshotConsistency`.\n */\nexport function computeImmutableSnapshot(signal: SignalDefinition): SnapshotRecord {\n return {\n id: signal.id,\n addedVersion: signal.addedVersion,\n removedVersion: signal.removedVersion,\n denoise: signal.denoise,\n mode: signal.mode,\n plane: signal.plane,\n group: signal.group,\n finalizedTier: signal.measurement.provisional ? null : signal.tier,\n };\n}\n\nconst FORK_INSTRUCTION =\n 'Shipped signals are immutable — a signal is never edited, only forked. ' +\n 'Create a new signal (e.g. \"<id>.v2\") with supersedes set to this id and ' +\n 'removedVersion set on this entry, instead of editing it in place.';\n\n/**\n * Compares the committed snapshot (what has already shipped) against the\n * live registry. This is deliberately NOT \"regenerate the snapshot from the\n * live registry and diff\" — that self-referential check would pass even\n * when an existing entry was edited, because the regenerated file would\n * just agree with the edit. Instead every id already in `committed` is\n * pinned, and the live registry is checked against that pin.\n */\nexport function checkSnapshotConsistency(\n committed: SnapshotRecord[],\n live: SignalDefinition[]\n): SnapshotConsistencyResult {\n const violations: SnapshotViolation[] = [];\n const liveById = new Map(live.map((s) => [s.id, s]));\n const committedIds = new Set(committed.map((r) => r.id));\n\n for (const record of committed) {\n const current = liveById.get(record.id);\n if (!current) {\n violations.push({\n id: record.id,\n kind: 'deleted',\n message: `Signal \"${record.id}\" was removed from the registry entirely. Mark it removed with removedVersion instead of deleting it — historical fingerprints still reference it.`,\n });\n continue;\n }\n\n const currentSnapshot = computeImmutableSnapshot(current);\n const frozenMismatch =\n currentSnapshot.addedVersion !== record.addedVersion ||\n !denoiseEqual(currentSnapshot.denoise, record.denoise) ||\n currentSnapshot.mode !== record.mode ||\n currentSnapshot.plane !== record.plane ||\n currentSnapshot.group !== record.group;\n\n // Once a tier is finalized (recorded non-null), it is frozen too. A\n // provisional tier (record.finalizedTier === null) is allowed to move\n // in place, and finalizing it for the first time is allowed.\n const tierMismatch =\n record.finalizedTier !== null && currentSnapshot.finalizedTier !== record.finalizedTier;\n\n // Same one-way lock as finalizedTier: removedVersion is null until the\n // signal is forked, then frozen. Marking it removed for the first time\n // is allowed; changing an already-recorded removedVersion is not.\n const removedVersionMismatch =\n record.removedVersion !== null && currentSnapshot.removedVersion !== record.removedVersion;\n\n if (frozenMismatch || tierMismatch || removedVersionMismatch) {\n violations.push({\n id: record.id,\n kind: 'edited',\n message: `Signal \"${record.id}\" was edited in place. ${FORK_INSTRUCTION} Re-running the snapshot recorder will not fix this — it refuses to overwrite a divergent entry.`,\n });\n }\n }\n\n for (const current of live) {\n if (!committedIds.has(current.id)) {\n violations.push({\n id: current.id,\n kind: 'unrecorded',\n message: `Signal \"${current.id}\" is new and not yet recorded. Run \\`pnpm --filter @kya-os/checkpoint-shared run signals:snapshot -- --write\\` and commit the result.`,\n });\n }\n }\n\n return { ok: violations.length === 0, violations };\n}\n\n/**\n * Snapshot writer: append-only for new signal ids, and refuses (throws)\n * rather than overwrite any existing record that disagrees with the live\n * registry — so running this locally after an in-place edit fails loudly\n * instead of quietly re-recording the edit as the new baseline.\n *\n * Existing records DO get rewritten, deliberately: `checkSnapshotConsistency`\n * having already passed (no violations) means the only way an existing\n * record can still differ from `computeImmutableSnapshot(current)` is one of\n * the two allowed one-way transitions (finalizing a provisional tier,\n * marking a signal removed) — so it's safe to persist the live value.\n * Recording only the truly-new ids and never updating existing ones was the\n * bug: a transition that `checkSnapshotConsistency` correctly allowed was\n * never actually written back, so the committed snapshot stayed at its\n * pre-transition value forever and the lock never engaged (Bugbot, PR #4257).\n */\nexport function recordSnapshot(\n committed: SnapshotRecord[],\n live: SignalDefinition[]\n): SnapshotRecord[] {\n const result = checkSnapshotConsistency(committed, live);\n const editedOrDeleted = result.violations.filter((v) => v.kind !== 'unrecorded');\n if (editedOrDeleted.length > 0) {\n throw new Error(editedOrDeleted.map((v) => v.message).join('\\n'));\n }\n\n const liveById = new Map(live.map((s) => [s.id, s]));\n const committedIds = new Set(committed.map((r) => r.id));\n\n const updated = committed.map((record) => {\n const current = liveById.get(record.id);\n return current ? computeImmutableSnapshot(current) : record;\n });\n\n const additions = live\n .filter((s) => !committedIds.has(s.id))\n .map((s) => computeImmutableSnapshot(s));\n\n return [...updated, ...additions];\n}\n","import { listShippedSignals } from './resolve';\nimport type { DenoisePolicy, SignalDefinition } from './types';\n\nconst GENERATED_HEADER = `<!-- GENERATED FILE — do not hand-edit. -->\n<!-- Generated from \\`packages/checkpoint-shared/src/signals/registry.ts\\` by -->\n<!-- \\`pnpm --filter @kya-os/checkpoint-shared run signals:docs\\`. -->\n<!-- CI rejects a stale copy of this file — see .github/workflows/signal-registry-check.yml. -->\n\n# Signal registry\n\nEvery signal ever shipped, generated from the registry so this can never\ndrift the way \\`fingerprintjs-android\\`'s hand-maintained \\`api_reference.md\\`\ndid (it stayed on \\`V_5\\` after the enum moved to \\`V_6\\`).\n\nA shipped signal is never edited, only forked: when a signal proves\nvolatile or is re-tiered, a new signal is added at the next version and the\nold one is marked removed (exclusive) rather than changed in place, so\nhistorical fingerprints stay reproducible against the version they were\ncomputed under.\n`;\n\nfunction formatDenoise(denoise: DenoisePolicy): string {\n return denoise.kind === 'modal' ? `modal(${denoise.runs})` : 'none';\n}\n\nfunction formatVersion(version: string | null): string {\n return version ?? '—';\n}\n\nfunction formatTier(signal: SignalDefinition): string {\n return signal.measurement.provisional ? `${signal.tier} (provisional)` : signal.tier;\n}\n\nfunction formatRow(signal: SignalDefinition): string {\n const cells = [\n `\\`${signal.id}\\``,\n `${signal.plane}/${signal.group}`,\n formatVersion(signal.addedVersion),\n formatVersion(signal.removedVersion),\n formatTier(signal),\n signal.mode,\n formatDenoise(signal.denoise),\n signal.supersedes ? `\\`${signal.supersedes}\\`` : '—',\n signal.u === null ? '—' : String(signal.u),\n ];\n return `| ${cells.join(' | ')} |`;\n}\n\nconst TABLE_HEADER = [\n '| id | plane/group | added | removed | tier | mode | denoise | supersedes | u |',\n '| --- | --- | --- | --- | --- | --- | --- | --- | --- |',\n].join('\\n');\n\n/**\n * Pure markdown generator over the registry — the doc-generation half of\n * \"generate the docs from the registry rather than maintaining them by\n * hand.\" Deterministic (stable sort, no timestamps) so regeneration\n * produces a clean diff only when the registry actually changed.\n */\nexport function generateRegistryMarkdown(registry: SignalDefinition[]): string {\n const rows = listShippedSignals(registry).map(formatRow);\n return [GENERATED_HEADER, TABLE_HEADER, ...rows, ''].join('\\n');\n}\n"],"x_google_ignoreList":[4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,oBAAoB;CAAC;CAAM;CAAM;AAAI;AAIlD,MAAa,2BACX,kBAAkB,kBAAkB,SAAS;;AAkD/C,MAAa,oCAAoC,CAAC,IAAI;;AAmEtD,MAAa,gBAAgB;CAAC;CAAM;CAAgB;CAAW;CAAQ;CAAS;AAAO;;;;;;;;AASvF,MAAa,qBAAqB,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpGzC,MAAa,2CACX,kCAAkC,kCAAkC,SAAS;AAgB/E,MAAa,qCAGT,EACF,IAAI;CACF;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GAAC;GAAiB;GAAiB;GAAkB;EAAqB;CACtF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GACR;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS;GACP;GACA;GACA;EACF;EACA,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GAAC;GAAsB;GAAY;EAA0B;CACzE;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,qEAAqE;EAC/E,UAAU;GACR;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aACE;EACF,SAAS,CAAC,wCAAwC;EAClD,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,UAAU;EACV,aAAa;EACb,SAAS,CAAC,wCAAwC;EAClD,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;AACF,EACF;AA8BA,MAAa,yBAAgD,CAC3D;CACE,IAAI;CACJ,UAAU;CACV,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,YAAY;CACZ,SAAS;EACP;EACA;EACA;CACF;CACA,WACE;AACJ,GACA;CACE,IAAI;CACJ,UAAU;CACV,WAAW;EAAC;EAAsB;EAAqB;CAAyB;CAChF,YAAY;CACZ,SAAS,CACP,uEACA,wCACF;CACA,WACE;AACJ,CACF;;;;;;;AA4BA,SAAS,mBAAmB,MAAsB;CAChD,OAAO,KAAK,QAAQ,sBAAsB,OAAO,CAAC,CAAC,QAAQ,WAAW,GAAG;AAC3E;;;;;;;;;;;;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