@codemem/core 0.49.0-beta.2 → 0.49.0-beta.4

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 (179) hide show
  1. package/dist/better-sqlite-coordinator-store.d.ts +21 -2
  2. package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
  3. package/dist/coordinator-account-change-authority.d.ts +56 -0
  4. package/dist/coordinator-account-change-authority.d.ts.map +1 -0
  5. package/dist/coordinator-account-change-decision.d.ts +141 -0
  6. package/dist/coordinator-account-change-decision.d.ts.map +1 -0
  7. package/dist/coordinator-account-change-http-test-fixtures.d.ts +3 -1
  8. package/dist/coordinator-account-change-http-test-fixtures.d.ts.map +1 -1
  9. package/dist/coordinator-account-change-original-sql-test-fixtures.d.ts +61 -0
  10. package/dist/coordinator-account-change-original-sql-test-fixtures.d.ts.map +1 -0
  11. package/dist/coordinator-account-change.d.ts +7 -1
  12. package/dist/coordinator-account-change.d.ts.map +1 -1
  13. package/dist/coordinator-account-connection-schema.d.ts +31 -0
  14. package/dist/coordinator-account-connection-schema.d.ts.map +1 -1
  15. package/dist/coordinator-account-connection-session.d.ts +9 -0
  16. package/dist/coordinator-account-connection-session.d.ts.map +1 -1
  17. package/dist/coordinator-account-historical-revoke-original-sql-test-fixtures.d.ts +7 -0
  18. package/dist/coordinator-account-historical-revoke-original-sql-test-fixtures.d.ts.map +1 -0
  19. package/dist/coordinator-account-historical-revoke.d.ts +8 -2
  20. package/dist/coordinator-account-historical-revoke.d.ts.map +1 -1
  21. package/dist/coordinator-account-link-status.d.ts.map +1 -1
  22. package/dist/coordinator-account-schema-sqlite-test-fixtures.d.ts +58 -0
  23. package/dist/coordinator-account-schema-sqlite-test-fixtures.d.ts.map +1 -0
  24. package/dist/coordinator-account-schema-test-fixtures.d.ts +20 -0
  25. package/dist/coordinator-account-schema-test-fixtures.d.ts.map +1 -0
  26. package/dist/coordinator-auth-browser-owner-purpose-test-harness.d.ts.map +1 -1
  27. package/dist/coordinator-auth-browser-transaction-test-fixtures.d.ts.map +1 -1
  28. package/dist/coordinator-auth-browser-transaction.d.ts.map +1 -1
  29. package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts +5 -1
  30. package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts.map +1 -1
  31. package/dist/coordinator-auth-controller-history.d.ts +0 -1
  32. package/dist/coordinator-auth-controller-history.d.ts.map +1 -1
  33. package/dist/coordinator-auth-controller-original-sql-test-fixtures.d.ts +41 -0
  34. package/dist/coordinator-auth-controller-original-sql-test-fixtures.d.ts.map +1 -0
  35. package/dist/coordinator-auth-controller-owner.d.ts +0 -6
  36. package/dist/coordinator-auth-controller-owner.d.ts.map +1 -1
  37. package/dist/coordinator-auth-controller-race-test-fixtures.d.ts +38 -0
  38. package/dist/coordinator-auth-controller-race-test-fixtures.d.ts.map +1 -0
  39. package/dist/coordinator-auth-controller-read-set.d.ts +47 -0
  40. package/dist/coordinator-auth-controller-read-set.d.ts.map +1 -0
  41. package/dist/coordinator-auth-controller-stages-original-sql-test-fixtures.d.ts +8 -0
  42. package/dist/coordinator-auth-controller-stages-original-sql-test-fixtures.d.ts.map +1 -0
  43. package/dist/coordinator-auth-controller.d.ts +1 -21
  44. package/dist/coordinator-auth-controller.d.ts.map +1 -1
  45. package/dist/coordinator-auth-device-claim-eligibility.d.ts +39 -1
  46. package/dist/coordinator-auth-device-claim-eligibility.d.ts.map +1 -1
  47. package/dist/coordinator-auth-historical-store-test-fixture.d.ts +2 -0
  48. package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
  49. package/dist/coordinator-auth-legacy-assignment.d.ts +4 -2
  50. package/dist/coordinator-auth-legacy-assignment.d.ts.map +1 -1
  51. package/dist/coordinator-auth-link-authority-upgrade.d.ts +5 -0
  52. package/dist/coordinator-auth-link-authority-upgrade.d.ts.map +1 -1
  53. package/dist/coordinator-auth-link-maintenance-fixtures.d.ts +2 -2
  54. package/dist/coordinator-auth-link-maintenance-fixtures.d.ts.map +1 -1
  55. package/dist/coordinator-auth-link-provenance.d.ts.map +1 -1
  56. package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -1
  57. package/dist/coordinator-auth-link-test-fixtures.d.ts +26 -4
  58. package/dist/coordinator-auth-link-test-fixtures.d.ts.map +1 -1
  59. package/dist/coordinator-auth-link.d.ts +4 -0
  60. package/dist/coordinator-auth-link.d.ts.map +1 -1
  61. package/dist/coordinator-auth-read-set.d.ts +99 -0
  62. package/dist/coordinator-auth-read-set.d.ts.map +1 -0
  63. package/dist/coordinator-auth-schema-stage.d.ts +36 -0
  64. package/dist/coordinator-auth-schema-stage.d.ts.map +1 -0
  65. package/dist/coordinator-auth-schema.d.ts.map +1 -1
  66. package/dist/coordinator-auth-session.d.ts.map +1 -1
  67. package/dist/coordinator-auth-store-test-fixtures.d.ts +12 -0
  68. package/dist/coordinator-auth-store-test-fixtures.d.ts.map +1 -1
  69. package/dist/coordinator-controller-revocation-test-harness.d.ts.map +1 -1
  70. package/dist/coordinator-d1-schema-inventory.d.ts +10 -0
  71. package/dist/coordinator-d1-schema-inventory.d.ts.map +1 -0
  72. package/dist/coordinator-device-claim-binding-reuse.d.ts +2 -0
  73. package/dist/coordinator-device-claim-binding-reuse.d.ts.map +1 -1
  74. package/dist/coordinator-device-claim-binding-sql.d.ts +8 -0
  75. package/dist/coordinator-device-claim-binding-sql.d.ts.map +1 -1
  76. package/dist/coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts +88 -0
  77. package/dist/coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts.map +1 -0
  78. package/dist/coordinator-device-ownership-evidence-queries.d.ts +4 -14
  79. package/dist/coordinator-device-ownership-evidence-queries.d.ts.map +1 -1
  80. package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts +10 -0
  81. package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts.map +1 -1
  82. package/dist/coordinator-device-ownership-evidence.d.ts +11 -3
  83. package/dist/coordinator-device-ownership-evidence.d.ts.map +1 -1
  84. package/dist/coordinator-device-rebind-browser.d.ts +1 -1
  85. package/dist/coordinator-device-rebind-ceremony.d.ts +2 -1
  86. package/dist/coordinator-device-rebind-ceremony.d.ts.map +1 -1
  87. package/dist/coordinator-device-rebind-commit.d.ts.map +1 -1
  88. package/dist/coordinator-device-rebind-test-fixtures.d.ts.map +1 -1
  89. package/dist/coordinator-device-self-bind-authority.d.ts +11 -2
  90. package/dist/coordinator-device-self-bind-authority.d.ts.map +1 -1
  91. package/dist/coordinator-device-self-bind-decision.d.ts +84 -0
  92. package/dist/coordinator-device-self-bind-decision.d.ts.map +1 -0
  93. package/dist/coordinator-device-self-bind-original-sql-test-fixtures.d.ts +17 -0
  94. package/dist/coordinator-device-self-bind-original-sql-test-fixtures.d.ts.map +1 -0
  95. package/dist/coordinator-device-self-bind-reviewed-history.d.ts +10 -0
  96. package/dist/coordinator-device-self-bind-reviewed-history.d.ts.map +1 -0
  97. package/dist/coordinator-device-self-bind-test-fixtures.d.ts +15 -1
  98. package/dist/coordinator-device-self-bind-test-fixtures.d.ts.map +1 -1
  99. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +6 -2
  100. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -1
  101. package/dist/coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.d.ts +77 -0
  102. package/dist/coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.d.ts.map +1 -0
  103. package/dist/coordinator-legacy-completion-owner-proof-test-fixtures.d.ts +46 -0
  104. package/dist/coordinator-legacy-completion-owner-proof-test-fixtures.d.ts.map +1 -0
  105. package/dist/coordinator-legacy-completion-owner-proof.d.ts +19 -2
  106. package/dist/coordinator-legacy-completion-owner-proof.d.ts.map +1 -1
  107. package/dist/coordinator-legacy-owner-compatibility.d.ts +23 -0
  108. package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -1
  109. package/dist/coordinator-legacy-owner-resolution-commit-original-sql-test-fixtures.d.ts +63 -0
  110. package/dist/coordinator-legacy-owner-resolution-commit-original-sql-test-fixtures.d.ts.map +1 -0
  111. package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts +3 -1
  112. package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts.map +1 -1
  113. package/dist/coordinator-legacy-owner-resolution-commit.d.ts.map +1 -1
  114. package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
  115. package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts +2 -0
  116. package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts.map +1 -1
  117. package/dist/coordinator-owner-enrollment-start-test-fixtures.d.ts.map +1 -1
  118. package/dist/coordinator-owner-negative-consistency.d.ts +11 -17
  119. package/dist/coordinator-owner-negative-consistency.d.ts.map +1 -1
  120. package/dist/coordinator-owner-negative-original-sql-test-fixtures.d.ts +44 -0
  121. package/dist/coordinator-owner-negative-original-sql-test-fixtures.d.ts.map +1 -0
  122. package/dist/coordinator-owner-negative-race-test-fixtures.d.ts +26 -0
  123. package/dist/coordinator-owner-negative-race-test-fixtures.d.ts.map +1 -0
  124. package/dist/coordinator-owner-negative-read-set.d.ts +43 -0
  125. package/dist/coordinator-owner-negative-read-set.d.ts.map +1 -0
  126. package/dist/coordinator-owner-negative-reads.d.ts +32 -0
  127. package/dist/coordinator-owner-negative-reads.d.ts.map +1 -0
  128. package/dist/coordinator-owner-producer-original-sql-test-fixtures.d.ts +26 -0
  129. package/dist/coordinator-owner-producer-original-sql-test-fixtures.d.ts.map +1 -0
  130. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts +1 -0
  131. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -1
  132. package/dist/coordinator-owner-resolution-review.d.ts +1 -0
  133. package/dist/coordinator-owner-resolution-review.d.ts.map +1 -1
  134. package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts +8 -2
  135. package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts.map +1 -1
  136. package/dist/coordinator-recipient-negative-race-test-fixtures.d.ts +54 -0
  137. package/dist/coordinator-recipient-negative-race-test-fixtures.d.ts.map +1 -0
  138. package/dist/coordinator-recipient-owner-consistency.d.ts +4 -5
  139. package/dist/coordinator-recipient-owner-consistency.d.ts.map +1 -1
  140. package/dist/coordinator-recipient-owner-original-sql-test-fixtures.d.ts +30 -0
  141. package/dist/coordinator-recipient-owner-original-sql-test-fixtures.d.ts.map +1 -0
  142. package/dist/coordinator-resolved-account-owner-status-query.d.ts +4 -1
  143. package/dist/coordinator-resolved-account-owner-status-query.d.ts.map +1 -1
  144. package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts +1 -0
  145. package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts.map +1 -1
  146. package/dist/coordinator-resolved-account-owner-status.d.ts +2 -0
  147. package/dist/coordinator-resolved-account-owner-status.d.ts.map +1 -1
  148. package/dist/{coordinator-runtime-kbPwxxKq.js → coordinator-runtime-BXJQAKFD.js} +3 -3
  149. package/dist/{coordinator-runtime-kbPwxxKq.js.map → coordinator-runtime-BXJQAKFD.js.map} +1 -1
  150. package/dist/coordinator-sql-compare.d.ts +22 -0
  151. package/dist/coordinator-sql-compare.d.ts.map +1 -0
  152. package/dist/d1-coordinator-store.d.ts +16 -1
  153. package/dist/d1-coordinator-store.d.ts.map +1 -1
  154. package/dist/index.d.ts +2 -1
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js +8907 -8434
  157. package/dist/index.js.map +1 -1
  158. package/dist/internal/cloudflare-coordinator.js +1070 -1065
  159. package/dist/internal/cloudflare-coordinator.js.map +1 -1
  160. package/dist/internal/relay-runtime.js +2 -2
  161. package/dist/linked-legacy-setup-test-fixtures.d.ts +2 -0
  162. package/dist/linked-legacy-setup-test-fixtures.d.ts.map +1 -1
  163. package/dist/{owner-enrollment-start-BtoRKf3z.js → owner-enrollment-start-BsDwgxAh.js} +2660 -2438
  164. package/dist/owner-enrollment-start-BsDwgxAh.js.map +1 -0
  165. package/dist/owner-enrollment-start.d.ts.map +1 -1
  166. package/dist/relay-admission-table-keys-test-fixtures.d.ts +2 -1
  167. package/dist/relay-admission-table-keys-test-fixtures.d.ts.map +1 -1
  168. package/dist/{relay-peer-client-0XpekgnZ.js → relay-peer-client-DrTb2oZt.js} +2631 -2617
  169. package/dist/relay-peer-client-DrTb2oZt.js.map +1 -0
  170. package/dist/{sync-auth-constants-DvALG0T0.js → sync-auth-constants-BVzVfSmn.js} +4019 -3416
  171. package/dist/sync-auth-constants-BVzVfSmn.js.map +1 -0
  172. package/dist/{sync-reachability-pass-BpDt2z4y.js → sync-reachability-pass-CUe5bK61.js} +12 -12
  173. package/dist/{sync-reachability-pass-BpDt2z4y.js.map → sync-reachability-pass-CUe5bK61.js.map} +1 -1
  174. package/dist/sync-reachability-pass-D9cA54fj.js +2 -0
  175. package/package.json +3 -3
  176. package/dist/owner-enrollment-start-BtoRKf3z.js.map +0 -1
  177. package/dist/relay-peer-client-0XpekgnZ.js.map +0 -1
  178. package/dist/sync-auth-constants-DvALG0T0.js.map +0 -1
  179. package/dist/sync-reachability-pass-Bi4GBi-x.js +0 -2
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Test-only. This file exists only to pin equivalence with the pre-port SQL.
3
+ *
4
+ * Between the markers are, copied verbatim from main at 075d46647 before ownership
5
+ * evidence moved to read-set guards: the evidence statements of
6
+ * coordinator-device-ownership-evidence-queries.ts, and the collector class of
7
+ * coordinator-device-ownership-evidence.ts. Only the class was renamed; its imports of
8
+ * those statements now resolve to the copies above it. Everything else it imports is
9
+ * unchanged since that commit. Do not edit the copy to follow later changes; delete this
10
+ * file with coordinator-device-ownership-evidence-equivalence.test.ts.
11
+ */
12
+ import { type ControllerHistorySnapshot } from "./coordinator-auth-controller-history.js";
13
+ import type { AuthLinkStatement } from "./coordinator-auth-link.js";
14
+ import { type OwnershipDecision } from "./coordinator-device-ownership-evidence-classify.js";
15
+ import { type ReviewedWeakLabel } from "./coordinator-legacy-owner-resolution-metadata.js";
16
+ export declare const ROW_LIMIT = 500;
17
+ export declare const BYTE_LIMIT = 750000;
18
+ export interface EvidenceQuery {
19
+ name: string;
20
+ sql: string;
21
+ }
22
+ export declare const CONTROLLER_COLUMNS: string[];
23
+ export declare const RESOLUTION_COLUMNS: string[];
24
+ export declare const EVIDENCE_QUERIES: EvidenceQuery[];
25
+ export declare function readEvidenceQuery(query: EvidenceQuery, encoded: string): AuthLinkStatement;
26
+ export interface CapturedEvidenceRow {
27
+ category: string;
28
+ row_count: number;
29
+ row: string | null;
30
+ }
31
+ export declare function readCombinedEvidenceQuery(encoded: string): AuthLinkStatement;
32
+ export declare function atomicEvidenceQuery(encoded: string): AuthLinkStatement;
33
+ interface EvidenceBackend {
34
+ first<T>(statement: AuthLinkStatement): Promise<T | null>;
35
+ all<T>(statement: AuthLinkStatement): Promise<T[]>;
36
+ }
37
+ interface ActualSigner {
38
+ groupId: string;
39
+ deviceId: string;
40
+ publicKey: string;
41
+ fingerprint: string;
42
+ }
43
+ interface CollectionInput {
44
+ canonicalOwnerId: string;
45
+ actualSigner: ActualSigner;
46
+ verifiedHistory: ControllerHistorySnapshot;
47
+ }
48
+ interface RecheckSnapshot {
49
+ readonly version: 1;
50
+ }
51
+ type OwnershipCollection = {
52
+ kind: "collected";
53
+ decision: OwnershipDecision;
54
+ weakLabels: ReviewedWeakLabel[];
55
+ recheckSnapshot: RecheckSnapshot;
56
+ } | {
57
+ kind: "unavailable";
58
+ authorizationUnavailable: true;
59
+ };
60
+ type SourceVerification = {
61
+ kind: "verified_controller_source" | "source_missing" | "source_revoked" | "source_mismatch";
62
+ } | {
63
+ kind: "unavailable";
64
+ authorizationUnavailable: true;
65
+ };
66
+ /** Internal read-only metadata collector. No result of this class grants access. */
67
+ export declare class OriginalDeviceOwnershipEvidence {
68
+ private readonly backend;
69
+ private readonly snapshots;
70
+ private readonly coordinatorId;
71
+ constructor(backend: EvidenceBackend, config: {
72
+ coordinatorId: string;
73
+ });
74
+ collect(input: CollectionInput): Promise<OwnershipCollection>;
75
+ private verifyHistory;
76
+ private captureRows;
77
+ /** A predicate for a future checked batch, never an admission or a write. */
78
+ prepareAtomicRecheck(snapshot: RecheckSnapshot): AuthLinkStatement;
79
+ /** Private confirmation metadata; only this reader's original capture is accepted. */
80
+ reviewedEvidenceDigest(snapshot: unknown): Promise<string | null>;
81
+ verifyControllerSource(input: {
82
+ sourceRef: unknown;
83
+ expectedOwnerId: string;
84
+ actualSigner: ActualSigner;
85
+ }): Promise<SourceVerification>;
86
+ }
87
+ export {};
88
+ //# sourceMappingURL=coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-original-sql-test-fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEN,KAAK,yBAAyB,EAI9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EASN,KAAK,iBAAiB,EACtB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAGN,KAAK,iBAAiB,EAEtB,MAAM,mDAAmD,CAAC;AAE3D,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,UAAU,SAAU,CAAC;AAClC,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAID,eAAO,MAAM,kBAAkB,UAA+B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,UAG7B,CAAC;AAqCH,eAAO,MAAM,gBAAgB,EAAE,aAAa,EA2D3C,CAAC;AAOF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAM1F;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE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BAAa,+BAA+B;IAI1C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8D;IACxF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,YACkB,OAAO,EAAE,eAAe,EACzC,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAGjC;IAEK,OAAO,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoClE;YAEa,aAAa;YA0Bb,WAAW;IA4BzB,6EAA6E;IAC7E,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,iBAAiB,CAIjE;IAED,sFAAsF;IAChF,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGtE;IAEK,sBAAsB,CAAC,KAAK,EAAE;QACnC,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,YAAY,CAAC;KAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2C9B;CACD"}
@@ -1,19 +1,9 @@
1
- import type { AuthLinkStatement } from "./coordinator-auth-link.js";
1
+ /**
2
+ * Limits and column lists of the ownership evidence categories. The reads themselves are
3
+ * in coordinator-owner-negative-reads.ts.
4
+ */
2
5
  export declare const ROW_LIMIT = 500;
