@codemem/core 0.47.0-beta.3 → 0.47.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 (178) hide show
  1. package/dist/account-owner-association-directory.d.ts +6 -0
  2. package/dist/account-owner-association-directory.d.ts.map +1 -0
  3. package/dist/account-owner-association.d.ts +45 -0
  4. package/dist/account-owner-association.d.ts.map +1 -0
  5. package/dist/better-sqlite-coordinator-store.d.ts +23 -1
  6. package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
  7. package/dist/coordinator-account-connection-schema.d.ts +3 -0
  8. package/dist/coordinator-account-connection-schema.d.ts.map +1 -1
  9. package/dist/coordinator-account-owner-target.d.ts +40 -0
  10. package/dist/coordinator-account-owner-target.d.ts.map +1 -0
  11. package/dist/coordinator-actions.d.ts +5 -0
  12. package/dist/coordinator-actions.d.ts.map +1 -1
  13. package/dist/coordinator-api.d.ts +2 -0
  14. package/dist/coordinator-api.d.ts.map +1 -1
  15. package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts +51 -0
  16. package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts.map +1 -0
  17. package/dist/coordinator-auth-controller-history.d.ts +71 -0
  18. package/dist/coordinator-auth-controller-history.d.ts.map +1 -0
  19. package/dist/coordinator-auth-controller-owner-review.d.ts +32 -0
  20. package/dist/coordinator-auth-controller-owner-review.d.ts.map +1 -0
  21. package/dist/coordinator-auth-controller-owner.d.ts +20 -0
  22. package/dist/coordinator-auth-controller-owner.d.ts.map +1 -0
  23. package/dist/coordinator-auth-controller-review-route.d.ts +16 -2
  24. package/dist/coordinator-auth-controller-review-route.d.ts.map +1 -1
  25. package/dist/coordinator-auth-controller.d.ts +30 -3
  26. package/dist/coordinator-auth-controller.d.ts.map +1 -1
  27. package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
  28. package/dist/coordinator-auth-link.d.ts +1 -0
  29. package/dist/coordinator-auth-link.d.ts.map +1 -1
  30. package/dist/coordinator-auth-schema.d.ts.map +1 -1
  31. package/dist/coordinator-auth-store-test-fixtures.d.ts.map +1 -1
  32. package/dist/coordinator-device-auth-link.d.ts +2 -1
  33. package/dist/coordinator-device-auth-link.d.ts.map +1 -1
  34. package/dist/coordinator-device-ownership-evidence-classify.d.ts +22 -0
  35. package/dist/coordinator-device-ownership-evidence-classify.d.ts.map +1 -0
  36. package/dist/coordinator-device-ownership-evidence-digest.d.ts +8 -0
  37. package/dist/coordinator-device-ownership-evidence-digest.d.ts.map +1 -0
  38. package/dist/coordinator-device-ownership-evidence-queries.d.ts +13 -0
  39. package/dist/coordinator-device-ownership-evidence-queries.d.ts.map +1 -0
  40. package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts +80 -0
  41. package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts.map +1 -0
  42. package/dist/coordinator-device-ownership-evidence.d.ts +60 -0
  43. package/dist/coordinator-device-ownership-evidence.d.ts.map +1 -0
  44. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +35 -0
  45. package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -0
  46. package/dist/coordinator-legacy-completion-owner-proof.d.ts +47 -0
  47. package/dist/coordinator-legacy-completion-owner-proof.d.ts.map +1 -0
  48. package/dist/coordinator-legacy-owner-compatibility.d.ts +31 -0
  49. package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -0
  50. package/dist/coordinator-legacy-owner-resolution-birth-test-fixtures.d.ts +3 -0
  51. package/dist/coordinator-legacy-owner-resolution-birth-test-fixtures.d.ts.map +1 -0
  52. package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts +54 -0
  53. package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts.map +1 -0
  54. package/dist/coordinator-legacy-owner-resolution-commit.d.ts +34 -0
  55. package/dist/coordinator-legacy-owner-resolution-commit.d.ts.map +1 -0
  56. package/dist/coordinator-legacy-owner-resolution-metadata.d.ts +40 -0
  57. package/dist/coordinator-legacy-owner-resolution-metadata.d.ts.map +1 -0
  58. package/dist/coordinator-legacy-owner-resolution-schema.d.ts +70 -0
  59. package/dist/coordinator-legacy-owner-resolution-schema.d.ts.map +1 -0
  60. package/dist/coordinator-legacy-owner-resolution-upgrade.d.ts +4 -0
  61. package/dist/coordinator-legacy-owner-resolution-upgrade.d.ts.map +1 -0
  62. package/dist/coordinator-owner-enrollment-commit.d.ts +7 -6
  63. package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
  64. package/dist/coordinator-owner-negative-consistency.d.ts +38 -0
  65. package/dist/coordinator-owner-negative-consistency.d.ts.map +1 -0
  66. package/dist/coordinator-owner-resolution-review-client.d.ts +17 -0
  67. package/dist/coordinator-owner-resolution-review-client.d.ts.map +1 -0
  68. package/dist/coordinator-owner-resolution-review-read.d.ts +48 -0
  69. package/dist/coordinator-owner-resolution-review-read.d.ts.map +1 -0
  70. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts +60 -0
  71. package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -0
  72. package/dist/coordinator-owner-resolution-review.d.ts +73 -0
  73. package/dist/coordinator-owner-resolution-review.d.ts.map +1 -0
  74. package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts +26 -0
  75. package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts.map +1 -0
  76. package/dist/coordinator-recipient-owner-consistency.d.ts +8 -0
  77. package/dist/coordinator-recipient-owner-consistency.d.ts.map +1 -0
  78. package/dist/coordinator-resolved-account-owner-status-client.d.ts +27 -0
  79. package/dist/coordinator-resolved-account-owner-status-client.d.ts.map +1 -0
  80. package/dist/coordinator-resolved-account-owner-status-query.d.ts +21 -0
  81. package/dist/coordinator-resolved-account-owner-status-query.d.ts.map +1 -0
  82. package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts +79 -0
  83. package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts.map +1 -0
  84. package/dist/coordinator-resolved-account-owner-status.d.ts +57 -0
  85. package/dist/coordinator-resolved-account-owner-status.d.ts.map +1 -0
  86. package/dist/coordinator-store-contract.d.ts +2 -0
  87. package/dist/coordinator-store-contract.d.ts.map +1 -1
  88. package/dist/coordinator-store-test-harness.d.ts.map +1 -1
  89. package/dist/d1-coordinator-runtime.d.ts +1 -0
  90. package/dist/d1-coordinator-runtime.d.ts.map +1 -1
  91. package/dist/d1-coordinator-store.d.ts +18 -1
  92. package/dist/d1-coordinator-store.d.ts.map +1 -1
  93. package/dist/db.d.ts.map +1 -1
  94. package/dist/index.d.ts +13 -3
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +13205 -18552
  97. package/dist/index.js.map +1 -1
  98. package/dist/internal/cloudflare-coordinator.js +1473 -1300
  99. package/dist/internal/cloudflare-coordinator.js.map +1 -1
  100. package/dist/memory-retirement-delivery.d.ts.map +1 -1
  101. package/dist/operational-status.d.ts.map +1 -1
  102. package/dist/owner-enrollment-start-BMkDi_Yz.js +7401 -0
  103. package/dist/owner-enrollment-start-BMkDi_Yz.js.map +1 -0
  104. package/dist/pack.d.ts +4 -4
  105. package/dist/pack.d.ts.map +1 -1
  106. package/dist/recipient-policy-contract-Ca40IBUh.js +24 -0
  107. package/dist/recipient-policy-contract-Ca40IBUh.js.map +1 -0
  108. package/dist/recipient-policy-contract.js +2 -24
  109. package/dist/same-actor-peers.d.ts +4 -0
  110. package/dist/same-actor-peers.d.ts.map +1 -0
  111. package/dist/schema-bootstrap.d.ts.map +1 -1
  112. package/dist/search.d.ts +2 -0
  113. package/dist/search.d.ts.map +1 -1
  114. package/dist/semantic/semantic-executor-seam.d.ts +30 -0
  115. package/dist/semantic/semantic-executor-seam.d.ts.map +1 -0
  116. package/dist/semantic/semantic-ranking-reference.test-helper.d.ts +34 -0
  117. package/dist/semantic/semantic-ranking-reference.test-helper.d.ts.map +1 -0
  118. package/dist/semantic/semantic-ranking.d.ts +50 -0
  119. package/dist/semantic/semantic-ranking.d.ts.map +1 -0
  120. package/dist/semantic/semantic-ranking.test-helper.d.ts +17 -0
  121. package/dist/semantic/semantic-ranking.test-helper.d.ts.map +1 -0
  122. package/dist/semantic/semantic-worker-entry.d.ts +2 -0
  123. package/dist/semantic/semantic-worker-entry.d.ts.map +1 -0
  124. package/dist/semantic/semantic-worker-executor.d.ts +20 -0
  125. package/dist/semantic/semantic-worker-executor.d.ts.map +1 -0
  126. package/dist/semantic/semantic-worker-job.d.ts +2 -0
  127. package/dist/semantic/semantic-worker-job.d.ts.map +1 -0
  128. package/dist/semantic/semantic-worker-protocol.d.ts +48 -0
  129. package/dist/semantic/semantic-worker-protocol.d.ts.map +1 -0
  130. package/dist/semantic/semantic-worker-queue.d.ts +32 -0
  131. package/dist/semantic/semantic-worker-queue.d.ts.map +1 -0
  132. package/dist/semantic/semantic-worker-ranking.d.ts +8 -0
  133. package/dist/semantic/semantic-worker-ranking.d.ts.map +1 -0
  134. package/dist/semantic/semantic-worker-test-fixtures.d.ts +55 -0
  135. package/dist/semantic/semantic-worker-test-fixtures.d.ts.map +1 -0
  136. package/dist/semantic/validated-vector-index-audit.d.ts +10 -0
  137. package/dist/semantic/validated-vector-index-audit.d.ts.map +1 -0
  138. package/dist/semantic/validated-vector-index-mutations.d.ts +23 -0
  139. package/dist/semantic/validated-vector-index-mutations.d.ts.map +1 -0
  140. package/dist/semantic/validated-vector-index-state.d.ts +77 -0
  141. package/dist/semantic/validated-vector-index-state.d.ts.map +1 -0
  142. package/dist/semantic/validated-vector-index-statements.d.ts +30 -0
  143. package/dist/semantic/validated-vector-index-statements.d.ts.map +1 -0
  144. package/dist/semantic/validated-vector-index.d.ts +16 -0
  145. package/dist/semantic/validated-vector-index.d.ts.map +1 -0
  146. package/dist/semantic/validated-vector-index.test-helper.d.ts +9 -0
  147. package/dist/semantic/validated-vector-index.test-helper.d.ts.map +1 -0
  148. package/dist/semantic-query.d.ts +10 -0
  149. package/dist/semantic-query.d.ts.map +1 -0
  150. package/dist/semantic-worker-entry.js +14 -0
  151. package/dist/semantic-worker-entry.js.map +1 -0
  152. package/dist/semantic-worker-job-J6TKJeAe.js +49 -0
  153. package/dist/semantic-worker-job-J6TKJeAe.js.map +1 -0
  154. package/dist/semantic-worker-ranking-ByCOj--W.js +7625 -0
  155. package/dist/semantic-worker-ranking-ByCOj--W.js.map +1 -0
  156. package/dist/store.d.ts +23 -12
  157. package/dist/store.d.ts.map +1 -1
  158. package/dist/types.d.ts +4 -0
  159. package/dist/types.d.ts.map +1 -1
  160. package/dist/usage-aggregate-index.d.ts +4 -0
  161. package/dist/usage-aggregate-index.d.ts.map +1 -0
  162. package/dist/vector-index-maintenance.d.ts +28 -0
  163. package/dist/vector-index-maintenance.d.ts.map +1 -0
  164. package/dist/vector-index-upgrade.d.ts +21 -0
  165. package/dist/vector-index-upgrade.d.ts.map +1 -0
  166. package/dist/vector-layout.d.ts +21 -0
  167. package/dist/vector-layout.d.ts.map +1 -0
  168. package/dist/vector-migration.d.ts.map +1 -1
  169. package/dist/vector-writes.d.ts +26 -0
  170. package/dist/vector-writes.d.ts.map +1 -0
  171. package/dist/vectors.d.ts +8 -3
  172. package/dist/vectors.d.ts.map +1 -1
  173. package/dist/workspace-identity-CgbP3sJa.js +9915 -0
  174. package/dist/workspace-identity-CgbP3sJa.js.map +1 -0
  175. package/package.json +5 -5
  176. package/dist/owner-enrollment-start-xsoRbhG2.js +0 -14318
  177. package/dist/owner-enrollment-start-xsoRbhG2.js.map +0 -1
  178. package/dist/recipient-policy-contract.js.map +0 -1
package/dist/pack.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { Database } from "./db.js";
17
17
  import type { StoreHandle } from "./search.js";
18
- import type { AutomaticContext, MemoryFilters, MemoryResult, PackRenderOptions, PackResponse, PackTrace } from "./types.js";
18
+ import type { AutomaticContext, MemoryFilters, MemoryResult, PackRenderOptions, PackResponse, PackTrace, SemanticExecutionOptions } from "./types.js";
19
19
  /** Rough token estimate: ~4 chars per token. */
20
20
  export declare function estimateTokens(text: string): number;
21
21
  export type PackArtifacts = {
@@ -38,11 +38,11 @@ export declare function buildMemoryPackTrace(store: StoreHandle, context: string
38
38
  */
39
39
  export declare function buildMemoryPackAsync(store: StoreHandle & {
40
40
  db: Database;
41
- }, context: string, limit?: number, tokenBudget?: number | null, filters?: MemoryFilters, renderOptions?: PackRenderOptions, automaticContext?: AutomaticContext | null): Promise<PackResponse>;
41
+ }, context: string, limit?: number, tokenBudget?: number | null, filters?: MemoryFilters, renderOptions?: PackRenderOptions, automaticContext?: AutomaticContext | null, executionOptions?: SemanticExecutionOptions): Promise<PackResponse>;
42
42
  export declare function buildMemoryPackWithTraceAsync(store: StoreHandle & {
43
43
  db: Database;
44
- }, context: string, limit?: number, tokenBudget?: number | null, filters?: MemoryFilters, renderOptions?: PackRenderOptions, automaticContext?: AutomaticContext | null): Promise<PackArtifacts>;
44
+ }, context: string, limit?: number, tokenBudget?: number | null, filters?: MemoryFilters, renderOptions?: PackRenderOptions, automaticContext?: AutomaticContext | null, executionOptions?: SemanticExecutionOptions): Promise<PackArtifacts>;
45
45
  export declare function buildMemoryPackTraceAsync(store: StoreHandle & {
46
46
  db: Database;
47
- }, context: string, limit?: number, tokenBudget?: number | null, filters?: MemoryFilters, renderOptions?: PackRenderOptions, automaticContext?: AutomaticContext | null): Promise<PackTrace>;
47
+ }, context: string, limit?: number, tokenBudget?: number | null, filters?: MemoryFilters, renderOptions?: PackRenderOptions, automaticContext?: AutomaticContext | null, executionOptions?: SemanticExecutionOptions): Promise<PackTrace>;
48
48
  //# sourceMappingURL=pack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AASxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkB/C,OAAO,KAAK,EACX,gBAAgB,EAChB,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vB,aAAa,CAAC,EAAE,iBAAiB,EACjC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,EAC1C,gBAAgB,CAAC,EAAE,wBAAwB,GACzC,OAAO,CAAC,YAAY,CAAC,CA6BvB;AAED,wBAAsB,6BAA6B,CAClD,KAAK,EAAE,WAAW,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,EACrC,OAAO,EAAE,MAAM,EACf,KAAK,SAAK,EACV,WAAW,GAAE,MAAM,GAAG,IAAW,EACjC,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,iBAAiB,EACjC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,EAC1C,gBAAgB,CAAC,EAAE,wBAAwB,GACzC,OAAO,CAAC,aAAa,CAAC,CA4BxB;AAED,wBAAsB,yBAAyB,CAC9C,KAAK,EAAE,WAAW,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,EACrC,OAAO,EAAE,MAAM,EACf,KAAK,SAAK,EACV,WAAW,GAAE,MAAM,GAAG,IAAW,EACjC,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,iBAAiB,EACjC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,EAC1C,gBAAgB,CAAC,EAAE,wBAAwB,GACzC,OAAO,CAAC,SAAS,CAAC,CA4BpB"}
@@ -0,0 +1,24 @@
1
+ //#region src/recipient-policy-contract.ts
2
+ var e = 1, t = [
3
+ "team_name_invalid",
4
+ "team_not_found",
5
+ "team_rename_stale",
6
+ "team_link_stale",
7
+ "team_link_ambiguous",
8
+ "team_coordinator_rename_failed",
9
+ "team_local_rename_pending",
10
+ "team_rename_failed"
11
+ ], n = [
12
+ "keep_current_setup",
13
+ "reject_suggestion",
14
+ "keep_project_local",
15
+ "keep_identities_separate",
16
+ "remove_stale_device"
17
+ ], r = new Set(n);
18
+ function i(e) {
19
+ return r.has(e);
20
+ }
21
+ //#endregion
22
+ export { i, n, t as r, e as t };
23
+
24
+ //# sourceMappingURL=recipient-policy-contract-Ca40IBUh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipient-policy-contract-Ca40IBUh.js","names":[],"sources":["../src/recipient-policy-contract.ts"],"sourcesContent":["export const RECIPIENT_POLICY_CONTRACT_VERSION = 1 as const;\n\nexport type RecipientPolicyContractVersion = typeof RECIPIENT_POLICY_CONTRACT_VERSION;\n\nexport const RECIPIENT_POLICY_TEAM_RENAME_ERROR_CODES = [\n\t\"team_name_invalid\",\n\t\"team_not_found\",\n\t\"team_rename_stale\",\n\t\"team_link_stale\",\n\t\"team_link_ambiguous\",\n\t\"team_coordinator_rename_failed\",\n\t\"team_local_rename_pending\",\n\t\"team_rename_failed\",\n] as const;\n\nexport type RecipientPolicyTeamRenameErrorCode =\n\t(typeof RECIPIENT_POLICY_TEAM_RENAME_ERROR_CODES)[number];\n\nexport interface RecipientPolicyTeamRenameResultV1 {\n\tversion: 1;\n\tteamId: string;\n\tdisplayName: string;\n\trevision: string;\n\tlinkedCoordinatorGroupRenamed: boolean;\n}\n\nexport type RecipientPolicyEdgeRecipientRefV1 =\n\t| { recipientKind: \"identity\"; identityId: string }\n\t| { recipientKind: \"team\"; teamId: string };\n\nexport interface RecipientPolicyEdgeChangeV1 {\n\tcanonicalProjectIdentity: string;\n\trecipient: RecipientPolicyEdgeRecipientRefV1;\n\taction: \"add\" | \"remove\";\n}\n\nexport interface RecipientPolicyEdgePreviewRequestV1 {\n\tversion: 1;\n\tchanges: RecipientPolicyEdgeChangeV1[];\n}\n\nexport interface RecipientPolicyEdgeCommitRequestV1 extends RecipientPolicyEdgePreviewRequestV1 {\n\treviewedPolicyDigest: string;\n}\n\nexport interface RecipientPolicyEdgePreviewProjectV1 {\n\tcanonicalProjectIdentity: string;\n\tdisplayName: string;\n\texistingMemoryCount: number;\n\tfutureMemoriesShared: true;\n}\n\nexport interface RecipientPolicyEdgeIdentitySummaryV1 {\n\tidentityId: string;\n\tdisplayName: string;\n\tverification: \"local\";\n}\n\nexport type RecipientPolicyEdgeSelectedRecipientV1 =\n\t| ({ recipientKind: \"identity\" } & RecipientPolicyEdgeIdentitySummaryV1)\n\t| {\n\t\t\trecipientKind: \"team\";\n\t\t\tteamId: string;\n\t\t\tdisplayName: string;\n\t\t\tcurrentMembers: RecipientPolicyEdgeIdentitySummaryV1[];\n\t\t\tfutureMembersInherit: true;\n\t };\n\nexport interface RecipientPolicyEdgeEffectiveDeviceV1 {\n\tcanonicalProjectIdentity: string;\n\tidentityId: string;\n\tdeviceId: string;\n\tdisplayName: string;\n}\n\nexport interface RecipientPolicyEdgePreviewResponseV1 {\n\tversion: 1;\n\tnormalizedChanges: RecipientPolicyEdgeChangeV1[];\n\toutcomes: RecipientPolicyEdgeCommitOutcomeV1[];\n\tprojects: RecipientPolicyEdgePreviewProjectV1[];\n\tselectedRecipients: RecipientPolicyEdgeSelectedRecipientV1[];\n\teffectiveDevices: RecipientPolicyEdgeEffectiveDeviceV1[];\n\tunchangedProjects: RecipientPolicyEdgePreviewProjectV1[];\n\treviewedPolicyDigest: string;\n\taddCount: number;\n\tremoveCount: number;\n\tnetWriteCount: number;\n}\n\nexport type RecipientPolicyEdgeOutcomeV1 =\n\t| \"added\"\n\t| \"removed\"\n\t| \"already_present\"\n\t| \"already_absent\";\n\nexport interface RecipientPolicyEdgeCommitOutcomeV1 {\n\tchange: RecipientPolicyEdgeChangeV1;\n\toutcome: RecipientPolicyEdgeOutcomeV1;\n}\n\nexport interface RecipientPolicyEdgeCommitResultV1 {\n\tversion: 1;\n\tstatus: \"applied\" | \"stale\" | \"invalid\" | \"not_found\" | \"conflict\";\n\treviewedPolicyDigest: string;\n\terrorCode: string | null;\n\toutcomes: RecipientPolicyEdgeCommitOutcomeV1[];\n\twriteCount: number;\n\tidempotent: boolean;\n}\n\nexport type RecipientPolicyIdentityKindV1 = \"personal\" | \"work\" | \"other\";\nexport type RecipientPolicyIdentityStatusV1 = \"active\" | \"pending\" | \"merged\";\n\nexport interface RecipientPolicyIdentityV1 {\n\tversion: RecipientPolicyContractVersion;\n\tidentityId: string;\n\tdisplayName: string;\n\tkind: RecipientPolicyIdentityKindV1;\n\tverification: \"local\";\n\tstatus: RecipientPolicyIdentityStatusV1;\n\tmergedIntoIdentityId: string | null;\n}\n\nexport interface RecipientPolicyTeamV1 {\n\tversion: RecipientPolicyContractVersion;\n\tteamId: string;\n\tdisplayName: string;\n\tstatus: \"active\" | \"archived\";\n}\n\nexport interface RecipientPolicyTeamMembershipV1 {\n\tversion: RecipientPolicyContractVersion;\n\tteamId: string;\n\tidentityId: string;\n\trole: \"member\" | \"admin\";\n\tstatus: \"active\" | \"pending\" | \"revoked\";\n}\n\nexport interface RecipientPolicyIdentityDeviceV1 {\n\tversion: RecipientPolicyContractVersion;\n\tidentityId: string;\n\tdeviceId: string;\n\tdisplayName: string;\n\tstatus: \"active\" | \"revoked\";\n}\n\nexport interface RecipientPolicyProjectV1 {\n\tversion: RecipientPolicyContractVersion;\n\tcanonicalIdentity: string;\n\tdisplayName: string;\n}\n\nexport type RecipientPolicyIntentSourceV1 = \"user\" | \"migration\" | \"legacy_project_invite\";\n\ninterface RecipientPolicyProjectRecipientBaseV1 {\n\tversion: RecipientPolicyContractVersion;\n\tcanonicalProjectIdentity: string;\n\tintentSource: RecipientPolicyIntentSourceV1;\n\tpolicyRevision: string;\n\tstatus: \"active\" | \"revoked\";\n}\n\nexport type RecipientPolicyProjectRecipientV1 =\n\t| (RecipientPolicyProjectRecipientBaseV1 & {\n\t\t\trecipientKind: \"identity\";\n\t\t\tidentityId: string;\n\t })\n\t| (RecipientPolicyProjectRecipientBaseV1 & {\n\t\t\trecipientKind: \"team\";\n\t\t\tteamId: string;\n\t });\n\ninterface RecipientPolicyEffectiveDeviceBaseV1 {\n\tversion: RecipientPolicyContractVersion;\n\tcanonicalProjectIdentity: string;\n\tidentityId: string;\n\tdeviceId: string;\n}\n\nexport type RecipientPolicyEffectiveDeviceV1 =\n\t| (RecipientPolicyEffectiveDeviceBaseV1 & {\n\t\t\tvia: \"direct_identity\";\n\t })\n\t| (RecipientPolicyEffectiveDeviceBaseV1 & {\n\t\t\tvia: \"team_membership\";\n\t\t\tteamId: string;\n\t });\n\nexport type RecipientPolicyAuthorityV1 = \"legacy_scope\" | \"recipient_policy\";\nexport type RecipientPolicyParityV1 = \"unknown\" | \"matched\" | \"diverged\";\n\nexport interface RecipientPolicyEnforcementV1 {\n\tversion: RecipientPolicyContractVersion;\n\tcanonicalProjectIdentity: string;\n\tauthority: RecipientPolicyAuthorityV1;\n\tparity: RecipientPolicyParityV1;\n\tcutoverState: \"legacy\" | \"eligible\" | \"active\" | \"rolled_back\";\n\tmanagedScopeId: string | null;\n\tdesiredDeviceIds: string[];\n\tcurrentDeviceIds: string[];\n\tsafeErrorCode: string | null;\n}\n\nexport type RecipientPolicyReviewDecisionV1 =\n\t| \"apply_recommendation\"\n\t| \"choose_recipients\"\n\t| \"preserve_current_access\"\n\t| \"reject_suggestion\"\n\t| \"keep_current_setup\"\n\t| \"keep_project_local\"\n\t| \"keep_identities_separate\"\n\t| \"attach_device_to_identity\"\n\t| \"create_identity\"\n\t| \"remove_stale_device\";\n\nexport const RECIPIENT_POLICY_NO_OP_DECISIONS = [\n\t\"keep_current_setup\",\n\t\"reject_suggestion\",\n\t\"keep_project_local\",\n\t\"keep_identities_separate\",\n\t\"remove_stale_device\",\n] as const satisfies readonly RecipientPolicyReviewDecisionV1[];\n\nconst RECIPIENT_POLICY_NO_OP_DECISION_SET = new Set<RecipientPolicyReviewDecisionV1>(\n\tRECIPIENT_POLICY_NO_OP_DECISIONS,\n);\n\nexport function isRecipientPolicyNoOpDecision(\n\tdecision: RecipientPolicyReviewDecisionV1 | string,\n): decision is (typeof RECIPIENT_POLICY_NO_OP_DECISIONS)[number] {\n\treturn RECIPIENT_POLICY_NO_OP_DECISION_SET.has(decision as RecipientPolicyReviewDecisionV1);\n}\n\nexport interface RecipientPolicyReviewOptionV1 {\n\tdecision: RecipientPolicyReviewDecisionV1;\n\tlabel: string;\n\teffect: \"none\" | \"grant_reviewed_access\" | \"revoke_reviewed_access\" | \"metadata_only\";\n\taffectedProjectCount: number;\n\taffectedMemoryCount: number;\n\taffectedDeviceCount: number;\n\t/** Additive exact preview used by actionable review APIs. */\n\tpreview?: RecipientPolicyReviewPreviewV1;\n}\n\nexport interface RecipientPolicyReviewPreviewProjectV1 {\n\tcanonicalIdentity: string;\n\tdisplayName: string;\n}\n\nexport interface RecipientPolicyReviewPreviewDeviceV1 {\n\tdeviceId: string;\n\tdisplayName: string;\n\tidentityId: string | null;\n\tassignment: \"assigned\" | \"unassigned\";\n}\n\nexport interface RecipientPolicyReviewPreviewV1 {\n\tprojects: RecipientPolicyReviewPreviewProjectV1[];\n\teffectiveDevices: RecipientPolicyReviewPreviewDeviceV1[];\n\taffectedProjectCount: number;\n\taffectedMemoryCount: number;\n\taffectedDeviceCount: number;\n\teffect: RecipientPolicyReviewOptionV1[\"effect\"];\n\trequiresDecisionInput: boolean;\n}\n\nexport interface RecipientPolicyReviewResolutionV1 {\n\tdecision: RecipientPolicyReviewDecisionV1;\n\tdecidedByIdentityId: string;\n\tdecidedByDeviceId: string;\n\tresolvedAt: string;\n}\n\nexport type RecipientPolicyReviewConditionCodeV1 =\n\t| \"suggest_local_identity\"\n\t| \"suggest_team_candidate\"\n\t| \"unassigned_effective_device\";\n\nexport interface RecipientPolicyReviewProjectGroupV1 {\n\tidentity: string;\n\tdisplayName: string;\n}\n\nexport interface RecipientPolicyReviewItemV1 {\n\tversion: RecipientPolicyContractVersion;\n\treviewItemId: string;\n\tsourceFingerprint: string;\n\tconditionCode: RecipientPolicyReviewConditionCodeV1;\n\tprojectGroup: RecipientPolicyReviewProjectGroupV1;\n\tfinding: string;\n\treason: string;\n\trecommendedDecision: RecipientPolicyReviewDecisionV1;\n\toptions: RecipientPolicyReviewOptionV1[];\n\tstate: \"open\" | \"resolved\";\n\tresolution: RecipientPolicyReviewResolutionV1 | null;\n}\n\nexport interface RecipientPolicyBlockedItemV1 {\n\tversion: RecipientPolicyContractVersion;\n\tblockedItemId: string;\n\tfinding: string;\n\treason: string;\n\townerLabel: string;\n\trepairAction: string;\n\trepair: {\n\t\tkind: \"reassign_project\" | \"open_project_administration\";\n\t\tprojectIdentity: string;\n\t\tlabel: string;\n\t};\n}\n\nexport interface RecipientPolicyProjectionV1 {\n\tversion: RecipientPolicyContractVersion;\n\tproject: RecipientPolicyProjectV1;\n\tintent: RecipientPolicyProjectRecipientV1[];\n\teffectiveDevices: RecipientPolicyEffectiveDeviceV1[];\n\tenforcement: RecipientPolicyEnforcementV1;\n\treviewItems: RecipientPolicyReviewItemV1[];\n\tblockedItems: RecipientPolicyBlockedItemV1[];\n}\n\nexport interface RecipientPolicyReconciliationStatusV1 {\n\tversion: RecipientPolicyContractVersion;\n\tcanonicalProjectIdentity: string;\n\tstate: \"projected\" | \"parity_verified\" | \"active\" | \"waiting\" | \"needs_attention\" | \"rolled_back\";\n\tauthority: RecipientPolicyAuthorityV1;\n\tparity: RecipientPolicyParityV1;\n\tlastCompletedAt: string | null;\n\tsafeErrorCode: string | null;\n}\n\nexport type LegacyTeamSetupActivationChangeV1 = \"add\" | \"update\" | \"remove\";\n\nexport interface LegacyTeamSetupTeamChangeV1 {\n\tteamId: string;\n\tchange: LegacyTeamSetupActivationChangeV1;\n\tfromDeviceEligibilityMode: \"person_all_devices\" | \"reviewed_allowlist\" | null;\n\ttoDeviceEligibilityMode: \"reviewed_allowlist\";\n}\n\nexport interface LegacyTeamSetupMembershipChangeV1 {\n\tteamId: string;\n\tidentityId: string;\n\tchange: LegacyTeamSetupActivationChangeV1;\n}\n\nexport interface LegacyTeamSetupProjectChangeV1 {\n\tprojectRef: string;\n\tfromProjectIdentity: string | null;\n\ttoProjectIdentity: string | null;\n\tchange: LegacyTeamSetupActivationChangeV1;\n}\n\nexport interface LegacyTeamSetupRecipientChangeV1 {\n\tcanonicalProjectIdentity: string;\n\trecipientKind: \"team\";\n\trecipientId: string;\n\tchange: LegacyTeamSetupActivationChangeV1;\n}\n\nexport interface LegacyTeamSetupDeviceAccessChangeV1 {\n\tcanonicalProjectIdentity: string;\n\tdeviceId: string;\n\tchange: \"add\" | \"remove\";\n}\n\nexport interface LegacyTeamSetupAccessDeltaV1 {\n\tteamChanges: LegacyTeamSetupTeamChangeV1[];\n\tmembershipChanges: LegacyTeamSetupMembershipChangeV1[];\n\tprojectChanges: LegacyTeamSetupProjectChangeV1[];\n\trecipientChanges: LegacyTeamSetupRecipientChangeV1[];\n\tdeviceAccessChanges: LegacyTeamSetupDeviceAccessChangeV1[];\n}\n\nexport interface LegacyTeamSetupActivationPreviewV1 {\n\tcandidateRef: string;\n\tattemptId: string;\n\tfinishDigest: string;\n\taccessDeltaDigest: string;\n\taccessDelta: LegacyTeamSetupAccessDeltaV1;\n}\n\nexport interface LegacyTeamSetupActivationResultV1 {\n\tstatus: \"completed\";\n\tteamId: string;\n\tattemptId: string;\n\taccessDeltaDigest: string;\n\tcompletedAt: string;\n}\n"],"mappings":";AAAA,IAAa,IAAoC,GAIpC,IAA2C;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,GA0Ma,IAAmC;CAC/C;CACA;CACA;CACA;CACA;AACD,GAEM,IAAsC,IAAI,IAC/C,CACD;AAEA,SAAgB,EACf,GACgE;CAChE,OAAO,EAAoC,IAAI,CAA2C;AAC3F"}
@@ -1,24 +1,2 @@
1
- //#region src/recipient-policy-contract.ts
2
- var e = 1, t = [
3
- "team_name_invalid",
4
- "team_not_found",
5
- "team_rename_stale",
6
- "team_link_stale",
7
- "team_link_ambiguous",
8
- "team_coordinator_rename_failed",
9
- "team_local_rename_pending",
10
- "team_rename_failed"
11
- ], n = [
12
- "keep_current_setup",
13
- "reject_suggestion",
14
- "keep_project_local",
15
- "keep_identities_separate",
16
- "remove_stale_device"
17
- ], r = new Set(n);
18
- function i(e) {
19
- return r.has(e);
20
- }
21
- //#endregion
22
- export { e as RECIPIENT_POLICY_CONTRACT_VERSION, n as RECIPIENT_POLICY_NO_OP_DECISIONS, t as RECIPIENT_POLICY_TEAM_RENAME_ERROR_CODES, i as isRecipientPolicyNoOpDecision };
23
-
24
- //# sourceMappingURL=recipient-policy-contract.js.map
1
+ import { i as e, n as t, r as n, t as r } from "./recipient-policy-contract-Ca40IBUh.js";
2
+ export { r as RECIPIENT_POLICY_CONTRACT_VERSION, t as RECIPIENT_POLICY_NO_OP_DECISIONS, n as RECIPIENT_POLICY_TEAM_RENAME_ERROR_CODES, e as isRecipientPolicyNoOpDecision };
@@ -0,0 +1,4 @@
1
+ import { type Database } from "./db.js";
2
+ /** Shared read-only resolver; authoritative bindings take precedence over legacy claims. */
3
+ export declare function resolveSameActorPeerIds(db: Database, actorId: string): string[];
4
+ //# sourceMappingURL=same-actor-peers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"same-actor-peers.d.ts","sourceRoot":"","sources":["../src/same-actor-peers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,QAAQ,EAAe,MAAM,SAAS,CAAC;AAWnE,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmB/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema-bootstrap.d.ts","sourceRoot":"","sources":["../src/schema-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAc/C,oFAAoF;AACpF,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAuB7D;AAkXD,wBAAgB,gCAAgC,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CA2BnE;AA6XD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAUrD;AAWD,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CA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AC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAmBrE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAI3D;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAE5D"}
package/dist/search.d.ts CHANGED
@@ -7,12 +7,14 @@
7
7
  */
8
8
  import { type OwnershipFilterContext } from "./filters.js";
9
9
  import { type ScopeVisibilityOptions } from "./scope-resolution.js";
10
+ import type { PackSemanticExecutor } from "./semantic/semantic-executor-seam.js";
10
11
  import type { ExplainResponse, MemoryFilters, MemoryItem, MemoryItemResponse, MemoryResult, PackTraceCandidateScores, TimelineItemResponse } from "./types.js";
11
12
  export interface ExplainOptions {
12
13
  includePackContext?: boolean;
13
14
  }
14
15
  /** Structural type for the store parameter (avoids circular import). */
15
16
  export interface StoreHandle {
17
+ semanticSearchAsync?: PackSemanticExecutor["search"];
16
18
  readonly db: import("better-sqlite3").Database;
17
19
  readonly actorId: string;
18
20
  readonly deviceId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAKN,KAAK,sBAAsB,EAC3B,MAAM,cAAc,CAAC;AAQtB,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAGX,eAAe,EACf,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAOD,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,EAAE,OAAO,gBAAgB,EAAE,QAAQ,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB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,OAAO,CAAC,EAAE,cAAc,GACtB,eAAe,CAkJjB;AAED;;;;;;;GAOG"}
@@ -0,0 +1,30 @@
1
+ import type { AutomaticContext, MemoryFilters, SemanticExecutionOptions } from "../types.js";
2
+ import type { SemanticSearchResult } from "../vectors.js";
3
+ export interface SemanticSearchInput {
4
+ query: string;
5
+ limit: number;
6
+ filters: MemoryFilters | null;
7
+ automaticContext: AutomaticContext | null | undefined;
8
+ }
9
+ export interface PackSemanticExecutor {
10
+ search(input: SemanticSearchInput, options?: SemanticExecutionOptions): Promise<SemanticSearchResult[]>;
11
+ close(): Promise<void>;
12
+ }
13
+ declare const identityErrorBrand: unique symbol;
14
+ export declare class SemanticIdentityChangedError extends Error {
15
+ readonly [identityErrorBrand] = true;
16
+ constructor();
17
+ }
18
+ /** Separate package bundles can load distinct copies of this class. */
19
+ export declare function isSemanticIdentityChangedError(error: unknown): boolean;
20
+ declare const closedErrorBrand: unique symbol;
21
+ export declare class SemanticStoreClosedError extends Error {
22
+ readonly [closedErrorBrand] = true;
23
+ constructor();
24
+ }
25
+ export declare function isSemanticStoreClosedError(error: unknown): boolean;
26
+ /** Internal test injection only: no runtime flag or package export. */
27
+ export declare function attachSemanticExecutorForTesting(store: object, executor: PackSemanticExecutor): void;
28
+ export declare function getSemanticExecutorOverride(store: object): PackSemanticExecutor | undefined;
29
+ export {};
30
+ //# sourceMappingURL=semantic-executor-seam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-executor-seam.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-executor-seam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,CACL,KAAK,EAAE,mBAAmB,EAC1B,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,QAAA,MAAM,kBAAkB,eAAkD,CAAC;AAE3E,qBAAa,4BAA6B,SAAQ,KAAK;IACtD,QAAQ,CAAC,CAAC,kBAAkB,CAAC,QAAQ;IAErC,cAEC;CACD;AAED,uEAAuE;AACvE,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEtE;AAED,QAAA,MAAM,gBAAgB,eAA8C,CAAC;AAErE,qBAAa,wBAAyB,SAAQ,KAAK;IAClD,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;IAEnC,cAEC;CACD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAElE;AAKD,uEAAuE;AACvE,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,oBAAoB,GAC5B,IAAI,CAIN;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE3F"}
@@ -0,0 +1,34 @@
1
+ /** Test-only full-corpus audit and token harness around the shipping ranking engine. */
2
+ import type { Database } from "../db.js";
3
+ import { inspectBytes, type RankingRequest as ProductionRankingRequest, type RankingResult, type VectorRowInput } from "./semantic-ranking.js";
4
+ declare const corpusTokenBrand: unique symbol;
5
+ export interface CorpusToken {
6
+ readonly [corpusTokenBrand]: true;
7
+ }
8
+ export interface RankingRequest extends ProductionRankingRequest {
9
+ token: CorpusToken;
10
+ }
11
+ export interface CorpusAudit {
12
+ token: CorpusToken;
13
+ scanned: number;
14
+ accepted: number;
15
+ rejected: readonly {
16
+ rowid: number;
17
+ reason: NonNullable<ReturnType<typeof inspectBytes>>;
18
+ }[];
19
+ }
20
+ /** Connection-bound proof tokens deliberately invalidate even after unrelated writes. */
21
+ export declare function auditCorpus(db: Database, options: {
22
+ knownModels: readonly string[];
23
+ }): CorpusAudit;
24
+ /** Validate the entire fixture batch before starting writes. */
25
+ export declare function writeFixtureBatch(db: Database, batch: {
26
+ expectedModel: string;
27
+ model: string;
28
+ expectedCount: number;
29
+ rows: readonly VectorRowInput[];
30
+ }): void;
31
+ /** All ranking and authorization assertions exercise rankPrevalidatedSnapshot itself. */
32
+ export declare function rankExact(db: Database, request: RankingRequest): RankingResult;
33
+ export {};
34
+ //# sourceMappingURL=semantic-ranking-reference.test-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-ranking-reference.test-helper.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-ranking-reference.test-helper.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACN,YAAY,EACZ,KAAK,cAAc,IAAI,wBAAwB,EAC/C,KAAK,aAAa,EAKlB,KAAK,cAAc,EAGnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,MAAM,CAAC;AAC9C,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC;CAClC;AACD,MAAM,WAAW,cAAe,SAAQ,wBAAwB;IAC/D,KAAK,EAAE,WAAW,CAAC;CACnB;AACD,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAA;KAAE,EAAE,CAAC;CAC7F;AA4CD,yFAAyF;AACzF,wBAAgB,WAAW,CAC1B,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE;IAAE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACzC,WAAW,CAsCb;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAChC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,SAAS,cAAc,EAAE,CAAC;CAChC,GACC,IAAI,CAgCN;AAkBD,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,CAO9E"}
@@ -0,0 +1,50 @@
1
+ /** Exact semantic ranking inside a caller-owned, validated read snapshot. */
2
+ import { type Database } from "../db.js";
3
+ import type { MaintenanceJobSnapshot } from "../maintenance-jobs.js";
4
+ import type { MemoryFilters } from "../types.js";
5
+ import type { SemanticSearchResult, SemanticSearchScopeContext } from "../vectors.js";
6
+ export interface PreparedQuery {
7
+ model: string;
8
+ vectors: readonly Float32Array[];
9
+ }
10
+ export interface VectorRowInput {
11
+ memoryId: number;
12
+ chunkIndex: number;
13
+ contentHash: string;
14
+ vector: Float32Array;
15
+ }
16
+ type Rejection = "shape" | "nonfinite" | "norm" | "model";
17
+ export interface RankingRequest {
18
+ query: PreparedQuery;
19
+ limit: number;
20
+ filters: MemoryFilters | null;
21
+ context: SemanticSearchScopeContext;
22
+ summarySessionId?: number | null;
23
+ }
24
+ interface Probe {
25
+ model: string;
26
+ k: number;
27
+ returned: number;
28
+ exhausted: boolean;
29
+ tailDistance: number | null;
30
+ }
31
+ export interface RankingResult {
32
+ results: SemanticSearchResult[];
33
+ strategy: "native" | "scalar";
34
+ probes: readonly Probe[];
35
+ fallbackCount: number;
36
+ }
37
+ export declare function requireModel(model: string): void;
38
+ export declare function vectorBytes(vector: Float32Array): Buffer;
39
+ export declare function inspectBytes(bytes: Buffer): Rejection | null;
40
+ export declare function readModelJob(db: Database): Pick<MaintenanceJobSnapshot, "status" | "metadata"> | null;
41
+ export declare function resolveCatalogModels(currentModel: string, catalog: Array<string | null>, job: Pick<MaintenanceJobSnapshot, "status" | "metadata"> | null): string[];
42
+ /** Internal engine; caller supplies validation evidence and owns the read snapshot. */
43
+ export declare function rankPrevalidatedSnapshot(db: Database, request: RankingRequest, options: {
44
+ models: string[];
45
+ acceptedIds: string | null;
46
+ indexedRows?: boolean;
47
+ }): RankingResult;
48
+ export declare function validateRankingRequest(request: RankingRequest): void;
49
+ export {};
50
+ //# sourceMappingURL=semantic-ranking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-ranking.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-ranking.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,UAAU,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAwB,MAAM,wBAAwB,CAAC;AAM3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;CACjC;AACD,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;CACrB;AACD,KAAK,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAC1D,MAAM,WAAW,cAAc;IAC9B,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IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9E,aAAa,CAiCf;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAOpE"}
@@ -0,0 +1,17 @@
1
+ import type { Database as DatabaseConnection } from "../db.js";
2
+ import type { SemanticSearchScopeContext } from "../vectors.js";
3
+ export declare const MODEL = "fixture-model";
4
+ export declare function vector(value?: number): Float32Array;
5
+ export interface RankingFixture {
6
+ db: DatabaseConnection;
7
+ path: string;
8
+ context: SemanticSearchScopeContext;
9
+ memory(scopeId?: string): number;
10
+ rawVector(memoryId: number, value: Float32Array, chunkIndex?: number, model?: string): number;
11
+ snapshot(): {
12
+ memories: unknown[];
13
+ vectors: unknown[];
14
+ };
15
+ }
16
+ export declare function createFixture(directory: string): RankingFixture;
17
+ //# sourceMappingURL=semantic-ranking.test-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-ranking.test-helper.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-ranking.test-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAEhE,eAAO,MAAM,KAAK,kBAAkB,CAAC;AAGrC,wBAAgB,MAAM,CAAC,KAAK,SAAI,GAAG,YAAY,CAI9C;AAED,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,kBAAkB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9F,QAAQ,IAAI;QAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CACxD;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAkD/D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=semantic-worker-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-entry.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-entry.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { type Database } from "../db.js";
2
+ import { type EmbeddingClient } from "../embeddings.js";
3
+ import { type StoreHandle } from "../search.js";
4
+ import { type PackSemanticExecutor } from "./semantic-executor-seam.js";
5
+ import { type QueueOptions } from "./semantic-worker-queue.js";
6
+ export interface SemanticWorkerOptions {
7
+ store: StoreHandle & {
8
+ hasCurrentIdentity(): boolean;
9
+ onIdentityChanged?(listener: () => void): () => void;
10
+ };
11
+ getClient?: () => Promise<EmbeddingClient | null>;
12
+ queueOptions?: Omit<QueueOptions, "createWorker">;
13
+ /** Lifecycle fault injection only; normal fixtures use the real worker. */
14
+ createWorker?: QueueOptions["createWorker"];
15
+ }
16
+ /** Metadata-only admission check; construction never starts a worker. */
17
+ export declare function hasReadySemanticCatalog(db: Database): boolean;
18
+ /** Owner must await close() before closing its writable store. */
19
+ export declare function createSemanticExecutor(options: SemanticWorkerOptions): PackSemanticExecutor;
20
+ //# sourceMappingURL=semantic-worker-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-executor.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-executor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAuB,MAAM,UAAU,CAAC;AAC9D,OAAO,EACN,KAAK,eAAe,EAMpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAIxE,OAAO,EACN,KAAK,oBAAoB,EAEzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEN,KAAK,YAAY,EAGjB,MAAM,4BAA4B,CAAC;AAWpC,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,WAAW,GAAG;QACpB,kBAAkB,IAAI,OAAO,CAAC;QAC9B,iBAAiB,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;KACrD,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAClD,2EAA2E;IAC3E,YAAY,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;CAC5C;AAiGD,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAE7D;AA0DD,kEAAkE;AAClE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB,CAuD3F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=semantic-worker-job.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-job.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-job.ts"],"names":[],"mappings":""}
@@ -0,0 +1,48 @@
1
+ import type { AutomaticContext, MemoryFilters } from "../types.js";
2
+ import type { CandidateVersion } from "./validated-vector-index.js";
3
+ export interface RuntimeProof {
4
+ actorId: string;
5
+ deviceId: string;
6
+ expectedPublicKey: string | undefined;
7
+ }
8
+ export interface RankInput {
9
+ generationId: string;
10
+ embedding: Float32Array;
11
+ embeddingIdentity: string;
12
+ filters: MemoryFilters | null;
13
+ automaticContext: AutomaticContext | null | undefined;
14
+ proof: RuntimeProof;
15
+ limit: number;
16
+ }
17
+ export interface RankOutput {
18
+ generationId: string;
19
+ /** Diagnostic only: unrelated vector writes may advance the revision. */
20
+ revision: number;
21
+ models: string[];
22
+ candidateVersions: CandidateVersion[];
23
+ candidates: Array<{
24
+ id: number;
25
+ distance: number;
26
+ contentIdentity: string;
27
+ }>;
28
+ }
29
+ export type WorkerRequest = {
30
+ type: "rank";
31
+ id: number;
32
+ deadlineAt: number;
33
+ input: RankInput;
34
+ } | {
35
+ type: "close";
36
+ };
37
+ export type WorkerReply = {
38
+ type: "ready";
39
+ } | {
40
+ type: "result";
41
+ id: number;
42
+ output: RankOutput | null;
43
+ } | {
44
+ type: "error";
45
+ id: number;
46
+ code: "ranking_failed" | "expired";
47
+ };
48
+ //# sourceMappingURL=semantic-worker-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-protocol.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,SAAS;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,YAAY,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAC;IACtD,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,UAAU,EAAE,KAAK,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC,CAAC;CACH;AAED,MAAM,MAAM,aAAa,GACtB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAErB,MAAM,MAAM,WAAW,GACpB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAAE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { RankInput, RankOutput, WorkerReply, WorkerRequest } from "./semantic-worker-protocol.js";
2
+ export interface WorkerEvents {
3
+ message(message: WorkerReply): void;
4
+ failure(error: Error): void;
5
+ exit(code: number): void;
6
+ }
7
+ export interface WorkerTransport {
8
+ postMessage(message: WorkerRequest): void;
9
+ terminate(): Promise<number>;
10
+ }
11
+ export interface QueueOptions {
12
+ createWorker(events: WorkerEvents): WorkerTransport;
13
+ maxPending?: number;
14
+ readinessMs?: number;
15
+ requestMs?: number;
16
+ shutdownMs?: number;
17
+ onCircuitOpen?(code: SemanticWorkerErrorCode): void;
18
+ }
19
+ export type SemanticWorkerErrorCode = "overloaded" | "expired" | "aborted" | "not_ready" | "worker_failed" | "closed";
20
+ export declare class SemanticWorkerError extends Error {
21
+ readonly code: SemanticWorkerErrorCode;
22
+ constructor(code: SemanticWorkerErrorCode);
23
+ }
24
+ export interface SemanticWorkerQueue {
25
+ run(prepare: () => Promise<RankInput | null>, options?: {
26
+ signal?: AbortSignal;
27
+ }): Promise<RankOutput | null>;
28
+ close(): Promise<void>;
29
+ }
30
+ /** Single native job, including embedding preparation. Caller cancellation is not SQL cancellation. */
31
+ export declare function createSemanticWorkerQueue(options: QueueOptions): SemanticWorkerQueue;
32
+ //# sourceMappingURL=semantic-worker-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-queue.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,UAAU,EACV,WAAW,EACX,aAAa,EACb,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC5B,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC/B,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1C,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC5B,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,CAAC,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACpD;AAED,MAAM,MAAM,uBAAuB,GAChC,YAAY,GACZ,SAAS,GACT,SAAS,GACT,WAAW,GACX,eAAe,GACf,QAAQ,CAAC;AAEZ,qBAAa,mBAAoB,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,EAAE,uBAAuB;IAAlD,YAAqB,IAAI,EAAE,uBAAuB,EAEjD;CACD;AAED,MAAM,WAAW,mBAAmB;IACnC,GAAG,CACF,OAAO,EAAE,MAAM,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,EACxC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAChC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAkBD,uGAAuG;AACvG,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,YAAY,GAAG,mBAAmB,CAQpF"}
@@ -0,0 +1,8 @@
1
+ import type { Database } from "../db.js";
2
+ import type { AutomaticContext } from "../types.js";
3
+ import type { RankInput, RankOutput } from "./semantic-worker-protocol.js";
4
+ export declare function contentIdentity(row: Record<string, unknown>): string;
5
+ export declare function summarySessionId(db: Database, context: AutomaticContext | null | undefined): number | null | undefined;
6
+ /** Authorization, continuity, model selection, ranking and identities share one short read snapshot. */
7
+ export declare function rankWorkerInput(db: Database, input: RankInput): RankOutput | null;
8
+ //# sourceMappingURL=semantic-worker-ranking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-ranking.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-ranking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAO3E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAEpE;AAED,wBAAgB,gBAAgB,CAC/B,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAC1C,MAAM,GAAG,IAAI,GAAG,SAAS,CAU3B;AAED,wGAAwG;AACxG,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAqCjF"}
@@ -0,0 +1,55 @@
1
+ import { type Database } from "../db.js";
2
+ import { type EmbeddingClient } from "../embeddings.js";
3
+ import { MemoryStore } from "../store.js";
4
+ import type { PackSemanticExecutor } from "./semantic-executor-seam.js";
5
+ import { type SemanticWorkerOptions } from "./semantic-worker-executor.js";
6
+ import type { RankOutput } from "./semantic-worker-protocol.js";
7
+ export declare const request: {
8
+ query: string;
9
+ limit: number;
10
+ filters: null;
11
+ automaticContext: undefined;
12
+ };
13
+ export declare function deferred<T>(): {
14
+ promise: Promise<T>;
15
+ resolve: (value: T) => void;
16
+ reject: (error: unknown) => void;
17
+ };
18
+ export declare function unitVector(first?: number): Float32Array;
19
+ export declare function seedVector(db: Database, id: number, client: EmbeddingClient, first: number, chunk?: number, options?: {
20
+ model?: string;
21
+ mode?: "append" | "replace-memory-model";
22
+ }): void;
23
+ export declare function finishFixtureAudit(db: Database, models: string[]): import("./validated-vector-index-state.js").VectorCatalog;
24
+ interface Fixture {
25
+ directory: string;
26
+ store: MemoryStore;
27
+ client: EmbeddingClient;
28
+ ids: {
29
+ semantic: number;
30
+ keyword: number;
31
+ hidden: number;
32
+ };
33
+ openExecutor(options?: Partial<Omit<SemanticWorkerOptions, "store">>): PackSemanticExecutor;
34
+ }
35
+ interface FixtureOptions {
36
+ initializeIndex?: boolean;
37
+ additionalKnownModels?: readonly string[];
38
+ }
39
+ export declare function useSemanticWorkerFixture(options?: FixtureOptions): Fixture;
40
+ /** Pause delivery after actual worker SQL completes, without sleeps or CPU work. */
41
+ export declare function resultBarrier(store: MemoryStore, options?: {
42
+ pauseFirstOnly?: boolean;
43
+ }): {
44
+ createWorker: (events: import("./semantic-worker-queue.js").WorkerEvents) => import("./semantic-worker-queue.js").WorkerTransport;
45
+ ranked: Promise<void>;
46
+ output: () => RankOutput | null | undefined;
47
+ release: () => void;
48
+ };
49
+ /** A foreign replica has no local-creation proof or local-origin exemption. */
50
+ export declare function seedForeignScopeReplica(fixture: Fixture, authority: "invite" | "coordinator"): {
51
+ scopeId: string;
52
+ memoryId: number;
53
+ };
54
+ export {};
55
+ //# sourceMappingURL=semantic-worker-test-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-worker-test-fixtures.d.ts","sourceRoot":"","sources":["../../src/semantic/semantic-worker-test-fixtures.ts"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,kBAAkB,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAA0B,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,+BAA+B,CAAC;AAQ7E,eAAO,MAAM,OAAO;IACnB,KAAK;IACL,KAAK;IACL,OAAO;IACP,gBAAgB;CAChB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,CAAC;;qBACH,CAAC,KAAK,IAAI;oBACX,OAAO,KAAK,IAAI;EAMrC;AAED,wBAAgB,UAAU,CAAC,KAAK,SAAI,GAAG,YAAY,CAKlD;AAwBD,wBAAgB,UAAU,CACzB,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,EACb,KAAK,SAAI,EACT,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,sBAAsB,CAAA;CAAO,QAkB1E;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,6DAMhE;AAED,UAAU,OAAO;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,GAAG,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC,GAAG,oBAAoB,CAAC;CAC5F;AAED,UAAU,cAAc;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAuD9E;AA4CD,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO;;;;;EAqC3F;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,GAAG,aAAa;;;EA0B5F"}
@@ -0,0 +1,10 @@
1
+ import type { Database } from "../db.js";
2
+ import { type AuditProgress, type VectorCatalog } from "./validated-vector-index-state.js";
3
+ /** One metadata census per generation; vector blobs are read only by bounded audit batches. */
4
+ export declare function startAudit(db: Database, options: {
5
+ knownModels: readonly string[];
6
+ }): VectorCatalog;
7
+ export declare function auditBatch(db: Database, options: {
8
+ limit: number;
9
+ }): AuditProgress;
10
+ //# sourceMappingURL=validated-vector-index-audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validated-vector-index-audit.d.ts","sourceRoot":"","sources":["../../src/semantic/validated-vector-index-audit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EACN,KAAK,aAAa,EASlB,KAAK,aAAa,EAClB,MAAM,mCAAmC,CAAC;AAM3C,+FAA+F;AAC/F,wBAAgB,UAAU,CACzB,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE;IAAE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACzC,aAAa,CAwBf;AAuBD,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CA0BlF"}
@@ -0,0 +1,23 @@
1
+ import type { Database } from "../db.js";
2
+ import { type VectorRowInput } from "./semantic-ranking.js";
3
+ import { type IndexedRow, type VectorCatalog } from "./validated-vector-index-state.js";
4
+ import { type InsertStatements, type RemoveStatements } from "./validated-vector-index-statements.js";
5
+ export interface ValidatedBatch {
6
+ writerVersion: 1;
7
+ expectedModel: string;
8
+ model: string;
9
+ expectedCount: number;
10
+ mode: "append" | "replace-memory-model";
11
+ rows: readonly VectorRowInput[];
12
+ }
13
+ export declare function requireModel(model: string): void;
14
+ export declare function requireVectorMetadata(row: Omit<VectorRowInput, "vector">): void;
15
+ export declare function removeRow(statements: RemoveStatements, row: IndexedRow): void;
16
+ export declare function insertRow(statements: InsertStatements, row: Omit<VectorRowInput, "vector">, model: string, bytes: Buffer): void;
17
+ export declare function writeValidatedBatch(db: Database, batch: ValidatedBatch): VectorCatalog;
18
+ export declare function deleteValidatedVectors(db: Database, options: {
19
+ writerVersion: 1;
20
+ memoryId: number;
21
+ model: string | null;
22
+ }): VectorCatalog;
23
+ //# sourceMappingURL=validated-vector-index-mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validated-vector-index-mutations.d.ts","sourceRoot":"","sources":["../../src/semantic/validated-vector-index-mutations.ts"],"names":[],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