2026-05-08 02:52:05 +02:00
|
|
|
# SQLite Runtime Baseline
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
**Status:** complete for the Node 26.1 runtime baseline.
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
SF uses built-in `node:sqlite` and the project-local `.sf/sf.db` as the
|
|
|
|
|
canonical structured store for planning state, UOK execution state, learning
|
|
|
|
|
outcomes, schedules, memory extraction queues, and generated projections.
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
## Runtime Rule
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
- **Node baseline:** 26.1+
|
|
|
|
|
- **Canonical database:** `.sf/sf.db`
|
|
|
|
|
- **SQLite binding:** built-in `node:sqlite`
|
|
|
|
|
- **Sidecar stores:** not allowed for active SF state
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
Runtime code must not introduce `sql.js`, `better-sqlite3`, `sqlite3` CLI
|
|
|
|
|
shell-outs, or JSON fallback databases for DB-owned state. If a feature needs
|
|
|
|
|
ordering, validation, joins, leases, TTLs, or history, put it in `.sf/sf.db`.
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
## Current Surfaces
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
- **Learning outcomes:** `llm_task_outcomes`
|
|
|
|
|
- **UOK execution graphs:** `uok_execution_graphs`, `uok_graph_nodes`,
|
|
|
|
|
`uok_graph_progress`
|
|
|
|
|
- **UOK coordination:** `uok_kv`, `uok_stream_entries`, `uok_queue_items`
|
|
|
|
|
- **Memory extraction:** `threads`, `stage1_outputs`, `jobs`
|
|
|
|
|
- **Schedules:** `schedule_entries`
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
## Development Rules
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
1. Use SF query/writer helpers when operating inside the SF extension.
|
|
|
|
|
2. Use `node:sqlite` directly only for isolated tooling or package code that
|
|
|
|
|
cannot import the SF extension runtime.
|
|
|
|
|
3. Prefer read-only SQLite handles for monitors and inspection overlays.
|
|
|
|
|
4. Do not keep compatibility code for retired JSON or sidecar DB stores unless
|
|
|
|
|
an explicit migration command owns it.
|
|
|
|
|
5. Add behavior tests before changing persistence semantics.
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
## Verification
|
2026-05-06 23:03:50 +02:00
|
|
|
|
2026-05-08 02:52:05 +02:00
|
|
|
```bash
|
|
|
|
|
npm run typecheck:extensions
|
|
|
|
|
npx vitest run --config vitest.config.ts \
|
|
|
|
|
src/resources/extensions/sf/learning/*.test.mjs \
|
|
|
|
|
src/resources/extensions/sf/tests/uok-*.test.mjs
|
2026-05-06 23:03:50 +02:00
|
|
|
```
|