@codemem/core 0.46.0-alpha.2 → 0.46.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-types.d.ts +1 -0
- package/dist/api-types.d.ts.map +1 -1
- package/dist/{coordinator-api-BToPmSNg.js → coordinator-api-CdUQtf5l.js} +565 -541
- package/dist/coordinator-api-CdUQtf5l.js.map +1 -0
- package/dist/coordinator-enrollment-reconciler.d.ts.map +1 -1
- package/dist/coordinator-runtime.d.ts.map +1 -1
- package/dist/database-runtime-primitives.d.ts +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/device-identity-binding.d.ts +2 -0
- package/dist/device-identity-binding.d.ts.map +1 -1
- package/dist/device-identity-inventory.d.ts.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11930 -10072
- package/dist/index.js.map +1 -1
- package/dist/internal/cloudflare-coordinator.js +1 -1
- package/dist/legacy-recipient-policy-projection.d.ts.map +1 -1
- package/dist/legacy-team-candidate.d.ts.map +1 -1
- package/dist/legacy-team-setup-activation.d.ts +0 -4
- package/dist/legacy-team-setup-activation.d.ts.map +1 -1
- package/dist/legacy-team-setup-completion-manifest.d.ts.map +1 -1
- package/dist/memory-ownership-recovery-schema.d.ts +3 -0
- package/dist/memory-ownership-recovery-schema.d.ts.map +1 -0
- package/dist/memory-ownership-recovery.d.ts +77 -0
- package/dist/memory-ownership-recovery.d.ts.map +1 -0
- package/dist/memory-retirement-delivery-schema.d.ts +3 -0
- package/dist/memory-retirement-delivery-schema.d.ts.map +1 -0
- package/dist/memory-retirement-delivery.d.ts +70 -0
- package/dist/memory-retirement-delivery.d.ts.map +1 -0
- package/dist/memory-retirement-reset.d.ts +48 -0
- package/dist/memory-retirement-reset.d.ts.map +1 -0
- package/dist/memory-retirement-snapshot-guard.d.ts +4 -0
- package/dist/memory-retirement-snapshot-guard.d.ts.map +1 -0
- package/dist/memory-retirement-trust.d.ts +13 -0
- package/dist/memory-retirement-trust.d.ts.map +1 -0
- package/dist/memory-scope-retirement.d.ts +24 -0
- package/dist/memory-scope-retirement.d.ts.map +1 -0
- package/dist/memory-source-identity.d.ts +26 -0
- package/dist/memory-source-identity.d.ts.map +1 -0
- package/dist/observer-client.d.ts +6 -2
- package/dist/observer-client.d.ts.map +1 -1
- package/dist/observer-config.d.ts +3 -1
- package/dist/observer-config.d.ts.map +1 -1
- package/dist/project-scope-settings.d.ts +28 -3
- package/dist/project-scope-settings.d.ts.map +1 -1
- package/dist/project.d.ts +1 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/recipient-policy-edges.d.ts.map +1 -1
- package/dist/recipient-policy-intent.d.ts.map +1 -1
- package/dist/recipient-policy-migration.d.ts.map +1 -1
- package/dist/recipient-policy-onboarding.d.ts.map +1 -1
- package/dist/recipient-policy-reconciler.d.ts.map +1 -1
- package/dist/recipient-policy-reconciliation.d.ts.map +1 -1
- package/dist/recipient-policy-review.d.ts.map +1 -1
- package/dist/repository-discovery-cache.d.ts +10 -0
- package/dist/repository-discovery-cache.d.ts.map +1 -0
- package/dist/repository-discovery-index.d.ts +14 -0
- package/dist/repository-discovery-index.d.ts.map +1 -0
- package/dist/repository-mapping-aliases.d.ts +48 -0
- package/dist/repository-mapping-aliases.d.ts.map +1 -0
- package/dist/schema-bootstrap.d.ts.map +1 -1
- package/dist/schema.d.ts +34 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/scope-resolution.d.ts +5 -1
- package/dist/scope-resolution.d.ts.map +1 -1
- package/dist/scope-stamping.d.ts.map +1 -1
- package/dist/share-operation.d.ts.map +1 -1
- package/dist/share-provisioning.d.ts +1 -0
- package/dist/share-provisioning.d.ts.map +1 -1
- package/dist/store.d.ts +2 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/sync-bootstrap.d.ts +6 -1
- package/dist/sync-bootstrap.d.ts.map +1 -1
- package/dist/sync-capability.d.ts +1 -1
- package/dist/sync-capability.d.ts.map +1 -1
- package/dist/sync-replication.d.ts +2 -18
- package/dist/sync-replication.d.ts.map +1 -1
- package/dist/test-schema.generated.d.ts +1 -1
- package/dist/test-schema.generated.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/coordinator-api-BToPmSNg.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-bootstrap.d.ts","sourceRoot":"","sources":["../src/sync-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-bootstrap.d.ts","sourceRoot":"","sources":["../src/sync-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,OAAO,EAAsB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAcxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAM1E,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AASD,MAAM,WAAW,gBAAgB;IAChC,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAqDD;;;GAGG;AACH,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC;IACV,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC,CAsED;AA0ND;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,QAAQ,EACZ,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,sBAAsB,EAAE,EAC/B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,CAAC,EAAE,aAAa,GACrB,eAAe,CAuFjB;AAqCD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,QAAQ,EACZ,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,sBAAsB,EAAE,EAC/B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE;IAAE,YAAY,EAAE,UAAU,CAAA;CAAE,GACpC,eAAe,CA4DjB"}
|
|
@@ -9,7 +9,7 @@ export declare const SYNC_CAPABILITIES: readonly ["unsupported", "aware", "enfor
|
|
|
9
9
|
export declare const SYNC_CAPABILITY_HEADER = "X-Codemem-Sync-Capability";
|
|
10
10
|
export declare const SYNC_FEATURES_HEADER = "X-Codemem-Sync-Features";
|
|
11
11
|
export declare const SYNC_AUTHORIZATION_REFRESH_HEADER = "X-Codemem-Refresh-Authorization";
|
|
12
|
-
export declare const SYNC_FEATURES: readonly ["reassign_scope"];
|
|
12
|
+
export declare const SYNC_FEATURES: readonly ["reassign_scope", "memory_scope_retirement_v1"];
|
|
13
13
|
export declare const LOCAL_SYNC_FEATURES: readonly SyncFeature[];
|
|
14
14
|
export type SyncCapability = (typeof SYNC_CAPABILITIES)[number];
|
|
15
15
|
export type SyncFeature = (typeof SYNC_FEATURES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-capability.d.ts","sourceRoot":"","sources":["../src/sync-capability.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,iBAAiB,YAAI,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAE1F,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAC9D,eAAO,MAAM,iCAAiC,oCAAoC,CAAC;AACnF,eAAO,MAAM,aAAa,YAAI,gBAAgB,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-capability.d.ts","sourceRoot":"","sources":["../src/sync-capability.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,iBAAiB,YAAI,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAE1F,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAC9D,eAAO,MAAM,iCAAiC,oCAAoC,CAAC;AACnF,eAAO,MAAM,aAAa,YAAI,gBAAgB,EAAE,4BAA4B,CAAU,CAAC;AAEvF,eAAO,MAAM,mBAAmB,EAAE,SAAS,WAAW,EAAuB,CAAC;AAE9E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,EAAE,CASnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAEjF;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAyB,CAAC;AAS9D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAE1E;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAMtE;AAED,wBAAgB,uBAAuB,CACtC,eAAe,EAAE,OAAO,EACxB,cAAc,EAAE,OAAO,GACrB,cAAc,CAIhB"}
|
|
@@ -49,6 +49,8 @@ export type LoadReplicationOpsForPeerResult = {
|
|
|
49
49
|
reset: SyncResetRequired;
|
|
50
50
|
};
|
|
51
51
|
export interface LoadMemorySnapshotPageForPeerOptions {
|
|
52
|
+
/** Direct-source reset lane; the HTTP caller must require its own local device ID. */
|
|
53
|
+
sourceDeviceId?: string;
|
|
52
54
|
limit?: number;
|
|
53
55
|
pageToken?: string | null;
|
|
54
56
|
peerDeviceId?: string | null;
|
|
@@ -245,13 +247,6 @@ export interface FilterReplicationOpsForSyncOptions {
|
|
|
245
247
|
applyScopeFilter?: boolean;
|
|
246
248
|
supportsReassignScope?: boolean;
|
|
247
249
|
}
|
|
248
|
-
/**
|
|
249
|
-
* Filter replication ops for peer sync scopes.
|
|
250
|
-
*
|
|
251
|
-
* Returns ops that pass project/visibility rules, a cursor for the last
|
|
252
|
-
* processed op (including skipped ops), and skipped metadata when filtering
|
|
253
|
-
* removed one or more ops.
|
|
254
|
-
*/
|
|
255
250
|
export declare function filterReplicationOpsForSyncWithStatus(db: Database, ops: ReplicationOp[], peerDeviceId: string | null, options?: FilterReplicationOpsForSyncOptions): [ReplicationOp[], string | null, FilterReplicationSkipped | null];
|
|
256
251
|
export declare function filterReplicationOpsForSync(db: Database, ops: ReplicationOp[], peerDeviceId: string | null, options?: FilterReplicationOpsForSyncOptions): [ReplicationOp[], string | null];
|
|
257
252
|
export interface ApplyResult {
|
|
@@ -360,17 +355,6 @@ export declare function migrateLegacyImportKeys(db: Database, limit?: number): n
|
|
|
360
355
|
* generates ops when a matching op for the same entity/rev/op_type is missing.
|
|
361
356
|
*/
|
|
362
357
|
export declare function backfillReplicationOps(db: Database, limit?: number): number;
|
|
363
|
-
/**
|
|
364
|
-
* Apply inbound replication ops from a remote peer.
|
|
365
|
-
*
|
|
366
|
-
* Runs all ops in a single transaction. For each op:
|
|
367
|
-
* - Skips if device_id matches localDeviceId (don't re-apply own ops)
|
|
368
|
-
* - Skips if op_id already exists (idempotent)
|
|
369
|
-
* - For upsert: finds existing memory by import_key; if existing has a newer
|
|
370
|
-
* clock, counts as conflict and skips; otherwise INSERT or UPDATE
|
|
371
|
-
* - For delete: soft-deletes (active=0, deleted_at) by import_key
|
|
372
|
-
* - Records the applied op in replication_ops
|
|
373
|
-
*/
|
|
374
358
|
export declare function applyReplicationOps(db: Database, ops: ReplicationOp[], localDeviceId: string, scanner?: SecretScanner, options?: ApplyReplicationOpsOptions): ApplyResult;
|
|
375
359
|
export {};
|
|
376
360
|
//# sourceMappingURL=sync-replication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-replication.d.ts","sourceRoot":"","sources":["../src/sync-replication.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AASxC,OAAO,EAAsB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EACX,aAAa,EACb,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AACrD,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,4CAA4C,+CACZ,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,EAAE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;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,EAAE,EAAE,QAAQ,EACZ,OAAO,GAAE,iCAAsC,GAC7C,2BAA2B,EAAE,CA+C/B;AAaD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,SAAO,GAAG,MAAM,CAqE1E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,SAAM,GAAG,MAAM,CAiIxE;AAqFD,wBAAgB,mBAAmB,CAClC,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE,aAAa,EAAE,EACpB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,GAAE,0BAA+B,GACtC,WAAW,CAubb"}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* Do not edit manually. Regenerate with:
|
|
5
5
|
* pnpm --filter @codemem/core run generate:test-schema
|
|
6
6
|
*/
|
|
7
|
-
export declare const TEST_SCHEMA_BASE_DDL = "CREATE TABLE IF NOT EXISTS `device_identity_binding_commits` (\n\t`commit_digest` text PRIMARY KEY NOT NULL,\n\t`reviewed_inventory_digest` text NOT NULL,\n\t`request_json` text NOT NULL,\n\t`outcomes_json` text NOT NULL,\n\t`write_count` integer NOT NULL,\n\t`decided_by_identity_id` text NOT NULL,\n\t`decided_by_device_id` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `device_identity_binding_audit` (\n\t`event_id` text PRIMARY KEY NOT NULL,\n\t`commit_digest` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`previous_identity_id` text,\n\t`target_identity_id` text NOT NULL,\n\t`action` text NOT NULL,\n\t`previous_assignment_version` integer,\n\t`resulting_assignment_version` integer NOT NULL,\n\t`decided_by_identity_id` text NOT NULL,\n\t`decided_by_device_id` text NOT NULL,\n\t`created_at` text NOT NULL,\n\tFOREIGN KEY (`commit_digest`) REFERENCES `device_identity_binding_commits`(`commit_digest`) ON UPDATE no action ON DELETE no action\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_device_identity_binding_audit_commit_device` ON `device_identity_binding_audit` (`commit_digest`,`device_id`);\nCREATE INDEX IF NOT EXISTS `idx_device_identity_binding_audit_device_created` ON `device_identity_binding_audit` (`device_id`,`created_at`,`event_id`);\nCREATE TABLE IF NOT EXISTS `sessions` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`started_at` text NOT NULL,\n\t`ended_at` text,\n\t`cwd` text,\n\t`project` text,\n\t`git_remote` text,\n\t`git_branch` text,\n\t`user` text,\n\t`tool_version` text,\n\t`metadata_json` text,\n\t`import_key` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_sessions_started_id` ON `sessions` (`started_at`,`id`);\nCREATE TABLE IF NOT EXISTS `replication_scopes` (\n\t`scope_id` text PRIMARY KEY NOT NULL,\n\t`label` text NOT NULL,\n\t`kind` text DEFAULT 'user' NOT NULL,\n\t`authority_type` text DEFAULT 'local' NOT NULL,\n\t`coordinator_id` text,\n\t`group_id` text,\n\t`manifest_issuer_device_id` text,\n\t`membership_epoch` integer DEFAULT 0 NOT NULL,\n\t`manifest_hash` text,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_replication_scopes_status` ON `replication_scopes` (`status`);\nCREATE INDEX IF NOT EXISTS `idx_replication_scopes_authority_group` ON `replication_scopes` (`coordinator_id`,`group_id`);\nCREATE TABLE IF NOT EXISTS `project_scope_mappings` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`workspace_identity` text,\n\t`project_pattern` text NOT NULL,\n\t`scope_id` text NOT NULL,\n\t`priority` integer DEFAULT 0 NOT NULL,\n\t`source` text DEFAULT 'user' NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_project_scope_mappings_workspace_priority` ON `project_scope_mappings` (`workspace_identity`,`priority`);\nCREATE INDEX IF NOT EXISTS `idx_project_scope_mappings_pattern_priority` ON `project_scope_mappings` (`project_pattern`,`priority`);\nCREATE INDEX IF NOT EXISTS `idx_project_scope_mappings_scope` ON `project_scope_mappings` (`scope_id`);\nCREATE TABLE IF NOT EXISTS `scope_memberships` (\n\t`scope_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`role` text DEFAULT 'member' NOT NULL,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`membership_epoch` integer DEFAULT 0 NOT NULL,\n\t`coordinator_id` text,\n\t`group_id` text,\n\t`manifest_issuer_device_id` text,\n\t`manifest_hash` text,\n\t`signed_manifest_json` text,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`scope_id`, `device_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_scope_memberships_device_status` ON `scope_memberships` (`device_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_scope_memberships_scope_status` ON `scope_memberships` (`scope_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_scope_memberships_authority_group` ON `scope_memberships` (`coordinator_id`,`group_id`);\nCREATE TABLE IF NOT EXISTS `artifacts` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer NOT NULL,\n\t`kind` text NOT NULL,\n\t`path` text,\n\t`content_text` text,\n\t`content_hash` text,\n\t`created_at` text NOT NULL,\n\t`metadata_json` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_artifacts_session_kind` ON `artifacts` (`session_id`,`kind`);\nCREATE TABLE IF NOT EXISTS `memory_items` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer NOT NULL,\n\t`kind` text NOT NULL,\n\t`title` text NOT NULL,\n\t`subtitle` text,\n\t`body_text` text NOT NULL,\n\t`confidence` real DEFAULT 0.5,\n\t`tags_text` text DEFAULT '',\n\t`active` integer DEFAULT 1,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\t`metadata_json` text,\n\t`actor_id` text,\n\t`actor_display_name` text,\n\t`visibility` text,\n\t`workspace_id` text,\n\t`workspace_kind` text,\n\t`origin_device_id` text,\n\t`origin_source` text,\n\t`trust_state` text,\n\t`facts` text,\n\t`narrative` text,\n\t`concepts` text,\n\t`files_read` text,\n\t`files_modified` text,\n\t`user_prompt_id` integer,\n\t`prompt_number` integer,\n\t`deleted_at` text,\n\t`rev` integer DEFAULT 0,\n\t`dedup_key` text,\n\t`import_key` text,\n\t`scope_id` text,\n\t`project` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_memory_items_active_created` ON `memory_items` (`active`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_created_id` ON `memory_items` (`created_at`,`id`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_origin_device_active` ON `memory_items` (`origin_device_id`,`active`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_session` ON `memory_items` (`session_id`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_project` ON `memory_items` (`project`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_scope_visibility_created` ON `memory_items` (`scope_id`,`visibility`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_scope_backfill_pending` ON `memory_items` (`id`) WHERE scope_id IS NULL OR scope_id = '';\nCREATE INDEX IF NOT EXISTS `idx_memory_items_dedup_key_active_created` ON `memory_items` (`dedup_key`,`active`,`created_at`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_memory_items_same_session_dedup_unique` ON `memory_items` (`session_id`,`kind`,`visibility`,`workspace_id`,`dedup_key`) WHERE active = 1 AND dedup_key IS NOT NULL;\nCREATE TABLE IF NOT EXISTS `memory_file_refs` (\n\t`memory_id` integer NOT NULL,\n\t`file_path` text NOT NULL,\n\t`relation` text NOT NULL,\n\tPRIMARY KEY(`memory_id`, `file_path`, `relation`),\n\tFOREIGN KEY (`memory_id`) REFERENCES `memory_items`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_memory_file_refs_path` ON `memory_file_refs` (`file_path`);\nCREATE TABLE IF NOT EXISTS `memory_concept_refs` (\n\t`memory_id` integer NOT NULL,\n\t`concept` text NOT NULL,\n\tPRIMARY KEY(`memory_id`, `concept`),\n\tFOREIGN KEY (`memory_id`) REFERENCES `memory_items`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_memory_concept_refs_concept` ON `memory_concept_refs` (`concept`);\nCREATE TABLE IF NOT EXISTS `usage_events` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer,\n\t`event` text NOT NULL,\n\t`tokens_read` integer DEFAULT 0,\n\t`tokens_written` integer DEFAULT 0,\n\t`tokens_saved` integer DEFAULT 0,\n\t`created_at` text NOT NULL,\n\t`metadata_json` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null\n);\n\nCREATE INDEX IF NOT EXISTS `idx_usage_events_event_created` ON `usage_events` (`event`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_usage_events_session` ON `usage_events` (`session_id`);\nCREATE TABLE IF NOT EXISTS `retrieval_attempts` (\n\t`attempt_id` text PRIMARY KEY NOT NULL,\n\t`contract_version` integer NOT NULL,\n\t`surface` text NOT NULL,\n\t`trigger` text NOT NULL,\n\t`started_at` text NOT NULL,\n\t`completed_at` text,\n\t`retrieval_status` text NOT NULL,\n\t`delivery_status` text NOT NULL,\n\t`candidate_count` integer NOT NULL,\n\t`selected_count` integer NOT NULL,\n\t`persisted_candidate_count` integer NOT NULL,\n\t`recorder_version` text NOT NULL,\n\t`session_id` integer,\n\t`source` text,\n\t`stream_id` text,\n\t`source_session_id` text,\n\t`prompt_number` integer,\n\t`request_id` text,\n\t`raw_event_start_seq` integer,\n\t`raw_event_end_seq` integer,\n\t`experiment_id` text,\n\t`experiment_cell_id` text,\n\t`evaluation_checkout_id` text,\n\t`evaluation_fixture_id` text,\n\t`evaluation_seed` integer,\n\t`latency_ms` integer,\n\t`project` text,\n\t`scope_id` text,\n\t`mode` text,\n\t`limit_requested` integer,\n\t`token_budget` integer,\n\t`output_tokens` integer,\n\t`working_set_file_count` integer,\n\t`working_set_files_json` text,\n\t`query_hash_sha256` text,\n\t`query_char_count` integer,\n\t`query_token_estimate` integer,\n\t`filter_summary_json` text,\n\t`failure_code` text,\n\t`failure_stage` text,\n\t`trace_version` integer,\n\t`automatic_recall_json` text,\n\t`automatic_recall_key` text,\n\t`retention_until` text,\n\t`retention_pinned` integer DEFAULT 0 NOT NULL,\n\t`retention_finalized_at` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_session_started` ON `retrieval_attempts` (`session_id`,`started_at`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_retrieval_attempts_automatic_recall_key` ON `retrieval_attempts` (`automatic_recall_key`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_source_stream_started` ON `retrieval_attempts` (`source`,`stream_id`,`started_at`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_retention` ON `retrieval_attempts` (`retention_pinned`,`retention_until`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_started` ON `retrieval_attempts` (`started_at`,`attempt_id`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_surface_started` ON `retrieval_attempts` (`surface`,`started_at`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_retrieval_attempts_request_identity` ON `retrieval_attempts` (`source`,`surface`,`request_id`) WHERE request_id IS NOT NULL;\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_experiment_cell` ON `retrieval_attempts` (`experiment_id`,`experiment_cell_id`);\nCREATE TABLE IF NOT EXISTS `retrieval_exposures` (\n\t`exposure_id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`attempt_id` text NOT NULL,\n\t`memory_id` integer,\n\t`memory_import_key` text,\n\t`origin_device_id` text,\n\t`rank` integer NOT NULL,\n\t`disposition` text NOT NULL,\n\t`section` text,\n\t`handoff_status` text NOT NULL,\n\t`memory_rev` integer,\n\t`memory_updated_at` text,\n\t`memory_scope_id` text,\n\t`memory_kind` text,\n\t`memory_active` integer,\n\t`memory_deleted_at` text,\n\t`score_summary_json` text,\n\t`reason_codes_json` text,\n\tFOREIGN KEY (`attempt_id`) REFERENCES `retrieval_attempts`(`attempt_id`) ON UPDATE no action ON DELETE cascade,\n\tFOREIGN KEY (`memory_id`) REFERENCES `memory_items`(`id`) ON UPDATE no action ON DELETE set null\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_retrieval_exposures_attempt_rank` ON `retrieval_exposures` (`attempt_id`,`rank`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_exposures_memory` ON `retrieval_exposures` (`memory_id`);\nCREATE TABLE IF NOT EXISTS `outcome_evidence` (\n\t`evidence_id` text PRIMARY KEY NOT NULL,\n\t`contract_version` integer NOT NULL,\n\t`dimension` text NOT NULL,\n\t`evidence_type` text NOT NULL,\n\t`source_class` text NOT NULL,\n\t`observed_at` text NOT NULL,\n\t`producer` text NOT NULL,\n\t`producer_version` text NOT NULL,\n\t`status` text NOT NULL,\n\t`value_type` text,\n\t`value_integer` integer,\n\t`value_real` real,\n\t`value_unit` text,\n\t`session_id` integer,\n\t`source` text,\n\t`stream_id` text,\n\t`source_session_id` text,\n\t`prompt_number` integer,\n\t`raw_event_start_seq` integer,\n\t`raw_event_end_seq` integer,\n\t`experiment_id` text,\n\t`experiment_cell_id` text,\n\t`window_start_at` text,\n\t`window_end_at` text,\n\t`references_json` text,\n\t`retention_until` text,\n\t`retention_pinned` integer DEFAULT 0 NOT NULL,\n\t`retention_finalized_at` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_observed_id` ON `outcome_evidence` (`observed_at`,`evidence_id`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_session_observed` ON `outcome_evidence` (`session_id`,`observed_at`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_source_stream_observed` ON `outcome_evidence` (`source`,`stream_id`,`observed_at`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_type_observed` ON `outcome_evidence` (`evidence_type`,`observed_at`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_retention` ON `outcome_evidence` (`retention_pinned`,`retention_until`);\nCREATE TABLE IF NOT EXISTS `attribution_assessments` (\n\t`assessment_id` text PRIMARY KEY NOT NULL,\n\t`contract_version` integer NOT NULL,\n\t`subject_type` text NOT NULL,\n\t`attempt_id` text NOT NULL,\n\t`exposure_id` integer,\n\t`dimension` text NOT NULL,\n\t`impact_label` text NOT NULL,\n\t`basis` text NOT NULL,\n\t`confidence_level` text NOT NULL,\n\t`method` text NOT NULL,\n\t`method_version` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`claim_type` text DEFAULT 'observational' NOT NULL,\n\tFOREIGN KEY (`attempt_id`) REFERENCES `retrieval_attempts`(`attempt_id`) ON UPDATE no action ON DELETE cascade,\n\tFOREIGN KEY (`exposure_id`) REFERENCES `retrieval_exposures`(`exposure_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessments_attempt_created` ON `attribution_assessments` (`attempt_id`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessments_label_created` ON `attribution_assessments` (`impact_label`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessments_exposure` ON `attribution_assessments` (`exposure_id`);\nCREATE TABLE IF NOT EXISTS `attribution_assessment_evidence` (\n\t`assessment_id` text NOT NULL,\n\t`evidence_id` text NOT NULL,\n\tPRIMARY KEY(`assessment_id`, `evidence_id`),\n\tFOREIGN KEY (`assessment_id`) REFERENCES `attribution_assessments`(`assessment_id`) ON UPDATE no action ON DELETE cascade,\n\tFOREIGN KEY (`evidence_id`) REFERENCES `outcome_evidence`(`evidence_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessment_evidence_evidence` ON `attribution_assessment_evidence` (`evidence_id`,`assessment_id`);\nCREATE TABLE IF NOT EXISTS `raw_events` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`event_id` text,\n\t`event_seq` integer NOT NULL,\n\t`event_type` text NOT NULL,\n\t`ts_wall_ms` integer,\n\t`ts_mono_ms` real,\n\t`payload_json` text NOT NULL,\n\t`capture_context_json` text,\n\t`created_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_raw_events_source_stream_seq` ON `raw_events` (`source`,`stream_id`,`event_seq`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_raw_events_source_stream_event_id` ON `raw_events` (`source`,`stream_id`,`event_id`);\nCREATE INDEX IF NOT EXISTS `idx_raw_events_session_seq` ON `raw_events` (`opencode_session_id`,`event_seq`);\nCREATE INDEX IF NOT EXISTS `idx_raw_events_created` ON `raw_events` (`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_raw_events_capture_context` ON `raw_events` (`source`,`stream_id`,`event_seq`) WHERE \"raw_events\".\"capture_context_json\" IS NOT NULL;\nCREATE TABLE IF NOT EXISTS `raw_event_sessions` (\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`cwd` text,\n\t`project` text,\n\t`started_at` text,\n\t`last_seen_ts_wall_ms` integer,\n\t`last_received_event_seq` integer DEFAULT -1 NOT NULL,\n\t`last_flushed_event_seq` integer DEFAULT -1 NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`source`, `stream_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_raw_event_sessions_pending_updated` ON `raw_event_sessions` (`updated_at`) WHERE \"raw_event_sessions\".\"last_received_event_seq\" > \"raw_event_sessions\".\"last_flushed_event_seq\";\nCREATE TABLE IF NOT EXISTS `opencode_sessions` (\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`session_id` integer,\n\t`created_at` text NOT NULL,\n\tPRIMARY KEY(`source`, `stream_id`),\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_opencode_sessions_session` ON `opencode_sessions` (`session_id`);\nCREATE TABLE IF NOT EXISTS `raw_event_flush_batches` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`start_event_seq` integer NOT NULL,\n\t`end_event_seq` integer NOT NULL,\n\t`extractor_version` text NOT NULL,\n\t`status` text NOT NULL,\n\t`error_message` text,\n\t`error_type` text,\n\t`observer_provider` text,\n\t`observer_model` text,\n\t`observer_runtime` text,\n\t`observer_auth_source` text,\n\t`observer_auth_type` text,\n\t`observer_error_code` text,\n\t`observer_error_message` text,\n\t`attempt_count` integer DEFAULT 0 NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_flush_batches_source_stream_seq_ver` ON `raw_event_flush_batches` (`source`,`stream_id`,`start_event_seq`,`end_event_seq`,`extractor_version`);\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_session_created` ON `raw_event_flush_batches` (`opencode_session_id`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_status_updated` ON `raw_event_flush_batches` (`status`,`updated_at`);\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_observer_status_updated` ON `raw_event_flush_batches` (`status`,`updated_at`) WHERE \"raw_event_flush_batches\".\"observer_provider\" IS NOT NULL;\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_capture_status_updated` ON `raw_event_flush_batches` (`status`,`updated_at`) WHERE \"raw_event_flush_batches\".\"observer_provider\" IS NULL;\nCREATE TABLE IF NOT EXISTS `user_prompts` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer,\n\t`project` text,\n\t`prompt_text` text NOT NULL,\n\t`prompt_number` integer,\n\t`created_at` text NOT NULL,\n\t`created_at_epoch` integer NOT NULL,\n\t`metadata_json` text,\n\t`import_key` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_user_prompts_session` ON `user_prompts` (`session_id`);\nCREATE INDEX IF NOT EXISTS `idx_user_prompts_project` ON `user_prompts` (`project`);\nCREATE INDEX IF NOT EXISTS `idx_user_prompts_epoch` ON `user_prompts` (`created_at_epoch`);\nCREATE TABLE IF NOT EXISTS `session_summaries` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer,\n\t`project` text,\n\t`request` text,\n\t`investigated` text,\n\t`learned` text,\n\t`completed` text,\n\t`next_steps` text,\n\t`notes` text,\n\t`files_read` text,\n\t`files_edited` text,\n\t`prompt_number` integer,\n\t`created_at` text NOT NULL,\n\t`created_at_epoch` integer NOT NULL,\n\t`metadata_json` text,\n\t`import_key` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_session_summaries_session` ON `session_summaries` (`session_id`);\nCREATE INDEX IF NOT EXISTS `idx_session_summaries_project` ON `session_summaries` (`project`);\nCREATE INDEX IF NOT EXISTS `idx_session_summaries_epoch` ON `session_summaries` (`created_at_epoch`);\nCREATE TABLE IF NOT EXISTS `replication_ops` (\n\t`op_id` text PRIMARY KEY NOT NULL,\n\t`entity_type` text NOT NULL,\n\t`entity_id` text NOT NULL,\n\t`op_type` text NOT NULL,\n\t`payload_json` text,\n\t`clock_rev` integer NOT NULL,\n\t`clock_updated_at` text NOT NULL,\n\t`clock_device_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`scope_id` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_replication_ops_created` ON `replication_ops` (`created_at`,`op_id`);\nCREATE INDEX IF NOT EXISTS `idx_replication_ops_entity` ON `replication_ops` (`entity_type`,`entity_id`);\nCREATE INDEX IF NOT EXISTS `idx_replication_ops_scope_created` ON `replication_ops` (`scope_id`,`created_at`,`op_id`);\nCREATE TABLE IF NOT EXISTS `replication_cursors` (\n\t`peer_device_id` text PRIMARY KEY NOT NULL,\n\t`last_applied_cursor` text,\n\t`last_acked_cursor` text,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `replication_cursors_v2` (\n\t`peer_device_id` text NOT NULL,\n\t`scope_id` text NOT NULL,\n\t`last_applied_cursor` text,\n\t`last_acked_cursor` text,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`peer_device_id`, `scope_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_replication_cursors_v2_scope` ON `replication_cursors_v2` (`scope_id`);\nCREATE TABLE IF NOT EXISTS `sync_peers` (\n\t`peer_device_id` text PRIMARY KEY NOT NULL,\n\t`name` text,\n\t`pinned_fingerprint` text,\n\t`public_key` text,\n\t`addresses_json` text,\n\t`claimed_local_actor` integer DEFAULT 0 NOT NULL,\n\t`actor_id` text,\n\t`projects_include_json` text,\n\t`projects_exclude_json` text,\n\t`created_at` text NOT NULL,\n\t`last_seen_at` text,\n\t`last_sync_at` text,\n\t`last_error` text,\n\t`runtime_version` text,\n\t`runtime_version_observed_at` text,\n\t`highest_observed_direct_signature_version` integer,\n\t`discovered_via_coordinator_id` text,\n\t`discovered_via_group_id` text,\n\t`trust_provenance` text,\n\t`pending_bootstrap_grant_id` text\n);\n\nCREATE TABLE IF NOT EXISTS `sync_nonces` (\n\t`nonce` text PRIMARY KEY NOT NULL,\n\t`device_id` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_device` (\n\t`device_id` text PRIMARY KEY NOT NULL,\n\t`public_key` text NOT NULL,\n\t`fingerprint` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_attempts` (\n\t`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`peer_device_id` text NOT NULL,\n\t`started_at` text NOT NULL,\n\t`finished_at` text,\n\t`ok` integer NOT NULL,\n\t`ops_in` integer NOT NULL,\n\t`ops_out` integer NOT NULL,\n\t`error` text,\n\t`local_sync_capability` text,\n\t`peer_sync_capability` text,\n\t`negotiated_sync_capability` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_peer_started` ON `sync_attempts` (`peer_device_id`,`started_at`);\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_occurred` ON `sync_attempts` (CASE WHEN \"finished_at\" IS NULL THEN \"started_at\" ELSE \"finished_at\" END,`id`);\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_error_occurred` ON `sync_attempts` (CASE WHEN \"finished_at\" IS NULL THEN \"started_at\" ELSE \"finished_at\" END,`id`) WHERE \"sync_attempts\".\"ok\" = 0;\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_success_occurred` ON `sync_attempts` (CASE WHEN \"finished_at\" IS NULL THEN \"started_at\" ELSE \"finished_at\" END,`id`) WHERE \"sync_attempts\".\"ok\" <> 0;\nCREATE TABLE IF NOT EXISTS `sync_scope_rejections` (\n\t`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`peer_device_id` text,\n\t`op_id` text NOT NULL,\n\t`entity_type` text NOT NULL,\n\t`entity_id` text NOT NULL,\n\t`scope_id` text,\n\t`reason` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_sync_scope_rejections_peer_created` ON `sync_scope_rejections` (`peer_device_id`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_sync_scope_rejections_scope_created` ON `sync_scope_rejections` (`scope_id`,`created_at`);\nCREATE TABLE IF NOT EXISTS `sync_daemon_state` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`last_error` text,\n\t`last_traceback` text,\n\t`last_error_at` text,\n\t`last_ok_at` text,\n\t`phase` text\n);\n\nCREATE TABLE IF NOT EXISTS `sync_reset_state` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`generation` integer NOT NULL,\n\t`snapshot_id` text NOT NULL,\n\t`baseline_cursor` text,\n\t`retained_floor_cursor` text,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_reset_state_v2` (\n\t`scope_id` text PRIMARY KEY NOT NULL,\n\t`generation` integer NOT NULL,\n\t`snapshot_id` text NOT NULL,\n\t`baseline_cursor` text,\n\t`retained_floor_cursor` text,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_retention_state_v2` (\n\t`scope_id` text PRIMARY KEY NOT NULL,\n\t`last_run_at` text,\n\t`last_duration_ms` integer,\n\t`last_deleted_ops` integer DEFAULT 0 NOT NULL,\n\t`last_estimated_bytes_before` integer,\n\t`last_estimated_bytes_after` integer,\n\t`retained_floor_cursor` text,\n\t`last_error` text,\n\t`last_error_at` text\n);\n\nCREATE TABLE IF NOT EXISTS `raw_event_ingest_samples` (\n\t`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`created_at` text NOT NULL,\n\t`inserted_events` integer DEFAULT 0 NOT NULL,\n\t`skipped_invalid` integer DEFAULT 0 NOT NULL,\n\t`skipped_duplicate` integer DEFAULT 0 NOT NULL,\n\t`skipped_conflict` integer DEFAULT 0 NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `raw_event_ingest_stats` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`inserted_events` integer DEFAULT 0 NOT NULL,\n\t`skipped_events` integer DEFAULT 0 NOT NULL,\n\t`skipped_invalid` integer DEFAULT 0 NOT NULL,\n\t`skipped_duplicate` integer DEFAULT 0 NOT NULL,\n\t`skipped_conflict` integer DEFAULT 0 NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `coordinator_group_preferences` (\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`projects_include_json` text,\n\t`projects_exclude_json` text,\n\t`auto_seed_scope` integer DEFAULT 1 NOT NULL,\n\t`default_space_scope_id` text,\n\t`auto_grant_default_space_on_join` integer DEFAULT 0 NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`coordinator_id`, `group_id`)\n);\n\nCREATE TABLE IF NOT EXISTS `actors` (\n\t`actor_id` text PRIMARY KEY NOT NULL,\n\t`display_name` text NOT NULL,\n\t`is_local` integer DEFAULT 0 NOT NULL,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`merged_into_actor_id` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_actors_is_local` ON `actors` (`is_local`);\nCREATE INDEX IF NOT EXISTS `idx_actors_status` ON `actors` (`status`);\nCREATE TABLE IF NOT EXISTS `recipient_policy_review_resolutions` (\n\t`review_item_id` text NOT NULL,\n\t`source_fingerprint` text NOT NULL,\n\t`decision` text NOT NULL,\n\t`decision_input_json` text NOT NULL,\n\t`preview_json` text NOT NULL,\n\t`decided_by_identity_id` text NOT NULL,\n\t`decided_by_device_id` text NOT NULL,\n\t`resolved_at` text NOT NULL,\n\tPRIMARY KEY(`review_item_id`, `source_fingerprint`)\n);\n\nCREATE TABLE IF NOT EXISTS `coordinator_enrollment_reconciliation_issues` (\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`kind` text NOT NULL,\n\t`reference_id` text NOT NULL,\n\t`code` text NOT NULL,\n\t`status` text DEFAULT 'open' NOT NULL,\n\t`first_seen_at` text NOT NULL,\n\t`last_seen_at` text NOT NULL,\n\t`resolved_at` text,\n\t`occurrence_count` integer DEFAULT 1 NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`coordinator_id`, `group_id`, `kind`, `reference_id`, `code`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_coordinator_enrollment_issues_boundary_status` ON `coordinator_enrollment_reconciliation_issues` (`coordinator_id`,`group_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_coordinator_enrollment_issues_status_recent` ON `coordinator_enrollment_reconciliation_issues` (`status`,`last_seen_at`,`resolved_at`);\nCREATE TABLE IF NOT EXISTS `policy_teams` (\n\t`team_id` text PRIMARY KEY NOT NULL,\n\t`display_name` text NOT NULL,\n\t`status` text NOT NULL,\n\t`device_eligibility_mode` text DEFAULT 'person_all_devices' NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `policy_teams_idempotency_key_unique` ON `policy_teams` (`idempotency_key`);\nCREATE TABLE IF NOT EXISTS `policy_team_memberships` (\n\t`team_id` text NOT NULL,\n\t`identity_id` text NOT NULL,\n\t`role` text NOT NULL,\n\t`status` text NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`team_id`, `identity_id`)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `policy_team_memberships_idempotency_key_unique` ON `policy_team_memberships` (`idempotency_key`);\nCREATE INDEX IF NOT EXISTS `idx_policy_team_memberships_identity_status` ON `policy_team_memberships` (`identity_id`,`status`);\nCREATE TABLE IF NOT EXISTS `policy_team_device_decisions` (\n\t`team_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`decision` text NOT NULL,\n\t`assignment_version` integer DEFAULT 0 NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`team_id`, `device_id`),\n\tFOREIGN KEY (`team_id`) REFERENCES `policy_teams`(`team_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_policy_team_device_decisions_device` ON `policy_team_device_decisions` (`device_id`);\nCREATE TABLE IF NOT EXISTS `identity_devices` (\n\t`device_id` text PRIMARY KEY NOT NULL,\n\t`identity_id` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`status` text NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`assignment_version` integer DEFAULT 0 NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `identity_devices_idempotency_key_unique` ON `identity_devices` (`idempotency_key`);\nCREATE INDEX IF NOT EXISTS `idx_identity_devices_identity_status` ON `identity_devices` (`identity_id`,`status`);\nCREATE TABLE IF NOT EXISTS `project_recipients` (\n\t`canonical_project_identity` text NOT NULL,\n\t`recipient_kind` text NOT NULL,\n\t`recipient_id` text NOT NULL,\n\t`status` text NOT NULL,\n\t`provenance` text NOT NULL,\n\t`policy_revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`canonical_project_identity`, `recipient_kind`, `recipient_id`)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `project_recipients_idempotency_key_unique` ON `project_recipients` (`idempotency_key`);\nCREATE INDEX IF NOT EXISTS `idx_project_recipients_project_status` ON `project_recipients` (`canonical_project_identity`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_project_recipients_recipient_status` ON `project_recipients` (`recipient_kind`,`recipient_id`,`status`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_drafts` (\n\t`attempt_id` text PRIMARY KEY NOT NULL,\n\t`candidate_id` text NOT NULL,\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`state` text DEFAULT 'needs_setup' NOT NULL,\n\t`display_name` text NOT NULL,\n\t`roster_fingerprint` text NOT NULL,\n\t`projection_fingerprint` text NOT NULL,\n\t`finish_digest` text,\n\t`safe_error_code` text,\n\t`completed_team_id` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\t`completed_at` text,\n\t`superseded_at` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_drafts_candidate_state` ON `legacy_team_setup_drafts` (`candidate_id`,`state`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_drafts_state_updated` ON `legacy_team_setup_drafts` (`state`,`updated_at`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_drafts_finish_digest` ON `legacy_team_setup_drafts` (`finish_digest`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_completions` (\n\t`attempt_id` text NOT NULL,\n\t`finish_digest` text NOT NULL,\n\t`candidate_ref` text NOT NULL,\n\t`confirmed_access_delta_digest` text NOT NULL,\n\t`completed_team_id` text NOT NULL,\n\t`response_json` text NOT NULL,\n\t`completed_at` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_legacy_team_setup_completions_attempt_finish` ON `legacy_team_setup_completions` (`attempt_id`,`finish_digest`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_completions_exact_replay` ON `legacy_team_setup_completions` (`candidate_ref`,`attempt_id`,`finish_digest`,`confirmed_access_delta_digest`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_draft_devices` (\n\t`attempt_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`device_ref` text NOT NULL,\n\t`key_fingerprint` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`enabled` integer NOT NULL,\n\t`existing_identity_id` text,\n\t`existing_assignment_version` integer,\n\t`verified_evidence_kind` text,\n\t`decision` text DEFAULT 'unresolved' NOT NULL,\n\t`target_identity_id` text,\n\t`expected_assignment_kind` text,\n\t`expected_assignment_version` integer,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`attempt_id`, `device_id`),\n\tFOREIGN KEY (`attempt_id`) REFERENCES `legacy_team_setup_drafts`(`attempt_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_legacy_team_setup_devices_attempt_ref` ON `legacy_team_setup_draft_devices` (`attempt_id`,`device_ref`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_devices_attempt_decision` ON `legacy_team_setup_draft_devices` (`attempt_id`,`decision`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_draft_projects` (\n\t`attempt_id` text NOT NULL,\n\t`project_ref` text NOT NULL,\n\t`source_project_identity` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`source_fingerprint` text NOT NULL,\n\t`resolution_kind` text DEFAULT 'unresolved' NOT NULL,\n\t`resolved_project_identity` text,\n\t`target_scope_id` text,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`attempt_id`, `project_ref`),\n\tFOREIGN KEY (`attempt_id`) REFERENCES `legacy_team_setup_drafts`(`attempt_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_projects_attempt_resolution` ON `legacy_team_setup_draft_projects` (`attempt_id`,`resolution_kind`);\nCREATE TABLE IF NOT EXISTS `recipient_managed_project_projections` (\n\t`canonical_project_identity` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`managed_scope_id` text NOT NULL,\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`recipient_identity_id` text NOT NULL,\n\t`accepting_device_id` text NOT NULL,\n\t`source_operation_id` text NOT NULL,\n\t`reviewed_project_set_digest` text NOT NULL,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`accepted_at` text NOT NULL,\n\t`revoked_at` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`source_operation_id`, `canonical_project_identity`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_recipient_managed_projects_identity_status` ON `recipient_managed_project_projections` (`recipient_identity_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_recipient_managed_projects_scope_authority` ON `recipient_managed_project_projections` (`managed_scope_id`,`coordinator_id`,`group_id`,`status`);\nCREATE TABLE IF NOT EXISTS `recipient_policy_authority_states` (\n\t`canonical_project_identity` text PRIMARY KEY NOT NULL,\n\t`authority_state` text DEFAULT 'legacy' NOT NULL,\n\t`generation` integer DEFAULT 0 NOT NULL,\n\t`desired_devices_digest` text,\n\t`current_devices_digest` text,\n\t`stable_parity_evidence_digest` text,\n\t`stable_parity_passed_at` text,\n\t`fresh_snapshot_fingerprint` text,\n\t`fresh_snapshot_observed_at` text,\n\t`safe_error_code` text,\n\t`state_changed_at` text NOT NULL,\n\t`last_error_at` text,\n\t`attempt_count` integer DEFAULT 0 NOT NULL,\n\t`last_attempt_at` text,\n\t`last_completed_at` text,\n\t`lease_owner` text,\n\t`lease_acquired_at` text,\n\t`lease_expires_at` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `recipient_policy_reconciliation_steps` (\n\t`canonical_project_identity` text NOT NULL,\n\t`generation` integer NOT NULL,\n\t`step_key` text NOT NULL,\n\t`effect_id` text NOT NULL,\n\t`payload_digest` text NOT NULL,\n\t`status` text DEFAULT 'pending' NOT NULL,\n\t`attempt_count` integer DEFAULT 0 NOT NULL,\n\t`started_at` text,\n\t`completed_at` text,\n\t`last_attempt_at` text,\n\t`safe_error_code` text,\n\t`error_at` text,\n\t`lease_owner` text,\n\t`lease_acquired_at` text,\n\t`lease_expires_at` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`canonical_project_identity`, `generation`, `step_key`)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_recipient_policy_reconciliation_steps_effect` ON `recipient_policy_reconciliation_steps` (`effect_id`);\nCREATE INDEX IF NOT EXISTS `idx_recipient_policy_reconciliation_steps_status` ON `recipient_policy_reconciliation_steps` (`canonical_project_identity`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_recipient_policy_reconciliation_steps_pending_refresh` ON `recipient_policy_reconciliation_steps` (`canonical_project_identity`,`generation`,`step_key`) WHERE \"recipient_policy_reconciliation_steps\".\"status\" IN ('pending', 'running', 'failed') AND \"recipient_policy_reconciliation_steps\".\"step_key\" GLOB 'refresh-after-revocations-v2:*';\nCREATE TABLE IF NOT EXISTS `recipient_policy_deny_overlays` (\n\t`canonical_project_identity` text NOT NULL,\n\t`scope_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`generation` integer NOT NULL,\n\t`reason_code` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`canonical_project_identity`, `scope_id`, `device_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_recipient_policy_deny_overlays_scope_device` ON `recipient_policy_deny_overlays` (`scope_id`,`device_id`);";
|
|
7
|
+
export declare const TEST_SCHEMA_BASE_DDL = "CREATE TABLE IF NOT EXISTS `device_identity_binding_commits` (\n\t`commit_digest` text PRIMARY KEY NOT NULL,\n\t`reviewed_inventory_digest` text NOT NULL,\n\t`request_json` text NOT NULL,\n\t`outcomes_json` text NOT NULL,\n\t`write_count` integer NOT NULL,\n\t`decided_by_identity_id` text NOT NULL,\n\t`decided_by_device_id` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `device_identity_binding_audit` (\n\t`event_id` text PRIMARY KEY NOT NULL,\n\t`commit_digest` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`previous_identity_id` text,\n\t`target_identity_id` text NOT NULL,\n\t`action` text NOT NULL,\n\t`previous_assignment_version` integer,\n\t`resulting_assignment_version` integer NOT NULL,\n\t`decided_by_identity_id` text NOT NULL,\n\t`decided_by_device_id` text NOT NULL,\n\t`created_at` text NOT NULL,\n\tFOREIGN KEY (`commit_digest`) REFERENCES `device_identity_binding_commits`(`commit_digest`) ON UPDATE no action ON DELETE no action\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_device_identity_binding_audit_commit_device` ON `device_identity_binding_audit` (`commit_digest`,`device_id`);\nCREATE INDEX IF NOT EXISTS `idx_device_identity_binding_audit_device_created` ON `device_identity_binding_audit` (`device_id`,`created_at`,`event_id`);\nCREATE TABLE IF NOT EXISTS `sessions` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`started_at` text NOT NULL,\n\t`ended_at` text,\n\t`cwd` text,\n\t`project` text,\n\t`git_remote` text,\n\t`git_branch` text,\n\t`user` text,\n\t`tool_version` text,\n\t`metadata_json` text,\n\t`import_key` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_sessions_started_id` ON `sessions` (`started_at`,`id`);\nCREATE TABLE IF NOT EXISTS `replication_scopes` (\n\t`scope_id` text PRIMARY KEY NOT NULL,\n\t`label` text NOT NULL,\n\t`kind` text DEFAULT 'user' NOT NULL,\n\t`authority_type` text DEFAULT 'local' NOT NULL,\n\t`coordinator_id` text,\n\t`group_id` text,\n\t`manifest_issuer_device_id` text,\n\t`membership_epoch` integer DEFAULT 0 NOT NULL,\n\t`manifest_hash` text,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_replication_scopes_status` ON `replication_scopes` (`status`);\nCREATE INDEX IF NOT EXISTS `idx_replication_scopes_authority_group` ON `replication_scopes` (`coordinator_id`,`group_id`);\nCREATE TABLE IF NOT EXISTS `project_scope_mappings` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`workspace_identity` text,\n\t`project_pattern` text NOT NULL,\n\t`scope_id` text NOT NULL,\n\t`priority` integer DEFAULT 0 NOT NULL,\n\t`source` text DEFAULT 'user' NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_project_scope_mappings_workspace_priority` ON `project_scope_mappings` (`workspace_identity`,`priority`);\nCREATE INDEX IF NOT EXISTS `idx_project_scope_mappings_pattern_priority` ON `project_scope_mappings` (`project_pattern`,`priority`);\nCREATE INDEX IF NOT EXISTS `idx_project_scope_mappings_scope` ON `project_scope_mappings` (`scope_id`);\nCREATE TABLE IF NOT EXISTS `scope_memberships` (\n\t`scope_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`role` text DEFAULT 'member' NOT NULL,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`membership_epoch` integer DEFAULT 0 NOT NULL,\n\t`coordinator_id` text,\n\t`group_id` text,\n\t`manifest_issuer_device_id` text,\n\t`manifest_hash` text,\n\t`signed_manifest_json` text,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`scope_id`, `device_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_scope_memberships_device_status` ON `scope_memberships` (`device_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_scope_memberships_scope_status` ON `scope_memberships` (`scope_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_scope_memberships_authority_group` ON `scope_memberships` (`coordinator_id`,`group_id`);\nCREATE TABLE IF NOT EXISTS `artifacts` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer NOT NULL,\n\t`kind` text NOT NULL,\n\t`path` text,\n\t`content_text` text,\n\t`content_hash` text,\n\t`created_at` text NOT NULL,\n\t`metadata_json` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_artifacts_session_kind` ON `artifacts` (`session_id`,`kind`);\nCREATE TABLE IF NOT EXISTS `memory_items` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer NOT NULL,\n\t`kind` text NOT NULL,\n\t`title` text NOT NULL,\n\t`subtitle` text,\n\t`body_text` text NOT NULL,\n\t`confidence` real DEFAULT 0.5,\n\t`tags_text` text DEFAULT '',\n\t`active` integer DEFAULT 1,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\t`metadata_json` text,\n\t`actor_id` text,\n\t`actor_display_name` text,\n\t`visibility` text,\n\t`workspace_id` text,\n\t`workspace_kind` text,\n\t`origin_device_id` text,\n\t`origin_source` text,\n\t`trust_state` text,\n\t`facts` text,\n\t`narrative` text,\n\t`concepts` text,\n\t`files_read` text,\n\t`files_modified` text,\n\t`user_prompt_id` integer,\n\t`prompt_number` integer,\n\t`deleted_at` text,\n\t`rev` integer DEFAULT 0,\n\t`dedup_key` text,\n\t`import_key` text,\n\t`scope_id` text,\n\t`project` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_memory_items_active_created` ON `memory_items` (`active`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_created_id` ON `memory_items` (`created_at`,`id`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_origin_device_active` ON `memory_items` (`origin_device_id`,`active`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_session` ON `memory_items` (`session_id`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_project` ON `memory_items` (`project`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_scope_visibility_created` ON `memory_items` (`scope_id`,`visibility`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_memory_items_scope_backfill_pending` ON `memory_items` (`id`) WHERE scope_id IS NULL OR scope_id = '';\nCREATE INDEX IF NOT EXISTS `idx_memory_items_dedup_key_active_created` ON `memory_items` (`dedup_key`,`active`,`created_at`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_memory_items_same_session_dedup_unique` ON `memory_items` (`session_id`,`kind`,`visibility`,`workspace_id`,`dedup_key`) WHERE active = 1 AND dedup_key IS NOT NULL;\nCREATE TABLE IF NOT EXISTS `memory_file_refs` (\n\t`memory_id` integer NOT NULL,\n\t`file_path` text NOT NULL,\n\t`relation` text NOT NULL,\n\tPRIMARY KEY(`memory_id`, `file_path`, `relation`),\n\tFOREIGN KEY (`memory_id`) REFERENCES `memory_items`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_memory_file_refs_path` ON `memory_file_refs` (`file_path`);\nCREATE TABLE IF NOT EXISTS `memory_concept_refs` (\n\t`memory_id` integer NOT NULL,\n\t`concept` text NOT NULL,\n\tPRIMARY KEY(`memory_id`, `concept`),\n\tFOREIGN KEY (`memory_id`) REFERENCES `memory_items`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_memory_concept_refs_concept` ON `memory_concept_refs` (`concept`);\nCREATE TABLE IF NOT EXISTS `usage_events` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer,\n\t`event` text NOT NULL,\n\t`tokens_read` integer DEFAULT 0,\n\t`tokens_written` integer DEFAULT 0,\n\t`tokens_saved` integer DEFAULT 0,\n\t`created_at` text NOT NULL,\n\t`metadata_json` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null\n);\n\nCREATE INDEX IF NOT EXISTS `idx_usage_events_event_created` ON `usage_events` (`event`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_usage_events_session` ON `usage_events` (`session_id`);\nCREATE TABLE IF NOT EXISTS `retrieval_attempts` (\n\t`attempt_id` text PRIMARY KEY NOT NULL,\n\t`contract_version` integer NOT NULL,\n\t`surface` text NOT NULL,\n\t`trigger` text NOT NULL,\n\t`started_at` text NOT NULL,\n\t`completed_at` text,\n\t`retrieval_status` text NOT NULL,\n\t`delivery_status` text NOT NULL,\n\t`candidate_count` integer NOT NULL,\n\t`selected_count` integer NOT NULL,\n\t`persisted_candidate_count` integer NOT NULL,\n\t`recorder_version` text NOT NULL,\n\t`session_id` integer,\n\t`source` text,\n\t`stream_id` text,\n\t`source_session_id` text,\n\t`prompt_number` integer,\n\t`request_id` text,\n\t`raw_event_start_seq` integer,\n\t`raw_event_end_seq` integer,\n\t`experiment_id` text,\n\t`experiment_cell_id` text,\n\t`evaluation_checkout_id` text,\n\t`evaluation_fixture_id` text,\n\t`evaluation_seed` integer,\n\t`latency_ms` integer,\n\t`project` text,\n\t`scope_id` text,\n\t`mode` text,\n\t`limit_requested` integer,\n\t`token_budget` integer,\n\t`output_tokens` integer,\n\t`working_set_file_count` integer,\n\t`working_set_files_json` text,\n\t`query_hash_sha256` text,\n\t`query_char_count` integer,\n\t`query_token_estimate` integer,\n\t`filter_summary_json` text,\n\t`failure_code` text,\n\t`failure_stage` text,\n\t`trace_version` integer,\n\t`automatic_recall_json` text,\n\t`automatic_recall_key` text,\n\t`retention_until` text,\n\t`retention_pinned` integer DEFAULT 0 NOT NULL,\n\t`retention_finalized_at` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_session_started` ON `retrieval_attempts` (`session_id`,`started_at`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_retrieval_attempts_automatic_recall_key` ON `retrieval_attempts` (`automatic_recall_key`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_source_stream_started` ON `retrieval_attempts` (`source`,`stream_id`,`started_at`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_retention` ON `retrieval_attempts` (`retention_pinned`,`retention_until`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_started` ON `retrieval_attempts` (`started_at`,`attempt_id`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_surface_started` ON `retrieval_attempts` (`surface`,`started_at`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_retrieval_attempts_request_identity` ON `retrieval_attempts` (`source`,`surface`,`request_id`) WHERE request_id IS NOT NULL;\nCREATE INDEX IF NOT EXISTS `idx_retrieval_attempts_experiment_cell` ON `retrieval_attempts` (`experiment_id`,`experiment_cell_id`);\nCREATE TABLE IF NOT EXISTS `retrieval_exposures` (\n\t`exposure_id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`attempt_id` text NOT NULL,\n\t`memory_id` integer,\n\t`memory_import_key` text,\n\t`origin_device_id` text,\n\t`rank` integer NOT NULL,\n\t`disposition` text NOT NULL,\n\t`section` text,\n\t`handoff_status` text NOT NULL,\n\t`memory_rev` integer,\n\t`memory_updated_at` text,\n\t`memory_scope_id` text,\n\t`memory_kind` text,\n\t`memory_active` integer,\n\t`memory_deleted_at` text,\n\t`score_summary_json` text,\n\t`reason_codes_json` text,\n\tFOREIGN KEY (`attempt_id`) REFERENCES `retrieval_attempts`(`attempt_id`) ON UPDATE no action ON DELETE cascade,\n\tFOREIGN KEY (`memory_id`) REFERENCES `memory_items`(`id`) ON UPDATE no action ON DELETE set null\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_retrieval_exposures_attempt_rank` ON `retrieval_exposures` (`attempt_id`,`rank`);\nCREATE INDEX IF NOT EXISTS `idx_retrieval_exposures_memory` ON `retrieval_exposures` (`memory_id`);\nCREATE TABLE IF NOT EXISTS `outcome_evidence` (\n\t`evidence_id` text PRIMARY KEY NOT NULL,\n\t`contract_version` integer NOT NULL,\n\t`dimension` text NOT NULL,\n\t`evidence_type` text NOT NULL,\n\t`source_class` text NOT NULL,\n\t`observed_at` text NOT NULL,\n\t`producer` text NOT NULL,\n\t`producer_version` text NOT NULL,\n\t`status` text NOT NULL,\n\t`value_type` text,\n\t`value_integer` integer,\n\t`value_real` real,\n\t`value_unit` text,\n\t`session_id` integer,\n\t`source` text,\n\t`stream_id` text,\n\t`source_session_id` text,\n\t`prompt_number` integer,\n\t`raw_event_start_seq` integer,\n\t`raw_event_end_seq` integer,\n\t`experiment_id` text,\n\t`experiment_cell_id` text,\n\t`window_start_at` text,\n\t`window_end_at` text,\n\t`references_json` text,\n\t`retention_until` text,\n\t`retention_pinned` integer DEFAULT 0 NOT NULL,\n\t`retention_finalized_at` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_observed_id` ON `outcome_evidence` (`observed_at`,`evidence_id`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_session_observed` ON `outcome_evidence` (`session_id`,`observed_at`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_source_stream_observed` ON `outcome_evidence` (`source`,`stream_id`,`observed_at`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_type_observed` ON `outcome_evidence` (`evidence_type`,`observed_at`);\nCREATE INDEX IF NOT EXISTS `idx_outcome_evidence_retention` ON `outcome_evidence` (`retention_pinned`,`retention_until`);\nCREATE TABLE IF NOT EXISTS `attribution_assessments` (\n\t`assessment_id` text PRIMARY KEY NOT NULL,\n\t`contract_version` integer NOT NULL,\n\t`subject_type` text NOT NULL,\n\t`attempt_id` text NOT NULL,\n\t`exposure_id` integer,\n\t`dimension` text NOT NULL,\n\t`impact_label` text NOT NULL,\n\t`basis` text NOT NULL,\n\t`confidence_level` text NOT NULL,\n\t`method` text NOT NULL,\n\t`method_version` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`claim_type` text DEFAULT 'observational' NOT NULL,\n\tFOREIGN KEY (`attempt_id`) REFERENCES `retrieval_attempts`(`attempt_id`) ON UPDATE no action ON DELETE cascade,\n\tFOREIGN KEY (`exposure_id`) REFERENCES `retrieval_exposures`(`exposure_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessments_attempt_created` ON `attribution_assessments` (`attempt_id`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessments_label_created` ON `attribution_assessments` (`impact_label`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessments_exposure` ON `attribution_assessments` (`exposure_id`);\nCREATE TABLE IF NOT EXISTS `attribution_assessment_evidence` (\n\t`assessment_id` text NOT NULL,\n\t`evidence_id` text NOT NULL,\n\tPRIMARY KEY(`assessment_id`, `evidence_id`),\n\tFOREIGN KEY (`assessment_id`) REFERENCES `attribution_assessments`(`assessment_id`) ON UPDATE no action ON DELETE cascade,\n\tFOREIGN KEY (`evidence_id`) REFERENCES `outcome_evidence`(`evidence_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_attribution_assessment_evidence_evidence` ON `attribution_assessment_evidence` (`evidence_id`,`assessment_id`);\nCREATE TABLE IF NOT EXISTS `raw_events` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`event_id` text,\n\t`event_seq` integer NOT NULL,\n\t`event_type` text NOT NULL,\n\t`ts_wall_ms` integer,\n\t`ts_mono_ms` real,\n\t`payload_json` text NOT NULL,\n\t`capture_context_json` text,\n\t`created_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_raw_events_source_stream_seq` ON `raw_events` (`source`,`stream_id`,`event_seq`);\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_raw_events_source_stream_event_id` ON `raw_events` (`source`,`stream_id`,`event_id`);\nCREATE INDEX IF NOT EXISTS `idx_raw_events_session_seq` ON `raw_events` (`opencode_session_id`,`event_seq`);\nCREATE INDEX IF NOT EXISTS `idx_raw_events_created` ON `raw_events` (`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_raw_events_capture_context` ON `raw_events` (`source`,`stream_id`,`event_seq`) WHERE \"raw_events\".\"capture_context_json\" IS NOT NULL;\nCREATE TABLE IF NOT EXISTS `raw_event_sessions` (\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`cwd` text,\n\t`project` text,\n\t`started_at` text,\n\t`last_seen_ts_wall_ms` integer,\n\t`last_received_event_seq` integer DEFAULT -1 NOT NULL,\n\t`last_flushed_event_seq` integer DEFAULT -1 NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`source`, `stream_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_raw_event_sessions_pending_updated` ON `raw_event_sessions` (`updated_at`) WHERE \"raw_event_sessions\".\"last_received_event_seq\" > \"raw_event_sessions\".\"last_flushed_event_seq\";\nCREATE TABLE IF NOT EXISTS `opencode_sessions` (\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`session_id` integer,\n\t`created_at` text NOT NULL,\n\tPRIMARY KEY(`source`, `stream_id`),\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_opencode_sessions_session` ON `opencode_sessions` (`session_id`);\nCREATE TABLE IF NOT EXISTS `raw_event_flush_batches` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`source` text DEFAULT 'opencode' NOT NULL,\n\t`stream_id` text DEFAULT '' NOT NULL,\n\t`opencode_session_id` text NOT NULL,\n\t`start_event_seq` integer NOT NULL,\n\t`end_event_seq` integer NOT NULL,\n\t`extractor_version` text NOT NULL,\n\t`status` text NOT NULL,\n\t`error_message` text,\n\t`error_type` text,\n\t`observer_provider` text,\n\t`observer_model` text,\n\t`observer_runtime` text,\n\t`observer_auth_source` text,\n\t`observer_auth_type` text,\n\t`observer_error_code` text,\n\t`observer_error_message` text,\n\t`attempt_count` integer DEFAULT 0 NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_flush_batches_source_stream_seq_ver` ON `raw_event_flush_batches` (`source`,`stream_id`,`start_event_seq`,`end_event_seq`,`extractor_version`);\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_session_created` ON `raw_event_flush_batches` (`opencode_session_id`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_status_updated` ON `raw_event_flush_batches` (`status`,`updated_at`);\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_observer_status_updated` ON `raw_event_flush_batches` (`status`,`updated_at`) WHERE \"raw_event_flush_batches\".\"observer_provider\" IS NOT NULL;\nCREATE INDEX IF NOT EXISTS `idx_flush_batches_capture_status_updated` ON `raw_event_flush_batches` (`status`,`updated_at`) WHERE \"raw_event_flush_batches\".\"observer_provider\" IS NULL;\nCREATE TABLE IF NOT EXISTS `user_prompts` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer,\n\t`project` text,\n\t`prompt_text` text NOT NULL,\n\t`prompt_number` integer,\n\t`created_at` text NOT NULL,\n\t`created_at_epoch` integer NOT NULL,\n\t`metadata_json` text,\n\t`import_key` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_user_prompts_session` ON `user_prompts` (`session_id`);\nCREATE INDEX IF NOT EXISTS `idx_user_prompts_project` ON `user_prompts` (`project`);\nCREATE INDEX IF NOT EXISTS `idx_user_prompts_epoch` ON `user_prompts` (`created_at_epoch`);\nCREATE TABLE IF NOT EXISTS `session_summaries` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`session_id` integer,\n\t`project` text,\n\t`request` text,\n\t`investigated` text,\n\t`learned` text,\n\t`completed` text,\n\t`next_steps` text,\n\t`notes` text,\n\t`files_read` text,\n\t`files_edited` text,\n\t`prompt_number` integer,\n\t`created_at` text NOT NULL,\n\t`created_at_epoch` integer NOT NULL,\n\t`metadata_json` text,\n\t`import_key` text,\n\tFOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_session_summaries_session` ON `session_summaries` (`session_id`);\nCREATE INDEX IF NOT EXISTS `idx_session_summaries_project` ON `session_summaries` (`project`);\nCREATE INDEX IF NOT EXISTS `idx_session_summaries_epoch` ON `session_summaries` (`created_at_epoch`);\nCREATE TABLE IF NOT EXISTS `replication_ops` (\n\t`op_id` text PRIMARY KEY NOT NULL,\n\t`entity_type` text NOT NULL,\n\t`entity_id` text NOT NULL,\n\t`op_type` text NOT NULL,\n\t`payload_json` text,\n\t`clock_rev` integer NOT NULL,\n\t`clock_updated_at` text NOT NULL,\n\t`clock_device_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`scope_id` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_replication_ops_created` ON `replication_ops` (`created_at`,`op_id`);\nCREATE INDEX IF NOT EXISTS `idx_replication_ops_entity` ON `replication_ops` (`entity_type`,`entity_id`);\nCREATE INDEX IF NOT EXISTS `idx_replication_ops_scope_created` ON `replication_ops` (`scope_id`,`created_at`,`op_id`);\nCREATE TABLE IF NOT EXISTS `replication_cursors` (\n\t`peer_device_id` text PRIMARY KEY NOT NULL,\n\t`last_applied_cursor` text,\n\t`last_acked_cursor` text,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `replication_cursors_v2` (\n\t`peer_device_id` text NOT NULL,\n\t`scope_id` text NOT NULL,\n\t`last_applied_cursor` text,\n\t`last_acked_cursor` text,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`peer_device_id`, `scope_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_replication_cursors_v2_scope` ON `replication_cursors_v2` (`scope_id`);\nCREATE TABLE IF NOT EXISTS `sync_peers` (\n\t`peer_device_id` text PRIMARY KEY NOT NULL,\n\t`name` text,\n\t`pinned_fingerprint` text,\n\t`public_key` text,\n\t`addresses_json` text,\n\t`claimed_local_actor` integer DEFAULT 0 NOT NULL,\n\t`actor_id` text,\n\t`projects_include_json` text,\n\t`projects_exclude_json` text,\n\t`created_at` text NOT NULL,\n\t`last_seen_at` text,\n\t`last_sync_at` text,\n\t`last_error` text,\n\t`runtime_version` text,\n\t`runtime_version_observed_at` text,\n\t`highest_observed_direct_signature_version` integer,\n\t`discovered_via_coordinator_id` text,\n\t`discovered_via_group_id` text,\n\t`trust_provenance` text,\n\t`pending_bootstrap_grant_id` text\n);\n\nCREATE TABLE IF NOT EXISTS `sync_nonces` (\n\t`nonce` text PRIMARY KEY NOT NULL,\n\t`device_id` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_device` (\n\t`device_id` text PRIMARY KEY NOT NULL,\n\t`public_key` text NOT NULL,\n\t`fingerprint` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_attempts` (\n\t`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`peer_device_id` text NOT NULL,\n\t`started_at` text NOT NULL,\n\t`finished_at` text,\n\t`ok` integer NOT NULL,\n\t`ops_in` integer NOT NULL,\n\t`ops_out` integer NOT NULL,\n\t`error` text,\n\t`local_sync_capability` text,\n\t`peer_sync_capability` text,\n\t`negotiated_sync_capability` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_peer_started` ON `sync_attempts` (`peer_device_id`,`started_at`);\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_occurred` ON `sync_attempts` (CASE WHEN \"finished_at\" IS NULL THEN \"started_at\" ELSE \"finished_at\" END,`id`);\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_error_occurred` ON `sync_attempts` (CASE WHEN \"finished_at\" IS NULL THEN \"started_at\" ELSE \"finished_at\" END,`id`) WHERE \"sync_attempts\".\"ok\" = 0;\nCREATE INDEX IF NOT EXISTS `idx_sync_attempts_success_occurred` ON `sync_attempts` (CASE WHEN \"finished_at\" IS NULL THEN \"started_at\" ELSE \"finished_at\" END,`id`) WHERE \"sync_attempts\".\"ok\" <> 0;\nCREATE TABLE IF NOT EXISTS `sync_scope_rejections` (\n\t`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`peer_device_id` text,\n\t`op_id` text NOT NULL,\n\t`entity_type` text NOT NULL,\n\t`entity_id` text NOT NULL,\n\t`scope_id` text,\n\t`reason` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_sync_scope_rejections_peer_created` ON `sync_scope_rejections` (`peer_device_id`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_sync_scope_rejections_scope_created` ON `sync_scope_rejections` (`scope_id`,`created_at`);\nCREATE TABLE IF NOT EXISTS `sync_daemon_state` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`last_error` text,\n\t`last_traceback` text,\n\t`last_error_at` text,\n\t`last_ok_at` text,\n\t`phase` text\n);\n\nCREATE TABLE IF NOT EXISTS `sync_reset_state` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`generation` integer NOT NULL,\n\t`snapshot_id` text NOT NULL,\n\t`baseline_cursor` text,\n\t`retained_floor_cursor` text,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_reset_state_v2` (\n\t`scope_id` text PRIMARY KEY NOT NULL,\n\t`generation` integer NOT NULL,\n\t`snapshot_id` text NOT NULL,\n\t`baseline_cursor` text,\n\t`retained_floor_cursor` text,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `sync_retention_state_v2` (\n\t`scope_id` text PRIMARY KEY NOT NULL,\n\t`last_run_at` text,\n\t`last_duration_ms` integer,\n\t`last_deleted_ops` integer DEFAULT 0 NOT NULL,\n\t`last_estimated_bytes_before` integer,\n\t`last_estimated_bytes_after` integer,\n\t`retained_floor_cursor` text,\n\t`last_error` text,\n\t`last_error_at` text\n);\n\nCREATE TABLE IF NOT EXISTS `raw_event_ingest_samples` (\n\t`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n\t`created_at` text NOT NULL,\n\t`inserted_events` integer DEFAULT 0 NOT NULL,\n\t`skipped_invalid` integer DEFAULT 0 NOT NULL,\n\t`skipped_duplicate` integer DEFAULT 0 NOT NULL,\n\t`skipped_conflict` integer DEFAULT 0 NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `raw_event_ingest_stats` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`inserted_events` integer DEFAULT 0 NOT NULL,\n\t`skipped_events` integer DEFAULT 0 NOT NULL,\n\t`skipped_invalid` integer DEFAULT 0 NOT NULL,\n\t`skipped_duplicate` integer DEFAULT 0 NOT NULL,\n\t`skipped_conflict` integer DEFAULT 0 NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `coordinator_group_preferences` (\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`projects_include_json` text,\n\t`projects_exclude_json` text,\n\t`auto_seed_scope` integer DEFAULT 1 NOT NULL,\n\t`default_space_scope_id` text,\n\t`auto_grant_default_space_on_join` integer DEFAULT 0 NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`coordinator_id`, `group_id`)\n);\n\nCREATE TABLE IF NOT EXISTS `actors` (\n\t`actor_id` text PRIMARY KEY NOT NULL,\n\t`display_name` text NOT NULL,\n\t`is_local` integer DEFAULT 0 NOT NULL,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`merged_into_actor_id` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS `idx_actors_is_local` ON `actors` (`is_local`);\nCREATE INDEX IF NOT EXISTS `idx_actors_status` ON `actors` (`status`);\nCREATE TABLE IF NOT EXISTS `recipient_policy_review_resolutions` (\n\t`review_item_id` text NOT NULL,\n\t`source_fingerprint` text NOT NULL,\n\t`decision` text NOT NULL,\n\t`decision_input_json` text NOT NULL,\n\t`preview_json` text NOT NULL,\n\t`decided_by_identity_id` text NOT NULL,\n\t`decided_by_device_id` text NOT NULL,\n\t`resolved_at` text NOT NULL,\n\tPRIMARY KEY(`review_item_id`, `source_fingerprint`)\n);\n\nCREATE TABLE IF NOT EXISTS `coordinator_enrollment_reconciliation_issues` (\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`kind` text NOT NULL,\n\t`reference_id` text NOT NULL,\n\t`code` text NOT NULL,\n\t`status` text DEFAULT 'open' NOT NULL,\n\t`first_seen_at` text NOT NULL,\n\t`last_seen_at` text NOT NULL,\n\t`resolved_at` text,\n\t`occurrence_count` integer DEFAULT 1 NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`coordinator_id`, `group_id`, `kind`, `reference_id`, `code`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_coordinator_enrollment_issues_boundary_status` ON `coordinator_enrollment_reconciliation_issues` (`coordinator_id`,`group_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_coordinator_enrollment_issues_status_recent` ON `coordinator_enrollment_reconciliation_issues` (`status`,`last_seen_at`,`resolved_at`);\nCREATE TABLE IF NOT EXISTS `policy_teams` (\n\t`team_id` text PRIMARY KEY NOT NULL,\n\t`display_name` text NOT NULL,\n\t`status` text NOT NULL,\n\t`device_eligibility_mode` text DEFAULT 'person_all_devices' NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `policy_teams_idempotency_key_unique` ON `policy_teams` (`idempotency_key`);\nCREATE TABLE IF NOT EXISTS `policy_team_memberships` (\n\t`team_id` text NOT NULL,\n\t`identity_id` text NOT NULL,\n\t`role` text NOT NULL,\n\t`status` text NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`team_id`, `identity_id`)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `policy_team_memberships_idempotency_key_unique` ON `policy_team_memberships` (`idempotency_key`);\nCREATE INDEX IF NOT EXISTS `idx_policy_team_memberships_identity_status` ON `policy_team_memberships` (`identity_id`,`status`);\nCREATE TABLE IF NOT EXISTS `policy_team_device_decisions` (\n\t`team_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`decision` text NOT NULL,\n\t`assignment_version` integer DEFAULT 0 NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`team_id`, `device_id`),\n\tFOREIGN KEY (`team_id`) REFERENCES `policy_teams`(`team_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_policy_team_device_decisions_device` ON `policy_team_device_decisions` (`device_id`);\nCREATE TABLE IF NOT EXISTS `identity_devices` (\n\t`device_id` text PRIMARY KEY NOT NULL,\n\t`identity_id` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`status` text NOT NULL,\n\t`provenance` text NOT NULL,\n\t`revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`assignment_version` integer DEFAULT 0 NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `identity_devices_idempotency_key_unique` ON `identity_devices` (`idempotency_key`);\nCREATE INDEX IF NOT EXISTS `idx_identity_devices_identity_status` ON `identity_devices` (`identity_id`,`status`);\nCREATE TABLE IF NOT EXISTS `project_recipients` (\n\t`canonical_project_identity` text NOT NULL,\n\t`recipient_kind` text NOT NULL,\n\t`recipient_id` text NOT NULL,\n\t`status` text NOT NULL,\n\t`provenance` text NOT NULL,\n\t`policy_revision` text NOT NULL,\n\t`migration_state` text NOT NULL,\n\t`source_fingerprint` text,\n\t`idempotency_key` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`canonical_project_identity`, `recipient_kind`, `recipient_id`)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `project_recipients_idempotency_key_unique` ON `project_recipients` (`idempotency_key`);\nCREATE INDEX IF NOT EXISTS `idx_project_recipients_project_status` ON `project_recipients` (`canonical_project_identity`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_project_recipients_recipient_status` ON `project_recipients` (`recipient_kind`,`recipient_id`,`status`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_drafts` (\n\t`attempt_id` text PRIMARY KEY NOT NULL,\n\t`candidate_id` text NOT NULL,\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`state` text DEFAULT 'needs_setup' NOT NULL,\n\t`display_name` text NOT NULL,\n\t`roster_fingerprint` text NOT NULL,\n\t`projection_fingerprint` text NOT NULL,\n\t`finish_digest` text,\n\t`safe_error_code` text,\n\t`completed_team_id` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\t`completed_at` text,\n\t`superseded_at` text\n);\n\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_drafts_candidate_state` ON `legacy_team_setup_drafts` (`candidate_id`,`state`,`created_at`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_drafts_state_updated` ON `legacy_team_setup_drafts` (`state`,`updated_at`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_drafts_finish_digest` ON `legacy_team_setup_drafts` (`finish_digest`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_completions` (\n\t`attempt_id` text NOT NULL,\n\t`finish_digest` text NOT NULL,\n\t`candidate_ref` text NOT NULL,\n\t`confirmed_access_delta_digest` text NOT NULL,\n\t`completed_team_id` text NOT NULL,\n\t`response_json` text NOT NULL,\n\t`completed_at` text NOT NULL,\n\t`created_at` text NOT NULL\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_legacy_team_setup_completions_attempt_finish` ON `legacy_team_setup_completions` (`attempt_id`,`finish_digest`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_completions_exact_replay` ON `legacy_team_setup_completions` (`candidate_ref`,`attempt_id`,`finish_digest`,`confirmed_access_delta_digest`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_draft_devices` (\n\t`attempt_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`device_ref` text NOT NULL,\n\t`key_fingerprint` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`enabled` integer NOT NULL,\n\t`existing_identity_id` text,\n\t`existing_assignment_version` integer,\n\t`verified_evidence_kind` text,\n\t`decision` text DEFAULT 'unresolved' NOT NULL,\n\t`target_identity_id` text,\n\t`expected_assignment_kind` text,\n\t`expected_assignment_version` integer,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`attempt_id`, `device_id`),\n\tFOREIGN KEY (`attempt_id`) REFERENCES `legacy_team_setup_drafts`(`attempt_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_legacy_team_setup_devices_attempt_ref` ON `legacy_team_setup_draft_devices` (`attempt_id`,`device_ref`);\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_devices_attempt_decision` ON `legacy_team_setup_draft_devices` (`attempt_id`,`decision`);\nCREATE TABLE IF NOT EXISTS `legacy_team_setup_draft_projects` (\n\t`attempt_id` text NOT NULL,\n\t`project_ref` text NOT NULL,\n\t`source_project_identity` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`source_fingerprint` text NOT NULL,\n\t`resolution_kind` text DEFAULT 'unresolved' NOT NULL,\n\t`resolved_project_identity` text,\n\t`target_scope_id` text,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`attempt_id`, `project_ref`),\n\tFOREIGN KEY (`attempt_id`) REFERENCES `legacy_team_setup_drafts`(`attempt_id`) ON UPDATE no action ON DELETE cascade\n);\n\nCREATE INDEX IF NOT EXISTS `idx_legacy_team_setup_projects_attempt_resolution` ON `legacy_team_setup_draft_projects` (`attempt_id`,`resolution_kind`);\nCREATE TABLE IF NOT EXISTS `recipient_managed_project_projections` (\n\t`canonical_project_identity` text NOT NULL,\n\t`display_name` text NOT NULL,\n\t`managed_scope_id` text NOT NULL,\n\t`coordinator_id` text NOT NULL,\n\t`group_id` text NOT NULL,\n\t`recipient_identity_id` text NOT NULL,\n\t`accepting_device_id` text NOT NULL,\n\t`source_operation_id` text NOT NULL,\n\t`reviewed_project_set_digest` text NOT NULL,\n\t`status` text DEFAULT 'active' NOT NULL,\n\t`accepted_at` text NOT NULL,\n\t`revoked_at` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`source_operation_id`, `canonical_project_identity`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_recipient_managed_projects_identity_status` ON `recipient_managed_project_projections` (`recipient_identity_id`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_recipient_managed_projects_scope_authority` ON `recipient_managed_project_projections` (`managed_scope_id`,`coordinator_id`,`group_id`,`status`);\nCREATE TABLE IF NOT EXISTS `recipient_policy_authority_states` (\n\t`canonical_project_identity` text PRIMARY KEY NOT NULL,\n\t`authority_state` text DEFAULT 'legacy' NOT NULL,\n\t`generation` integer DEFAULT 0 NOT NULL,\n\t`desired_devices_digest` text,\n\t`current_devices_digest` text,\n\t`stable_parity_evidence_digest` text,\n\t`stable_parity_passed_at` text,\n\t`fresh_snapshot_fingerprint` text,\n\t`fresh_snapshot_observed_at` text,\n\t`safe_error_code` text,\n\t`state_changed_at` text NOT NULL,\n\t`last_error_at` text,\n\t`attempt_count` integer DEFAULT 0 NOT NULL,\n\t`last_attempt_at` text,\n\t`wake_epoch` integer DEFAULT 0 NOT NULL,\n\t`last_completed_at` text,\n\t`lease_owner` text,\n\t`lease_acquired_at` text,\n\t`lease_expires_at` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS `recipient_policy_reconciliation_steps` (\n\t`canonical_project_identity` text NOT NULL,\n\t`generation` integer NOT NULL,\n\t`step_key` text NOT NULL,\n\t`effect_id` text NOT NULL,\n\t`payload_digest` text NOT NULL,\n\t`status` text DEFAULT 'pending' NOT NULL,\n\t`attempt_count` integer DEFAULT 0 NOT NULL,\n\t`started_at` text,\n\t`completed_at` text,\n\t`last_attempt_at` text,\n\t`safe_error_code` text,\n\t`error_at` text,\n\t`lease_owner` text,\n\t`lease_acquired_at` text,\n\t`lease_expires_at` text,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`canonical_project_identity`, `generation`, `step_key`)\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS `idx_recipient_policy_reconciliation_steps_effect` ON `recipient_policy_reconciliation_steps` (`effect_id`);\nCREATE INDEX IF NOT EXISTS `idx_recipient_policy_reconciliation_steps_status` ON `recipient_policy_reconciliation_steps` (`canonical_project_identity`,`status`);\nCREATE INDEX IF NOT EXISTS `idx_recipient_policy_reconciliation_steps_pending_refresh` ON `recipient_policy_reconciliation_steps` (`canonical_project_identity`,`generation`,`step_key`) WHERE \"recipient_policy_reconciliation_steps\".\"status\" IN ('pending', 'running', 'failed') AND \"recipient_policy_reconciliation_steps\".\"step_key\" GLOB 'refresh-after-revocations-v2:*';\nCREATE TABLE IF NOT EXISTS `recipient_policy_deny_overlays` (\n\t`canonical_project_identity` text NOT NULL,\n\t`scope_id` text NOT NULL,\n\t`device_id` text NOT NULL,\n\t`generation` integer NOT NULL,\n\t`reason_code` text NOT NULL,\n\t`created_at` text NOT NULL,\n\t`updated_at` text NOT NULL,\n\tPRIMARY KEY(`canonical_project_identity`, `scope_id`, `device_id`)\n);\n\nCREATE INDEX IF NOT EXISTS `idx_recipient_policy_deny_overlays_scope_device` ON `recipient_policy_deny_overlays` (`scope_id`,`device_id`);";
|
|
8
8
|
//# sourceMappingURL=test-schema.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-schema.generated.d.ts","sourceRoot":"","sources":["../src/test-schema.generated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"test-schema.generated.d.ts","sourceRoot":"","sources":["../src/test-schema.generated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,oBAAoB,m/qCACg9qC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemem/core",
|
|
3
|
-
"version": "0.46.0-
|
|
3
|
+
"version": "0.46.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist/"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@codemem/embeddings": "^0.46.0-
|
|
27
|
+
"@codemem/embeddings": "^0.46.0-beta.2",
|
|
28
28
|
"@types/better-sqlite3": "^9.6.0",
|
|
29
29
|
"typescript": "^7.0.2",
|
|
30
30
|
"vite": "^8.2.2",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"zod": "4.5.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@codemem/embeddings": "^0.46.0-
|
|
44
|
+
"@codemem/embeddings": "^0.46.0-beta.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@codemem/embeddings": {
|