You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(ai-persistence): static tests for the persistence adapter skills #1919
The persistence adapter skills in packages/ai-persistence/skills/ai-persistence/ have no tests. An agent following build-drizzle-adapter on Postgres wrote only chat_threads and chat_runs and dropped chat_interrupts and chat_metadata. PR #1918 fixed the skill text. Nothing stops the next regression.
Goal
Deterministic checks that run in pnpm test:pr and fail when a recipe is incomplete or does not compile. No LLM in the loop. Agent evals are a separate follow-up.
Tasks
Type-check the skill snippets with kiira.kiira.config already includes packages/*/skills/**/*.md, but the adapter blocks are marked ts ignore because they import @/db, @/db/schema, drizzle-orm, pg, and @prisma/client. Add those as docs-only dev deps and tsconfig.docs.json path stubs for the app-local imports, then drop ignore on the schema and store blocks in build-drizzle-adapter (SQLite and Postgres), build-prisma-adapter, and build-custom-adapter. Follow .agent/self-learning/lessons/2026-06-23-authoring-kiira-doc-snippets.md and kiira-ci-setup.md.
Run the conformance suite on the recipe code. Extract each recipe's chat-persistence.ts block into a vitest file under packages/ai-persistence/skills-test/ (or similar) and call runPersistenceConformance from @tanstack/ai-persistence/testkit against it. Drizzle: node:sqlite and PGlite (@electric-sql/pglite, new dev dep). Custom: PGlite via the pg-compatible driver. Prisma: skip if it needs a generated client; say so in the PR. Extraction can be a small script that pulls the fenced block by a marker comment so the test and the skill cannot drift.
Lint for all four tables. A small test that asserts each of build-drizzle-adapter, build-prisma-adapter, build-custom-adapter, and build-cloudflare-adapter names all four tables (threads, runs, interrupts, metadata) and all four store factories in defineAIPersistence.
Wire into an Nx target that test:pr already runs (test:lib in packages/ai-persistence is fine).
Activity