3
6
  export declare const BYTE_LIMIT = 750000;
4
- export interface EvidenceQuery {
5
- name: string;
6
- sql: string;
7
- }
8
7
  export declare const CONTROLLER_COLUMNS: string[];
9
8
  export declare const RESOLUTION_COLUMNS: string[];
10
- export declare const EVIDENCE_QUERIES: EvidenceQuery[];
11
- export declare function readEvidenceQuery(query: EvidenceQuery, encoded: string): AuthLinkStatement;
12
- export interface CapturedEvidenceRow {
13
- category: string;
14
- row_count: number;
15
- row: string | null;
16
- }
17
- export declare function readCombinedEvidenceQuery(encoded: string): AuthLinkStatement;
18
- export declare function atomicEvidenceQuery(encoded: string): AuthLinkStatement;
19
9
  //# sourceMappingURL=coordinator-device-ownership-evidence-queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-ownership-evidence-queries.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-queries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,UAAU,SAAU,CAAC;AAClC,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAID,eAAO,MAAM,kBAAkB,UAA+B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,UAG7B,CAAC;AAqCH,eAAO,MAAM,gBAAgB,EAAE,aAAa,EA2D3C,CAAC;AAOF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAM1F;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAID,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CA6B5E;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAiBtE"}
1
+ {"version":3,"file":"coordinator-device-ownership-evidence-queries.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-queries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,UAAU,SAAU,CAAC;AAIlC,eAAO,MAAM,kBAAkB,UAA+B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,UAG7B,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { AuthLinkStatement } from "./coordinator-auth-link.js";
2
2
  import { cfg } from "./coordinator-auth-link-test-fixtures.js";
3
+ import { type AtomicReader } from "./coordinator-auth-read-set.js";
3
4
  import { type Backend, type Fixture } from "./coordinator-auth-store-test-fixtures.js";
4
5
  import { EXPECTED_KEY_ID } from "./coordinator-ed25519-key-id-test-fixtures.js";
5
6
  export { cfg, EXPECTED_KEY_ID };
@@ -16,6 +17,8 @@ export declare function insert(f: Fixture, table: string, row: Row): void;
16
17
  export declare function evidenceBackend(f: Fixture, backend: Backend): {
17
18
  first<T>(statement: AuthLinkStatement): Promise<T | null>;
18
19
  all<T>(statement: AuthLinkStatement): Promise<T[]>;
20
+ /** Both stores' backends read a set of statements together, as one snapshot. */
21
+ readBatch<T>(statements: AuthLinkStatement[]): Promise<T[][]>;
19
22
  };
20
23
  export declare function evidenceTest(backend: Backend): import("vitest").TestAPI<{
21
24
  f: Fixture;
@@ -77,4 +80,11 @@ export declare function sourceRef(row: ReturnType<typeof controller>): {
77
80
  reviewed_weak_labels_json: string;
78
81
  created_at: string;
79
82
  };
83
+ /**
84
+ * Runs a capture's recheck guards together and reports them as the old atomic recheck
85
+ * did: 1 while every read still holds, 0 once one changed or for an unknown capture.
86
+ */
87
+ export declare function recheckMatches(db: AtomicReader, guards: AuthLinkStatement[] | null): Promise<{
88
+ matches: 0 | 1;
89
+ }>;
80
90
  //# sourceMappingURL=coordinator-device-ownership-evidence-test-fixtures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-ownership-evidence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAO,MAAM,0CAA0C,CAAC;AACpE,OAAO,EACN,KAAK,OAAO,EAEZ,KAAK,OAAO,EAIZ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEN,eAAe,EACf,MAAM,+CAA+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AG,UAAU,CAAC;CAC9B,QAyCN;AACD,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO;;;;;;;;;GAS5C;AAID,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;EAuB3D"}
1
+ {"version":3,"file":"coordinator-device-ownership-evidence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAO,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EACN,KAAK,OAAO,EAEZ,KAAK,OAAO,EAIZ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEN,eAAe,EACf,MAAM,+CAA+C,CAAC;AAQvD,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC;AAChC,eAAO,MAAM,SAAS,6BAA6B,CAAC;AACpD,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AACF,eAAO,MAAM,QAAQ,qFAC8D,CAAC;AACpF,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;AACzD,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,QAOzD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;IAGpD,KAAK,CAAC,CAAC,aAAa,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IASzD,GAAG,CAAC,CAAC,aAAa,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAaxD,gFAAgF;IAC1E,SAAS,CAAC,CAAC,cAAc,iBAAiB,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC;EAapE;AACD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO;;GAc5C;AACD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,4BAK1C;AACD,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,GAAQ;;;;;;;;;;;;;;EAmBrD;AACD,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,GAAQ,QAYlD;AACD,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,GAAQ,QAgBhD;AACD,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,GAAQ,QAoBrD;AACD,wBAAgB,OAAO,CACtB,CAAC,EAAE,OAAO,EACV,KAAK,GAAE;IACN,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAC9B,QAyCN;AACD,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO;;;;;;;;;GAS5C;AAID,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;EAuB3D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,GAChC,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAE7B"}
@@ -5,6 +5,11 @@ import { type ReviewedWeakLabel } from "./coordinator-legacy-owner-resolution-me
5
5
  interface EvidenceBackend {
6
6
  first<T>(statement: AuthLinkStatement): Promise<T | null>;
7
7
  all<T>(statement: AuthLinkStatement): Promise<T[]>;
8
+ /**
9
+ * Runs reads together, so a capture and each recheck are one snapshot. Required: a
10
+ * one-at-a-time fallback would check the guards at different moments.
11
+ */
12
+ readBatch<T>(statements: AuthLinkStatement[]): Promise<T[][]>;
8
13
  }
9
14
  interface ActualSigner {
10
15
  groupId: string;
@@ -45,9 +50,12 @@ export declare class CoordinatorDeviceOwnershipEvidence {
45
50
  });
46
51
  collect(input: CollectionInput): Promise<OwnershipCollection>;
47
52
  private verifyHistory;
48
- private captureRows;
49
- /** A predicate for a future checked batch, never an admission or a write. */
50
- prepareAtomicRecheck(snapshot: RecheckSnapshot): AuthLinkStatement;
53
+ /**
54
+ * Guards that re-run every read of this capture, for a later checked batch: each aborts
55
+ * it once its read changed. Never an admission or a write. Null for a snapshot this
56
+ * reader did not capture, which therefore never matches.
57
+ */
58
+ recheckGuards(snapshot: RecheckSnapshot): AuthLinkStatement[] | null;
51
59
  /** Private confirmation metadata; only this reader's original capture is accepted. */
52
60
  reviewedEvidenceDigest(snapshot: unknown): Promise<string | null>;
53
61
  verifyControllerSource(input: {
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-ownership-evidence.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,yBAAyB,EAI9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EASN,KAAK,iBAAiB,EACtB,MAAM,qDAAqD,CAAC;AAW7D,OAAO,EAGN,KAAK,iBAAiB,EAEtB,MAAM,mDAAmD,CAAC;AAE3D,UAAU,eAAe;IACxB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACnD;AACD,UAAU,YAAY;IACrB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O,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGtE;IAEK,sBAAsB,CAAC,KAAK,EAAE;QACnC,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,YAAY,CAAC;KAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2C9B;CACD"}
1
+ {"version":3,"file":"coordinator-device-ownership-evidence.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,yBAAyB,EAG9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAQN,KAAK,iBAAiB,EACtB,MAAM,qDAAqD,CAAC;AAG7D,OAAO,EAGN,KAAK,iBAAiB,EAEtB,MAAM,mDAAmD,CAAC;AAG3D,UAAU,eAAe;IACxB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;CAC9D;AACD,UAAU,YAAY;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AACD,UAAU,eAAe;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,yBAAyB,CAAC;CAC3C;AACD,UAAU,eAAe;IACxB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACpB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viceRebindBrowser(input: DeviceRebindBrowserInput): Promise<{
15
- handlers?: undefined;
16
15
  ok: false;
16
+ handlers?: undefined;
17
17
  } | {
18
18
  ok: true;
19
19
  handlers: Readonly<{
@@ -99,7 +99,8 @@ export interface DeviceRebindDependencies extends DeviceRebindDeviceDependencies
99
99
  /**
100
100
  * The browser and device ceremony for ADR 0005 Section 8 rebinding. Every
101
101
  * step re-checks live authority in its winning statement; pre-reads only pick
102
- * the refusal reason shown to the person.
102
+ * the refusal reason shown to the person. The pinned self-bind authority is
103
+ * read and decided before the write, and guards in the same batch re-run its reads.
103
104
  */
104
105
  export declare function createDeviceRebindCeremony(deps: DeviceRebindDependencies): Readonly<{
105
106
  claimBrowser: (request: Request, clientKey: string) => Promise<DeviceRebindResult | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-rebind-ceremony.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-ceremony.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAOvG,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAgBrF,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAGN,KAAK,mBAAmB,EAGxB,MAAM,uCAAuC,CAAC;AAW/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,wFAAwF;IACxF,iBAAi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C,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAyBrC;AAED,UAAU,uBAAuB;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,uBAAuB,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CA4BnC"}
1
+ {"version":3,"file":"coordinator-device-rebind-commit.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-commit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAmBrF,0FAA0F;AAC1F,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAG3C,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAuFvB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,03BAWF,CAAC;AAuP5B;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAyBrC;AAED,UAAU,uBAAuB;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,uBAAuB,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAkCnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-rebind-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,2CAA2C,CAAC;AAC/F,OAAO,EACN,KAAK,mBAAmB,EAGxB,MAAM,sCAAsC,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,eAAO,MAAM,GAAG,gBAAoB,CAAC;AACrC,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAC3C,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,eAAO,MAAM,QAAQ,QAAiB,CAAC;AACvC,eAAO,MAAM,MAAM,YAAI,SAAS,EAAE,SAAS,CAAU,CAAC;AAEtD,qEA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;QACzB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,gBAAgB,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,IAAI,OAAO,EAAE,EAAE,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAyFD,+EAA+E;AAC/E,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAmCzE;AAED,qGAAqG;AACrG,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACjB,GACC,OAAO,CAAC,IAAI,CAAC,CAkBf"}
@@ -6,10 +6,19 @@ export interface DeviceSelfBindInput {
6
6
  attemptId?: string;
7
7
  }
8
8
  export declare function hasDeviceRebindStartAuthorityColumn(backend: AuthLinkBackend): Promise<boolean>;
9
- /** Server proof only. Embed this SELECT in the winning statement, never authorize from a pre-read.
9
+ export interface DeviceSelfBindAuthority {
10
+ /** Stored as `start_authority_json` at start; every later step requires the same text. */
11
+ snapshot: string;
12
+ /** These go first in the batch that writes. They re-run every read behind the pin. */
13
+ guards: AuthLinkStatement[];
14
+ }
15
+ /**
16
+ * Server proof only. Reads the facts, decides in TypeScript, and returns the pin with
17
+ * the guards that re-run every read. The decision is void unless those guards run in
18
+ * the batch that writes; never authorize from the pin alone.
10
19
  * The account link may originate on a peer. Its immutable genesis still has to verify.
11
20
  */
12
- export declare function prepareDeviceSelfBindAuthority(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<AuthLinkStatement | null>;
21
+ export declare function prepareDeviceSelfBindAuthority(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<DeviceSelfBindAuthority | null>;
13
22
  /** Readiness is deliberately fail closed on D1 before migration 0044. */
14
23
  export declare function readDeviceSelfBindEligibility(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<{
15
24
  kind: "eligible";
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-self-bind-authority.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-authority.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EACX,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,qCAAqC,CAAC;AAK7C,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,yBAAyB,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,mCAAmC,CACxD,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAiDD;;GAEG;AACH,wBAAsB,8BAA8B,CACnD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA4CnC;AAED,yEAAyE;AACzE,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,CAU7E"}
1
+ {"version":3,"file":"coordinator-device-self-bind-authority.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-authority.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EACX,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,qCAAqC,CAAC;AAa7C,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,yBAAyB,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,mCAAmC,CACxD,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAsKD,MAAM,WAAW,uBAAuB;IACvC,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAwDD;;;;;GAKG;AACH,wBAAsB,8BAA8B,CACnD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CA2BzC;AAED,yEAAyE;AACzE,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,CAS7E"}
@@ -0,0 +1,84 @@
1
+ import { type SqlValue } from "./coordinator-sql-compare.js";
2
+ /** Trusted server values: the signed enrollment, the configuration, and derived key facts. */
3
+ export interface SelfBindSubject {
4
+ coordinatorId: string;
5
+ identityId: string;
6
+ groupId: string;
7
+ deviceId: string;
8
+ publicKey: string;
9
+ fingerprint: string;
10
+ keyId: string;
11
+ issuer: string;
12
+ nowMs: number;
13
+ attemptId: string | null;
14
+ /** Every stored text form of this device's key. */
15
+ aliases: string[];
16
+ }
17
+ export interface SelfBindEnrollment {
18
+ group_id: string;
19
+ device_id: string;
20
+ public_key: SqlValue;
21
+ fingerprint: SqlValue;
22
+ identity_id: SqlValue;
23
+ enabled: SqlValue;
24
+ created_at: SqlValue;
25
+ /** For an enrollment in the signed group: 1 when that group exists and is not archived. */
26
+ group_live: SqlValue;
27
+ }
28
+ export interface SelfBindAttestation {
29
+ coordinator_id: string;
30
+ attestation_id: string;
31
+ identity_id: SqlValue;
32
+ group_id: SqlValue;
33
+ device_id: SqlValue;
34
+ public_key: SqlValue;
35
+ fingerprint: SqlValue;
36
+ review_receipt_id: SqlValue;
37
+ evidence_digest: SqlValue;
38
+ enrollment_identity_id: SqlValue;
39
+ revision: SqlValue;
40
+ created_at: SqlValue;
41
+ revoked_at: SqlValue;
42
+ }
43
+ export interface SelfBindLink {
44
+ /** The pinned link columns, in pin order. */
45
+ link: SqlValue[];
46
+ issuer: SqlValue;
47
+ /** SQL verdict: the link's immutable creation records verify. */
48
+ proven: SqlValue;
49
+ /** SQL verdict: a controller-reviewed link has its complete browser creation receipt. */
50
+ controller_receipt: SqlValue;
51
+ /** SQL verdict: the link came from a device without a browser. */
52
+ headless: SqlValue;
53
+ /** The pinned columns of the link's controller review and device claim, if any. */
54
+ linkController: SqlValue[][];
55
+ linkClaim: SqlValue[][];
56
+ }
57
+ /** Everything the decision looks at. A list named `...Conflicts` must be empty. */
58
+ export type SelfBindFacts = {
59
+ /** Enrollments of this device or of any text form of its key. */
60
+ enrollments: SelfBindEnrollment[];
61
+ /** Controller reviews of this device or of any text form of its key. */
62
+ attestations: SelfBindAttestation[];
63
+ /** Active account links of the current Identity. */
64
+ links: SelfBindLink[];
65
+ /** Consumed invites that assigned this device, key or fingerprint to another Identity. */
66
+ inviteConflicts: unknown[];
67
+ bindingConflicts: unknown[];
68
+ claimConflicts: unknown[];
69
+ revocationConflicts: unknown[];
70
+ otherIdentityLinkAttemptConflicts: unknown[];
71
+ otherIdentityLinkAuditConflicts: unknown[];
72
+ ownerAttemptConflicts: unknown[];
73
+ linkAttemptConflicts: unknown[];
74
+ rebindAttemptConflicts: unknown[];
75
+ legacyDecisionConflicts: unknown[];
76
+ };
77
+ /**
78
+ * Pure decision over the facts read. Returns the pin that the start stores as
79
+ * `start_authority_json` and every later step requires again, or null when this device
80
+ * may not connect this way. The pin is byte-compatible with the SQL `json_object` that
81
+ * produced it before, so attempts started by an earlier release still match.
82
+ */
83
+ export declare function decideDeviceSelfBind(p: SelfBindSubject, facts: SelfBindFacts): string | null;
84
+ //# sourceMappingURL=coordinator-device-self-bind-decision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-self-bind-decision.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAuB,MAAM,8BAA8B,CAAC;AAElF,8FAA8F;AAC9F,MAAM,WAAW,eAAe;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mDAAmD;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,QAAQ,CAAC;IACrB,WAAW,EAAE,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EAAE,OAAO,EAAE,CAAC;IAC5B,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,mBAAmB,EAAE,OAAO,EAAE,CAAC;IAC/B,iCAAiC,EAAE,OAAO,EAAE,CAAC;IAC7C,+BAA+B,EAAE,OAAO,EAAE,CAAC;IAC3C,qBAAqB,EAAE,OAAO,EAAE,CAAC;IACjC,oBAAoB,EAAE,OAAO,EAAE,CAAC;IAChC,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,uBAAuB,EAAE,OAAO,EAAE,CAAC;CACnC,CAAC;AAkHF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAO5F"}
@@ -0,0 +1,17 @@
1
+ import type { AuthLinkBackend, AuthLinkStatement } from "./coordinator-auth-link.js";
2
+ import type { CoordinatorAuthLinkConfig } from "./coordinator-auth-link-contract.js";
3
+ import { type DeviceSelfBindInput } from "./coordinator-device-self-bind-authority.js";
4
+ /** Server proof only. Embed this SELECT in the winning statement, never authorize from a pre-read.
5
+ * The account link may originate on a peer. Its immutable genesis still has to verify.
6
+ */
7
+ export declare function prepareOriginalSelfBindAuthority(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<AuthLinkStatement | null>;
8
+ export declare const ORIGINAL_CHECK_COUNT: number;
9
+ /** What the original statement answered: its pin, or null when it selected no row. */
10
+ export declare function originalSelfBindSnapshot(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<string | null>;
11
+ /**
12
+ * The original statement's individual checks, by index into CHECKS, that did not hold.
13
+ * Null when the statement was never built. It reuses the original WITH clause and
14
+ * replaces only the final SELECT, which has no bound values.
15
+ */
16
+ export declare function originalFailedChecks(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<number[] | null>;
17
+ //# sourceMappingURL=coordinator-device-self-bind-original-sql-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-self-bind-original-sql-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-original-sql-test-fixtures.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,6CAA6C,CAAC;AAqDrD;;GAEG;AACH,wBAAsB,gCAAgC,CACrD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA4CnC;AAGD,eAAO,MAAM,oBAAoB,QAAgB,CAAC;AAElD,sFAAsF;AACtF,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAU1B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * An explicit historical-label resolution removes only the exact included label from
3
+ * the negative history check. It grants no binding authority: the caller still requires
4
+ * matching device reviews, account provenance, fresh browser consent and key proof.
5
+ * The existing negative-owner read set validates resolution metadata and pins its rows.
6
+ * This verdict additionally requires this receipt's entire original source to remain live.
7
+ * Outer aliases c and d are a completion and one device decision from that completion.
8
+ */
9
+ export declare const SELF_BIND_REVIEWED_LABEL_SQL = "EXISTS (\n SELECT 1 FROM coordinator_legacy_owner_resolutions r\n JOIN coordinator_auth_controller_attestations t\n ON t.coordinator_id=r.coordinator_id AND t.attestation_id=r.source_attestation_id\n AND t.identity_id=r.owner_identity_id AND t.group_id=r.source_group_id\n AND t.device_id=r.device_id AND t.public_key=r.source_public_key\n AND t.fingerprint=r.source_fingerprint AND t.review_receipt_id=r.source_review_receipt_id\n AND t.evidence_digest=r.source_evidence_digest\n AND t.enrollment_identity_id IS r.source_enrollment_identity_id\n AND t.revision=r.source_controller_revision AND t.created_at=r.source_created_at\n AND t.revoked_at IS NULL,\n json_each(CASE WHEN json_valid(r.reviewed_weak_labels_json) THEN r.reviewed_weak_labels_json ELSE '[]' END) w\n WHERE r.coordinator_id=? AND r.device_id=? AND r.key_id=? AND r.owner_identity_id=?\n AND r.source_public_key=? AND r.source_fingerprint=?\n AND r.resolution_version=1 AND r.purpose='existing_account_owner'\n AND r.scope='historical_included_owner_labels_only'\n AND json_extract(d.value,'$.decision')='included'\n AND json_extract(d.value,'$.enabled')=1\n AND json_type(d.value,'$.identity_evidence') IS NULL\n AND json_extract(d.value,'$.device_id')=? AND json_extract(d.value,'$.key_fingerprint')=?\n AND json_extract(w.value,'$.kind')='legacy_included_owner_label'\n AND json_extract(w.value,'$.effect')='account_owner_display_only'\n AND json_extract(w.value,'$.group_id')=c.group_id\n AND json_extract(w.value,'$.device_id')=json_extract(d.value,'$.device_id')\n AND json_extract(w.value,'$.label')=json_extract(d.value,'$.identity_id')\n AND json_extract(w.value,'$.evidence_ref')=json_extract(c.manifest_json,'$.source_digest')\n)";
10
+ //# sourceMappingURL=coordinator-device-self-bind-reviewed-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-device-self-bind-reviewed-history.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-reviewed-history.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,irDA0BvC,CAAC"}
@@ -2,12 +2,16 @@ import Database from "better-sqlite3";
2
2
  import type { AuthLinkBackend } from "./coordinator-auth-link.js";
3
3
  import { type Backend } from "./coordinator-auth-store-test-fixtures.js";
4
4
  import { type DeviceRebindAttempt } from "./coordinator-device-rebind-proof.js";
5
+ import { type ReviewedWeakLabel } from "./coordinator-legacy-owner-resolution-metadata.js";
5
6
  export declare const SELF_BIND_NOW = 1791028800000;
6
7
  /** Original pre-upgrade account genesis, with an independent own controller review.
7
8
  * Peer-origin links intentionally have no relationship to that own review.
8
9
  */
9
10
  export type SelfBindLinkOrigin = "own" | "peer" | "peer_controller";
10
- export declare function selfBindFixture(kind: Backend, origin?: SelfBindLinkOrigin, identityId?: string): Promise<{
11
+ export interface SelfBindFixtureOptions {
12
+ accountSchema?: "current" | "v2";
13
+ }
14
+ export declare function selfBindFixture(kind: Backend, origin?: SelfBindLinkOrigin, identityId?: string, options?: SelfBindFixtureOptions): Promise<{
11
15
  store: import("./coordinator-auth-store-test-fixtures.js").Store;
12
16
  db: Database.Database;
13
17
  own: {
@@ -100,4 +104,14 @@ export declare function selfBindFixture(kind: Backend, origin?: SelfBindLinkOrig
100
104
  };
101
105
  close: () => Promise<void>;
102
106
  }>;
107
+ /** Stores a canonical legacy completion of group-a that assigns device-a to its Identity. */
108
+ export declare function assignLegacyCompletion(f: Awaited<ReturnType<typeof selfBindFixture>>): void;
109
+ /**
110
+ * Stores a retained legacy owner resolution for device-a whose original source is the
111
+ * device's own controller review. The self-bind authority then takes the path that
112
+ * reads and classifies ownership evidence, which needs a backend that can read rows.
113
+ */
114
+ export declare function retainOwnReviewOwnership(f: Awaited<ReturnType<typeof selfBindFixture>>, options?: {
115
+ reviewedWeakLabels?: ReviewedWeakLabel[];
116
+ }): Promise<void>;
103
117
  //# sourceMappingURL=coordinator-device-self-bind-test-fixtures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-device-self-bind-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAGtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACN,KAAK,OAAO,EAIZ,MAAM,2CAA2C,CAAC;AAInD,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,sCAAsC,CAAC;AAM9C,eAAO,MAAM,aAAa,gBAAoB,CAAC;AAU/C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,CAAC;AA+HpE,wBAAsB,eAAe,CACpC,IAAI,EAAE,OAAO,EACb,MAAM,GAAE,kBAA0B,EAClC,UAAU,SAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAQE,eAAe;;;;;;;;;;;;;;;;0BA8BjB,mBAAmB,UAAU,MAAM;;;;;;;;;;;;GAmBhE"}
1
+ {"version":3,"file":"coordinator-device-self-bind-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAQtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACN,KAAK,OAAO,EAKZ,MAAM,2CAA2C,CAAC;AAInD,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,mDAAmD,CAAC;AAW3D,eAAO,MAAM,aAAa,gBAAoB,CAAC;AAU/C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAkJpE,MAAM,WAAW,sBAAsB;IACtC,aAAa,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACjC;AAED,wBAAsB,eAAe,CACpC,IAAI,EAAE,OAAO,EACb,MAAM,GAAE,kBAA0B,EAClC,UAAU,SAAmB,EAC7B,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAQL,eAAe;;;;;;;;;;;;;;;;0BA8BjB,mBAAmB,UAAU,MAAM;;;;;;;;;;;;GAmBhE;AAuDD,6FAA6F;AAC7F,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,GAAG,IAAI,CAsC3F;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC7C,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,EAC9C,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAA;CAAO,GACxD,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -11,11 +11,15 @@ export declare function captureHistorySql(backend: Backend, input: {
11
11
  }): Promise<{
12
12
  statement: AuthLinkStatement;
13
13
  observedRows: unknown[];
14
+ /**
15
+ * 1 while every guard of the winning batch holds. With `reference`, the history
16
+ * guard uses the frozen selector instead of the live one.
17
+ */
14
18
  current(options?: {
15
19
  reference?: boolean;
16
20
  }): Promise<{
17
21
  current: number;
18
- } | null>;
22
+ }>;
19
23
  }>;
20
24
  export declare function historyCases(statement: AuthLinkStatement): {
21
25
  name: string;
@@ -23,10 +27,10 @@ export declare function historyCases(statement: AuthLinkStatement): {
23
27
  selected: boolean;
24
28
  }[];
25
29
  export declare function compareHistorySql(backend: Backend, statement: AuthLinkStatement): Promise<{
26
- error?: undefined;
27
30
  rows: {
28
31
  row: string;
29
32
  }[];
33
+ error?: undefined;
30
34
  } | {
31
35
  rows?: undefined;
32
36
  error: string;
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-history-sql-equivalence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-history-sql-equivalence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAOpE,KAAK,OAAO,GAAG;IACd,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACnD,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CAC1D,CAAC;AAoBF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsBvD;AAED,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;;;sBAyB7C;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;iBAGb,MAAM;;GAMxC;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB;UAYpC,MAAM;SAAO,MAAM;cAAY,OAAO;IA0B1D;AAuDD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB;;;aAG3C,MAAM;;;;;GAShD"}
1
+ {"version":3,"file":"coordinator-history-sql-equivalence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-history-sql-equivalence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAOpE,KAAK,OAAO,GAAG;IACd,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACnD,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CAC1D,CAAC;AAoBF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsBvD;AAED,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;;;IA0BpE;;;OAGG;sBACoB;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;;;GAc/C;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB;UAYpC,MAAM;SAAO,MAAM;cAAY,OAAO;IA0B1D;AAuDD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB;;aAG3C,MAAM;;;;;;GAShD"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Test-only. This file exists only to pin equivalence with the pre-port SQL.
3
+ *
4
+ * Between the markers are, copied verbatim from main at 075d46647 before legacy team
5
+ * completions moved to guarded capture reads: the whole of
6
+ * coordinator-legacy-completion-owner-proof.ts below its imports, and the winning INSERT
7
+ * of BetterSqliteCoordinatorStore.createLegacyTeamCompletion. Only the INSERT was wrapped
8
+ * in a function that binds what the store bound, in the same order; the D1 store sent
9
+ * the same statement with other whitespace. Do not edit the copy to follow later
10
+ * changes; delete this file with
11
+ * coordinator-legacy-completion-owner-proof-equivalence.test.ts.
12
+ */
13
+ import { type ControllerHistoryRecord, type ControllerHistorySnapshot } from "./coordinator-auth-controller-history.js";
14
+ import type { AuthLinkStatement } from "./coordinator-auth-link.js";
15
+ import { type EvidenceRow, type EvidenceRows, type EvidenceSubject } from "./coordinator-device-ownership-evidence-classify.js";
16
+ interface Backend {
17
+ first<T>(statement: AuthLinkStatement): Promise<T | null>;
18
+ all<T>(statement: AuthLinkStatement): Promise<T[]>;
19
+ }
20
+ /** Internal capability, meaningful only to this module's WeakMap. */
21
+ export interface LegacyCompletionOwnerProof {
22
+ readonly version: 1;
23
+ }
24
+ interface Subject extends EvidenceSubject {
25
+ owner: string;
26
+ fragments: string[];
27
+ fingerprints: string[];
28
+ }
29
+ interface ProofSql {
30
+ /** Append after LEGACY_OWNER_INPUT_SQL, which already starts WITH. */
31
+ readonly ctes: string;
32
+ readonly currentSql: string;
33
+ readonly compatibleSql: string;
34
+ /** Bind after the three LEGACY_OWNER_INPUT_SQL values. */
35
+ readonly values: readonly string[];
36
+ }
37
+ /** Internal capture preparation; not exported from the package entrypoint. */
38
+ export declare function prepareCompletionHistory(rows: EvidenceRow[], decode?: (text: string) => unknown): {
39
+ row: EvidenceRow;
40
+ record: ControllerHistoryRecord;
41
+ decode: () => unknown;
42
+ }[];
43
+ /** Internal subject view; canonical validation remains subject-specific. */
44
+ export declare function subjectHistory(rows: EvidenceRows, subject: Subject, keys: Map<string, string>, prepared: ReturnType<typeof prepareCompletionHistory>): ControllerHistorySnapshot;
45
+ /** Read-only capture. No submitted approved-subject list or source reference is accepted.
46
+ * Call only after the stores validate the canonical manifest and its source binding.
47
+ */
48
+ export declare function captureLegacyCompletionOwnerProof(input: {
49
+ backend: Backend;
50
+ groupId: string;
51
+ manifestJson: string;
52
+ keyMetadata: string;
53
+ }): Promise<LegacyCompletionOwnerProof>;
54
+ /** The winning INSERT must use both predicates. A token by itself grants nothing.
55
+ * Keep LEGACY_OWNER_SOURCE_CURRENT_SQL and all ordinary completion checks as well.
56
+ */
57
+ export declare function legacyCompletionOwnerProofSql(proof: LegacyCompletionOwnerProof): ProofSql;
58
+ /** The pre-port INSERT, bound as the store bound it. */
59
+ export declare function originalLegacyCompletionInsertStatement(input: {
60
+ proof: {
61
+ ctes: string;
62
+ currentSql: string;
63
+ compatibleSql: string;
64
+ values: readonly string[];
65
+ };
66
+ groupId: string;
67
+ manifest: {
68
+ candidate_ref: string;
69
+ version: number;
70
+ completed_at: string;
71
+ };
72
+ manifestJson: string;
73
+ coordinatorId: string | null;
74
+ createdAt: string;
75
+ }): AuthLinkStatement;
76
+ export {};
77
+ //# sourceMappingURL=coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAG9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EAGpB,MAAM,qDAAqD,CAAC;AAsB7D,UAAU,OAAO;IAChB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACnD;AAED,qEAAqE;AACrE,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACpB;AAED,UAAU,OAAQ,SAAQ,eAAe;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACvB;AAcD,UAAU,QAAQ;IACjB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAoVD,8EAA8E;AAC9E,wBAAgB,wBAAwB,CACvC,IAAI,EAAE,WAAW,EAAE,EACnB,M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