hippo-memory 1.59.0 → 1.61.0
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/README.md +1 -1
- package/dist/ablation.js +9 -27
- package/dist/agent-memories/apply.js +4 -1
- package/dist/agent-memories/claude-code.js +1 -1
- package/dist/agent-memories/codex.js +1 -1
- package/dist/agent-memories/gemini.js +1 -1
- package/dist/agent-memories/legacy.js +1 -1
- package/dist/agent-memories/source.js +1 -1
- package/dist/agent-memories/sync.js +8 -3
- package/dist/ambient-store.d.ts +14 -0
- package/dist/ambient-store.js +90 -0
- package/dist/ambient.d.ts +23 -0
- package/dist/ambient.js +72 -50
- package/dist/api/assemble.d.ts +93 -0
- package/dist/api/assemble.js +152 -0
- package/dist/api/audit.d.ts +17 -0
- package/dist/api/audit.js +23 -0
- package/dist/api/auth.d.ts +79 -0
- package/dist/api/auth.js +178 -0
- package/dist/api/context-types.d.ts +105 -0
- package/dist/api/context-types.js +3 -0
- package/dist/api/context.d.ts +31 -0
- package/dist/api/context.js +705 -0
- package/dist/api/dormant.d.ts +30 -0
- package/dist/api/dormant.js +140 -0
- package/dist/api/drill-down.d.ts +84 -0
- package/dist/api/drill-down.js +123 -0
- package/dist/api/forget.d.ts +57 -0
- package/dist/api/forget.js +87 -0
- package/dist/api/goals.d.ts +18 -0
- package/dist/api/goals.js +33 -0
- package/dist/api/learn.d.ts +31 -0
- package/dist/api/learn.js +88 -0
- package/dist/api/outcome.d.ts +61 -0
- package/dist/api/outcome.js +66 -0
- package/dist/api/promote.d.ts +54 -0
- package/dist/api/promote.js +203 -0
- package/dist/api/quarantine.d.ts +24 -0
- package/dist/api/quarantine.js +121 -0
- package/dist/api/recall-types.d.ts +390 -0
- package/dist/api/recall-types.js +3 -0
- package/dist/api/recall.d.ts +36 -0
- package/dist/api/recall.js +634 -0
- package/dist/api/remember.d.ts +35 -0
- package/dist/api/remember.js +43 -0
- package/dist/api/sleep.d.ts +136 -0
- package/dist/api/sleep.js +271 -0
- package/dist/api/tokens.d.ts +26 -0
- package/dist/api/tokens.js +60 -0
- package/dist/api/types.d.ts +56 -0
- package/dist/api/types.js +38 -0
- package/dist/api.d.ts +20 -1260
- package/dist/api.js +25 -2711
- package/dist/audit.d.ts +3 -0
- package/dist/audit.js +7 -3
- package/dist/auth.d.ts +45 -4
- package/dist/auth.js +125 -48
- package/dist/autolearn.js +7 -4
- package/dist/capture/command.d.ts +33 -0
- package/dist/capture/command.js +264 -0
- package/dist/capture/compact.d.ts +44 -0
- package/dist/capture/compact.js +354 -0
- package/dist/capture/extract.d.ts +21 -0
- package/dist/capture/extract.js +464 -0
- package/dist/capture/transcript.d.ts +40 -0
- package/dist/capture/transcript.js +193 -0
- package/dist/capture-error.js +2 -1
- package/dist/churn-git.js +4 -2
- package/dist/cli/audit.d.ts +3 -0
- package/dist/cli/audit.js +159 -0
- package/dist/cli/auth.d.ts +2 -0
- package/dist/cli/auth.js +171 -0
- package/dist/cli/briefs.d.ts +4 -0
- package/dist/cli/briefs.js +435 -0
- package/dist/cli/card.d.ts +3 -0
- package/dist/cli/card.js +333 -0
- package/dist/cli/context.d.ts +15 -0
- package/dist/cli/context.js +366 -0
- package/dist/cli/continuity.d.ts +6 -0
- package/dist/cli/continuity.js +445 -0
- package/dist/cli/curate.d.ts +19 -0
- package/dist/cli/curate.js +555 -0
- package/dist/cli/dag.d.ts +5 -0
- package/dist/cli/dag.js +177 -0
- package/dist/cli/decisions.d.ts +4 -0
- package/dist/cli/decisions.js +528 -0
- package/dist/cli/eval.d.ts +5 -0
- package/dist/cli/eval.js +213 -0
- package/dist/cli/explain.d.ts +4 -0
- package/dist/cli/explain.js +150 -0
- package/dist/cli/goals.d.ts +2 -0
- package/dist/cli/goals.js +196 -0
- package/dist/cli/hook-blocks.d.ts +18 -0
- package/dist/cli/hook-blocks.js +233 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.js +305 -0
- package/dist/cli/maintenance.d.ts +4 -0
- package/dist/cli/maintenance.js +179 -0
- package/dist/cli/playbooks.d.ts +4 -0
- package/dist/cli/playbooks.js +556 -0
- package/dist/cli/projects.js +1 -1
- package/dist/cli/recall.d.ts +7 -0
- package/dist/cli/recall.js +597 -0
- package/dist/cli/remember.d.ts +5 -0
- package/dist/cli/remember.js +442 -0
- package/dist/cli/serve.d.ts +5 -0
- package/dist/cli/serve.js +40 -0
- package/dist/cli/session-hooks.d.ts +29 -0
- package/dist/cli/session-hooks.js +637 -0
- package/dist/cli/setup.d.ts +4 -0
- package/dist/cli/setup.js +376 -0
- package/dist/cli/shared.d.ts +15 -19
- package/dist/cli/shared.js +50 -341
- package/dist/cli/slack.d.ts +2 -0
- package/dist/cli/slack.js +171 -0
- package/dist/cli/status.d.ts +18 -0
- package/dist/cli/status.js +400 -0
- package/dist/cli/transfer.d.ts +10 -0
- package/dist/cli/transfer.js +438 -0
- package/dist/cli/usage.d.ts +85 -0
- package/dist/cli/usage.js +741 -0
- package/dist/cli.d.ts +319 -13
- package/dist/cli.js +436 -8580
- package/dist/client.js +15 -8
- package/dist/compaction-record.js +12 -9
- package/dist/config.js +12 -11
- package/dist/connectors/github/backfill.js +94 -87
- package/dist/connectors/github/cli-impl.js +5 -3
- package/dist/connectors/github/dlq.js +67 -54
- package/dist/connectors/github/ingest.js +34 -35
- package/dist/connectors/github/tenant-routing.js +3 -2
- package/dist/connectors/github/webhook.js +135 -216
- package/dist/connectors/slack/dlq.js +49 -61
- package/dist/connectors/slack/ingest.js +55 -48
- package/dist/connectors/slack/tenant-routing.js +4 -3
- package/dist/connectors/slack/webhook.js +72 -74
- package/dist/consolidate/conflicts.d.ts +10 -0
- package/dist/consolidate/conflicts.js +178 -0
- package/dist/consolidate/decay.d.ts +12 -0
- package/dist/consolidate/decay.js +145 -0
- package/dist/consolidate/llm-passes.d.ts +3 -0
- package/dist/consolidate/llm-passes.js +141 -0
- package/dist/consolidate/merge.d.ts +7 -0
- package/dist/consolidate/merge.js +251 -0
- package/dist/consolidate/physics-pass.d.ts +3 -0
- package/dist/consolidate/physics-pass.js +60 -0
- package/dist/consolidate/run.d.ts +69 -0
- package/dist/consolidate/run.js +76 -0
- package/dist/consolidate/sleep.d.ts +18 -0
- package/dist/consolidate/sleep.js +209 -0
- package/dist/consolidate/traces.d.ts +4 -0
- package/dist/consolidate/traces.js +178 -0
- package/dist/context-auto.js +7 -11
- package/dist/context-render.d.ts +1 -1
- package/dist/context-render.js +1 -1
- package/dist/customer-notes.d.ts +3 -0
- package/dist/customer-notes.js +6 -4
- package/dist/dag.js +13 -12
- package/dist/dashboard-actions.d.ts +20 -0
- package/dist/dashboard-actions.js +88 -0
- package/dist/dashboard-params.d.ts +45 -0
- package/dist/dashboard-params.js +127 -0
- package/dist/dashboard-queries.d.ts +15 -0
- package/dist/dashboard-queries.js +355 -0
- package/dist/dashboard-snapshot.d.ts +138 -0
- package/dist/dashboard-snapshot.js +308 -0
- package/dist/dashboard-types.d.ts +163 -0
- package/dist/dashboard-types.js +3 -0
- package/dist/dashboard.d.ts +6 -7
- package/dist/dashboard.js +231 -203
- package/dist/db/busy.d.ts +5 -0
- package/dist/db/busy.js +24 -0
- package/dist/db/continuity.d.ts +5 -0
- package/dist/db/continuity.js +145 -0
- package/dist/db/meta.d.ts +8 -0
- package/dist/db/meta.js +35 -0
- package/dist/db/migrate.d.ts +9 -0
- package/dist/db/migrate.js +138 -0
- package/dist/db/migrations/index.d.ts +5 -0
- package/dist/db/migrations/index.js +109 -0
- package/dist/db/migrations/types.d.ts +14 -0
- package/dist/db/migrations/types.js +2 -0
- package/dist/db/migrations/v01.d.ts +3 -0
- package/dist/db/migrations/v01.js +38 -0
- package/dist/db/migrations/v02.d.ts +3 -0
- package/dist/db/migrations/v02.js +21 -0
- package/dist/db/migrations/v03.d.ts +3 -0
- package/dist/db/migrations/v03.js +22 -0
- package/dist/db/migrations/v04.d.ts +3 -0
- package/dist/db/migrations/v04.js +28 -0
- package/dist/db/migrations/v05.d.ts +3 -0
- package/dist/db/migrations/v05.js +21 -0
- package/dist/db/migrations/v06.d.ts +3 -0
- package/dist/db/migrations/v06.js +25 -0
- package/dist/db/migrations/v07.d.ts +3 -0
- package/dist/db/migrations/v07.js +13 -0
- package/dist/db/migrations/v08.d.ts +3 -0
- package/dist/db/migrations/v08.js +8 -0
- package/dist/db/migrations/v09.d.ts +3 -0
- package/dist/db/migrations/v09.js +13 -0
- package/dist/db/migrations/v10.d.ts +3 -0
- package/dist/db/migrations/v10.js +17 -0
- package/dist/db/migrations/v11.d.ts +3 -0
- package/dist/db/migrations/v11.js +15 -0
- package/dist/db/migrations/v12.d.ts +3 -0
- package/dist/db/migrations/v12.js +11 -0
- package/dist/db/migrations/v13.d.ts +3 -0
- package/dist/db/migrations/v13.js +15 -0
- package/dist/db/migrations/v14.d.ts +3 -0
- package/dist/db/migrations/v14.js +66 -0
- package/dist/db/migrations/v15.d.ts +3 -0
- package/dist/db/migrations/v15.js +42 -0
- package/dist/db/migrations/v16.d.ts +3 -0
- package/dist/db/migrations/v16.js +61 -0
- package/dist/db/migrations/v17.d.ts +3 -0
- package/dist/db/migrations/v17.js +46 -0
- package/dist/db/migrations/v18.d.ts +3 -0
- package/dist/db/migrations/v18.js +60 -0
- package/dist/db/migrations/v19.d.ts +3 -0
- package/dist/db/migrations/v19.js +28 -0
- package/dist/db/migrations/v20.d.ts +3 -0
- package/dist/db/migrations/v20.js +42 -0
- package/dist/db/migrations/v21.d.ts +3 -0
- package/dist/db/migrations/v21.js +16 -0
- package/dist/db/migrations/v22.d.ts +3 -0
- package/dist/db/migrations/v22.js +82 -0
- package/dist/db/migrations/v23.d.ts +3 -0
- package/dist/db/migrations/v23.js +48 -0
- package/dist/db/migrations/v24.d.ts +3 -0
- package/dist/db/migrations/v24.js +72 -0
- package/dist/db/migrations/v25.d.ts +3 -0
- package/dist/db/migrations/v25.js +46 -0
- package/dist/db/migrations/v26.d.ts +3 -0
- package/dist/db/migrations/v26.js +23 -0
- package/dist/db/migrations/v27.d.ts +3 -0
- package/dist/db/migrations/v27.js +57 -0
- package/dist/db/migrations/v28.d.ts +3 -0
- package/dist/db/migrations/v28.js +38 -0
- package/dist/db/migrations/v29.d.ts +3 -0
- package/dist/db/migrations/v29.js +78 -0
- package/dist/db/migrations/v30.d.ts +3 -0
- package/dist/db/migrations/v30.js +92 -0
- package/dist/db/migrations/v31.d.ts +3 -0
- package/dist/db/migrations/v31.js +74 -0
- package/dist/db/migrations/v32.d.ts +3 -0
- package/dist/db/migrations/v32.js +102 -0
- package/dist/db/migrations/v33.d.ts +3 -0
- package/dist/db/migrations/v33.js +104 -0
- package/dist/db/migrations/v34.d.ts +3 -0
- package/dist/db/migrations/v34.js +93 -0
- package/dist/db/migrations/v35.d.ts +3 -0
- package/dist/db/migrations/v35.js +98 -0
- package/dist/db/migrations/v36.d.ts +3 -0
- package/dist/db/migrations/v36.js +98 -0
- package/dist/db/migrations/v37.d.ts +3 -0
- package/dist/db/migrations/v37.js +219 -0
- package/dist/db/migrations/v38.d.ts +3 -0
- package/dist/db/migrations/v38.js +277 -0
- package/dist/db/migrations/v39.d.ts +3 -0
- package/dist/db/migrations/v39.js +59 -0
- package/dist/db/migrations/v40.d.ts +3 -0
- package/dist/db/migrations/v40.js +74 -0
- package/dist/db/migrations/v41.d.ts +3 -0
- package/dist/db/migrations/v41.js +43 -0
- package/dist/db/migrations/v42.d.ts +3 -0
- package/dist/db/migrations/v42.js +41 -0
- package/dist/db/migrations/v43.d.ts +3 -0
- package/dist/db/migrations/v43.js +67 -0
- package/dist/db/migrations/v44.d.ts +3 -0
- package/dist/db/migrations/v44.js +28 -0
- package/dist/db/migrations/v45.d.ts +3 -0
- package/dist/db/migrations/v45.js +30 -0
- package/dist/db/migrations/v46.d.ts +3 -0
- package/dist/db/migrations/v46.js +25 -0
- package/dist/db/migrations/v47.d.ts +3 -0
- package/dist/db/migrations/v47.js +17 -0
- package/dist/db/migrations/v48.d.ts +3 -0
- package/dist/db/migrations/v48.js +10 -0
- package/dist/db/migrations/v49.d.ts +3 -0
- package/dist/db/migrations/v49.js +31 -0
- package/dist/db/migrations/v50.d.ts +3 -0
- package/dist/db/migrations/v50.js +67 -0
- package/dist/db/migrations/v51.d.ts +3 -0
- package/dist/db/migrations/v51.js +14 -0
- package/dist/db/migrations/v52.d.ts +3 -0
- package/dist/db/migrations/v52.js +7 -0
- package/dist/db/open.d.ts +23 -0
- package/dist/db/open.js +146 -0
- package/dist/db/sqlite.d.ts +21 -0
- package/dist/db/sqlite.js +8 -0
- package/dist/db/tables.d.ts +7 -0
- package/dist/db/tables.js +38 -0
- package/dist/db.d.ts +6 -46
- package/dist/db.js +5 -3036
- package/dist/decisions.d.ts +4 -1
- package/dist/decisions.js +9 -7
- package/dist/dedupe.js +3 -2
- package/dist/delivery-recorder.js +5 -1
- package/dist/doctor.js +4 -3
- package/dist/dormant.js +1 -0
- package/dist/embedding-provider.d.ts +1 -1
- package/dist/embedding-provider.js +7 -5
- package/dist/embeddings.d.ts +9 -52
- package/dist/embeddings.js +47 -298
- package/dist/env.d.ts +75 -0
- package/dist/env.js +119 -0
- package/dist/eval-suite.js +1 -1
- package/dist/eval.js +2 -2
- package/dist/extract.js +5 -4
- package/dist/gated-write.js +3 -1
- package/dist/goals.d.ts +3 -1
- package/dist/goals.js +18 -0
- package/dist/graph/read.d.ts +73 -0
- package/dist/graph/read.js +325 -0
- package/dist/graph/rows.d.ts +45 -0
- package/dist/graph/rows.js +51 -0
- package/dist/graph/types.d.ts +83 -0
- package/dist/graph/types.js +11 -0
- package/dist/graph/write.d.ts +93 -0
- package/dist/{graph.js → graph/write.js} +8 -391
- package/dist/graph-extract.js +2 -1
- package/dist/graph-recall.d.ts +1 -1
- package/dist/graph-recall.js +2 -2
- package/dist/graph-stream.js +1 -1
- package/dist/graph-view.d.ts +1 -1
- package/dist/graph-view.js +1 -1
- package/dist/half-life-migration.d.ts +1 -1
- package/dist/half-life-migration.js +2 -1
- package/dist/handoff.js +3 -0
- package/dist/hooks/codex-session.d.ts +8 -0
- package/dist/hooks/codex-session.js +76 -0
- package/dist/hooks/codex-wrapper.d.ts +55 -0
- package/dist/hooks/codex-wrapper.js +288 -0
- package/dist/hooks/json-hooks.d.ts +63 -0
- package/dist/hooks/json-hooks.js +356 -0
- package/dist/hooks/opencode.d.ts +50 -0
- package/dist/hooks/opencode.js +202 -0
- package/dist/hooks/shared.d.ts +54 -0
- package/dist/hooks/shared.js +77 -0
- package/dist/http-retry.d.ts +2 -0
- package/dist/http-retry.js +4 -3
- package/dist/http-util.d.ts +3 -0
- package/dist/http-util.js +10 -0
- package/dist/{importers.d.ts → importers/core.d.ts} +13 -17
- package/dist/importers/core.js +141 -0
- package/dist/importers/markdown-parse.d.ts +41 -0
- package/dist/importers/markdown-parse.js +132 -0
- package/dist/importers/markdown.d.ts +3 -0
- package/dist/importers/markdown.js +92 -0
- package/dist/importers/sources.d.ts +7 -0
- package/dist/importers/sources.js +229 -0
- package/dist/importers/vault.d.ts +11 -0
- package/dist/importers/vault.js +352 -0
- package/dist/incidents.d.ts +3 -0
- package/dist/incidents.js +8 -5
- package/dist/index.d.ts +25 -6
- package/dist/index.js +23 -6
- package/dist/invalidation.js +2 -1
- package/dist/judgment.js +7 -3
- package/dist/keyset.d.ts +13 -0
- package/dist/keyset.js +8 -0
- package/dist/local-embedding.d.ts +13 -0
- package/dist/local-embedding.js +165 -0
- package/dist/log.d.ts +7 -0
- package/dist/log.js +19 -1
- package/dist/mcp/admin-tools.d.ts +8 -0
- package/dist/mcp/admin-tools.js +116 -0
- package/dist/mcp/format.d.ts +27 -0
- package/dist/mcp/format.js +135 -0
- package/dist/mcp/memory-tools.d.ts +5 -0
- package/dist/mcp/memory-tools.js +83 -0
- package/dist/mcp/protocol.d.ts +83 -0
- package/dist/mcp/protocol.js +55 -0
- package/dist/mcp/recall-tools.d.ts +6 -0
- package/dist/mcp/recall-tools.js +320 -0
- package/dist/mcp/request.d.ts +10 -0
- package/dist/mcp/request.js +163 -0
- package/dist/mcp/server.d.ts +4 -70
- package/dist/mcp/server.js +8 -1172
- package/dist/mcp/session-state.d.ts +11 -0
- package/dist/mcp/session-state.js +28 -0
- package/dist/mcp/stdio.d.ts +8 -0
- package/dist/mcp/stdio.js +79 -0
- package/dist/mcp/tools.d.ts +11 -0
- package/dist/mcp/tools.js +247 -0
- package/dist/memory.d.ts +8 -3
- package/dist/memory.js +27 -1
- package/dist/multihop.d.ts +1 -1
- package/dist/multihop.js +2 -1
- package/dist/owner-validation.js +2 -1
- package/dist/physics-state.js +10 -7
- package/dist/policies.d.ts +3 -0
- package/dist/policies.js +8 -6
- package/dist/postinstall.js +3 -2
- package/dist/predictions/planning-fallacy.d.ts +100 -0
- package/dist/predictions/planning-fallacy.js +190 -0
- package/dist/{predictions.d.ts → predictions/store.d.ts} +7 -102
- package/dist/predictions/store.js +434 -0
- package/dist/processes.d.ts +3 -0
- package/dist/processes.js +8 -5
- package/dist/project-briefs.d.ts +3 -0
- package/dist/project-briefs.js +7 -5
- package/dist/project-identity.d.ts +1 -1
- package/dist/project-identity.js +12 -6
- package/dist/project-merge.js +3 -1
- package/dist/quarantine.d.ts +2 -1
- package/dist/quarantine.js +8 -5
- package/dist/raw-archive-mirror-cleanup.js +2 -1
- package/dist/raw-archive.js +1 -1
- package/dist/recall-history.js +3 -2
- package/dist/recall-pipeline.d.ts +2 -2
- package/dist/recall-pipeline.js +16 -8
- package/dist/recall-scope.js +1 -1
- package/dist/recall-trace.d.ts +3 -3
- package/dist/recall-trace.js +10 -14
- package/dist/refine-llm.js +20 -11
- package/dist/reject-flow.js +6 -1
- package/dist/rerankers/clef.d.ts +2 -2
- package/dist/rerankers/clef.js +72 -30
- package/dist/rerankers/cross-encoder.js +6 -4
- package/dist/rerankers/jev.d.ts +4 -2
- package/dist/rerankers/jev.js +24 -19
- package/dist/rerankers/llm.d.ts +4 -2
- package/dist/rerankers/llm.js +61 -41
- package/dist/rerankers/types.d.ts +1 -1
- package/dist/salience.js +1 -1
- package/dist/same-text.d.ts +2 -0
- package/dist/same-text.js +4 -0
- package/dist/scheduler.d.ts +1 -0
- package/dist/scheduler.js +26 -3
- package/dist/scope.js +4 -3
- package/dist/search/as-of.d.ts +10 -0
- package/dist/search/as-of.js +22 -0
- package/dist/search/bm25-search.d.ts +14 -0
- package/dist/search/bm25-search.js +43 -0
- package/dist/search/bm25.d.ts +15 -0
- package/dist/search/bm25.js +54 -0
- package/dist/search/boosts.d.ts +54 -0
- package/dist/search/boosts.js +94 -0
- package/dist/search/breakdown.d.ts +7 -0
- package/dist/search/breakdown.js +20 -0
- package/dist/search/explain.d.ts +25 -0
- package/dist/search/explain.js +31 -0
- package/dist/search/finalize.d.ts +8 -0
- package/dist/search/finalize.js +52 -0
- package/dist/search/fusion.d.ts +27 -0
- package/dist/search/fusion.js +42 -0
- package/dist/search/hybrid-score.d.ts +20 -0
- package/dist/search/hybrid-score.js +73 -0
- package/dist/search/hybrid.d.ts +46 -0
- package/dist/search/hybrid.js +64 -0
- package/dist/search/physics-search.d.ts +29 -0
- package/dist/search/physics-search.js +162 -0
- package/dist/search/rerank.d.ts +10 -0
- package/dist/search/rerank.js +72 -0
- package/dist/search/temporal.d.ts +15 -0
- package/dist/search/temporal.js +45 -0
- package/dist/search/types.d.ts +91 -0
- package/dist/search/types.js +2 -0
- package/dist/search/vector.d.ts +30 -0
- package/dist/search/vector.js +71 -0
- package/dist/secret-detect.d.ts +2 -0
- package/dist/secret-detect.js +3 -1
- package/dist/server/auth.d.ts +52 -0
- package/dist/server/auth.js +221 -0
- package/dist/server/client-ip.d.ts +25 -0
- package/dist/server/client-ip.js +92 -0
- package/dist/server/cursor.d.ts +23 -0
- package/dist/server/cursor.js +58 -0
- package/dist/server/lifecycle.d.ts +7 -0
- package/dist/server/lifecycle.js +29 -0
- package/dist/server/mcp-http.d.ts +5 -0
- package/dist/server/mcp-http.js +199 -0
- package/dist/server/request.d.ts +33 -0
- package/dist/server/request.js +103 -0
- package/dist/server/routes/admin.d.ts +9 -0
- package/dist/server/routes/admin.js +158 -0
- package/dist/server/routes/customer-notes.d.ts +7 -0
- package/dist/server/routes/customer-notes.js +112 -0
- package/dist/server/routes/decisions.d.ts +7 -0
- package/dist/server/routes/decisions.js +133 -0
- package/dist/server/routes/incidents.d.ts +7 -0
- package/dist/server/routes/incidents.js +126 -0
- package/dist/server/routes/memories.d.ts +10 -0
- package/dist/server/routes/memories.js +179 -0
- package/dist/server/routes/policies.d.ts +8 -0
- package/dist/server/routes/policies.js +151 -0
- package/dist/server/routes/predictions.d.ts +7 -0
- package/dist/server/routes/predictions.js +164 -0
- package/dist/server/routes/processes.d.ts +7 -0
- package/dist/server/routes/processes.js +161 -0
- package/dist/server/routes/project-briefs.d.ts +8 -0
- package/dist/server/routes/project-briefs.js +136 -0
- package/dist/server/routes/recall.d.ts +8 -0
- package/dist/server/routes/recall.js +340 -0
- package/dist/server/routes/skills.d.ts +8 -0
- package/dist/server/routes/skills.js +150 -0
- package/dist/server/types.d.ts +56 -0
- package/dist/server/types.js +2 -0
- package/dist/server/validation.d.ts +14 -0
- package/dist/server/validation.js +91 -0
- package/dist/server.d.ts +7 -61
- package/dist/server.js +92 -2368
- package/dist/session-digest.d.ts +1 -1
- package/dist/session-digest.js +9 -2
- package/dist/shared.d.ts +3 -1
- package/dist/shared.js +46 -40
- package/dist/skills.d.ts +3 -0
- package/dist/skills.js +7 -5
- package/dist/stdin.js +3 -2
- package/dist/store/audit-event.d.ts +19 -0
- package/dist/store/audit-event.js +33 -0
- package/dist/store/candidates.d.ts +42 -0
- package/dist/store/candidates.js +152 -0
- package/dist/store/conflicts.d.ts +44 -0
- package/dist/store/conflicts.js +444 -0
- package/dist/store/delete-and-batch.d.ts +63 -0
- package/dist/store/delete-and-batch.js +310 -0
- package/dist/store/entry-reads.d.ts +92 -0
- package/dist/store/entry-reads.js +255 -0
- package/dist/store/entry-row.d.ts +67 -0
- package/dist/store/entry-row.js +208 -0
- package/dist/store/entry-writes.d.ts +46 -0
- package/dist/store/entry-writes.js +148 -0
- package/dist/store/handoffs.d.ts +26 -0
- package/dist/store/handoffs.js +184 -0
- package/dist/store/index-and-stats.d.ts +52 -0
- package/dist/store/index-and-stats.js +214 -0
- package/dist/store/markdown.d.ts +10 -0
- package/dist/store/markdown.js +108 -0
- package/dist/store/mirrors.d.ts +49 -0
- package/dist/store/mirrors.js +312 -0
- package/dist/store/open.d.ts +15 -0
- package/dist/store/open.js +223 -0
- package/dist/store/rows.d.ts +178 -0
- package/dist/store/rows.js +158 -0
- package/dist/store/search-rows.d.ts +86 -0
- package/dist/store/search-rows.js +254 -0
- package/dist/store/sessions.d.ts +83 -0
- package/dist/store/sessions.js +272 -0
- package/dist/store/summaries.d.ts +94 -0
- package/dist/store/summaries.js +377 -0
- package/dist/store/tenant-lookup.d.ts +12 -0
- package/dist/store/tenant-lookup.js +16 -0
- package/dist/store-cards.js +2 -1
- package/dist/summary-dirty.d.ts +4 -0
- package/dist/summary-dirty.js +32 -0
- package/dist/support-bundle.js +4 -3
- package/dist/tenant.js +2 -2
- package/dist/token-ledger.js +1 -0
- package/dist/tokenize.d.ts +2 -0
- package/dist/tokenize.js +16 -0
- package/dist/transcript-tail.d.ts +7 -0
- package/dist/transcript-tail.js +48 -0
- package/dist/vector-store.d.ts +27 -0
- package/dist/vector-store.js +210 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/dist/working-memory.js +1 -1
- package/dist/yaml.js +36 -11
- package/dist-ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/dist-ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/dist-ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/dist-ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/dist-ui/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/dist-ui/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/dist-ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/dist-ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/dist-ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/dist-ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/dist-ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/dist-ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/dist-ui/assets/index-DPN7cP19.js +33 -0
- package/dist-ui/assets/index-dFloKRVr.css +1 -0
- package/dist-ui/index.html +3 -25
- package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
- package/extensions/openclaw-plugin/package.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -1
- package/dist/capture.d.ts +0 -155
- package/dist/capture.js +0 -1293
- package/dist/consolidate.d.ts +0 -58
- package/dist/consolidate.js +0 -1123
- package/dist/graph.d.ts +0 -245
- package/dist/hooks.d.ts +0 -208
- package/dist/hooks.js +0 -1073
- package/dist/importers.js +0 -897
- package/dist/predictions.js +0 -620
- package/dist/search.d.ts +0 -320
- package/dist/search.js +0 -968
- package/dist/store.d.ts +0 -744
- package/dist/store.js +0 -3372
- package/dist-ui/assets/d3-BiWEKnn4.js +0 -1
- package/dist-ui/assets/index-BhT8RvO6.js +0 -61
- package/dist-ui/assets/index-RoXXJ5dq.css +0 -1
- package/dist-ui/assets/three-BDgTxR1l.js +0 -4112
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { tableHasColumn } from '../tables.js';
|
|
2
|
+
export const v25 = {
|
|
3
|
+
version: 25,
|
|
4
|
+
up: (db) => {
|
|
5
|
+
// v1.5.0 DAG-aware recall — cache summary metadata so the assembler can
|
|
6
|
+
// reason about scope without re-walking the DAG. Three additive,
|
|
7
|
+
// optional columns. No min_compatible_binary bump: these columns are
|
|
8
|
+
// pure metadata; older binaries opening this DB will see them as NULL
|
|
9
|
+
// / 0 and behave as before. See docs/plans/2026-05-05-dag-recall.md
|
|
10
|
+
// Task 1.
|
|
11
|
+
if (!tableHasColumn(db, 'memories', 'descendant_count')) {
|
|
12
|
+
db.exec(`ALTER TABLE memories ADD COLUMN descendant_count INTEGER NOT NULL DEFAULT 0`);
|
|
13
|
+
}
|
|
14
|
+
if (!tableHasColumn(db, 'memories', 'earliest_at')) {
|
|
15
|
+
db.exec(`ALTER TABLE memories ADD COLUMN earliest_at TEXT`);
|
|
16
|
+
}
|
|
17
|
+
if (!tableHasColumn(db, 'memories', 'latest_at')) {
|
|
18
|
+
db.exec(`ALTER TABLE memories ADD COLUMN latest_at TEXT`);
|
|
19
|
+
}
|
|
20
|
+
// Backfill descendant_count for existing level-2 summary rows. Use
|
|
21
|
+
// dag_parent_id pointing at the summary id. Level-3 (entity profiles)
|
|
22
|
+
// not built today; their descendant_count stays at default 0.
|
|
23
|
+
db.exec(`
|
|
24
|
+
UPDATE memories
|
|
25
|
+
SET descendant_count = (
|
|
26
|
+
SELECT COUNT(*) FROM memories AS c WHERE c.dag_parent_id = memories.id
|
|
27
|
+
)
|
|
28
|
+
WHERE dag_level >= 2
|
|
29
|
+
AND descendant_count = 0
|
|
30
|
+
`);
|
|
31
|
+
// Backfill earliest_at / latest_at from child created timestamps for
|
|
32
|
+
// existing summaries. Children of a level-2 summary are level-1 facts.
|
|
33
|
+
db.exec(`
|
|
34
|
+
UPDATE memories
|
|
35
|
+
SET earliest_at = (
|
|
36
|
+
SELECT MIN(c.created) FROM memories AS c WHERE c.dag_parent_id = memories.id
|
|
37
|
+
),
|
|
38
|
+
latest_at = (
|
|
39
|
+
SELECT MAX(c.created) FROM memories AS c WHERE c.dag_parent_id = memories.id
|
|
40
|
+
)
|
|
41
|
+
WHERE dag_level >= 2
|
|
42
|
+
AND earliest_at IS NULL
|
|
43
|
+
`);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=v25.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { tableHasColumn, tableExists } from '../tables.js';
|
|
2
|
+
export const v26 = {
|
|
3
|
+
version: 26,
|
|
4
|
+
up: (db) => {
|
|
5
|
+
// v1.12.0 A5 v2 sub-1: add role column to api_keys for the admin/member
|
|
6
|
+
// distinction that gates /v1/sleep. Additive — existing keys backfill to
|
|
7
|
+
// 'admin' via DEFAULT (single-tenant operator = admin by definition).
|
|
8
|
+
// No min_compatible_binary bump: old binaries (v1.11.x) ignore the
|
|
9
|
+
// column on SELECTs that don't name it; new binaries on old data run
|
|
10
|
+
// this migration at openHippoDb time before any createApiKey call.
|
|
11
|
+
//
|
|
12
|
+
// v1.12.7 defensive: also guard on tableExists. If a DB landed in the
|
|
13
|
+
// partial-v16-state (api_keys table missing despite schema_version >= 16),
|
|
14
|
+
// running ALTER TABLE here would crash and block all later migrations.
|
|
15
|
+
// The v27 heal below recreates api_keys with the role column already
|
|
16
|
+
// present, so this ALTER becomes a no-op anyway for that path. Defense
|
|
17
|
+
// in depth: guard so v26 never crashes on the partial-apply state.
|
|
18
|
+
if (tableExists(db, 'api_keys') && !tableHasColumn(db, 'api_keys', 'role')) {
|
|
19
|
+
db.exec(`ALTER TABLE api_keys ADD COLUMN role TEXT NOT NULL DEFAULT 'admin'`);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=v26.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { tableHasColumn, tableExists } from '../tables.js';
|
|
2
|
+
export const v27 = {
|
|
3
|
+
version: 27,
|
|
4
|
+
up: (db) => {
|
|
5
|
+
// v1.12.7 self-heal — re-assert the v16 schema (api_keys + audit_log).
|
|
6
|
+
//
|
|
7
|
+
// Surfaced 2026-05-24 on Keith's ~/.hippo/hippo.db: schema_version
|
|
8
|
+
// recorded as 25 but api_keys and audit_log tables were missing from
|
|
9
|
+
// migration v16. Root cause unknown — the migration runner has wrapped
|
|
10
|
+
// each migration in BEGIN/COMMIT since the first SQLite commit, so
|
|
11
|
+
// atomicity isn't the bug. Possible causes: DROP TABLE post-migration,
|
|
12
|
+
// SQL import / restore from a pre-v16 backup over a v16+ schema_version,
|
|
13
|
+
// or some edge case the wrapping doesn't catch. Cause may be operator
|
|
14
|
+
// action; either way the practical fix is the same.
|
|
15
|
+
//
|
|
16
|
+
// All CREATE IF NOT EXISTS — zero-cost no-op for users without the
|
|
17
|
+
// bug, fixes anyone who has it. Includes the role column from the
|
|
18
|
+
// start so it matches v26's intent without needing v26 to ALTER on
|
|
19
|
+
// this heal path.
|
|
20
|
+
db.exec(`
|
|
21
|
+
CREATE TABLE IF NOT EXISTS api_keys (
|
|
22
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
23
|
+
key_id TEXT UNIQUE NOT NULL,
|
|
24
|
+
key_hash TEXT NOT NULL,
|
|
25
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
26
|
+
label TEXT,
|
|
27
|
+
created_at TEXT NOT NULL,
|
|
28
|
+
revoked_at TEXT,
|
|
29
|
+
role TEXT NOT NULL DEFAULT 'admin'
|
|
30
|
+
)
|
|
31
|
+
`);
|
|
32
|
+
db.exec(`
|
|
33
|
+
CREATE INDEX IF NOT EXISTS idx_api_keys_tenant_active
|
|
34
|
+
ON api_keys(tenant_id) WHERE revoked_at IS NULL
|
|
35
|
+
`);
|
|
36
|
+
db.exec(`
|
|
37
|
+
CREATE TABLE IF NOT EXISTS audit_log (
|
|
38
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
39
|
+
ts TEXT NOT NULL,
|
|
40
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
41
|
+
actor TEXT NOT NULL,
|
|
42
|
+
op TEXT NOT NULL,
|
|
43
|
+
target_id TEXT,
|
|
44
|
+
metadata_json TEXT NOT NULL DEFAULT '{}'
|
|
45
|
+
)
|
|
46
|
+
`);
|
|
47
|
+
db.exec(`CREATE INDEX IF NOT EXISTS idx_audit_log_tenant_ts ON audit_log(tenant_id, ts DESC)`);
|
|
48
|
+
// Belt-and-braces: if api_keys existed before this migration WITHOUT
|
|
49
|
+
// the role column (i.e. v16-shape table that v26's ALTER skipped due
|
|
50
|
+
// to tableExists=false on an earlier broken run, then someone manually
|
|
51
|
+
// CREATEd it without role), backfill role.
|
|
52
|
+
if (tableExists(db, 'api_keys') && !tableHasColumn(db, 'api_keys', 'role')) {
|
|
53
|
+
db.exec(`ALTER TABLE api_keys ADD COLUMN role TEXT NOT NULL DEFAULT 'admin'`);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=v27.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { tableHasColumn } from '../tables.js';
|
|
2
|
+
export const v28 = {
|
|
3
|
+
version: 28,
|
|
4
|
+
up: (db) => {
|
|
5
|
+
// E1 of 5-episode DAG live-coupling arc (docs/plans/2026-05-25-dag-e1-schema-v28.md).
|
|
6
|
+
// Adds dirty-flag persistence for the existing DAG layer's level-2
|
|
7
|
+
// summaries so E2 (child-write propagation) and E3 (sleep-cycle
|
|
8
|
+
// rebuild) have somewhere to write + read the staleness signal. Adds
|
|
9
|
+
// dag_level_3_built_at as a column (Keith Q5 pick: lets E5 entity-
|
|
10
|
+
// profile build path land without a second migration).
|
|
11
|
+
//
|
|
12
|
+
// All columns are additive + DEFAULTed/nullable, so backfill is
|
|
13
|
+
// automatic for existing rows. No min_compatible_binary bump: old
|
|
14
|
+
// binaries (v1.12.x) ignore the columns on SELECTs that don't name
|
|
15
|
+
// them; new binaries on old data hit this migration at openHippoDb
|
|
16
|
+
// time before any DAG path touches summary_dirty.
|
|
17
|
+
//
|
|
18
|
+
// Precedent for column-only guards on memories: v25 (db.ts:827),
|
|
19
|
+
// which added the DAG cache columns the same way. memories table
|
|
20
|
+
// itself comes from v1 and is always present, so the tableExists
|
|
21
|
+
// half of the v26/v27 guard pattern isn't load-bearing here.
|
|
22
|
+
if (!tableHasColumn(db, 'memories', 'summary_dirty')) {
|
|
23
|
+
db.exec(`ALTER TABLE memories ADD COLUMN summary_dirty INTEGER NOT NULL DEFAULT 0`);
|
|
24
|
+
}
|
|
25
|
+
if (!tableHasColumn(db, 'memories', 'last_rebuilt_at')) {
|
|
26
|
+
db.exec(`ALTER TABLE memories ADD COLUMN last_rebuilt_at TEXT`);
|
|
27
|
+
}
|
|
28
|
+
if (!tableHasColumn(db, 'memories', 'rebuild_count')) {
|
|
29
|
+
db.exec(`ALTER TABLE memories ADD COLUMN rebuild_count INTEGER NOT NULL DEFAULT 0`);
|
|
30
|
+
}
|
|
31
|
+
if (!tableHasColumn(db, 'memories', 'dag_level_3_built_at')) {
|
|
32
|
+
// Reserved for E5: buildEntityProfiles will set this on level-3
|
|
33
|
+
// rows when they're created. Always NULL for level 0/1/2 rows.
|
|
34
|
+
db.exec(`ALTER TABLE memories ADD COLUMN dag_level_3_built_at TEXT`);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=v28.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { tableExists } from '../tables.js';
|
|
2
|
+
export const v29 = {
|
|
3
|
+
version: 29,
|
|
4
|
+
up: (db) => {
|
|
5
|
+
// E2 prediction first-class object (docs/plans/2026-05-26-e2-prediction-object.md).
|
|
6
|
+
// Adds a canonical predictions table for J3 reference-class /
|
|
7
|
+
// planning-fallacy detector (a follow-up episode). Predictions
|
|
8
|
+
// duplicate claim_text in the table itself so memory deletion
|
|
9
|
+
// (forget/consolidate/archive) does not lose prediction data; FK
|
|
10
|
+
// memory_id is NULLABLE with ON DELETE SET NULL.
|
|
11
|
+
//
|
|
12
|
+
// Cross-tenant safety: BEFORE INSERT + BEFORE UPDATE triggers
|
|
13
|
+
// enforce tenant_id match against the referenced memory. SQLite's
|
|
14
|
+
// ON DELETE SET NULL is incompatible with composite FK where one
|
|
15
|
+
// side is NOT NULL, so the trigger pattern replaces a composite
|
|
16
|
+
// FK target. Precedent: v14 memories.kind trigger pair at db.ts:298-322.
|
|
17
|
+
//
|
|
18
|
+
// CHECK constraint pins closure_state to (open|closed|closed-unknown).
|
|
19
|
+
// J3 computes accuracy (clean vs regressed) from (estimate_value,
|
|
20
|
+
// actual_value) at query time.
|
|
21
|
+
if (!tableExists(db, 'predictions')) {
|
|
22
|
+
db.exec(`
|
|
23
|
+
CREATE TABLE predictions (
|
|
24
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
25
|
+
memory_id TEXT,
|
|
26
|
+
tenant_id TEXT NOT NULL,
|
|
27
|
+
class_tag TEXT NOT NULL,
|
|
28
|
+
claim_text TEXT NOT NULL,
|
|
29
|
+
estimate_value REAL,
|
|
30
|
+
estimate_unit TEXT,
|
|
31
|
+
target_date TEXT,
|
|
32
|
+
actual_value REAL,
|
|
33
|
+
closure_state TEXT NOT NULL DEFAULT 'open'
|
|
34
|
+
CHECK (closure_state IN ('open', 'closed', 'closed-unknown')),
|
|
35
|
+
closed_at TEXT,
|
|
36
|
+
closure_note TEXT,
|
|
37
|
+
created_at TEXT NOT NULL,
|
|
38
|
+
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE SET NULL
|
|
39
|
+
)
|
|
40
|
+
`);
|
|
41
|
+
db.exec(`
|
|
42
|
+
CREATE INDEX IF NOT EXISTS idx_predictions_tenant_class
|
|
43
|
+
ON predictions(tenant_id, class_tag, closure_state)
|
|
44
|
+
`);
|
|
45
|
+
db.exec(`
|
|
46
|
+
CREATE INDEX IF NOT EXISTS idx_predictions_memory
|
|
47
|
+
ON predictions(memory_id) WHERE memory_id IS NOT NULL
|
|
48
|
+
`);
|
|
49
|
+
// Cross-tenant safety: tenant_id must match the referenced memory's
|
|
50
|
+
// tenant_id when memory_id IS NOT NULL. INSERT + UPDATE pair, mirroring
|
|
51
|
+
// v14 memories.kind enforcement (db.ts:298-322).
|
|
52
|
+
db.exec(`
|
|
53
|
+
CREATE TRIGGER IF NOT EXISTS trg_predictions_tenant_match_insert
|
|
54
|
+
BEFORE INSERT ON predictions
|
|
55
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
56
|
+
BEGIN
|
|
57
|
+
SELECT CASE
|
|
58
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
59
|
+
THEN RAISE(ABORT, 'predictions.tenant_id must match memories.tenant_id for the referenced memory')
|
|
60
|
+
END;
|
|
61
|
+
END
|
|
62
|
+
`);
|
|
63
|
+
db.exec(`
|
|
64
|
+
CREATE TRIGGER IF NOT EXISTS trg_predictions_tenant_match_update
|
|
65
|
+
BEFORE UPDATE ON predictions
|
|
66
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
67
|
+
AND (NEW.memory_id IS NOT OLD.memory_id OR NEW.tenant_id IS NOT OLD.tenant_id)
|
|
68
|
+
BEGIN
|
|
69
|
+
SELECT CASE
|
|
70
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
71
|
+
THEN RAISE(ABORT, 'predictions.tenant_id must match memories.tenant_id for the referenced memory')
|
|
72
|
+
END;
|
|
73
|
+
END
|
|
74
|
+
`);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=v29.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { tableExists } from '../tables.js';
|
|
2
|
+
const DECISIONS_TABLE = `
|
|
3
|
+
CREATE TABLE decisions (
|
|
4
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
|
+
memory_id TEXT,
|
|
6
|
+
tenant_id TEXT NOT NULL,
|
|
7
|
+
decision_text TEXT NOT NULL,
|
|
8
|
+
context TEXT,
|
|
9
|
+
status TEXT NOT NULL DEFAULT 'active'
|
|
10
|
+
CHECK (status IN ('active', 'superseded', 'closed')),
|
|
11
|
+
superseded_by INTEGER,
|
|
12
|
+
superseded_at TEXT,
|
|
13
|
+
closed_at TEXT,
|
|
14
|
+
created_at TEXT NOT NULL,
|
|
15
|
+
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE SET NULL,
|
|
16
|
+
FOREIGN KEY (superseded_by) REFERENCES decisions(id) ON DELETE SET NULL
|
|
17
|
+
)
|
|
18
|
+
`;
|
|
19
|
+
const IDX_DECISIONS_TENANT_STATUS = `
|
|
20
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_tenant_status
|
|
21
|
+
ON decisions(tenant_id, status)
|
|
22
|
+
`;
|
|
23
|
+
const IDX_DECISIONS_MEMORY = `
|
|
24
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_memory
|
|
25
|
+
ON decisions(memory_id) WHERE memory_id IS NOT NULL
|
|
26
|
+
`;
|
|
27
|
+
// Cross-tenant safety vs the referenced memory (mirrors predictions v29).
|
|
28
|
+
const TRG_DECISIONS_TENANT_MATCH_INSERT = `
|
|
29
|
+
CREATE TRIGGER IF NOT EXISTS trg_decisions_tenant_match_insert
|
|
30
|
+
BEFORE INSERT ON decisions
|
|
31
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
32
|
+
BEGIN
|
|
33
|
+
SELECT CASE
|
|
34
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
35
|
+
THEN RAISE(ABORT, 'decisions.tenant_id must match memories.tenant_id for the referenced memory')
|
|
36
|
+
END;
|
|
37
|
+
END
|
|
38
|
+
`;
|
|
39
|
+
const TRG_DECISIONS_TENANT_MATCH_UPDATE = `
|
|
40
|
+
CREATE TRIGGER IF NOT EXISTS trg_decisions_tenant_match_update
|
|
41
|
+
BEFORE UPDATE ON decisions
|
|
42
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
43
|
+
AND (NEW.memory_id IS NOT OLD.memory_id OR NEW.tenant_id IS NOT OLD.tenant_id)
|
|
44
|
+
BEGIN
|
|
45
|
+
SELECT CASE
|
|
46
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
47
|
+
THEN RAISE(ABORT, 'decisions.tenant_id must match memories.tenant_id for the referenced memory')
|
|
48
|
+
END;
|
|
49
|
+
END
|
|
50
|
+
`;
|
|
51
|
+
// Cross-tenant safety vs the successor decision (self-FK). superseded_by
|
|
52
|
+
// is set only via UPDATE (the supersede path); the successor must share
|
|
53
|
+
// the tenant. The successor row already exists in the same transaction
|
|
54
|
+
// when this fires, so the subquery resolves.
|
|
55
|
+
const TRG_DECISIONS_SUPERSEDE_TENANT_MATCH_UPDATE = `
|
|
56
|
+
CREATE TRIGGER IF NOT EXISTS trg_decisions_supersede_tenant_match_update
|
|
57
|
+
BEFORE UPDATE ON decisions
|
|
58
|
+
WHEN NEW.superseded_by IS NOT NULL
|
|
59
|
+
AND NEW.superseded_by IS NOT OLD.superseded_by
|
|
60
|
+
BEGIN
|
|
61
|
+
SELECT CASE
|
|
62
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM decisions WHERE id = NEW.superseded_by)
|
|
63
|
+
THEN RAISE(ABORT, 'decisions.superseded_by must reference a decision in the same tenant')
|
|
64
|
+
END;
|
|
65
|
+
END
|
|
66
|
+
`;
|
|
67
|
+
export const v30 = {
|
|
68
|
+
version: 30,
|
|
69
|
+
up: (db) => {
|
|
70
|
+
// E2 decision first-class object (docs/plans/2026-05-28-e2-decision-object.md).
|
|
71
|
+
// Promotes `hippo decide` from a tagged memory (which decayed on a 90-day
|
|
72
|
+
// half-life even while the decision was still in force) to a canonical
|
|
73
|
+
// decisions table that is the source of truth. The memory mirror is kept
|
|
74
|
+
// for recall but is no longer authoritative; memory_id is NULLABLE with
|
|
75
|
+
// ON DELETE SET NULL so forget/consolidate/archive does not lose a
|
|
76
|
+
// decision. Mirrors the v29 predictions tenant-match trigger pattern.
|
|
77
|
+
//
|
|
78
|
+
// status (active|superseded|closed): superseded carries a self-FK
|
|
79
|
+
// superseded_by to the successor decision; closed is a terminal
|
|
80
|
+
// retire-without-successor. A superseded_by same-tenant trigger makes
|
|
81
|
+
// cross-tenant supersession unrepresentable at the schema level.
|
|
82
|
+
if (!tableExists(db, 'decisions')) {
|
|
83
|
+
db.exec(DECISIONS_TABLE);
|
|
84
|
+
db.exec(IDX_DECISIONS_TENANT_STATUS);
|
|
85
|
+
db.exec(IDX_DECISIONS_MEMORY);
|
|
86
|
+
db.exec(TRG_DECISIONS_TENANT_MATCH_INSERT);
|
|
87
|
+
db.exec(TRG_DECISIONS_TENANT_MATCH_UPDATE);
|
|
88
|
+
db.exec(TRG_DECISIONS_SUPERSEDE_TENANT_MATCH_UPDATE);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=v30.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { tableExists } from '../tables.js';
|
|
2
|
+
export const v31 = {
|
|
3
|
+
version: 31,
|
|
4
|
+
up: (db) => {
|
|
5
|
+
// E2 incident first-class object (docs/plans/2026-05-29-e2-incident-object.md).
|
|
6
|
+
// Mirrors the v30 decisions block but for an open -> resolved -> closed
|
|
7
|
+
// lifecycle (NOT supersede): there is no superseded_by self-FK and no
|
|
8
|
+
// supersede trigger. An incident is a postmortem capsule: a recorded
|
|
9
|
+
// operational event with a lifecycle and optional linked receipts (the
|
|
10
|
+
// memories that are its evidence, stored as a JSON array of ids in
|
|
11
|
+
// linked_memory_ids). The memory mirror is kept for recall but is not
|
|
12
|
+
// authoritative; memory_id is NULLABLE with ON DELETE SET NULL so
|
|
13
|
+
// forget/consolidate/archive does not lose an incident.
|
|
14
|
+
//
|
|
15
|
+
// status (open|resolved|closed): resolved records a resolution_text +
|
|
16
|
+
// resolved_at and stays on record; closed is a terminal retire reachable
|
|
17
|
+
// from open or resolved. Cross-tenant safety: BEFORE INSERT + BEFORE
|
|
18
|
+
// UPDATE triggers enforce incidents.tenant_id == the referenced memory's
|
|
19
|
+
// tenant_id (verbatim mirror of the v30 decisions tenant-match triggers).
|
|
20
|
+
if (!tableExists(db, 'incidents')) {
|
|
21
|
+
db.exec(`
|
|
22
|
+
CREATE TABLE incidents (
|
|
23
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
24
|
+
memory_id TEXT,
|
|
25
|
+
tenant_id TEXT NOT NULL,
|
|
26
|
+
incident_text TEXT NOT NULL,
|
|
27
|
+
context TEXT,
|
|
28
|
+
status TEXT NOT NULL DEFAULT 'open'
|
|
29
|
+
CHECK (status IN ('open', 'resolved', 'closed')),
|
|
30
|
+
resolution_text TEXT,
|
|
31
|
+
resolved_at TEXT,
|
|
32
|
+
closed_at TEXT,
|
|
33
|
+
linked_memory_ids TEXT NOT NULL DEFAULT '[]',
|
|
34
|
+
created_at TEXT NOT NULL,
|
|
35
|
+
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE SET NULL
|
|
36
|
+
)
|
|
37
|
+
`);
|
|
38
|
+
db.exec(`
|
|
39
|
+
CREATE INDEX IF NOT EXISTS idx_incidents_tenant_status
|
|
40
|
+
ON incidents(tenant_id, status)
|
|
41
|
+
`);
|
|
42
|
+
db.exec(`
|
|
43
|
+
CREATE INDEX IF NOT EXISTS idx_incidents_memory
|
|
44
|
+
ON incidents(memory_id) WHERE memory_id IS NOT NULL
|
|
45
|
+
`);
|
|
46
|
+
// Cross-tenant safety vs the referenced memory (verbatim mirror of the
|
|
47
|
+
// v30 decisions tenant-match triggers; no supersede trigger).
|
|
48
|
+
db.exec(`
|
|
49
|
+
CREATE TRIGGER IF NOT EXISTS trg_incidents_tenant_match_insert
|
|
50
|
+
BEFORE INSERT ON incidents
|
|
51
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
52
|
+
BEGIN
|
|
53
|
+
SELECT CASE
|
|
54
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
55
|
+
THEN RAISE(ABORT, 'incidents.tenant_id must match memories.tenant_id for the referenced memory')
|
|
56
|
+
END;
|
|
57
|
+
END
|
|
58
|
+
`);
|
|
59
|
+
db.exec(`
|
|
60
|
+
CREATE TRIGGER IF NOT EXISTS trg_incidents_tenant_match_update
|
|
61
|
+
BEFORE UPDATE ON incidents
|
|
62
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
63
|
+
AND (NEW.memory_id IS NOT OLD.memory_id OR NEW.tenant_id IS NOT OLD.tenant_id)
|
|
64
|
+
BEGIN
|
|
65
|
+
SELECT CASE
|
|
66
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
67
|
+
THEN RAISE(ABORT, 'incidents.tenant_id must match memories.tenant_id for the referenced memory')
|
|
68
|
+
END;
|
|
69
|
+
END
|
|
70
|
+
`);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=v31.js.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { tableExists } from '../tables.js';
|
|
2
|
+
const PROCESSES_TABLE = `
|
|
3
|
+
CREATE TABLE processes (
|
|
4
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
|
+
memory_id TEXT,
|
|
6
|
+
tenant_id TEXT NOT NULL,
|
|
7
|
+
process_name TEXT NOT NULL,
|
|
8
|
+
description TEXT,
|
|
9
|
+
steps TEXT NOT NULL DEFAULT '[]',
|
|
10
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
11
|
+
status TEXT NOT NULL DEFAULT 'active'
|
|
12
|
+
CHECK (status IN ('active', 'superseded', 'closed')),
|
|
13
|
+
superseded_by INTEGER,
|
|
14
|
+
superseded_at TEXT,
|
|
15
|
+
change_summary TEXT,
|
|
16
|
+
closed_at TEXT,
|
|
17
|
+
created_at TEXT NOT NULL,
|
|
18
|
+
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE SET NULL,
|
|
19
|
+
FOREIGN KEY (superseded_by) REFERENCES processes(id) ON DELETE SET NULL
|
|
20
|
+
)
|
|
21
|
+
`;
|
|
22
|
+
const IDX_PROCESSES_TENANT_STATUS = `
|
|
23
|
+
CREATE INDEX IF NOT EXISTS idx_processes_tenant_status
|
|
24
|
+
ON processes(tenant_id, status)
|
|
25
|
+
`;
|
|
26
|
+
const IDX_PROCESSES_MEMORY = `
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_processes_memory
|
|
28
|
+
ON processes(memory_id) WHERE memory_id IS NOT NULL
|
|
29
|
+
`;
|
|
30
|
+
// Cross-tenant safety vs the referenced memory (verbatim mirror of the
|
|
31
|
+
// v31 incidents / v30 decisions tenant-match triggers).
|
|
32
|
+
const TRG_PROCESSES_TENANT_MATCH_INSERT = `
|
|
33
|
+
CREATE TRIGGER IF NOT EXISTS trg_processes_tenant_match_insert
|
|
34
|
+
BEFORE INSERT ON processes
|
|
35
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
36
|
+
BEGIN
|
|
37
|
+
SELECT CASE
|
|
38
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
39
|
+
THEN RAISE(ABORT, 'processes.tenant_id must match memories.tenant_id for the referenced memory')
|
|
40
|
+
END;
|
|
41
|
+
END
|
|
42
|
+
`;
|
|
43
|
+
const TRG_PROCESSES_TENANT_MATCH_UPDATE = `
|
|
44
|
+
CREATE TRIGGER IF NOT EXISTS trg_processes_tenant_match_update
|
|
45
|
+
BEFORE UPDATE ON processes
|
|
46
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
47
|
+
AND (NEW.memory_id IS NOT OLD.memory_id OR NEW.tenant_id IS NOT OLD.tenant_id)
|
|
48
|
+
BEGIN
|
|
49
|
+
SELECT CASE
|
|
50
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
51
|
+
THEN RAISE(ABORT, 'processes.tenant_id must match memories.tenant_id for the referenced memory')
|
|
52
|
+
END;
|
|
53
|
+
END
|
|
54
|
+
`;
|
|
55
|
+
// Cross-tenant safety vs the successor process (self-FK; verbatim mirror
|
|
56
|
+
// of the v30 decisions supersede trigger). superseded_by is set only via
|
|
57
|
+
// the supersede UPDATE; the successor must share the tenant. The successor
|
|
58
|
+
// row already exists in the same transaction when this fires.
|
|
59
|
+
const TRG_PROCESSES_SUPERSEDE_TENANT_MATCH_UPDATE = `
|
|
60
|
+
CREATE TRIGGER IF NOT EXISTS trg_processes_supersede_tenant_match_update
|
|
61
|
+
BEFORE UPDATE ON processes
|
|
62
|
+
WHEN NEW.superseded_by IS NOT NULL
|
|
63
|
+
AND NEW.superseded_by IS NOT OLD.superseded_by
|
|
64
|
+
BEGIN
|
|
65
|
+
SELECT CASE
|
|
66
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM processes WHERE id = NEW.superseded_by)
|
|
67
|
+
THEN RAISE(ABORT, 'processes.superseded_by must reference a process in the same tenant')
|
|
68
|
+
END;
|
|
69
|
+
END
|
|
70
|
+
`;
|
|
71
|
+
export const v32 = {
|
|
72
|
+
version: 32,
|
|
73
|
+
up: (db) => {
|
|
74
|
+
// E2 process first-class object (docs/plans/2026-05-29-e2-process-object.md).
|
|
75
|
+
// A process is a "living process map": a named, ordered list of steps that
|
|
76
|
+
// evolves. Unlike incident (open->resolved->closed, no supersede), process
|
|
77
|
+
// REUSES the v30 decisions supersede path as its delta mechanism: a process
|
|
78
|
+
// evolves by being superseded by a NEW VERSION that records what changed
|
|
79
|
+
// (change_summary) and the full new state (steps), carrying a derived
|
|
80
|
+
// version counter. So this table combines the v31 incidents tenant-match
|
|
81
|
+
// trigger pair (vs the referenced memory) WITH the v30 decisions
|
|
82
|
+
// superseded_by self-FK + supersede tenant-match trigger.
|
|
83
|
+
//
|
|
84
|
+
// status (active|superseded|closed): superseded carries a self-FK
|
|
85
|
+
// superseded_by to the successor version; closed is a terminal
|
|
86
|
+
// retire-without-successor (only an active head closes). The memory mirror
|
|
87
|
+
// is kept for recall but is not authoritative; memory_id is NULLABLE with
|
|
88
|
+
// ON DELETE SET NULL so forget/consolidate/archive does not lose a process.
|
|
89
|
+
// steps is a JSON-encoded array of step strings (scoped v1; a normalized
|
|
90
|
+
// process_steps table is deferred). version is server-derived
|
|
91
|
+
// (predecessor.version + 1); change_summary is set on a successor row only.
|
|
92
|
+
if (!tableExists(db, 'processes')) {
|
|
93
|
+
db.exec(PROCESSES_TABLE);
|
|
94
|
+
db.exec(IDX_PROCESSES_TENANT_STATUS);
|
|
95
|
+
db.exec(IDX_PROCESSES_MEMORY);
|
|
96
|
+
db.exec(TRG_PROCESSES_TENANT_MATCH_INSERT);
|
|
97
|
+
db.exec(TRG_PROCESSES_TENANT_MATCH_UPDATE);
|
|
98
|
+
db.exec(TRG_PROCESSES_SUPERSEDE_TENANT_MATCH_UPDATE);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=v32.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { tableExists } from '../tables.js';
|
|
2
|
+
const POLICIES_TABLE = `
|
|
3
|
+
CREATE TABLE policies (
|
|
4
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
|
+
memory_id TEXT,
|
|
6
|
+
tenant_id TEXT NOT NULL,
|
|
7
|
+
policy_name TEXT NOT NULL,
|
|
8
|
+
policy_text TEXT NOT NULL,
|
|
9
|
+
valid_from TEXT NOT NULL,
|
|
10
|
+
valid_to TEXT,
|
|
11
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
12
|
+
status TEXT NOT NULL DEFAULT 'active'
|
|
13
|
+
CHECK (status IN ('active', 'superseded', 'closed')),
|
|
14
|
+
superseded_by INTEGER,
|
|
15
|
+
superseded_at TEXT,
|
|
16
|
+
change_summary TEXT,
|
|
17
|
+
closed_at TEXT,
|
|
18
|
+
created_at TEXT NOT NULL,
|
|
19
|
+
FOREIGN KEY (memory_id) REFERENCES memories(id) ON DELETE SET NULL,
|
|
20
|
+
FOREIGN KEY (superseded_by) REFERENCES policies(id) ON DELETE SET NULL
|
|
21
|
+
)
|
|
22
|
+
`;
|
|
23
|
+
const IDX_POLICIES_TENANT_STATUS = `
|
|
24
|
+
CREATE INDEX IF NOT EXISTS idx_policies_tenant_status
|
|
25
|
+
ON policies(tenant_id, status)
|
|
26
|
+
`;
|
|
27
|
+
const IDX_POLICIES_MEMORY = `
|
|
28
|
+
CREATE INDEX IF NOT EXISTS idx_policies_memory
|
|
29
|
+
ON policies(memory_id) WHERE memory_id IS NOT NULL
|
|
30
|
+
`;
|
|
31
|
+
// Supports the as-of query (active policies in force at a valid-time).
|
|
32
|
+
const IDX_POLICIES_ASOF = `
|
|
33
|
+
CREATE INDEX IF NOT EXISTS idx_policies_asof
|
|
34
|
+
ON policies(tenant_id, valid_from)
|
|
35
|
+
`;
|
|
36
|
+
// Cross-tenant safety vs the referenced memory (verbatim mirror of the
|
|
37
|
+
// v32 processes tenant-match triggers).
|
|
38
|
+
const TRG_POLICIES_TENANT_MATCH_INSERT = `
|
|
39
|
+
CREATE TRIGGER IF NOT EXISTS trg_policies_tenant_match_insert
|
|
40
|
+
BEFORE INSERT ON policies
|
|
41
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
42
|
+
BEGIN
|
|
43
|
+
SELECT CASE
|
|
44
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
45
|
+
THEN RAISE(ABORT, 'policies.tenant_id must match memories.tenant_id for the referenced memory')
|
|
46
|
+
END;
|
|
47
|
+
END
|
|
48
|
+
`;
|
|
49
|
+
const TRG_POLICIES_TENANT_MATCH_UPDATE = `
|
|
50
|
+
CREATE TRIGGER IF NOT EXISTS trg_policies_tenant_match_update
|
|
51
|
+
BEFORE UPDATE ON policies
|
|
52
|
+
WHEN NEW.memory_id IS NOT NULL
|
|
53
|
+
AND (NEW.memory_id IS NOT OLD.memory_id OR NEW.tenant_id IS NOT OLD.tenant_id)
|
|
54
|
+
BEGIN
|
|
55
|
+
SELECT CASE
|
|
56
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM memories WHERE id = NEW.memory_id)
|
|
57
|
+
THEN RAISE(ABORT, 'policies.tenant_id must match memories.tenant_id for the referenced memory')
|
|
58
|
+
END;
|
|
59
|
+
END
|
|
60
|
+
`;
|
|
61
|
+
// Cross-tenant safety vs the successor policy (self-FK; verbatim mirror of
|
|
62
|
+
// the v32 processes supersede trigger).
|
|
63
|
+
const TRG_POLICIES_SUPERSEDE_TENANT_MATCH_UPDATE = `
|
|
64
|
+
CREATE TRIGGER IF NOT EXISTS trg_policies_supersede_tenant_match_update
|
|
65
|
+
BEFORE UPDATE ON policies
|
|
66
|
+
WHEN NEW.superseded_by IS NOT NULL
|
|
67
|
+
AND NEW.superseded_by IS NOT OLD.superseded_by
|
|
68
|
+
BEGIN
|
|
69
|
+
SELECT CASE
|
|
70
|
+
WHEN NEW.tenant_id != (SELECT tenant_id FROM policies WHERE id = NEW.superseded_by)
|
|
71
|
+
THEN RAISE(ABORT, 'policies.superseded_by must reference a policy in the same tenant')
|
|
72
|
+
END;
|
|
73
|
+
END
|
|
74
|
+
`;
|
|
75
|
+
export const v33 = {
|
|
76
|
+
version: 33,
|
|
77
|
+
up: (db) => {
|
|
78
|
+
// E2 policy first-class object (docs/plans/2026-05-30-e2-policy-object.md).
|
|
79
|
+
// The "bi-temporal-first" object type: a named rule/statement that is in
|
|
80
|
+
// force over an EFFECTIVE-TIME range (valid_from required, valid_to nullable
|
|
81
|
+
// = open-ended) and evolves via the v32 processes supersede machinery
|
|
82
|
+
// (superseded_by self-FK + supersede tenant-match trigger + version +
|
|
83
|
+
// change_summary). This table = the v32 processes table MINUS `steps`
|
|
84
|
+
// (a policy has policy_text, not an ordered step list) PLUS the first-class
|
|
85
|
+
// effective-time columns valid_from/valid_to. Valid-time is the queryable
|
|
86
|
+
// axis (the as-of query loadPoliciesAsOf); transaction-time is present via
|
|
87
|
+
// created_at + the supersede chain's superseded_at (time-travel deferred).
|
|
88
|
+
//
|
|
89
|
+
// All date inputs are normalized to canonical ISO-8601 datetime
|
|
90
|
+
// (toISOString) at the store boundary before persist/compare, so the
|
|
91
|
+
// fixed-width values sort lexically and the half-open [valid_from, valid_to)
|
|
92
|
+
// as-of comparison is correct (plan-eng-critic round-1 CRIT fix).
|
|
93
|
+
if (!tableExists(db, 'policies')) {
|
|
94
|
+
db.exec(POLICIES_TABLE);
|
|
95
|
+
db.exec(IDX_POLICIES_TENANT_STATUS);
|
|
96
|
+
db.exec(IDX_POLICIES_MEMORY);
|
|
97
|
+
db.exec(IDX_POLICIES_ASOF);
|
|
98
|
+
db.exec(TRG_POLICIES_TENANT_MATCH_INSERT);
|
|
99
|
+
db.exec(TRG_POLICIES_TENANT_MATCH_UPDATE);
|
|
100
|
+
db.exec(TRG_POLICIES_SUPERSEDE_TENANT_MATCH_UPDATE);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=v33.js.map
|