@codemem/core 0.46.3 → 0.47.0-beta.3
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/address-utils.d.ts.map +1 -1
- package/dist/better-sqlite-coordinator-runtime.d.ts +2 -0
- package/dist/better-sqlite-coordinator-runtime.d.ts.map +1 -1
- package/dist/better-sqlite-coordinator-store.d.ts +109 -5
- package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
- package/dist/coordinator-account-change-browser.d.ts +39 -0
- package/dist/coordinator-account-change-browser.d.ts.map +1 -0
- package/dist/coordinator-account-change-contract.d.ts +4 -0
- package/dist/coordinator-account-change-contract.d.ts.map +1 -0
- package/dist/coordinator-account-change-http-test-fixtures.d.ts +101 -0
- package/dist/coordinator-account-change-http-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-account-change-schema.d.ts +5 -0
- package/dist/coordinator-account-change-schema.d.ts.map +1 -0
- package/dist/coordinator-account-change.d.ts +100 -0
- package/dist/coordinator-account-change.d.ts.map +1 -0
- package/dist/coordinator-account-connection-link.d.ts +25 -0
- package/dist/coordinator-account-connection-link.d.ts.map +1 -0
- package/dist/coordinator-account-connection-schema.d.ts +68 -0
- package/dist/coordinator-account-connection-schema.d.ts.map +1 -0
- package/dist/coordinator-account-connection-session.d.ts +15 -0
- package/dist/coordinator-account-connection-session.d.ts.map +1 -0
- package/dist/coordinator-account-connection-storage.d.ts +46 -0
- package/dist/coordinator-account-connection-storage.d.ts.map +1 -0
- package/dist/coordinator-account-historical-revoke.d.ts +7 -0
- package/dist/coordinator-account-historical-revoke.d.ts.map +1 -0
- package/dist/coordinator-account-link-receipt.d.ts +20 -0
- package/dist/coordinator-account-link-receipt.d.ts.map +1 -0
- package/dist/coordinator-account-link-receiver.d.ts +28 -0
- package/dist/coordinator-account-link-receiver.d.ts.map +1 -0
- package/dist/coordinator-account-link-runtime.d.ts +45 -0
- package/dist/coordinator-account-link-runtime.d.ts.map +1 -0
- package/dist/coordinator-account-link-signer.d.ts +15 -0
- package/dist/coordinator-account-link-signer.d.ts.map +1 -0
- package/dist/coordinator-account-link-status-client.d.ts +37 -0
- package/dist/coordinator-account-link-status-client.d.ts.map +1 -0
- package/dist/coordinator-account-link-status.d.ts +23 -0
- package/dist/coordinator-account-link-status.d.ts.map +1 -0
- package/dist/coordinator-account-unlink-schema.d.ts +7 -0
- package/dist/coordinator-account-unlink-schema.d.ts.map +1 -0
- package/dist/coordinator-actions.d.ts +29 -0
- package/dist/coordinator-actions.d.ts.map +1 -1
- package/dist/coordinator-api.d.ts +21 -1
- package/dist/coordinator-api.d.ts.map +1 -1
- package/dist/coordinator-auth-account-profile-contract.d.ts +41 -0
- package/dist/coordinator-auth-account-profile-contract.d.ts.map +1 -0
- package/dist/coordinator-auth-account-profile.d.ts +27 -0
- package/dist/coordinator-auth-account-profile.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-migration-test-harness.d.ts +18 -0
- package/dist/coordinator-auth-browser-migration-test-harness.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-owner-purpose-test-harness.d.ts +6 -0
- package/dist/coordinator-auth-browser-owner-purpose-test-harness.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-proof-test-fixtures.d.ts +25 -0
- package/dist/coordinator-auth-browser-proof-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-schema-upgrade.d.ts +6 -0
- package/dist/coordinator-auth-browser-schema-upgrade.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-style.d.ts +6 -0
- package/dist/coordinator-auth-browser-style.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-transaction-contract.d.ts +130 -0
- package/dist/coordinator-auth-browser-transaction-contract.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-transaction-test-fixtures.d.ts +14 -0
- package/dist/coordinator-auth-browser-transaction-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-transaction.d.ts +36 -0
- package/dist/coordinator-auth-browser-transaction.d.ts.map +1 -0
- package/dist/coordinator-auth-browser-view.d.ts +84 -0
- package/dist/coordinator-auth-browser-view.d.ts.map +1 -0
- package/dist/coordinator-auth-contract.d.ts +71 -0
- package/dist/coordinator-auth-contract.d.ts.map +1 -0
- package/dist/coordinator-auth-controller-review-route.d.ts +38 -0
- package/dist/coordinator-auth-controller-review-route.d.ts.map +1 -0
- package/dist/coordinator-auth-controller.d.ts +87 -0
- package/dist/coordinator-auth-controller.d.ts.map +1 -0
- package/dist/coordinator-auth-device-claim-eligibility.d.ts +43 -0
- package/dist/coordinator-auth-device-claim-eligibility.d.ts.map +1 -0
- package/dist/coordinator-auth-device-claim-schema.d.ts +116 -0
- package/dist/coordinator-auth-device-claim-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-historical-migration-test-fixture.d.ts +2 -0
- package/dist/coordinator-auth-historical-migration-test-fixture.d.ts.map +1 -0
- package/dist/coordinator-auth-historical-store-test-fixture.d.ts +13 -0
- package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -0
- package/dist/coordinator-auth-historical-test-fixture.d.ts +48 -0
- package/dist/coordinator-auth-historical-test-fixture.d.ts.map +1 -0
- package/dist/coordinator-auth-legacy-assignment.d.ts +12 -0
- package/dist/coordinator-auth-legacy-assignment.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-admission-schema.d.ts +28 -0
- package/dist/coordinator-auth-lifecycle-admission-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-browser-schema.d.ts +15 -0
- package/dist/coordinator-auth-lifecycle-browser-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-current-readiness.d.ts +7 -0
- package/dist/coordinator-auth-lifecycle-current-readiness.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-first-link.d.ts +17 -0
- package/dist/coordinator-auth-lifecycle-first-link.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-fresh-schema.d.ts +14 -0
- package/dist/coordinator-auth-lifecycle-fresh-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-predecessor-shapes.d.ts +24 -0
- package/dist/coordinator-auth-lifecycle-predecessor-shapes.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-predecessor.d.ts +9 -0
- package/dist/coordinator-auth-lifecycle-predecessor.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-profile-schema.d.ts +13 -0
- package/dist/coordinator-auth-lifecycle-profile-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-recognition.d.ts +22 -0
- package/dist/coordinator-auth-lifecycle-recognition.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-schema.d.ts +20 -0
- package/dist/coordinator-auth-lifecycle-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-upgrade-copy.d.ts +36 -0
- package/dist/coordinator-auth-lifecycle-upgrade-copy.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-upgrade-sqlite.d.ts +11 -0
- package/dist/coordinator-auth-lifecycle-upgrade-sqlite.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-upgrade-test-fixture.d.ts +31 -0
- package/dist/coordinator-auth-lifecycle-upgrade-test-fixture.d.ts.map +1 -0
- package/dist/coordinator-auth-lifecycle-upgrade.d.ts +6 -0
- package/dist/coordinator-auth-lifecycle-upgrade.d.ts.map +1 -0
- package/dist/coordinator-auth-link-authority-upgrade.d.ts +17 -0
- package/dist/coordinator-auth-link-authority-upgrade.d.ts.map +1 -0
- package/dist/coordinator-auth-link-authority.d.ts +92 -0
- package/dist/coordinator-auth-link-authority.d.ts.map +1 -0
- package/dist/coordinator-auth-link-change-schema.d.ts +21 -0
- package/dist/coordinator-auth-link-change-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-link-contract.d.ts +137 -0
- package/dist/coordinator-auth-link-contract.d.ts.map +1 -0
- package/dist/coordinator-auth-link-input.d.ts +7 -0
- package/dist/coordinator-auth-link-input.d.ts.map +1 -0
- package/dist/coordinator-auth-link-legacy-inline-test-fixture.d.ts +2 -0
- package/dist/coordinator-auth-link-legacy-inline-test-fixture.d.ts.map +1 -0
- package/dist/coordinator-auth-link-liveness.d.ts +8 -0
- package/dist/coordinator-auth-link-liveness.d.ts.map +1 -0
- package/dist/coordinator-auth-link-maintenance-fixtures.d.ts +14 -0
- package/dist/coordinator-auth-link-maintenance-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-link-profile.d.ts +15 -0
- package/dist/coordinator-auth-link-profile.d.ts.map +1 -0
- package/dist/coordinator-auth-link-provenance.d.ts +17 -0
- package/dist/coordinator-auth-link-provenance.d.ts.map +1 -0
- package/dist/coordinator-auth-link-revocation-test-harness.d.ts +19 -0
- package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-auth-link-source.d.ts +15 -0
- package/dist/coordinator-auth-link-source.d.ts.map +1 -0
- package/dist/coordinator-auth-link-test-fixtures.d.ts +49 -0
- package/dist/coordinator-auth-link-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-link.d.ts +91 -0
- package/dist/coordinator-auth-link.d.ts.map +1 -0
- package/dist/coordinator-auth-loopback.d.ts +11 -0
- package/dist/coordinator-auth-loopback.d.ts.map +1 -0
- package/dist/coordinator-auth-proof.d.ts +4 -0
- package/dist/coordinator-auth-proof.d.ts.map +1 -0
- package/dist/coordinator-auth-schema-operator.d.ts +6 -0
- package/dist/coordinator-auth-schema-operator.d.ts.map +1 -0
- package/dist/coordinator-auth-schema.d.ts +18 -0
- package/dist/coordinator-auth-schema.d.ts.map +1 -0
- package/dist/coordinator-auth-session-bound-test-fixtures.d.ts +7 -0
- package/dist/coordinator-auth-session-bound-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-session-contract.d.ts +104 -0
- package/dist/coordinator-auth-session-contract.d.ts.map +1 -0
- package/dist/coordinator-auth-session-test-fixtures.d.ts +31 -0
- package/dist/coordinator-auth-session-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-session.d.ts +44 -0
- package/dist/coordinator-auth-session.d.ts.map +1 -0
- package/dist/coordinator-auth-store-test-fixtures.d.ts +26 -0
- package/dist/coordinator-auth-store-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts +5 -0
- package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-authorization-test-harness.d.ts +11 -0
- package/dist/coordinator-bootstrap-authorization-test-harness.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-grant-authorization.d.ts +28 -0
- package/dist/coordinator-bootstrap-grant-authorization.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-grant-issuance.d.ts +22 -0
- package/dist/coordinator-bootstrap-grant-issuance.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-revocation-test-harness.d.ts +11 -0
- package/dist/coordinator-bootstrap-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-browser-account.d.ts +36 -0
- package/dist/coordinator-browser-account.d.ts.map +1 -0
- package/dist/coordinator-browser-auth-app.d.ts +84 -0
- package/dist/coordinator-browser-auth-app.d.ts.map +1 -0
- package/dist/coordinator-browser-auth-callback.d.ts +47 -0
- package/dist/coordinator-browser-auth-callback.d.ts.map +1 -0
- package/dist/coordinator-browser-auth-config.d.ts +32 -0
- package/dist/coordinator-browser-auth-config.d.ts.map +1 -0
- package/dist/coordinator-browser-credential.d.ts +40 -0
- package/dist/coordinator-browser-credential.d.ts.map +1 -0
- package/dist/coordinator-browser-csrf.d.ts +19 -0
- package/dist/coordinator-browser-csrf.d.ts.map +1 -0
- package/dist/coordinator-browser-form-body.d.ts +42 -0
- package/dist/coordinator-browser-form-body.d.ts.map +1 -0
- package/dist/coordinator-browser-form-guard.d.ts +55 -0
- package/dist/coordinator-browser-form-guard.d.ts.map +1 -0
- package/dist/coordinator-browser-link-completion.d.ts +32 -0
- package/dist/coordinator-browser-link-completion.d.ts.map +1 -0
- package/dist/coordinator-browser-link-start.d.ts +39 -0
- package/dist/coordinator-browser-link-start.d.ts.map +1 -0
- package/dist/coordinator-browser-link.d.ts +36 -0
- package/dist/coordinator-browser-link.d.ts.map +1 -0
- package/dist/coordinator-browser-request.d.ts +10 -0
- package/dist/coordinator-browser-request.d.ts.map +1 -0
- package/dist/coordinator-browser-signin-start.d.ts +38 -0
- package/dist/coordinator-browser-signin-start.d.ts.map +1 -0
- package/dist/coordinator-browser-start-transaction.d.ts +6 -0
- package/dist/coordinator-browser-start-transaction.d.ts.map +1 -0
- package/dist/coordinator-controller-revocation-test-harness.d.ts +11 -0
- package/dist/coordinator-controller-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-d1-scope-authorization-test-harness.d.ts +14 -0
- package/dist/coordinator-d1-scope-authorization-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-account-change.d.ts +17 -0
- package/dist/coordinator-device-account-change.d.ts.map +1 -0
- package/dist/coordinator-device-auth-link.d.ts +43 -0
- package/dist/coordinator-device-auth-link.d.ts.map +1 -0
- package/dist/coordinator-device-local.d.ts +9 -0
- package/dist/coordinator-device-local.d.ts.map +1 -0
- package/dist/coordinator-device-ownership-schema.d.ts +3 -0
- package/dist/coordinator-device-ownership-schema.d.ts.map +1 -0
- package/dist/coordinator-device-ownership-test-harness.d.ts +17 -0
- package/dist/coordinator-device-ownership-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-client.d.ts +41 -0
- package/dist/coordinator-device-revocation-client.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-handler-test-harness.d.ts +4 -0
- package/dist/coordinator-device-revocation-handler-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-handler.d.ts +17 -0
- package/dist/coordinator-device-revocation-handler.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-route.d.ts +14 -0
- package/dist/coordinator-device-revocation-route.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-test-harness.d.ts +34 -0
- package/dist/coordinator-device-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-revocation.d.ts +67 -0
- package/dist/coordinator-device-revocation.d.ts.map +1 -0
- package/dist/coordinator-ed25519-key-id-compat.d.ts +6 -0
- package/dist/coordinator-ed25519-key-id-compat.d.ts.map +1 -0
- package/dist/coordinator-ed25519-key-id-test-fixtures.d.ts +30 -0
- package/dist/coordinator-ed25519-key-id-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-ed25519-key-id.d.ts +21 -0
- package/dist/coordinator-ed25519-key-id.d.ts.map +1 -0
- package/dist/coordinator-enrollment-revocation-test-harness.d.ts +6 -0
- package/dist/coordinator-enrollment-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-hono-test-fixtures.d.ts +2 -0
- package/dist/coordinator-hono-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-identity-grant-revocation-test-harness.d.ts +11 -0
- package/dist/coordinator-identity-grant-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-identity-group-grant-client.d.ts +9 -0
- package/dist/coordinator-identity-group-grant-client.d.ts.map +1 -0
- package/dist/coordinator-identity-group-grant-input-test-harness.d.ts +3 -0
- package/dist/coordinator-identity-group-grant-input-test-harness.d.ts.map +1 -0
- package/dist/coordinator-identity-group-grant-test-harness.d.ts +17 -0
- package/dist/coordinator-identity-group-grant-test-harness.d.ts.map +1 -0
- package/dist/coordinator-identity-group-grant.d.ts +51 -0
- package/dist/coordinator-identity-group-grant.d.ts.map +1 -0
- package/dist/coordinator-invite-review.d.ts +64 -0
- package/dist/coordinator-invite-review.d.ts.map +1 -0
- package/dist/coordinator-join-review-guards.d.ts +22 -0
- package/dist/coordinator-join-review-guards.d.ts.map +1 -0
- package/dist/coordinator-join-revocation-test-harness.d.ts +23 -0
- package/dist/coordinator-join-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-legacy-device-ownership.d.ts +34 -0
- package/dist/coordinator-legacy-device-ownership.d.ts.map +1 -0
- package/dist/coordinator-oidc-test-fixtures.d.ts +50 -0
- package/dist/coordinator-oidc-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-oidc.d.ts +59 -0
- package/dist/coordinator-oidc.d.ts.map +1 -0
- package/dist/coordinator-owner-attempt-migration-test-harness.d.ts +16 -0
- package/dist/coordinator-owner-attempt-migration-test-harness.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-client.d.ts +29 -0
- package/dist/coordinator-owner-enrollment-client.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-commit-test-fixtures.d.ts +31 -0
- package/dist/coordinator-owner-enrollment-commit-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-commit.d.ts +23 -0
- package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts +11 -0
- package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-http.d.ts +67 -0
- package/dist/coordinator-owner-enrollment-http.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-proof.d.ts +67 -0
- package/dist/coordinator-owner-enrollment-proof.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-qualification-schema.d.ts +107 -0
- package/dist/coordinator-owner-enrollment-qualification-schema.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts +39 -0
- package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-qualification.d.ts +56 -0
- package/dist/coordinator-owner-enrollment-qualification.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-schema.d.ts +7 -0
- package/dist/coordinator-owner-enrollment-schema.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-start-test-fixtures.d.ts +54 -0
- package/dist/coordinator-owner-enrollment-start-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-test-harness.d.ts +72 -0
- package/dist/coordinator-owner-enrollment-test-harness.d.ts.map +1 -0
- package/dist/coordinator-owner-profile-adoption.d.ts +34 -0
- package/dist/coordinator-owner-profile-adoption.d.ts.map +1 -0
- package/dist/coordinator-owner-profile-client-test-harness.d.ts +57 -0
- package/dist/coordinator-owner-profile-client-test-harness.d.ts.map +1 -0
- package/dist/coordinator-owner-profile-client.d.ts +38 -0
- package/dist/coordinator-owner-profile-client.d.ts.map +1 -0
- package/dist/coordinator-owner-profile-files.d.ts +62 -0
- package/dist/coordinator-owner-profile-files.d.ts.map +1 -0
- package/dist/coordinator-owner-qualification-http.d.ts +14 -0
- package/dist/coordinator-owner-qualification-http.d.ts.map +1 -0
- package/dist/coordinator-owner-qualification-route.d.ts +16 -0
- package/dist/coordinator-owner-qualification-route.d.ts.map +1 -0
- package/dist/coordinator-owner-review-local.d.ts +35 -0
- package/dist/coordinator-owner-review-local.d.ts.map +1 -0
- package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts +21 -0
- package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-peer-discovery.d.ts +15 -0
- package/dist/coordinator-peer-discovery.d.ts.map +1 -0
- package/dist/coordinator-project-invite-guards.d.ts +13 -0
- package/dist/coordinator-project-invite-guards.d.ts.map +1 -0
- package/dist/coordinator-project-revocation-test-harness.d.ts +25 -0
- package/dist/coordinator-project-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-recipient-revocation-test-harness.d.ts +30 -0
- package/dist/coordinator-recipient-revocation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-runtime.d.ts +1 -0
- package/dist/coordinator-runtime.d.ts.map +1 -1
- package/dist/coordinator-scope-authorization-api-test-harness.d.ts +8 -0
- package/dist/coordinator-scope-authorization-api-test-harness.d.ts.map +1 -0
- package/dist/coordinator-scope-authorization-response.d.ts +10 -0
- package/dist/coordinator-scope-authorization-response.d.ts.map +1 -0
- package/dist/coordinator-scope-authorization.d.ts +25 -0
- package/dist/coordinator-scope-authorization.d.ts.map +1 -0
- package/dist/coordinator-store-contract.d.ts +48 -1
- package/dist/coordinator-store-contract.d.ts.map +1 -1
- package/dist/coordinator-store.d.ts +2 -1
- package/dist/coordinator-store.d.ts.map +1 -1
- package/dist/d1-coordinator-runtime.d.ts +9 -1
- package/dist/d1-coordinator-runtime.d.ts.map +1 -1
- package/dist/d1-coordinator-store.d.ts +108 -5
- package/dist/d1-coordinator-store.d.ts.map +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/export-import.d.ts +2 -0
- package/dist/export-import.d.ts.map +1 -1
- package/dist/extraction-tier-routing.d.ts.map +1 -1
- package/dist/file-context-transport.d.ts +93 -0
- package/dist/file-context-transport.d.ts.map +1 -0
- package/dist/file-context.d.ts +58 -0
- package/dist/file-context.d.ts.map +1 -0
- package/dist/filters.d.ts +14 -3
- package/dist/filters.d.ts.map +1 -1
- package/dist/index.d.ts +43 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29731 -23760
- package/dist/index.js.map +1 -1
- package/dist/ingest-pipeline.d.ts +4 -0
- package/dist/ingest-pipeline.d.ts.map +1 -1
- package/dist/ingest-xml-parser.d.ts +2 -5
- package/dist/ingest-xml-parser.d.ts.map +1 -1
- package/dist/ingest-xml-scan.d.ts +30 -0
- package/dist/ingest-xml-scan.d.ts.map +1 -0
- package/dist/internal/cloudflare-coordinator.d.ts +23 -2
- package/dist/internal/cloudflare-coordinator.d.ts.map +1 -1
- package/dist/internal/cloudflare-coordinator.js +4109 -372
- package/dist/internal/cloudflare-coordinator.js.map +1 -1
- package/dist/legacy-recipient-policy-projection.d.ts.map +1 -1
- package/dist/maintenance/relink.d.ts.map +1 -1
- package/dist/managed-scope-test-fixtures.d.ts +25 -0
- package/dist/managed-scope-test-fixtures.d.ts.map +1 -0
- package/dist/memory-creation-provenance.d.ts +13 -0
- package/dist/memory-creation-provenance.d.ts.map +1 -0
- package/dist/memory-local-capture-test-fixtures.d.ts +39 -0
- package/dist/memory-local-capture-test-fixtures.d.ts.map +1 -0
- package/dist/memory-local-capture.d.ts +29 -0
- package/dist/memory-local-capture.d.ts.map +1 -0
- package/dist/memory-ownership-recovery.d.ts.map +1 -1
- package/dist/memory-retirement-delivery.d.ts.map +1 -1
- package/dist/memory-source-identity.d.ts +3 -0
- package/dist/memory-source-identity.d.ts.map +1 -1
- package/dist/observer-client.d.ts.map +1 -1
- package/dist/observer-output.d.ts.map +1 -1
- package/dist/opencode-v2-generation.d.ts.map +1 -1
- package/dist/owned-recipient-d1-test-harness.d.ts +7 -0
- package/dist/owned-recipient-d1-test-harness.d.ts.map +1 -0
- package/dist/owner-browser-admission-authority.d.ts +24 -0
- package/dist/owner-browser-admission-authority.d.ts.map +1 -0
- package/dist/owner-browser-admission-body.d.ts +8 -0
- package/dist/owner-browser-admission-body.d.ts.map +1 -0
- package/dist/owner-browser-admission.d.ts +30 -0
- package/dist/owner-browser-admission.d.ts.map +1 -0
- package/dist/owner-enrollment-admission.d.ts +58 -0
- package/dist/owner-enrollment-admission.d.ts.map +1 -0
- package/dist/owner-enrollment-link-authority.d.ts +26 -0
- package/dist/owner-enrollment-link-authority.d.ts.map +1 -0
- package/dist/owner-enrollment-owner-pin-test-harness.d.ts +21 -0
- package/dist/owner-enrollment-owner-pin-test-harness.d.ts.map +1 -0
- package/dist/owner-enrollment-owner-pin.d.ts +14 -0
- package/dist/owner-enrollment-owner-pin.d.ts.map +1 -0
- package/dist/owner-enrollment-start-xsoRbhG2.js +14318 -0
- package/dist/owner-enrollment-start-xsoRbhG2.js.map +1 -0
- package/dist/owner-enrollment-start.d.ts +109 -0
- package/dist/owner-enrollment-start.d.ts.map +1 -0
- package/dist/owner-qualified-consumer-access-test-harness.d.ts +3 -0
- package/dist/owner-qualified-consumer-access-test-harness.d.ts.map +1 -0
- package/dist/owner-qualified-consumer-adversarial-test-harness.d.ts +5 -0
- package/dist/owner-qualified-consumer-adversarial-test-harness.d.ts.map +1 -0
- package/dist/owner-qualified-consumer-test-fixture.d.ts +4 -0
- package/dist/owner-qualified-consumer-test-fixture.d.ts.map +1 -0
- package/dist/owner-qualified-consumer-test-harness.d.ts +69 -0
- package/dist/owner-qualified-consumer-test-harness.d.ts.map +1 -0
- package/dist/pack.d.ts.map +1 -1
- package/dist/pi-session-search.d.ts +73 -0
- package/dist/pi-session-search.d.ts.map +1 -0
- package/dist/pi-sessions-import.d.ts +72 -0
- package/dist/pi-sessions-import.d.ts.map +1 -0
- package/dist/policy-team-device-eligibility.d.ts.map +1 -1
- package/dist/project-scope-settings.d.ts +4 -0
- package/dist/project-scope-settings.d.ts.map +1 -1
- package/dist/{promise-B3UhYSzv.js → promise-BgC-VNzX.js} +436 -214
- package/dist/promise-BgC-VNzX.js.map +1 -0
- package/dist/{service-contender-9rqn6x4v-pocTjwT1.js → pty-handoff-9rqn6x4v-Dxw6kceQ.js} +2 -2
- package/dist/pty-handoff-9rqn6x4v-Dxw6kceQ.js.map +1 -0
- package/dist/raw-event-auth-recovery.d.ts +1 -1
- package/dist/raw-event-auth-recovery.d.ts.map +1 -1
- package/dist/raw-event-flush.d.ts.map +1 -1
- package/dist/recipient-policy-deny-overlay.d.ts +9 -0
- package/dist/recipient-policy-deny-overlay.d.ts.map +1 -0
- package/dist/recipient-policy-reconciliation.d.ts +1 -9
- package/dist/recipient-policy-reconciliation.d.ts.map +1 -1
- package/dist/ref-queries.d.ts +7 -2
- package/dist/ref-queries.d.ts.map +1 -1
- package/dist/schema-bootstrap.d.ts +2 -0
- package/dist/schema-bootstrap.d.ts.map +1 -1
- package/dist/schema.d.ts +160 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/scope-membership-cache-test-fixtures.d.ts +19 -0
- package/dist/scope-membership-cache-test-fixtures.d.ts.map +1 -0
- package/dist/scope-membership-cache.d.ts +15 -2
- package/dist/scope-membership-cache.d.ts.map +1 -1
- package/dist/scope-membership-evidence.d.ts +17 -0
- package/dist/scope-membership-evidence.d.ts.map +1 -0
- package/dist/scope-membership-snapshot.d.ts +22 -0
- package/dist/scope-membership-snapshot.d.ts.map +1 -0
- package/dist/scope-membership-wire.d.ts +4 -0
- package/dist/scope-membership-wire.d.ts.map +1 -0
- package/dist/scope-resolution.d.ts +15 -37
- package/dist/scope-resolution.d.ts.map +1 -1
- package/dist/scope-stamping.d.ts +7 -0
- package/dist/scope-stamping.d.ts.map +1 -1
- package/dist/scope-write-authority-error.d.ts +5 -0
- package/dist/scope-write-authority-error.d.ts.map +1 -0
- package/dist/search.d.ts +3 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/session-export-identity-mutation.d.ts +4 -0
- package/dist/session-export-identity-mutation.d.ts.map +1 -0
- package/dist/session-export-identity.d.ts +7 -0
- package/dist/session-export-identity.d.ts.map +1 -0
- package/dist/shared-owned-device-enrollment-test-harness.d.ts +33 -0
- package/dist/shared-owned-device-enrollment-test-harness.d.ts.map +1 -0
- package/dist/shared-owned-join-approval-test-harness.d.ts +9 -0
- package/dist/shared-owned-join-approval-test-harness.d.ts.map +1 -0
- package/dist/shared-owned-project-invites-test-harness.d.ts +23 -0
- package/dist/shared-owned-project-invites-test-harness.d.ts.map +1 -0
- package/dist/shared-owned-recipient-invites-test-harness.d.ts +11 -0
- package/dist/shared-owned-recipient-invites-test-harness.d.ts.map +1 -0
- package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts +19 -0
- package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts.map +1 -0
- package/dist/store.d.ts +81 -13
- package/dist/store.d.ts.map +1 -1
- package/dist/summary-memory.d.ts +1 -1
- package/dist/summary-memory.d.ts.map +1 -1
- package/dist/sync-bootstrap.d.ts.map +1 -1
- package/dist/sync-http-client.d.ts +1 -0
- package/dist/sync-http-client.d.ts.map +1 -1
- package/dist/sync-identity.d.ts +6 -0
- package/dist/sync-identity.d.ts.map +1 -1
- package/dist/sync-pass.d.ts.map +1 -1
- package/dist/sync-replication.d.ts +6 -3
- package/dist/sync-replication.d.ts.map +1 -1
- package/dist/sync-scope-protocol.d.ts +6 -0
- package/dist/sync-scope-protocol.d.ts.map +1 -1
- package/dist/sync-status-test-fixtures.d.ts +21 -0
- package/dist/sync-status-test-fixtures.d.ts.map +1 -0
- package/dist/test-schema.generated.d.ts +1 -1
- package/dist/test-schema.generated.d.ts.map +1 -1
- package/dist/vector-corpus-epoch.d.ts +10 -0
- package/dist/vector-corpus-epoch.d.ts.map +1 -0
- package/dist/vector-cutover-validation.d.ts +19 -0
- package/dist/vector-cutover-validation.d.ts.map +1 -0
- package/dist/vector-metadata-snapshot.d.ts +21 -0
- package/dist/vector-metadata-snapshot.d.ts.map +1 -0
- package/dist/vector-migration.d.ts.map +1 -1
- package/dist/vectors.d.ts +8 -1
- package/dist/vectors.d.ts.map +1 -1
- package/dist/wildcard-match.d.ts +9 -0
- package/dist/wildcard-match.d.ts.map +1 -0
- package/dist/workspace-identity.d.ts +18 -0
- package/dist/workspace-identity.d.ts.map +1 -0
- package/package.json +5 -4
- package/dist/coordinator-api-CdUQtf5l.js +0 -3755
- package/dist/coordinator-api-CdUQtf5l.js.map +0 -1
- package/dist/promise-B3UhYSzv.js.map +0 -1
- package/dist/service-contender-9rqn6x4v-pocTjwT1.js.map +0 -1
|
@@ -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`manual_addresses_json` text,\n\t`last_success_address` 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\t`failure_category` 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`);";
|
|
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 `pi_import_state` (\n\t`file_path` text PRIMARY KEY NOT NULL,\n\t`size_bytes` integer NOT NULL,\n\t`mtime_ms` real NOT NULL,\n\t`updated_at` text NOT NULL\n);\n\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`manual_addresses_json` text,\n\t`last_success_address` 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\t`failure_category` 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,6wrCAC0urC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Database } from "better-sqlite3";
|
|
2
|
+
/** Ordinary-table triggers also observe writes from older application versions. */
|
|
3
|
+
export declare function ensureVectorCorpusEpoch(db: Database): void;
|
|
4
|
+
/** Compare both fields: repairing a deleted counter row can repeat an epoch. */
|
|
5
|
+
export type VectorCorpusFence = {
|
|
6
|
+
schemaVersion: number;
|
|
7
|
+
epoch: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function readVectorCorpusFence(db: Database): VectorCorpusFence;
|
|
10
|
+
//# sourceMappingURL=vector-corpus-epoch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-corpus-epoch.d.ts","sourceRoot":"","sources":["../src/vector-corpus-epoch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAwB/C,mFAAmF;AACnF,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAQ1D;AAuBD,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEhF,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,GAAG,iBAAiB,CAcrE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Database } from "better-sqlite3";
|
|
2
|
+
/**
|
|
3
|
+
* Keep the catalog alive through finalization; it is NOT a source TEMP table.
|
|
4
|
+
* Blob/chunk_index-only writes cannot change hash coverage and are intentionally ignored.
|
|
5
|
+
*/
|
|
6
|
+
export type VectorCutoverValidation = {
|
|
7
|
+
deleted: number;
|
|
8
|
+
uncovered: number;
|
|
9
|
+
close: () => void;
|
|
10
|
+
retryReason: () => string | null;
|
|
11
|
+
corpusRetryReason: () => string | null;
|
|
12
|
+
metadataRetryReason: () => string | null;
|
|
13
|
+
noteOwnWrites: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function prepareVectorCutoverValidation(db: Database, model: string, options?: {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
phase?: "cleanup-";
|
|
18
|
+
}): VectorCutoverValidation;
|
|
19
|
+
//# sourceMappingURL=vector-cutover-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-cutover-validation.d.ts","sourceRoot":"","sources":["../src/vector-cutover-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAkF/C;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACvC,mBAAmB,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,wBAAgB,8BAA8B,CAC7C,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,UAAU,CAAA;CAAO,GACxD,uBAAuB,CAkDzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Database } from "./db.js";
|
|
2
|
+
type VectorMetadataSnapshotOptions = {
|
|
3
|
+
memoryIds?: readonly number[];
|
|
4
|
+
model?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Stream vec0 metadata once into an indexed, disposable SQLite database.
|
|
8
|
+
*
|
|
9
|
+
* A separate temporary database avoids changing the source connection's
|
|
10
|
+
* temp_store (which would destroy callers' TEMP tables). Its pager can spill
|
|
11
|
+
* to disk, unlike a TEMP table on our temp_store=MEMORY source connection.
|
|
12
|
+
* Every invocation owns its connection, including nested operations.
|
|
13
|
+
*
|
|
14
|
+
* Callers own its lifetime and must close it in finally. Retaining an idle
|
|
15
|
+
* catalog across cleanup yields holds no source transaction or statement open.
|
|
16
|
+
* A write recheck must build it inside the source's immediate transaction.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createVectorMetadataSnapshot(db: Database, options?: VectorMetadataSnapshotOptions): Database;
|
|
19
|
+
export declare function withVectorMetadataSnapshot<T>(db: Database, visit: (metadata: Database) => T, options?: VectorMetadataSnapshotOptions): T;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=vector-metadata-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-metadata-snapshot.d.ts","sourceRoot":"","sources":["../src/vector-metadata-snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,KAAK,6BAA6B,GAAG;IAAE,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA6CvF;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,EAAE,QAAQ,EACZ,OAAO,GAAE,6BAAkC,GACzC,QAAQ,CAoBV;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAC3C,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,CAAC,EAChC,OAAO,GAAE,6BAAkC,GACzC,CAAC,CAOH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-migration.d.ts","sourceRoot":"","sources":["../src/vector-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAgBjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"vector-migration.d.ts","sourceRoot":"","sources":["../src/vector-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAgBjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAanE,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAKnE,MAAM,WAAW,2BAA2B;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AA6OD,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED,wBAAgB,qCAAqC,CACpD,EAAE,EAAE,cAAc,EAClB,IAAI,EAAE,qBAAqB,GACzB,IAAI,CA2DN;AA4CD,wBAAgB,mCAAmC,CAClD,EAAE,EAAE,cAAc,EAClB,OAAO,GAAE;IAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC/C,IAAI,CAsBN;AA67BD,wBAAsB,sBAAsB,CAC3C,EAAE,EAAE,cAAc,EAClB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,OAAO,CAAA;CAAO,GACpF,OAAO,CAAC,IAAI,CAAC,CAuSf;AAED,qBAAa,0BAA0B;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,eAAe,CAAS;IAEhC,YAAY,OAAO,GAAE,2BAAgC,EAMpD;IAED,KAAK,IAAI,IAAI,CAMZ;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ1B;IAED;;;;;OAKG;IACH,IAAI,IAAI,IAAI,CAQX;IAED,OAAO,CAAC,QAAQ;YAiBF,OAAO;IAgCrB,OAAO,CAAC,WAAW;CAiDnB"}
|
package/dist/vectors.d.ts
CHANGED
|
@@ -31,7 +31,14 @@ export declare function resolveSemanticSearchModel(db: Database, currentModel?:
|
|
|
31
31
|
export declare function resolveSemanticSearchModels(db: Database, resolvedModel?: string): string[];
|
|
32
32
|
export declare function memoryHasCompleteVectorCoverage(db: Database, memory: MemoryTextRow, model: string): boolean;
|
|
33
33
|
export declare function findMemoryIdsWithCompleteActiveVectorCoverage(db: Database, memoryIds: number[], model: string): number[];
|
|
34
|
-
export declare function countIncompleteActiveMemoryVectorCoverage(db: Database, model: string
|
|
34
|
+
export declare function countIncompleteActiveMemoryVectorCoverage(db: Database, model: string, options?: {
|
|
35
|
+
metadata?: Database;
|
|
36
|
+
}): number;
|
|
37
|
+
/** Recheck a delete batch under its writer transaction, using one metadata scan. */
|
|
38
|
+
export declare function findMemoryIdsWithCurrentTargetCoverage(db: Database, memoryIds: readonly number[], model: string): Set<number>;
|
|
39
|
+
export declare function pruneObsoleteTargetVectorsFromCatalog(db: Database, model: string, metadata: Database, options?: {
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
}): number;
|
|
35
42
|
/**
|
|
36
43
|
* Delete target-model vector rows whose content_hash is not part of their
|
|
37
44
|
* memory's current chunk set. Coverage is a subset check, so a memory can be
|
package/dist/vectors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectors.d.ts","sourceRoot":"","sources":["../src/vectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"vectors.d.ts","sourceRoot":"","sources":["../src/vectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAIN,KAAK,eAAe,EAUpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAkC,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAQ3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAehD,KAAK,aAAa,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAmDF,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAiGhG,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU7F;AA8CD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAS1F;AA2BD,wBAAgB,+BAA+B,CAC9C,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GACX,OAAO,CAOT;AAED,wBAAgB,6CAA6C,CAC5D,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EAAE,EACnB,KAAK,EAAE,MAAM,GACX,MAAM,EAAE,CAsBV;AA2CD,wBAAgB,yCAAyC,CACxD,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAO,GACnC,MAAM,CAiCR;AAED,oFAAoF;AACpF,wBAAgB,sCAAsC,CACrD,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,KAAK,EAAE,MAAM,GACX,GAAG,CAAC,MAAM,CAAC,CAyBb;AAgFD,wBAAgB,qCAAqC,CACpD,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACpC,MAAM,CAsBR;AA2VD;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC9C,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACpC,MAAM,CAER;AAED,wBAAgB,2CAA2C,CAC1D,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACpC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAQ9D;AA4CD,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,kCAAkC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5F,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,GAAG,cAAc,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE;QAChB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;QACrE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,GAAG,IAAI,CAAC;CACT;AAED,MAAM,WAAW,+BAA+B;IAC/C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAsQD,wBAAgB,2BAA2B,CAC1C,EAAE,EAAE,QAAQ,EACZ,OAAO,GAAE,+BAAoC,GAC3C,wBAAwB,CA8D1B;AA+CD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC5C,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EAAE,EACnB,KAAK,EAAE,MAAM,GACX,MAAM,CAkCR;AAED;;;;GAIG;AACH,wBAAsB,wCAAwC,CAC7D,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,qBAAqB,GACzB,OAAO,CAAC,kCAAkC,CAAC,CAwC7C;AAMD;;;GAGG;AACH,wBAAsB,YAAY,CACjC,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAgCf;AAoGD;;;GAGG;AACH,wBAAsB,eAAe,CACpC,EAAE,EAAE,QAAQ,EACZ,IAAI,GAAE,sBAA2B,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAyIhC;AAMD,MAAM,WAAW,oBAAoB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oDAAoD;IACpD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AA0CD;;;;;GAKG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,aAAa,GAAG,IAAI,EAC7B,OAAO,EAAE,0BAA0B,EACnC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA0DjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Match the legacy wildcard language without exploring wildcard partitions.
|
|
2
|
+
* Each pattern/input pair is visited once: O(pattern × input) time,
|
|
3
|
+
* O(pattern + input) space for tokens and the current/previous rows.
|
|
4
|
+
* Scope resolution historically used UTF-16 units; recipient projection used /u.
|
|
5
|
+
*/
|
|
6
|
+
export declare function matchesWildcard(identity: string, pattern: string, options: {
|
|
7
|
+
unicode: boolean;
|
|
8
|
+
}): boolean;
|
|
9
|
+
//# sourceMappingURL=wildcard-match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wildcard-match.d.ts","sourceRoot":"","sources":["../src/wildcard-match.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAC3B,OAAO,CAST"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type WorkspaceIdentitySource = "git_remote" | "git_remote_branch" | "git_repository" | "cwd" | "workspace_id" | "unmapped";
|
|
2
|
+
export interface WorkspaceIdentityInput {
|
|
3
|
+
gitRemote?: string | null;
|
|
4
|
+
gitBranch?: string | null;
|
|
5
|
+
repositoryIdentity?: string | null;
|
|
6
|
+
cwd?: string | null;
|
|
7
|
+
workspaceId?: string | null;
|
|
8
|
+
project?: string | null;
|
|
9
|
+
branchScoped?: boolean;
|
|
10
|
+
allowRepositoryCwdFallback?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CanonicalWorkspaceIdentity {
|
|
13
|
+
value: string;
|
|
14
|
+
source: WorkspaceIdentitySource;
|
|
15
|
+
displayProject: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function canonicalWorkspaceIdentity(input: WorkspaceIdentityInput): CanonicalWorkspaceIdentity;
|
|
18
|
+
//# sourceMappingURL=workspace-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-identity.d.ts","sourceRoot":"","sources":["../src/workspace-identity.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,uBAAuB,GAChC,YAAY,GACZ,mBAAmB,GACnB,gBAAgB,GAChB,KAAK,GACL,cAAc,GACd,UAAU,CAAC;AAEd,MAAM,WAAW,sBAAsB;IACtC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,0BAA0B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,uBAAuB,CAAC;IAChC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAgCD,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,sBAAsB,GAC3B,0BAA0B,CA6C5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemem/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -24,25 +24,26 @@
|
|
|
24
24
|
"dist/"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@codemem/embeddings": "^0.
|
|
27
|
+
"@codemem/embeddings": "^0.47.0-beta.3",
|
|
28
28
|
"@types/better-sqlite3": "^9.6.0",
|
|
29
29
|
"typescript": "^7.0.2",
|
|
30
30
|
"vite": "^8.2.2",
|
|
31
31
|
"vitest": "^4.1.11"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@opencode/client": "2.0.
|
|
34
|
+
"@opencode/client": "2.0.24",
|
|
35
35
|
"better-sqlite3": "13.0.3",
|
|
36
36
|
"bonjour-service": "^1.4.4",
|
|
37
37
|
"drizzle-orm": "^0.45.2",
|
|
38
38
|
"eventsource-parser": "4.1.0",
|
|
39
39
|
"hono": "^4.13.5",
|
|
40
40
|
"limiter": "^3.0.0",
|
|
41
|
+
"openid-client": "6.8.8",
|
|
41
42
|
"sqlite-vec": "0.1.9",
|
|
42
43
|
"zod": "4.5.4"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"@codemem/embeddings": "^0.
|
|
46
|
+
"@codemem/embeddings": "^0.47.0-beta.3"
|
|
46
47
|
},
|
|
47
48
|
"peerDependenciesMeta": {
|
|
48
49
|
"@codemem/embeddings": {
|