Files
deepseek-harness/tsconfig.base.json
Tianyi Cui 9126697d87 feat(session-persistence-sqlite): second backend validating the abstraction
Add a SQLite SessionPersistence backend (node:sqlite), a SECOND
implementation built to prove the abstract seam + the shared
runPersistenceContract suite are genuinely backend-agnostic. Each
SessionEvent maps 1:1 onto an events row (session_id, seq, type, time,
data); append is an INSERT inside a transaction asserting the
contiguous-seq contract; the mutable SessionSummary lives in the
sessions metadata row.

It satisfies the SAME contract semantics as the JSONL backend, expressed
over rows instead of file bytes:
- Lazy materialization: create() records intent in memory; no row until
  the first append (a never-appended session is absent from has()/list()
  via a materialized flag set inside the first append transaction).
- Crash-tail-on-load: load() returns events only through the last
  complete turn/end and deletes the uncommitted tail; a seq gap in the
  committed region makes the session unloadable.
- Transactional append: a mid-batch failure (a UNIQUE seq collision from
  a concurrent writer) rolls back entirely, keeping the cursor truthful.

Like the JSONL backend it is also the write-path plugin (session/event →
buffer → session/flush drain, onCreated seed/adopt/collision handling,
HMR seeding, dispose-to-quiescence). The package runs the shared
runPersistenceContract suite plus SQLite-specific tests (transaction
rollback, crash-tail cut, schema version, HMR adoption).

Docs flip every "SQLite is future/deferred" reference (ADR 0016,
architecture.md, the persistence module doc + README) to "implemented;
the contract holds both backends to identical semantics".
2026-06-15 21:45:21 +08:00

55 lines
2.5 KiB
JSON

{
"compilerOptions": {
"target": "es2024",
"module": "esnext",
"moduleResolution": "bundler",
"declaration": true,
"emitDeclarationOnly": true,
"composite": true,
"incremental": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": false,
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"types": ["node"],
// Source-level resolution for the build graph: without this, a fresh
// checkout's first `tsc -b` resolves sibling vendor plugins through their
// package.json types (vendor/*/lib/*.d.ts) which don't exist yet — TS2307
// until a second run. Derived configs that want lib resolution
// (tsconfig.typecheck.json) override this map wholesale.
"paths": {
"cordis": ["./vendor/cordis/src"],
"cosmokit": ["./vendor/cosmokit/src"],
"schemastery": ["./vendor/schemastery/src"],
"@cordisjs/plugin-loader": ["./vendor/loader/src"],
"@cordisjs/plugin-include": ["./vendor/include/src"],
"@cordisjs/plugin-group": ["./vendor/group/src"],
"@cordisjs/plugin-timer": ["./vendor/timer/src"],
"@cordisjs/plugin-hmr": ["./vendor/hmr/src"],
"@cordisjs/plugin-logger-console": ["./vendor/logger-console/src"],
"@deepseek-ai/dsh-llm": ["./packages/llm/src"],
"@deepseek-ai/dsh-session": ["./packages/session/src"],
"@deepseek-ai/dsh-session-persistence": ["./packages/session-persistence/src"],
"@deepseek-ai/dsh-session-persistence-jsonl": ["./packages/session-persistence-jsonl/src"],
"@deepseek-ai/dsh-session-persistence-sqlite": ["./packages/session-persistence-sqlite/src"],
"@deepseek-ai/dsh-system-prompt": ["./packages/system-prompt/src"],
"@deepseek-ai/dsh-tools": ["./packages/tools/src"],
"@deepseek-ai/dsh-agent": ["./packages/agent/src"],
"@deepseek-ai/dsh-agent-loop": ["./packages/agent-loop/src"],
"@deepseek-ai/dsh-bash": ["./packages/bash/src"],
"@deepseek-ai/dsh-llm-deepseek": ["./packages/llm-deepseek/src"],
"@deepseek-ai/dsh-llm-pi-ai": ["./packages/llm-pi-ai/src"],
"@deepseek-ai/dsh-bash-local": ["./packages/bash-local/src"],
"@deepseek-ai/dsh-tool-bash": ["./packages/tool-bash/src"],
"@deepseek-ai/dsh-invariants": ["./packages/invariants/src"]
}
}
}