Add the durable session-persistence capability seam (ADR 0016): an
abstract SessionPersistence service (dsh-session-persistence,
ctx.sessionPersistence) defining create/append/load/list/has/delete/
update over the existing SessionEvent — no parallel persisted type — and
a first implementation (dsh-session-persistence-jsonl): an append-only
JSONL log per session with crash-safe atomic writes, truncation-repair
of a never-committed crash tail, and a read/replay path. SessionMeta
(format version, cwd, lineage) travels out-of-log via session.header.
A shared runPersistenceContract suite holds every backend to the same
append-only / contiguous-seq / lazy-materialization / serializability
semantics.
Config-driven create() now uses a per-run ${id}-session-<uuid> session
id so a fixed name no longer collides with an on-disk log once a durable
backend is loaded; each run is a new session (a demo simplification). The
examples drop their hand-rolled session-jsonl.ts and load the JSONL
backend via cordis.yml; CI smoke-loads it too.
The agent-facing create/resume factory that consumes load() is a
separate seam, deferred to a follow-up; this change stops at the load
primitive and does not reach into the loop.
76 lines
2.5 KiB
YAML
76 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
checks:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node: [24, 26]
|
|
name: node ${{ matrix.node }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Enable corepack (yarn 4)
|
|
run: corepack enable
|
|
|
|
- name: Install (immutable)
|
|
run: yarn install --immutable
|
|
|
|
- name: Constraints
|
|
run: yarn constraints
|
|
|
|
# Before lint: the type-aware ESLint config resolves vendor packages via
|
|
# their built declarations (tsconfig.typecheck.json -> vendor/*/lib),
|
|
# which `yarn typecheck` emits. Lint on a fresh checkout would otherwise
|
|
# see unresolved types and erupt with no-unsafe-* errors.
|
|
- name: Typecheck (src + tests + examples)
|
|
run: yarn typecheck
|
|
|
|
- name: Lint
|
|
run: yarn lint
|
|
|
|
# Doc-sync gates (RFC 006). doc-typecheck compiles the fenced ts blocks in
|
|
# the docs and resolves vendor packages via their built declarations, which
|
|
# the typecheck step above emits — so it runs after typecheck. The event
|
|
# taxonomy check only reads source. Same `doc-sync` script the pre-push
|
|
# hook runs (ADR 0007: one source of truth).
|
|
- name: Doc-sync gates (doc code blocks + event taxonomy)
|
|
run: yarn doc-sync
|
|
|
|
- name: Tests with coverage gate (per-file 100%)
|
|
run: yarn test:coverage
|
|
|
|
# Before hygiene: publint validates the packed artifacts (lib/index.js),
|
|
# which only the tsdown bundling step emits.
|
|
- name: Build (tsc -b + tsdown bundles)
|
|
run: yarn build
|
|
|
|
- name: Hygiene (knip + publint)
|
|
run: yarn knip && yarn publint
|
|
|
|
- name: Demo smoke test
|
|
run: |
|
|
set -euo pipefail
|
|
out=$(printf 'echo ci smoke\n' | timeout 60 node --expose-internals --import tsx examples/echo-agent/start.ts 2>&1)
|
|
echo "$out"
|
|
echo "$out" | grep -q '\[tool call\] echo({"text":"ci smoke"})'
|
|
echo "$out" | grep -q '\[tool result\] ECHO: CI SMOKE'
|
|
# The JSONL backend (root ./.sessions, no cwd → _no-cwd bucket) writes a
|
|
# per-run session log named main-session-<uuid>.jsonl. Assert one exists.
|
|
ls .sessions/_no-cwd/main-session-*.jsonl >/dev/null
|
|
rm -rf .sessions
|