@kya-os/checkpoint-shared 1.5.0 → 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 +129 -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 +50 -14
  10. package/dist/beacon-types/index.d.mts.map +1 -1
  11. package/dist/beacon-types/index.d.ts +50 -14
  12. package/dist/beacon-types/index.d.ts.map +1 -1
  13. package/dist/beacon-types/index.js +127 -8
  14. package/dist/beacon-types/index.mjs +122 -9
  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 -83
  40. package/dist/browser-posture.d.ts +2 -83
  41. package/dist/browser-posture.js +214 -44
  42. package/dist/browser-posture.mjs +203 -45
  43. package/dist/browser-posture.mjs.map +1 -1
  44. package/dist/browser.d.mts +3 -11
  45. package/dist/browser.d.mts.map +1 -1
  46. package/dist/browser.d.ts +3 -11
  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 +5227 -1063
  79. package/dist/index.d.mts.map +1 -1
  80. package/dist/index.d.ts +5227 -1063
  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,57 +1,3 @@
1
- //#region src/signals/sensitive-attributes.d.ts
2
- export declare const SENSITIVE_REJECTION_LIST_VERSIONS: readonly ["v1"];
3
- type SensitiveRejectionListVersion = (typeof SENSITIVE_REJECTION_LIST_VERSIONS)[number];
4
- export declare const CURRENT_SENSITIVE_REJECTION_LIST_VERSION: SensitiveRejectionListVersion;
5
- type SensitiveAttributeCategory = 'racial-or-ethnic-origin' | 'religious-or-philosophical-beliefs' | 'mental-or-physical-health-condition-or-diagnosis' | 'sex-life-or-sexual-orientation' | 'citizenship-or-immigration-status' | 'biometric-identifier-or-derivative' | 'government-identification-number';
6
- interface SensitiveAttributeRule {
7
- category: SensitiveAttributeCategory;
8
- description: string;
9
- regimes: string[];
10
- keywords: string[];
11
- }
12
- export declare const SENSITIVE_ATTRIBUTE_REJECTION_LIST: Record<SensitiveRejectionListVersion, SensitiveAttributeRule[]>;
13
- interface CompositionRiskRule {
14
- id: string;
15
- category: SensitiveAttributeCategory;
16
- signalIds: string[];
17
- minMatches: number;
18
- regimes: string[];
19
- rationale: string;
20
- }
21
- export declare const COMPOSITION_RISK_RULES: CompositionRiskRule[];
22
- interface SensitiveAttributeReview {
23
- listVersion: SensitiveRejectionListVersion;
24
- reviewedBy: string;
25
- reviewedAt: string;
26
- combinesWith: string[];
27
- derivesCategory: SensitiveAttributeCategory | null;
28
- rationale: string;
29
- }
30
- type SensitiveAttributeViolationKind = 'direct' | 'composition' | 'declared' | 'stale-review';
31
- interface SensitiveAttributeViolation {
32
- kind: SensitiveAttributeViolationKind;
33
- category: SensitiveAttributeCategory | null;
34
- ruleId: string;
35
- regimes: string[];
36
- message: string;
37
- }
38
- export declare function checkDirectMatch(signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
39
- export declare function checkCompositionRisk(signalId: string, combinesWith: string[]): SensitiveAttributeViolation[];
40
- export declare function checkDeclaredCategory(review: Pick<SensitiveAttributeReview, 'derivesCategory'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
41
- export declare function checkReviewRecordIntegrity(review: SignalDefinition['review'] | undefined, currentVersion?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
42
- export declare function evaluateSensitiveAttributeCompliance(signal: SignalDefinition): SensitiveAttributeViolation[];
43
- export declare class SensitiveAttributeRejectionError extends Error {
44
- readonly signalId: string;
45
- readonly violations: SensitiveAttributeViolation[];
46
- constructor(signalId: string, violations: SensitiveAttributeViolation[]);
47
- }
48
- export declare function registerSignal(definition: SignalDefinition): SignalDefinition;
49
- export declare function checkSensitiveAttributeCompliance(signal: SignalDefinition): {
50
- ok: boolean;
51
- violations: SensitiveAttributeViolation[];
52
- };
53
- export declare function findSignalsNeedingReevaluation(signals: SignalDefinition[], currentVersion?: SensitiveRejectionListVersion): SignalDefinition[];
54
- //#endregion
55
1
  //#region src/signals/types.d.ts
56
2
  export declare const REGISTRY_VERSIONS: readonly ["v1", "v2", "v3"];
57
3
  type RegistryVersion = (typeof REGISTRY_VERSIONS)[number];
@@ -73,6 +19,17 @@ interface TierMeasurement {
73
19
  provisional: boolean;
74
20
  notes: string;
75
21
  }
22
+ export declare const SENSITIVE_REJECTION_LIST_VERSIONS: readonly ["v1"];
23
+ type SensitiveRejectionListVersion = (typeof SENSITIVE_REJECTION_LIST_VERSIONS)[number];
24
+ type SensitiveAttributeCategory = 'racial-or-ethnic-origin' | 'religious-or-philosophical-beliefs' | 'mental-or-physical-health-condition-or-diagnosis' | 'sex-life-or-sexual-orientation' | 'citizenship-or-immigration-status' | 'biometric-identifier-or-derivative' | 'government-identification-number';
25
+ interface SensitiveAttributeReview {
26
+ listVersion: SensitiveRejectionListVersion;
27
+ reviewedBy: string;
28
+ reviewedAt: string;
29
+ combinesWith: string[];
30
+ derivesCategory: SensitiveAttributeCategory | null;
31
+ rationale: string;
32
+ }
76
33
  interface SignalDefinition {
77
34
  id: string;
78
35
  addedVersion: RegistryVersion;
@@ -140,6 +97,26 @@ export declare function buildFingerprintTree(registry: SignalDefinition[], readi
140
97
  //#region src/signals/session-fingerprint-hash.d.ts
141
98
  export declare function computeSessionFingerprintHash(clientAttributes: Record<string, string> | null | undefined): string | null;
142
99
  //#endregion
100
+ //#region src/signals/device-fingerprint.d.ts
101
+ export declare const DEVICE_FINGERPRINT_VERSION = 2;
102
+ export declare const DEVICE_FINGERPRINT_PREFIX = "fp2:";
103
+ type FingerprintRole = 'include' | 'exclude-churning';
104
+ interface ClientAttributeClassification {
105
+ readonly role: FingerprintRole;
106
+ readonly reason: string;
107
+ readonly signalId?: string;
108
+ readonly presenceOnly?: boolean;
109
+ }
110
+ export declare const LAZY_CHUNK_PRESENCE_REASON = "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.";
111
+ export declare const VENDORED_PRESENCE_REASON = "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.";
112
+ export declare const LANE_ONLY_REASON = "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.";
113
+ export declare const CLIENT_ATTRIBUTE_CLASSIFICATION: ReadonlyMap<string, ClientAttributeClassification>;
114
+ export declare function isChurningClientAttribute(name: string): boolean;
115
+ export declare function isStatsRecordableClientAttribute(name: string): boolean;
116
+ export declare function canonicalizeClientAttributes(attributes: Readonly<Record<string, string>> | null | undefined): Record<string, string>;
117
+ export declare function deviceFingerprintComponents(attributes: Readonly<Record<string, string>> | null | undefined): Record<string, string>;
118
+ export declare function computeDeviceFingerprint(attributes: Readonly<Record<string, string>> | null | undefined): string | null;
119
+ //#endregion
143
120
  //#region src/signals/validate.d.ts
144
121
  interface RegistryValidationResult {
145
122
  valid: boolean;
@@ -164,5 +141,48 @@ export declare function recordSnapshot(committed: SnapshotRecord[], live: Signal
164
141
  //#region src/signals/docs.d.ts
165
142
  export declare function generateRegistryMarkdown(registry: SignalDefinition[]): string;
166
143
  //#endregion
167
- export type { CompositionRiskRule, DenoisePolicy, FingerprintTree, GroupFingerprint, GroupedSignals, PlaneFingerprint, RegistryValidationResult, RegistryVersion, SensitiveAttributeCategory, SensitiveAttributeReview, SensitiveAttributeRule, SensitiveAttributeViolation, SensitiveAttributeViolationKind, SensitiveRejectionListVersion, SignalDefinition, SignalMode, SignalPlane, SignalReading, SnapshotConsistencyResult, SnapshotRecord, SnapshotViolation, StabilityTier, TierMeasurement };
144
+ //#region src/signals/sensitive-attributes.d.ts
145
+ export declare const CURRENT_SENSITIVE_REJECTION_LIST_VERSION: SensitiveRejectionListVersion;
146
+ interface SensitiveAttributeRule {
147
+ category: SensitiveAttributeCategory;
148
+ description: string;
149
+ regimes: string[];
150
+ keywords: string[];
151
+ }
152
+ export declare const SENSITIVE_ATTRIBUTE_REJECTION_LIST: Record<SensitiveRejectionListVersion, SensitiveAttributeRule[]>;
153
+ interface CompositionRiskRule {
154
+ id: string;
155
+ category: SensitiveAttributeCategory;
156
+ signalIds: string[];
157
+ minMatches: number;
158
+ regimes: string[];
159
+ rationale: string;
160
+ }
161
+ export declare const COMPOSITION_RISK_RULES: CompositionRiskRule[];
162
+ type SensitiveAttributeViolationKind = 'direct' | 'composition' | 'declared' | 'stale-review';
163
+ interface SensitiveAttributeViolation {
164
+ kind: SensitiveAttributeViolationKind;
165
+ category: SensitiveAttributeCategory | null;
166
+ ruleId: string;
167
+ regimes: string[];
168
+ message: string;
169
+ }
170
+ export declare function checkDirectMatch(signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
171
+ export declare function checkCompositionRisk(signalId: string, combinesWith: string[]): SensitiveAttributeViolation[];
172
+ export declare function checkDeclaredCategory(review: Pick<SensitiveAttributeReview, 'derivesCategory'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
173
+ export declare function checkReviewRecordIntegrity(review: SignalDefinition['review'] | undefined, currentVersion?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
174
+ export declare function evaluateSensitiveAttributeCompliance(signal: SignalDefinition): SensitiveAttributeViolation[];
175
+ export declare class SensitiveAttributeRejectionError extends Error {
176
+ readonly signalId: string;
177
+ readonly violations: SensitiveAttributeViolation[];
178
+ constructor(signalId: string, violations: SensitiveAttributeViolation[]);
179
+ }
180
+ export declare function registerSignal(definition: SignalDefinition): SignalDefinition;
181
+ export declare function checkSensitiveAttributeCompliance(signal: SignalDefinition): {
182
+ ok: boolean;
183
+ violations: SensitiveAttributeViolation[];
184
+ };
185
+ export declare function findSignalsNeedingReevaluation(signals: SignalDefinition[], currentVersion?: SensitiveRejectionListVersion): SignalDefinition[];
186
+ //#endregion
187
+ export type { ClientAttributeClassification, CompositionRiskRule, DenoisePolicy, FingerprintRole, FingerprintTree, GroupFingerprint, GroupedSignals, PlaneFingerprint, RegistryValidationResult, RegistryVersion, SensitiveAttributeCategory, SensitiveAttributeReview, SensitiveAttributeRule, SensitiveAttributeViolation, SensitiveAttributeViolationKind, SensitiveRejectionListVersion, SignalDefinition, SignalMode, SignalPlane, SignalReading, SnapshotConsistencyResult, SnapshotRecord, SnapshotViolation, StabilityTier, TierMeasurement };
168
188
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/signals/sensitive-attributes.ts","../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts"],"mappings":";qBAiDa;KAED,wCAAwC;qBAEvC,0CAA0C;KAO3C;UASK;EACf,UAAU;EACV;EAEA;EAOA;;qBAGW,oCAAoC,OAC/C,+BACA;UA8Ge;EACf;EACA,UAAU;EAEV;EAEA;EACA;EACA;;qBAGW,wBAAwB;UA6CpB;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;KAOU;UAMK;EACf,MAAM;EAEN,UAAU;EAEV;EACA;EACA;;wBAiCc,iBACd,QAAQ,KAAK,mDACb,UAAS,gCACR;wBAwBa,qBACd,kBACA,yBACC;wBAoBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf;;;qBCleU;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCAJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;UC7EH;EACf;EACA;;wBAac,iBAAiB,SAAS,qBAAqB;;;UCpB9C;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;;wBAgBE,yBAAyB,QAAQ,mBAAmB;wBA0BpD,yBACd,WAAW,kBACX,MAAM,qBACL;wBA0Ea,eACd,WAAW,kBACX,MAAM,qBACL;;;wBCzEa,yBAAyB,UAAU"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../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","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;wBAmMlD,0BAA0B;wBAK1B,iCAAiC;wBA4BjC,6BACd,YAAY,SAAS,6CACpB;wBAgBa,4BACd,YAAY,SAAS,6CACpB;wBAWa,yBACd,YAAY,SAAS;;;UCtUN;EACf;EACA;;wBAac,iBAAiB,SAAS,qBAAqB;;;UCpB9C;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;;wBAgBE,yBAAyB,QAAQ,mBAAmB;wBA0BpD,yBACd,WAAW,kBACX,MAAM,qBACL;wBA0Ea,eACd,WAAW,kBACX,MAAM,qBACL;;;wBCzEa,yBAAyB,UAAU;;;qBCLtC,0CAA0C;UAGtC;EACf,UAAU;EACV;EAEA;EAOA;;qBAGW,oCAAoC,OAC/C,+BACA;UA8Ge;EACf;EACA,UAAU;EAEV;EAEA;EACA;EACA;;qBAGW,wBAAwB;KAsCzB;UAMK;EACf,MAAM;EAEN,UAAU;EAEV;EACA;EACA;;wBAiCc,iBACd,QAAQ,KAAK,mDACb,UAAS,gCACR;wBAwBa,qBACd,kBACA,yBACC;wBAoBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf"}
@@ -1,57 +1,3 @@
1
- //#region src/signals/sensitive-attributes.d.ts
2
- export declare const SENSITIVE_REJECTION_LIST_VERSIONS: readonly ["v1"];
3
- type SensitiveRejectionListVersion = (typeof SENSITIVE_REJECTION_LIST_VERSIONS)[number];
4
- export declare const CURRENT_SENSITIVE_REJECTION_LIST_VERSION: SensitiveRejectionListVersion;
5
- type SensitiveAttributeCategory = 'racial-or-ethnic-origin' | 'religious-or-philosophical-beliefs' | 'mental-or-physical-health-condition-or-diagnosis' | 'sex-life-or-sexual-orientation' | 'citizenship-or-immigration-status' | 'biometric-identifier-or-derivative' | 'government-identification-number';
6
- interface SensitiveAttributeRule {
7
- category: SensitiveAttributeCategory;
8
- description: string;
9
- regimes: string[];
10
- keywords: string[];
11
- }
12
- export declare const SENSITIVE_ATTRIBUTE_REJECTION_LIST: Record<SensitiveRejectionListVersion, SensitiveAttributeRule[]>;
13
- interface CompositionRiskRule {
14
- id: string;
15
- category: SensitiveAttributeCategory;
16
- signalIds: string[];
17
- minMatches: number;
18
- regimes: string[];
19
- rationale: string;
20
- }
21
- export declare const COMPOSITION_RISK_RULES: CompositionRiskRule[];
22
- interface SensitiveAttributeReview {
23
- listVersion: SensitiveRejectionListVersion;
24
- reviewedBy: string;
25
- reviewedAt: string;
26
- combinesWith: string[];
27
- derivesCategory: SensitiveAttributeCategory | null;
28
- rationale: string;
29
- }
30
- type SensitiveAttributeViolationKind = 'direct' | 'composition' | 'declared' | 'stale-review';
31
- interface SensitiveAttributeViolation {
32
- kind: SensitiveAttributeViolationKind;
33
- category: SensitiveAttributeCategory | null;
34
- ruleId: string;
35
- regimes: string[];
36
- message: string;
37
- }
38
- export declare function checkDirectMatch(signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
39
- export declare function checkCompositionRisk(signalId: string, combinesWith: string[]): SensitiveAttributeViolation[];
40
- export declare function checkDeclaredCategory(review: Pick<SensitiveAttributeReview, 'derivesCategory'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
41
- export declare function checkReviewRecordIntegrity(review: SignalDefinition['review'] | undefined, currentVersion?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
42
- export declare function evaluateSensitiveAttributeCompliance(signal: SignalDefinition): SensitiveAttributeViolation[];
43
- export declare class SensitiveAttributeRejectionError extends Error {
44
- readonly signalId: string;
45
- readonly violations: SensitiveAttributeViolation[];
46
- constructor(signalId: string, violations: SensitiveAttributeViolation[]);
47
- }
48
- export declare function registerSignal(definition: SignalDefinition): SignalDefinition;
49
- export declare function checkSensitiveAttributeCompliance(signal: SignalDefinition): {
50
- ok: boolean;
51
- violations: SensitiveAttributeViolation[];
52
- };
53
- export declare function findSignalsNeedingReevaluation(signals: SignalDefinition[], currentVersion?: SensitiveRejectionListVersion): SignalDefinition[];
54
- //#endregion
55
1
  //#region src/signals/types.d.ts
56
2
  export declare const REGISTRY_VERSIONS: readonly ["v1", "v2", "v3"];
57
3
  type RegistryVersion = (typeof REGISTRY_VERSIONS)[number];
@@ -73,6 +19,17 @@ interface TierMeasurement {
73
19
  provisional: boolean;
74
20
  notes: string;
75
21
  }
22
+ export declare const SENSITIVE_REJECTION_LIST_VERSIONS: readonly ["v1"];
23
+ type SensitiveRejectionListVersion = (typeof SENSITIVE_REJECTION_LIST_VERSIONS)[number];
24
+ type SensitiveAttributeCategory = 'racial-or-ethnic-origin' | 'religious-or-philosophical-beliefs' | 'mental-or-physical-health-condition-or-diagnosis' | 'sex-life-or-sexual-orientation' | 'citizenship-or-immigration-status' | 'biometric-identifier-or-derivative' | 'government-identification-number';
25
+ interface SensitiveAttributeReview {
26
+ listVersion: SensitiveRejectionListVersion;
27
+ reviewedBy: string;
28
+ reviewedAt: string;
29
+ combinesWith: string[];
30
+ derivesCategory: SensitiveAttributeCategory | null;
31
+ rationale: string;
32
+ }
76
33
  interface SignalDefinition {
77
34
  id: string;
78
35
  addedVersion: RegistryVersion;
@@ -140,6 +97,26 @@ export declare function buildFingerprintTree(registry: SignalDefinition[], readi
140
97
  //#region src/signals/session-fingerprint-hash.d.ts
141
98
  export declare function computeSessionFingerprintHash(clientAttributes: Record<string, string> | null | undefined): string | null;
142
99
  //#endregion
100
+ //#region src/signals/device-fingerprint.d.ts
101
+ export declare const DEVICE_FINGERPRINT_VERSION = 2;
102
+ export declare const DEVICE_FINGERPRINT_PREFIX = "fp2:";
103
+ type FingerprintRole = 'include' | 'exclude-churning';
104
+ interface ClientAttributeClassification {
105
+ readonly role: FingerprintRole;
106
+ readonly reason: string;
107
+ readonly signalId?: string;
108
+ readonly presenceOnly?: boolean;
109
+ }
110
+ export declare const LAZY_CHUNK_PRESENCE_REASON = "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.";
111
+ export declare const VENDORED_PRESENCE_REASON = "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.";
112
+ export declare const LANE_ONLY_REASON = "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.";
113
+ export declare const CLIENT_ATTRIBUTE_CLASSIFICATION: ReadonlyMap<string, ClientAttributeClassification>;
114
+ export declare function isChurningClientAttribute(name: string): boolean;
115
+ export declare function isStatsRecordableClientAttribute(name: string): boolean;
116
+ export declare function canonicalizeClientAttributes(attributes: Readonly<Record<string, string>> | null | undefined): Record<string, string>;
117
+ export declare function deviceFingerprintComponents(attributes: Readonly<Record<string, string>> | null | undefined): Record<string, string>;
118
+ export declare function computeDeviceFingerprint(attributes: Readonly<Record<string, string>> | null | undefined): string | null;
119
+ //#endregion
143
120
  //#region src/signals/validate.d.ts
144
121
  interface RegistryValidationResult {
145
122
  valid: boolean;
@@ -164,5 +141,48 @@ export declare function recordSnapshot(committed: SnapshotRecord[], live: Signal
164
141
  //#region src/signals/docs.d.ts
165
142
  export declare function generateRegistryMarkdown(registry: SignalDefinition[]): string;
166
143
  //#endregion
167
- export type { CompositionRiskRule, DenoisePolicy, FingerprintTree, GroupFingerprint, GroupedSignals, PlaneFingerprint, RegistryValidationResult, RegistryVersion, SensitiveAttributeCategory, SensitiveAttributeReview, SensitiveAttributeRule, SensitiveAttributeViolation, SensitiveAttributeViolationKind, SensitiveRejectionListVersion, SignalDefinition, SignalMode, SignalPlane, SignalReading, SnapshotConsistencyResult, SnapshotRecord, SnapshotViolation, StabilityTier, TierMeasurement };
144
+ //#region src/signals/sensitive-attributes.d.ts
145
+ export declare const CURRENT_SENSITIVE_REJECTION_LIST_VERSION: SensitiveRejectionListVersion;
146
+ interface SensitiveAttributeRule {
147
+ category: SensitiveAttributeCategory;
148
+ description: string;
149
+ regimes: string[];
150
+ keywords: string[];
151
+ }
152
+ export declare const SENSITIVE_ATTRIBUTE_REJECTION_LIST: Record<SensitiveRejectionListVersion, SensitiveAttributeRule[]>;
153
+ interface CompositionRiskRule {
154
+ id: string;
155
+ category: SensitiveAttributeCategory;
156
+ signalIds: string[];
157
+ minMatches: number;
158
+ regimes: string[];
159
+ rationale: string;
160
+ }
161
+ export declare const COMPOSITION_RISK_RULES: CompositionRiskRule[];
162
+ type SensitiveAttributeViolationKind = 'direct' | 'composition' | 'declared' | 'stale-review';
163
+ interface SensitiveAttributeViolation {
164
+ kind: SensitiveAttributeViolationKind;
165
+ category: SensitiveAttributeCategory | null;
166
+ ruleId: string;
167
+ regimes: string[];
168
+ message: string;
169
+ }
170
+ export declare function checkDirectMatch(signal: Pick<SignalDefinition, 'id' | 'description' | 'group'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
171
+ export declare function checkCompositionRisk(signalId: string, combinesWith: string[]): SensitiveAttributeViolation[];
172
+ export declare function checkDeclaredCategory(review: Pick<SensitiveAttributeReview, 'derivesCategory'>, version?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
173
+ export declare function checkReviewRecordIntegrity(review: SignalDefinition['review'] | undefined, currentVersion?: SensitiveRejectionListVersion): SensitiveAttributeViolation[];
174
+ export declare function evaluateSensitiveAttributeCompliance(signal: SignalDefinition): SensitiveAttributeViolation[];
175
+ export declare class SensitiveAttributeRejectionError extends Error {
176
+ readonly signalId: string;
177
+ readonly violations: SensitiveAttributeViolation[];
178
+ constructor(signalId: string, violations: SensitiveAttributeViolation[]);
179
+ }
180
+ export declare function registerSignal(definition: SignalDefinition): SignalDefinition;
181
+ export declare function checkSensitiveAttributeCompliance(signal: SignalDefinition): {
182
+ ok: boolean;
183
+ violations: SensitiveAttributeViolation[];
184
+ };
185
+ export declare function findSignalsNeedingReevaluation(signals: SignalDefinition[], currentVersion?: SensitiveRejectionListVersion): SignalDefinition[];
186
+ //#endregion
187
+ export type { ClientAttributeClassification, CompositionRiskRule, DenoisePolicy, FingerprintRole, FingerprintTree, GroupFingerprint, GroupedSignals, PlaneFingerprint, RegistryValidationResult, RegistryVersion, SensitiveAttributeCategory, SensitiveAttributeReview, SensitiveAttributeRule, SensitiveAttributeViolation, SensitiveAttributeViolationKind, SensitiveRejectionListVersion, SignalDefinition, SignalMode, SignalPlane, SignalReading, SnapshotConsistencyResult, SnapshotRecord, SnapshotViolation, StabilityTier, TierMeasurement };
168
188
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/signals/sensitive-attributes.ts","../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../src/signals/merkle.ts","../../src/signals/session-fingerprint-hash.ts","../../src/signals/validate.ts","../../src/signals/immutability.ts","../../src/signals/docs.ts"],"mappings":";qBAiDa;KAED,wCAAwC;qBAEvC,0CAA0C;KAO3C;UASK;EACf,UAAU;EACV;EAEA;EAOA;;qBAGW,oCAAoC,OAC/C,+BACA;UA8Ge;EACf;EACA,UAAU;EAEV;EAEA;EACA;EACA;;qBAGW,wBAAwB;UA6CpB;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;KAOU;UAMK;EACf,MAAM;EAEN,UAAU;EAEV;EACA;EACA;;wBAiCc,iBACd,QAAQ,KAAK,mDACb,UAAS,gCACR;wBAwBa,qBACd,kBACA,yBACC;wBAoBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf;;;qBCleU;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCAJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;UC7EH;EACf;EACA;;wBAac,iBAAiB,SAAS,qBAAqB;;;UCpB9C;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;;wBAgBE,yBAAyB,QAAQ,mBAAmB;wBA0BpD,yBACd,WAAW,kBACX,MAAM,qBACL;wBA0Ea,eACd,WAAW,kBACX,MAAM,qBACL;;;wBCzEa,yBAAyB,UAAU"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/signals/types.ts","../../src/signals/registry.ts","../../src/signals/resolve.ts","../../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","../../src/signals/sensitive-attributes.ts"],"mappings":";qBAuBa;KAED,0BAA0B;qBAEzB,0BAA0B;KAU3B;KAQA;KASA;KAEA;EAAkB;;EAAmB;EAAe;;UAS/C;EAEf;EACA;EAEA;EAEA;EACA;EACA;;qBAIW;KAED,wCAAwC;KAMxC;UAgBK;EAEf,aAAa;EACb;EAEA;EAEA;EAEA,iBAAiB;EAEjB;;UAGe;EAEf;EAEA,cAAc;EAEd,gBAAgB;EAChB,MAAM;EACN,aAAa;EACb,SAAS;EACT,MAAM;EACN,OAAO;EAEP;EAEA;EAEA;EACA;EAOA,QAAQ;;qBAIG;qBASA;UASI;EACf;EACA,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,OAAO;EACP;EACA,eAAe;;;;qBCrCJ,iBAAiB;;;wBC3Gd,iBACd,UAAU,oBACV,UAAS,kBACR;wBASa,UACd,UAAU,oBACV,YACA,UAAS,kBACR;wBAKa,mBAAmB,UAAU,qBAAqB;KAItD,iBAAiB,OAAO,aAAa,eAAe;wBAOhD,aAAa,SAAS,qBAAqB;;;KCG/C;EACN;EAAiB;;EACjB;;EACA;EAAe;;UAEJ;EAEf;EAEA,QAAQ;;UAGO;EAEf;EAKA;EACA,QAAQ,eAAe;;UAGR;EAEf,iBAAiB;EAEjB;EAEA,QAAQ,QAAQ,OAAO,aAAa;;wBAiFtB,qBACd,UAAU,oBACV,UAAU,eAAe,gBACzB,kBAAiB,kBAChB;;;wBC7Fa,8BACd,kBAAkB;;;qBCjFP;qBAEA;KAED;UAEK;WACN,MAAM;WACN;WACA;WACA;;qBA2BE;qBAEA;qBAEA;qBA6BA,iCAAiC,oBAAoB;wBAmMlD,0BAA0B;wBAK1B,iCAAiC;wBA4BjC,6BACd,YAAY,SAAS,6CACpB;wBAgBa,4BACd,YAAY,SAAS,6CACpB;wBAWa,yBACd,YAAY,SAAS;;;UCtUN;EACf;EACA;;wBAac,iBAAiB,SAAS,qBAAqB;;;UCpB9C;EACf;EACA;EACA;;UAGe;EACf;EACA,YAAY;;wBAgBE,yBAAyB,QAAQ,mBAAmB;wBA0BpD,yBACd,WAAW,kBACX,MAAM,qBACL;wBA0Ea,eACd,WAAW,kBACX,MAAM,qBACL;;;wBCzEa,yBAAyB,UAAU;;;qBCLtC,0CAA0C;UAGtC;EACf,UAAU;EACV;EAEA;EAOA;;qBAGW,oCAAoC,OAC/C,+BACA;UA8Ge;EACf;EACA,UAAU;EAEV;EAEA;EACA;EACA;;qBAGW,wBAAwB;KAsCzB;UAMK;EACf,MAAM;EAEN,UAAU;EAEV;EACA;EACA;;wBAiCc,iBACd,QAAQ,KAAK,mDACb,UAAS,gCACR;wBAwBa,qBACd,kBACA,yBACC;wBAoBa,sBACd,QAAQ,KAAK,8CACb,UAAS,gCACR;wBAuBa,2BACd,QAAQ,wCACR,iBAAgB,gCACf;wBAsCa,qCACd,QAAQ,mBACP;qBAiBU,yCAAyC;WAC3C;WACA,YAAY;EAET,YAAA,kBAAkB,YAAY;;wBAqB5B,eAAe,YAAY,mBAAmB;wBAa9C,kCAAkC,QAAQ;EACxD;EACA,YAAY;;wBAaE,+BACd,SAAS,oBACT,iBAAgB,gCACf"}
@@ -31,6 +31,8 @@ const REGISTRY_VERSIONS = [
31
31
  "v3"
32
32
  ];
33
33
  const CURRENT_REGISTRY_VERSION = REGISTRY_VERSIONS[REGISTRY_VERSIONS.length - 1];
34
+ /** Ordered rejection-list versions. Order matters: CURRENT is always the last entry. */
35
+ const SENSITIVE_REJECTION_LIST_VERSIONS = ["v1"];
34
36
  /** Fields frozen once a signal has shipped (see immutability.ts). */
35
37
  const FROZEN_FIELDS = [
36
38
  "id",
@@ -92,8 +94,6 @@ const TIER_LOCKED_FIELDS = ["tier"];
92
94
  * avoids the bare words "fingerprint"/"biometric" for that reason: using
93
95
  * them would false-positive on this entire module.
94
96
  */
95
- /** Ordered rejection-list versions. Order matters: CURRENT is always the last entry. */
96
- const SENSITIVE_REJECTION_LIST_VERSIONS = ["v1"];
97
97
  const CURRENT_SENSITIVE_REJECTION_LIST_VERSION = SENSITIVE_REJECTION_LIST_VERSIONS[SENSITIVE_REJECTION_LIST_VERSIONS.length - 1];
98
98
  const SENSITIVE_ATTRIBUTE_REJECTION_LIST = { v1: [
99
99
  {
@@ -1574,6 +1574,239 @@ function computeSessionFingerprintHash(clientAttributes) {
1574
1574
  return (0, _noble_hashes_utils_js.bytesToHex)((0, _noble_hashes_sha2_js.sha256)(new TextEncoder().encode(json)));
1575
1575
  }
1576
1576
 
1577
+ //#endregion
1578
+ //#region src/signals/device-fingerprint.ts
1579
+ const DEVICE_FINGERPRINT_VERSION = 2;
1580
+ const DEVICE_FINGERPRINT_PREFIX = `fp${2}:`;
1581
+ const STABLE_HARDWARE = "Hardware constant for the device (registry tier high): does not move within a visit.";
1582
+ const STABLE_DISPLAY = "Display property fixed for the visit (registry tier medium): moves only on a monitor change.";
1583
+ const STABLE_SETTING = "Browser or OS setting fixed for the visit: moves only on a deliberate user change between visits.";
1584
+ const STABLE_MOBILE = "Mobile SDK device or app field fixed for the install: moves only on an OS or app change.";
1585
+ const LOW_ENTROPY_STABLE = "Low entropy (registry tier low) but fixed for the visit: adds distinctness without adding instability.";
1586
+ const COUNTER = "Event counter that grows through the visit: differs between two page loads of one device.";
1587
+ const PERFORMANCE = "Timing, size or memory reading taken per page load and overwritten by later events in a visit.";
1588
+ const NETWORK_STATE = "Live network state that flips within a visit (wifi to cellular, offline).";
1589
+ const PROBE_VERDICT = "Automation probe outcome, a verdict about the client rather than a device property; it appears or flips as probes finish.";
1590
+ const ACCESSIBILITY = "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.";
1591
+ const NEVER_MODE = "Registry mode never: collected for contradiction detection only, never identity linkage.";
1592
+ const BUILD_STAMP = "Detector release stamp: moves on every pixel release for every visitor at once, not a device property.";
1593
+ const LAZY_CHUNK_PRESENCE_REASON = "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.";
1594
+ const VENDORED_PRESENCE_REASON = "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.";
1595
+ const LANE_ONLY_REASON = "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.";
1596
+ const DAYLIGHT_SAVING = "Moves with daylight saving time between visits, so it differs for one device across the year.";
1597
+ const include = (reason, signalId) => ({
1598
+ role: "include",
1599
+ reason,
1600
+ signalId
1601
+ });
1602
+ const churning = (reason, signalId) => ({
1603
+ role: "exclude-churning",
1604
+ reason,
1605
+ signalId
1606
+ });
1607
+ const presence = (reason, signalId) => ({
1608
+ role: "exclude-churning",
1609
+ reason,
1610
+ signalId,
1611
+ presenceOnly: true
1612
+ });
1613
+ const lazy = (signalId) => presence(LAZY_CHUNK_PRESENCE_REASON, signalId);
1614
+ const laneOnly = (signalId) => presence(LANE_ONLY_REASON, signalId);
1615
+ const vendoredOnly = (signalId) => presence(VENDORED_PRESENCE_REASON, signalId);
1616
+ const counter = churning(COUNTER);
1617
+ const performance = churning(PERFORMANCE);
1618
+ const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
1619
+ ["device.id", include("Persistent per-browser cookie id: it keeps identical hardware apart, so visitor_id and the unattributed lookback stay per browser instead of collapsing.")],
1620
+ ["device.platform", include(LOW_ENTROPY_STABLE, "platform.navigatorPlatform")],
1621
+ ["device.vendorSub", laneOnly()],
1622
+ ["device.doNotTrackResolved", laneOnly()],
1623
+ ["device.locale", include(STABLE_SETTING)],
1624
+ ["device.timezone", include(STABLE_SETTING)],
1625
+ ["client.screenWidthPt", churning("Screen width swaps with height when the device rotates, so it moves within a visit.")],
1626
+ ["client.screenHeightPt", churning("Screen height swaps with width when the device rotates, so it moves within a visit.")],
1627
+ ["client.screenWidthPx", churning("Screen width swaps with height when the device rotates, so it moves within a visit.")],
1628
+ ["client.screenHeightPx", churning("Screen height swaps with width when the device rotates, so it moves within a visit.")],
1629
+ ["client.screenScale", include(STABLE_DISPLAY)],
1630
+ ["client.screenDensity", include(STABLE_DISPLAY)],
1631
+ ["device.manufacturer", include(STABLE_MOBILE)],
1632
+ ["device.model", include(STABLE_MOBILE)],
1633
+ ["device.osVersion", include(STABLE_MOBILE)],
1634
+ ["device.emulator", include(STABLE_MOBILE)],
1635
+ ["device.rooted", include(STABLE_MOBILE)],
1636
+ ["app.id", include(STABLE_MOBILE)],
1637
+ ["app.versionName", churning("Bumped for every install at once by an app release.")],
1638
+ ["app.versionCode", churning("Bumped for every install at once by an app release.")],
1639
+ ["browser.cookiesEnabled", include(LOW_ENTROPY_STABLE, "platform.cookiesEnabled")],
1640
+ ["browser.timezoneOffset", churning(DAYLIGHT_SAVING)],
1641
+ ["browser.timezone", include(STABLE_SETTING, "platform.timezone")],
1642
+ ["browser.language", include(STABLE_SETTING, "platform.languages")],
1643
+ ["browser.onLine", churning(NETWORK_STATE)],
1644
+ ["network.connectionType", churning(NETWORK_STATE)],
1645
+ ["network.connectionSpeed", churning(NETWORK_STATE)],
1646
+ ["network.connectionRtt", churning(NETWORK_STATE)],
1647
+ ["network.connectionSaveData", churning(NETWORK_STATE)],
1648
+ ["client.networkType", churning(NETWORK_STATE)],
1649
+ ["screen.resolution", include(STABLE_DISPLAY, "platform.screenResolution")],
1650
+ ["screen.pixelDepth", laneOnly("platform.colorDepth")],
1651
+ ["screen.viewport", churning("Window size: changes on resize, rotation and split view.")],
1652
+ ["client.hardwareConcurrency", include(STABLE_HARDWARE, "platform.hardwareConcurrency")],
1653
+ ["client.deviceMemory", include(STABLE_HARDWARE, "platform.deviceMemory")],
1654
+ ["client.maxTouchPoints", include(STABLE_DISPLAY, "platform.touchSupport")],
1655
+ ["client.hasTouch", laneOnly("platform.touchSupport")],
1656
+ ["client.colorDepth", include(LOW_ENTROPY_STABLE, "platform.colorDepth")],
1657
+ ["client.doNotTrack", laneOnly()],
1658
+ ["client.pluginsCount", laneOnly()],
1659
+ ["client.languages", vendoredOnly("platform.languages")],
1660
+ ["client.localStorageEnabled", vendoredOnly("platform.localStorage")],
1661
+ ["client.sessionStorageEnabled", vendoredOnly("platform.sessionStorage")],
1662
+ ["client.chrome", laneOnly("platform.vendorFlavors")],
1663
+ ["client.vendor", include(LOW_ENTROPY_STABLE, "platform.vendor")],
1664
+ ["client.pixelRatio", churning("devicePixelRatio moves with page zoom and when a window changes display.")],
1665
+ ["client.webrtc", churning("Outcome of a one second STUN race (available, timeout, error): depends on the network at load time.")],
1666
+ ["client.automation", churning(PROBE_VERDICT)],
1667
+ ["client.automationTag", churning(PROBE_VERDICT)],
1668
+ ["client.headless", churning(PROBE_VERDICT)],
1669
+ ["client.webdriver", churning(PROBE_VERDICT)],
1670
+ ["client.cdpStackAccessed", churning(PROBE_VERDICT)],
1671
+ ["client.pluginMimeTypesConsistent", churning(PROBE_VERDICT)],
1672
+ ["client.webglUaConsistent", churning(PROBE_VERDICT)],
1673
+ ["client.distinctiveProperties", churning(PROBE_VERDICT)],
1674
+ ["client.timingVersion", churning(BUILD_STAMP)],
1675
+ ["client.kinematicsVersion", churning(BUILD_STAMP)],
1676
+ ["client.scrollEvents", counter],
1677
+ ["client.keyboardEvents", counter],
1678
+ ["client.touchEvents", counter],
1679
+ ["client.untrustedEvents", counter],
1680
+ ["client.hasInteraction", counter],
1681
+ ["client.keyDwellCount", counter],
1682
+ ["client.keyDwellUnder5", counter],
1683
+ ["client.keyDwellSumMs", counter],
1684
+ ["client.keyGapCount", counter],
1685
+ ["client.keyGapUnder5", counter],
1686
+ ["client.pressCount", counter],
1687
+ ["client.pressAdjacencyCount", counter],
1688
+ ["client.pressAdjacentUnder5", counter],
1689
+ ["client.pressUnder10", counter],
1690
+ ["client.pressSumMs", counter],
1691
+ ["client.mouseClicks", counter],
1692
+ ["client.zeroTrailClicks", counter],
1693
+ ["client.pointerMoves", counter],
1694
+ ["client.coalescedMoves", counter],
1695
+ ["client.stepPairs", counter],
1696
+ ["client.equalSteps", counter],
1697
+ ["client.straightSteps", counter],
1698
+ ["performance.navigation", performance],
1699
+ ["performance.navigationType", performance],
1700
+ ["performance.pageLoadTime", performance],
1701
+ ["performance.domContentLoadedTime", performance],
1702
+ ["performance.domInteractiveTime", performance],
1703
+ ["performance.dnsLookupTime", performance],
1704
+ ["performance.tcpConnectionTime", performance],
1705
+ ["performance.serverResponseTime", performance],
1706
+ ["performance.transferSize", performance],
1707
+ ["performance.encodedBodySize", performance],
1708
+ ["performance.decodedBodySize", performance],
1709
+ ["performance.redirectCount", performance],
1710
+ ["performance.memoryUsedJSHeapSize", performance],
1711
+ ["performance.memoryTotalJSHeapSize", performance],
1712
+ ["performance.memoryLimitJSHeapSize", performance],
1713
+ ["performance.firstPaintTime", performance],
1714
+ ["performance.firstContentfulPaintTime", performance],
1715
+ ["performance.largestContentfulPaintTime", performance],
1716
+ ["canvas.geometry.v2", lazy("canvas.geometry.v2")],
1717
+ ["canvas.text", lazy("canvas.text")],
1718
+ ["webgl.render", lazy("webgl.render")],
1719
+ ["audio.digest", lazy("audio.digest")],
1720
+ ["rendering.mathFingerprint", laneOnly("rendering.mathFingerprint")],
1721
+ ["rendering.fontPreferences", lazy("rendering.fontPreferences")],
1722
+ ["transport.webrtcCodecs", lazy("transport.webrtcCodecs")],
1723
+ ["platform.speechVoices", lazy("platform.speechVoices")],
1724
+ ["platform.userAgentData", vendoredOnly("platform.userAgentData")],
1725
+ ["platform.architecture", laneOnly("platform.architecture")],
1726
+ ["platform.hardwareConcurrency", include(STABLE_HARDWARE, "platform.hardwareConcurrency")],
1727
+ ["platform.deviceMemory", include(STABLE_HARDWARE, "platform.deviceMemory")],
1728
+ ["platform.screenResolution", include(STABLE_DISPLAY, "platform.screenResolution")],
1729
+ ["platform.colorGamut", laneOnly("platform.colorGamut")],
1730
+ ["platform.hdr", laneOnly("platform.hdr")],
1731
+ ["platform.timezone", include(STABLE_SETTING, "platform.timezone")],
1732
+ ["platform.languages", vendoredOnly("platform.languages")],
1733
+ ["platform.touchSupport", laneOnly("platform.touchSupport")],
1734
+ ["platform.colorDepth", include(LOW_ENTROPY_STABLE, "platform.colorDepth")],
1735
+ ["platform.monochrome", laneOnly("platform.monochrome")],
1736
+ ["platform.navigatorPlatform", include(LOW_ENTROPY_STABLE, "platform.navigatorPlatform")],
1737
+ ["platform.vendor", include(LOW_ENTROPY_STABLE, "platform.vendor")],
1738
+ ["platform.osCpu", laneOnly("platform.osCpu")],
1739
+ ["platform.cookiesEnabled", include(LOW_ENTROPY_STABLE, "platform.cookiesEnabled")],
1740
+ ["platform.sessionStorage", vendoredOnly("platform.sessionStorage")],
1741
+ ["platform.localStorage", vendoredOnly("platform.localStorage")],
1742
+ ["platform.indexedDB", laneOnly("platform.indexedDB")],
1743
+ ["platform.pdfViewerEnabled", laneOnly("platform.pdfViewerEnabled")],
1744
+ ["platform.permissions", churning("Grant state changes within a session on a trivial user action (registry tier low).", "platform.permissions")],
1745
+ ["platform.contrast", churning(ACCESSIBILITY, "platform.contrast")],
1746
+ ["platform.forcedColors", churning(ACCESSIBILITY, "platform.forcedColors")],
1747
+ ["platform.invertedColors", churning(ACCESSIBILITY, "platform.invertedColors")],
1748
+ ["platform.reducedMotion", churning(ACCESSIBILITY, "platform.reducedMotion")],
1749
+ ["platform.reducedTransparency", churning(ACCESSIBILITY, "platform.reducedTransparency")],
1750
+ ["platform.clientHints.architecture", churning(NEVER_MODE, "platform.clientHints.architecture")],
1751
+ ["platform.clientHints.bitness", churning(NEVER_MODE, "platform.clientHints.bitness")],
1752
+ ["platform.clientHints.model", churning(NEVER_MODE, "platform.clientHints.model")],
1753
+ ["platform.clientHints.platform", churning(NEVER_MODE, "platform.clientHints.platform")],
1754
+ ["platform.clientHints.platformVersion", churning(NEVER_MODE, "platform.clientHints.platformVersion")],
1755
+ ["platform.clientHints.uaFullVersion", churning(NEVER_MODE, "platform.clientHints.uaFullVersion")],
1756
+ ["platform.clientHints.fullVersionList", churning(NEVER_MODE, "platform.clientHints.fullVersionList")],
1757
+ ["platform.clientHints.wow64", churning(NEVER_MODE, "platform.clientHints.wow64")],
1758
+ ["platform.clientHints.mobile", churning(NEVER_MODE, "platform.clientHints.mobile")]
1759
+ ]);
1760
+ function isChurningClientAttribute(name) {
1761
+ const entry = CLIENT_ATTRIBUTE_CLASSIFICATION.get(name);
1762
+ return entry?.role === "exclude-churning" && entry.presenceOnly !== true;
1763
+ }
1764
+ function isStatsRecordableClientAttribute(name) {
1765
+ return CLIENT_ATTRIBUTE_CLASSIFICATION.get(name) !== void 0 && !isChurningClientAttribute(name);
1766
+ }
1767
+ const CANONICAL_NAME = /* @__PURE__ */ new Map([
1768
+ ["platform.navigatorPlatform", "device.platform"],
1769
+ ["platform.timezone", "browser.timezone"],
1770
+ ["platform.screenResolution", "screen.resolution"],
1771
+ ["platform.cookiesEnabled", "browser.cookiesEnabled"],
1772
+ ["platform.hardwareConcurrency", "client.hardwareConcurrency"],
1773
+ ["platform.deviceMemory", "client.deviceMemory"],
1774
+ ["platform.colorDepth", "client.colorDepth"],
1775
+ ["platform.vendor", "client.vendor"]
1776
+ ]);
1777
+ function normalizeResolution(value) {
1778
+ const pair = value.match(/^\[?\s*(\d+)\s*[x,]\s*(\d+)\s*\]?$/i);
1779
+ if (!pair) return value;
1780
+ const width = Number(pair[1]);
1781
+ const height = Number(pair[2]);
1782
+ return `${Math.max(width, height)}x${Math.min(width, height)}`;
1783
+ }
1784
+ const NORMALIZERS = /* @__PURE__ */ new Map([["screen.resolution", normalizeResolution]]);
1785
+ function canonicalizeClientAttributes(attributes) {
1786
+ const source = attributes ?? {};
1787
+ const canonical = {};
1788
+ for (const name of Object.keys(source)) if (!CANONICAL_NAME.has(name)) canonical[name] = source[name];
1789
+ for (const name of Object.keys(source)) {
1790
+ const target = CANONICAL_NAME.get(name);
1791
+ if (target !== void 0 && !(target in canonical)) canonical[target] = source[name];
1792
+ }
1793
+ for (const [name, normalize] of NORMALIZERS) if (name in canonical) canonical[name] = normalize(canonical[name]);
1794
+ return canonical;
1795
+ }
1796
+ function deviceFingerprintComponents(attributes) {
1797
+ const source = canonicalizeClientAttributes(attributes);
1798
+ const components = {};
1799
+ for (const name of Object.keys(source).sort()) if (CLIENT_ATTRIBUTE_CLASSIFICATION.get(name)?.role === "include") components[name] = source[name];
1800
+ return components;
1801
+ }
1802
+ function computeDeviceFingerprint(attributes) {
1803
+ const components = deviceFingerprintComponents(attributes);
1804
+ const names = Object.keys(components);
1805
+ if (names.length === 0) return null;
1806
+ const payload = JSON.stringify([2, names.map((n) => [n, components[n]])]);
1807
+ return (0, _noble_hashes_utils_js.bytesToHex)((0, _noble_hashes_sha2_js.sha256)(new TextEncoder().encode(payload)));
1808
+ }
1809
+
1577
1810
  //#endregion
1578
1811
  //#region src/signals/validate.ts
1579
1812
  const VALID_TIERS = [
@@ -1793,30 +2026,41 @@ function generateRegistryMarkdown(registry) {
1793
2026
  }
1794
2027
 
1795
2028
  //#endregion
2029
+ exports.CLIENT_ATTRIBUTE_CLASSIFICATION = CLIENT_ATTRIBUTE_CLASSIFICATION;
1796
2030
  exports.COMPOSITION_RISK_RULES = COMPOSITION_RISK_RULES;
1797
2031
  exports.CURRENT_REGISTRY_VERSION = CURRENT_REGISTRY_VERSION;
1798
2032
  exports.CURRENT_SENSITIVE_REJECTION_LIST_VERSION = CURRENT_SENSITIVE_REJECTION_LIST_VERSION;
2033
+ exports.DEVICE_FINGERPRINT_PREFIX = DEVICE_FINGERPRINT_PREFIX;
2034
+ exports.DEVICE_FINGERPRINT_VERSION = DEVICE_FINGERPRINT_VERSION;
1799
2035
  exports.FROZEN_FIELDS = FROZEN_FIELDS;
2036
+ exports.LANE_ONLY_REASON = LANE_ONLY_REASON;
2037
+ exports.LAZY_CHUNK_PRESENCE_REASON = LAZY_CHUNK_PRESENCE_REASON;
1800
2038
  exports.REGISTRY_VERSIONS = REGISTRY_VERSIONS;
1801
2039
  exports.SENSITIVE_ATTRIBUTE_REJECTION_LIST = SENSITIVE_ATTRIBUTE_REJECTION_LIST;
1802
2040
  exports.SENSITIVE_REJECTION_LIST_VERSIONS = SENSITIVE_REJECTION_LIST_VERSIONS;
1803
2041
  exports.SIGNAL_REGISTRY = SIGNAL_REGISTRY;
1804
2042
  exports.SensitiveAttributeRejectionError = SensitiveAttributeRejectionError;
1805
2043
  exports.TIER_LOCKED_FIELDS = TIER_LOCKED_FIELDS;
2044
+ exports.VENDORED_PRESENCE_REASON = VENDORED_PRESENCE_REASON;
1806
2045
  exports.buildFingerprintTree = buildFingerprintTree;
2046
+ exports.canonicalizeClientAttributes = canonicalizeClientAttributes;
1807
2047
  exports.checkCompositionRisk = checkCompositionRisk;
1808
2048
  exports.checkDeclaredCategory = checkDeclaredCategory;
1809
2049
  exports.checkDirectMatch = checkDirectMatch;
1810
2050
  exports.checkReviewRecordIntegrity = checkReviewRecordIntegrity;
1811
2051
  exports.checkSensitiveAttributeCompliance = checkSensitiveAttributeCompliance;
1812
2052
  exports.checkSnapshotConsistency = checkSnapshotConsistency;
2053
+ exports.computeDeviceFingerprint = computeDeviceFingerprint;
1813
2054
  exports.computeImmutableSnapshot = computeImmutableSnapshot;
1814
2055
  exports.computeSessionFingerprintHash = computeSessionFingerprintHash;
2056
+ exports.deviceFingerprintComponents = deviceFingerprintComponents;
1815
2057
  exports.evaluateSensitiveAttributeCompliance = evaluateSensitiveAttributeCompliance;
1816
2058
  exports.findSignalsNeedingReevaluation = findSignalsNeedingReevaluation;
1817
2059
  exports.generateRegistryMarkdown = generateRegistryMarkdown;
1818
2060
  exports.getSignal = getSignal;
1819
2061
  exports.groupSignals = groupSignals;
2062
+ exports.isChurningClientAttribute = isChurningClientAttribute;
2063
+ exports.isStatsRecordableClientAttribute = isStatsRecordableClientAttribute;
1820
2064
  exports.listShippedSignals = listShippedSignals;
1821
2065
  exports.recordSnapshot = recordSnapshot;
1822
2066
  exports.registerSignal = registerSignal;