Skip to content

feat: add sqlite task runtime plugin - #25

Merged
zccz14 merged 14 commits into
mainfrom
feat/task-runtime-sqlite-plugin
Apr 18, 2026
Merged

zccz14 merged 14 commits into
mainfrom
feat/task-runtime-sqlite-plugin

Conversation

@zccz14

@zccz14 zccz14 commented Apr 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a SQLite-backed task runtime plugin with repository, database, prompt building, and session runtime wiring
  • cover task dispatch, persistence, and terminal outcome handling with repo-level integration tests
  • include the Chinese design spec and implementation plan for the sqlite task runtime work

Test Plan

  • pnpm exec vitest run --config vitest.workspace.ts --project repo
  • pnpm run typecheck
  • pnpm run test:lint

Copilot AI review requested due to automatic review settings April 18, 2026 15:46
@vercel

vercel Bot commented Apr 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cz-stack-web Ready Ready Preview, Comment Apr 18, 2026 3:46pm

@zccz14
zccz14 enabled auto-merge (squash) April 18, 2026 15:46
@zccz14
zccz14 merged commit 07e596e into main Apr 18, 2026
6 checks passed
@zccz14
zccz14 deleted the feat/task-runtime-sqlite-plugin branch April 18, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a SQLite-backed task runtime plugin under .opencode/plugins to drive task dispatch/progress tracking via <projectDir>/aim.sqlite, along with repo-level integration tests and accompanying Chinese design spec + implementation plan.

Changes:

  • Introduces sqlite-task-runtime plugin entrypoint exposing 6 tools (dispatch-tasks, list-processing-tasks, get-current-task, mark-task-status, setup-worktree-path, setup-pull-request-url) wired to a SQLite repository + session host adapter.
  • Implements SQLite repository helpers (task listing/binding, status and artifact write-back) and prompt builders that avoid exposing SQLite internals.
  • Adds extensive repo integration tests and documents the design + implementation plan.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/repo/sqlite-task-runtime-plugin.test.ts Repo-level integration tests for sqlite task runtime plugin behavior and prompt boundaries.
docs/superpowers/specs/2026-04-18-sqlite-task-runtime-design.md Design spec describing plugin boundaries, tool contract, and dispatch flow.
docs/superpowers/plans/2026-04-18-sqlite-task-runtime.md Implementation plan/checklist for building the plugin and tests.
.opencode/plugins/task-runtime-sqlite/task-repository.ts SQLite-backed task repository (binding, scanning, write-back rules).
.opencode/plugins/task-runtime-sqlite/session-runtime.ts Minimal host adapter for session operations used by dispatch.
.opencode/plugins/task-runtime-sqlite/prompt-builder.ts Prompt formatting for initial/follow-up task prompts without SQLite details.
.opencode/plugins/task-runtime-sqlite/database.ts SQLite path resolution + DB open helper for <projectDir>/aim.sqlite.
.opencode/plugins/task-runtime-sqlite.ts Plugin entrypoint registering tools and implementing dispatch logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +25
export const getTaskRuntimeDatabasePath = (projectDir: string) =>
join(projectDir, "aim.sqlite");

export const openTaskRuntimeDatabase = (projectDir: string) =>
new DatabaseSync(getTaskRuntimeDatabasePath(projectDir));

Copilot AI Apr 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openTaskRuntimeDatabase() uses new DatabaseSync(path) which will create aim.sqlite when it doesn’t exist. The design spec in this PR says the plugin should error when the DB is missing or schema is invalid; auto-creating an empty DB can hide misconfiguration and lead to dispatch operating against the wrong file. Consider checking file existence (and optionally opening read-only if supported) and throwing a clear error before creating/using the DB.

Copilot uses AI. Check for mistakes.
Comment on lines +129 to +134
vi.doMock(
"../../.opencode/plugins/task-runtime-sqlite/database.ts",
() => ({
createTaskRuntimeDatabase,
}),
);

Copilot AI Apr 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These vi.doMock() specifiers use .../task-runtime-sqlite/*.ts, but the plugin entrypoint imports the collaborators using .js specifiers (e.g. ./task-runtime-sqlite/database.js). In Vitest/NodeNext setups, mocks are keyed by the import specifier, so this mock may not intercept what the entrypoint actually imports and the test may pass without exercising the intended assertion. Use mock specifiers that match the entrypoint imports (or otherwise ensure the mock applies to the resolved module id).

Copilot uses AI. Check for mistakes.

This branch was successfully deployed

1 active deployment
Preview — 4f579ee2 Deployed Apr 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants