Commit graph

25 commits

Author SHA1 Message Date
Brad Groux
c1be9f7322 feat: add durable run supervisor 2026-07-24 03:02:36 -05:00
Brad Groux
b9b6273cf5
feat: add causal run event journal (#949) 2026-07-24 00:05:31 -05:00
Brad Groux
0f8506b4ce
feat: add run-bound credential lease engine (#933) 2026-07-23 18:43:21 -05:00
Brad Groux
44d1611741
feat: add governed SQLite journal maintenance (#884)
Some checks are pending
CI / Lint & Type Check (push) Waiting to run
CI / Workspace Unit Tests (push) Waiting to run
CI / Build (push) Waiting to run
CI / Security Audit (push) Waiting to run
* feat: add governed SQLite journal maintenance

* fix: update permission coverage for SQLite maintenance

---------

Co-authored-by: bradgroux <brad@digitalmeld.io>
2026-07-15 20:00:58 -05:00
Brad Groux
bd6b0932a6
fix: enforce SQLite filesystem startup posture (#881) (#883)
Some checks are pending
CI / Lint & Type Check (push) Waiting to run
CI / Workspace Unit Tests (push) Waiting to run
CI / Build (push) Waiting to run
CI / Security Audit (push) Waiting to run
Co-authored-by: bradgroux <brad@digitalmeld.io>
2026-07-15 17:49:13 -05:00
Brad Groux
abfac7c446 Add governance decision traces 2026-06-03 05:45:59 -07:00
Brad Groux
022889bf26
feat: add SQLite migration recovery drills
## Summary

- adds migration journals, recovery-state reporting, and restore-from-pre-migration-backup service support
- exposes admin recovery and restore endpoints for SQLite migration rollback drills
- documents the v5 recovery contract, downgrade policy, and support bundle contents
- expands portability tests for completed journals, corrupt target failure recovery, rerun, restore, duplicate IDs, and missing attachment files

Closes #419.

## Verification

- VERITAS_DISABLE_WATCHERS=1 node_modules/.bin/vitest run server/src/__tests__/sqlite-portability-service.test.ts
- pnpm --filter @veritas-kanban/server typecheck
- pnpm build
- pnpm lint:budget
- pnpm audit --prod --audit-level=high
- node_modules/.bin/prettier --check server/src/services/sqlite-portability-service.ts server/src/routes/sqlite-portability.ts server/src/__tests__/sqlite-portability-service.test.ts docs/API-REFERENCE.md docs/SQLITE-SCHEMA.md docs/MIGRATION-RECOVERY.md README.md
- git diff --check

## Notes

- pnpm audit --prod --audit-level=high passes the high-severity gate and still reports 3 moderate existing vulnerabilities.
- pnpm lint:budget passed with 705 warnings under the 714 warning budget.
2026-05-31 05:43:25 -05:00
Brad Groux
e97d01846a
feat: add SQLite provenance queries
## Summary

- adds a SQLite operational provenance repository with bounded task, run, and recent artifact queries
- exposes lightweight provenance metadata for work products, task deliverables, attachments, workflow runs, scheduled run snapshots, notifications, and task chat messages without returning raw JSON payloads
- wires the provenance repository into the SQLite storage provider
- documents the query surface in the SQLite schema guide

Closes #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- Local: `./node_modules/.bin/vitest run server/src/__tests__/storage/sqlite-provenance-repository.test.ts`
- Local: `pnpm --filter @veritas-kanban/server typecheck`
- Local: `pnpm lint:budget`
- Local: `pnpm audit --prod --audit-level=high`
- Local: `pnpm build`
- Local: prettier check for changed files
- Local: `git diff --check`
2026-05-31 03:52:38 -05:00
Brad Groux
b44efb8ade
feat: add multi-user identity APIs
## Summary

- adds the SQLite multi-user identity foundation migration for expanded workspace roles and workspace invitations
- adds SQLite identity repository/service support for local owner setup, workspace/profile reads, invitations, role updates, member removal, audit/activity recording, and invitation acceptance
- adds `/api/identity` and `/api/v1/identity` routes plus unauthenticated `/api/auth/invitations/accept`
- wires SQLite auth setup to ensure the local owner/default workspace exists
- includes identity tables in SQLite portability backups and documents the new identity API surface

Closes #335.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- sqlite-identity-repository identity-service routes/identity`
- `pnpm --filter @veritas-kanban/server test -- sqlite-portability-service sqlite-storage routes/auth`
- `pnpm --filter @veritas-kanban/server test -- middleware/auth`
- `pnpm --filter @veritas-kanban/server test -- docker-paths`
- `pnpm --filter @veritas-kanban/server typecheck`
- `./node_modules/.bin/prettier --check docs/API-REFERENCE.md docs/SQLITE-SCHEMA.md server/src/routes/auth.ts server/src/routes/identity.ts server/src/routes/v1/index.ts server/src/services/activity-service.ts server/src/services/identity-service.ts server/src/services/sqlite-portability-service.ts server/src/storage/index.ts server/src/storage/sqlite/identity-repository.ts server/src/storage/sqlite/migrations.ts server/src/__tests__/identity-service.test.ts server/src/__tests__/routes/identity.test.ts server/src/__tests__/storage/sqlite-identity-repository.test.ts`
- `git diff --check`
- `pnpm lint:budget`
- `pnpm audit --prod --audit-level=high`
- `pnpm build`

## Notes

- `pnpm lint:budget` currently reports the existing 707 warnings against the 714-warning budget.
- `pnpm audit --prod --audit-level=high` exits cleanly with 3 moderate advisories reported.
- A full `pnpm test:unit` attempt reached 1,625 passing server tests and timed out on `docker-paths.test.ts`; the isolated `docker-paths` rerun passed and hosted Workspace Unit Tests are green.
- This is the management API/data foundation for #335. Broad route-by-route RBAC enforcement remains in #336.
2026-05-31 02:25:04 -05:00
Brad Groux
5cf82db881
docs: define v5 identity RBAC model
## Summary

- adds the v5 identity, workspace, and RBAC design document
- defines users, workspaces, memberships, invitations, sessions, agent identities, scoped API tokens, roles, route permissions, entity-level rules, and actor attribution
- documents local mode, server mode, localhost bypass behavior, backward-compatible migration, recovery, invitation, device pairing, and agent token UX flows
- links the design from the README docs map, security guide, and SQLite schema strategy

Closes #334.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `./node_modules/.bin/prettier --check docs/IDENTITY-RBAC.md README.md docs/security.md docs/SQLITE-SCHEMA.md`
- `git diff --check`

## Notes

- This is the design slice for #334. It intentionally does not implement the RBAC tables or middleware.
2026-05-31 02:04:08 -05:00
Brad Groux
90793aeb54
feat: add SQLite migration backup API
## Summary

- adds an admin-only SQLite portability API for dry-run file migrations, migration runs, backup bundle export, and bundle import
- imports file-backed tasks, settings, templates, prompt registry data, telemetry, activity/status history, workflows, workflow runs, task chat, and squad messages into SQLite
- exports raw SQLite table snapshots plus human-readable task Markdown, config JSON, and workflow YAML, then rebuilds search indexes on import
- fixes squad transcript parsing so the first message after the file heading is preserved
- documents migration/recovery API usage and adds regression coverage for malformed input and backup round trips

Closes #333.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- sqlite-portability-service`
- `pnpm --filter @veritas-kanban/server test -- chat-service`
- `pnpm --filter @veritas-kanban/server typecheck`
- `./node_modules/.bin/prettier --check docs/API-REFERENCE.md docs/SQLITE-SCHEMA.md server/src/routes/v1/index.ts server/src/routes/sqlite-portability.ts server/src/services/chat-service.ts server/src/services/sqlite-portability-service.ts server/src/__tests__/sqlite-portability-service.test.ts server/src/__tests__/chat-service.test.ts server/src/storage/index.ts`
- `git diff --check`
- `pnpm lint:budget`
- `pnpm audit --prod --audit-level=high`
- `pnpm build`

## Notes

- `pnpm lint:budget` currently reports 707 existing warnings against the 714-warning budget.
- `pnpm audit --prod --audit-level=high` exits cleanly with 3 moderate advisories reported.
2026-05-31 01:56:05 -05:00
Brad Groux
b502872b49
feat: add durable work product foundation
Summary:
- adds typed durable work product render contracts
- adds SQLite work_products, work_product_versions, and work_product_search storage
- adds create, list, refine, archive, restore, preview, and export APIs
- wires work products into task-scoped APIs and keyword search
- adds redacted preview/export behavior and SQLite regression coverage
- documents the work product API and SQLite schema

Verification:
- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- ./node_modules/.bin/prettier --check README.md docs/SQLITE-SCHEMA.md docs/features/work-products.md shared/src/types/work-product.types.ts shared/src/types/index.ts server/src/schemas/work-product-schemas.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/work-product-repository.ts server/src/services/work-product-service.ts server/src/routes/work-products.ts server/src/routes/v1/index.ts server/src/routes/search.ts server/src/services/search-service.ts server/src/__tests__/storage/sqlite-work-products.test.ts
- pnpm --filter @veritas-kanban/server test -- sqlite-work-products
- pnpm typecheck
- pnpm lint:budget
- pnpm --filter @veritas-kanban/server test
- pnpm build
- pnpm audit --prod --audit-level=high
- git diff --check

Part of #403.
Part of #332.
2026-05-31 01:31:00 -05:00
Brad Groux
277dc6608e
feat: load dashboard metrics from sqlite telemetry
Some checks are pending
CI / Lint & Type Check (push) Waiting to run
CI / Workspace Unit Tests (push) Waiting to run
CI / Build (push) Waiting to run
CI / Security Audit (push) Waiting to run
Summary:
- read dashboard telemetry from SQLite telemetry_events in SQLite mode
- route dashboard metrics, trends, agent comparison, task cost, and utilization through the shared active-backend reader
- add SQLite regression coverage for metrics and trends without telemetry files
- document the SQLite dashboard aggregation path

Verification:
- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- ./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md server/src/services/metrics/telemetry-reader.ts server/src/services/metrics/dashboard-metrics.ts server/src/__tests__/storage/sqlite-dashboard-metrics.test.ts
- pnpm --filter @veritas-kanban/server test -- sqlite-dashboard-metrics
- pnpm typecheck
- pnpm lint:budget
- pnpm --filter @veritas-kanban/server test
- pnpm build
- pnpm audit --prod --audit-level=high
- git diff --check

Part of #332.
2026-05-31 01:05:55 -05:00
Brad Groux
39d9b907d3
feat: add SQLite task artifact metadata
## Summary

- adds SQLite migration 0012 for normalized task attachment and task deliverable metadata
- mirrors attachment validation, hash/path, retention, owner/session, and cleanup fields from task JSON into queryable SQLite rows
- adds deliverable provenance fields for model/source run/redaction/version metadata and stores them in SQLite
- updates task artifact schema docs and adds repository coverage for child row sync

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- sqlite-task-repository`
- `pnpm typecheck`
- `pnpm lint:budget`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md server/src/__tests__/storage/sqlite-task-repository.test.ts server/src/routes/task-deliverables.ts server/src/schemas/deliverable-schemas.ts server/src/services/attachment-service.ts server/src/services/clawdbot-agent-service.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/task-repository.ts shared/src/types/task.types.ts shared/src/types/task.types.d.ts`
- `git diff --check`

## Notes

- Attachment binary blobs remain on disk; this slice persists metadata in SQLite for query, migration, backup/import, and cleanup workflows.
2026-05-31 00:47:56 -05:00
Brad Groux
5b45fa1788
feat: add SQLite scheduled deliverable repositories
## Summary

- adds SQLite tables and repository storage for scheduled deliverables and recurring run history
- wires ScheduledDeliverablesService into SQLite mode while preserving JSON file mode and configurable file paths
- captures stable scheduled-run snapshots with source workflow/run IDs, output metadata, summary, duration, and audit-safe snapshot metadata
- adds restart-style SQLite coverage for schedules, filters, run history, snapshots, and no JSON-file writes
- documents the scheduled deliverable repository schema mapping

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-scheduled-deliverables-repository.test.ts`
- `pnpm typecheck`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
- `git diff --cached --check`

## Notes

- The production audit currently reports only moderate vulnerabilities.
2026-05-31 00:33:29 -05:00
Brad Groux
d168ac6e4c
feat: add SQLite notification repositories
## Summary

- adds SQLite tables and repository storage for notification inbox records and thread subscriptions
- wires NotificationService into SQLite mode while preserving JSON file mode and existing file-path test options
- preserves direct notification metadata including type, title, task title, project, target URL, dedupe key, and source metadata
- adds restart-style SQLite coverage for mentions, assignments, direct notifications, delivered state, stats, and subscriptions
- documents the notification repository schema mapping

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-notification-repositories.test.ts src/__tests__/notification-service.test.ts src/__tests__/failure-alert-service.test.ts src/__tests__/routes/notifications-coverage.test.ts`
- `pnpm typecheck`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
- `git diff --cached --check`

## Notes

- The production audit currently reports only moderate vulnerabilities.
2026-05-31 00:22:30 -05:00
Brad Groux
a59f1d42d1
feat: add SQLite chat repositories
## Summary

- adds SQLite tables and repositories for board chat sessions, task chat messages, and squad chat messages
- wires ChatService into SQLite mode while leaving Markdown file mode as the default
- adds restart-style SQLite coverage proving board chat, task chat, and squad chat persist without markdown files
- documents the chat repository schema mapping

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-chat-repositories.test.ts src/__tests__/chat-service.test.ts src/__tests__/routes/chat.test.ts`
- `pnpm typecheck`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
2026-05-30 23:51:15 -05:00
Brad Groux
ea1e69dadc
feat: add SQLite workflow repositories
## Summary

- adds SQLite tables and repositories for workflow definitions, ACLs, audit events, run state, and workflow snapshots
- wires workflow definition and run services into SQLite mode while keeping file mode as the default
- adds SQLite repository tests plus an execution-path test for start, retry, block, resume, and complete behavior
- documents the workflow repository schema mapping

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm typecheck`
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-workflow-repositories.test.ts src/__tests__/storage/sqlite-workflow-run-execution.test.ts src/__tests__/workflow-service.test.ts src/__tests__/workflow-run-service.test.ts`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
2026-05-30 22:56:20 -05:00
Brad Groux
e24c7abfd6
feat: add SQLite audit and policy repositories
## Summary

- adds v7 SQLite tables and repositories for audit entries, agent policies, and tool policies
- routes audit logging, policy service, and tool policy service to SQLite when configured while preserving file-backed defaults
- keeps audit hash-chain verification and recent-entry reads working in SQLite mode
- adds SQLite coverage for audit persistence, agent policy CRUD/evaluation, tool policy CRUD/access filters, and no file writes
- documents the audit/policy tables in the SQLite schema notes

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-audit-policy-repositories.test.ts`
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-audit-policy-repositories.test.ts src/__tests__/services/audit-service.test.ts src/__tests__/services/policy-service.test.ts`
- `./node_modules/.bin/eslint server/src/__tests__/storage/sqlite-audit-policy-repositories.test.ts server/src/services/audit-service.ts server/src/services/policy-service.ts server/src/services/tool-policy-service.ts server/src/storage/index.ts server/src/storage/sqlite/audit-policy-repositories.ts server/src/storage/sqlite/migrations.ts --quiet`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm typecheck`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
2026-05-30 22:25:14 -05:00
Brad Groux
1bcb4087eb
feat: add SQLite governance repositories
## Summary

- adds v6 SQLite governance tables and repository implementations for decisions, feedback, scoring, and drift data
- routes DecisionService, FeedbackService, ScoringService, and DriftService to SQLite when configured while preserving file-backed defaults
- adds SQLite coverage for decision chains, feedback analytics, scoring history, drift alerts and baselines, and no file writes
- documents the governance repository tables in the SQLite schema notes

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-governance-repositories.test.ts`
- `pnpm typecheck`
- `./node_modules/.bin/eslint server/src/__tests__/storage/sqlite-governance-repositories.test.ts server/src/services/decision-service.ts server/src/services/feedback-service.ts server/src/services/scoring-service.ts server/src/services/drift-service.ts server/src/storage/index.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/governance-repositories.ts --quiet`
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-governance-repositories.test.ts src/__tests__/decision-service.test.ts src/__tests__/feedback-service.test.ts src/__tests__/scoring-service.test.ts src/__tests__/drift-service.test.ts`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
2026-05-30 22:10:57 -05:00
Brad Groux
df54a42de7
feat: add SQLite operational history repositories
## Summary

- adds SQLite migration/table support for activity events, status history, and telemetry events
- wires ActivityService, StatusHistoryService, TelemetryService, and SqliteStorageProvider to use SQLite repositories in sqlite mode
- keeps file storage explicitly file-backed and adds regression coverage that sqlite mode does not create JSON/NDJSON operational files
- documents the operational repository slice in the v5 SQLite schema plan

Part of #332.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `pnpm --filter @veritas-kanban/server test -- --run src/__tests__/storage/sqlite-operational-repositories.test.ts src/__tests__/storage/sqlite-storage.test.ts`
- `pnpm typecheck`
- `./node_modules/.bin/eslint server/src/__tests__/storage/sqlite-storage.test.ts server/src/__tests__/storage/sqlite-operational-repositories.test.ts server/src/services/activity-service.ts server/src/services/status-history-service.ts server/src/services/telemetry-service.ts server/src/storage/file-storage.ts server/src/storage/index.ts server/src/storage/interfaces.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/activity-repository.ts server/src/storage/sqlite/status-history-repository.ts server/src/storage/sqlite/telemetry-repository.ts --quiet`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
2026-05-30 21:50:48 -05:00
Brad Groux
bcf7110b96
feat: add SQLite configuration repositories
## Summary

- adds SQLite migration/table support for app config, managed lists, task templates, prompt templates, prompt versions, and prompt usage
- wires ConfigService, ManagedListService, TemplateService, and PromptRegistryService into SQLite mode while preserving file-backed behavior
- exposes repository/provider implementations and documents the runtime schema
- adds SQLite configuration repository coverage and removes file-backed template constructor directory races

Closes #331.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md server/src/services/config-service.ts server/src/services/managed-list-service.ts server/src/services/prompt-registry-service.ts server/src/services/template-service.ts server/src/storage/file-storage.ts server/src/storage/index.ts server/src/storage/interfaces.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/managed-list-repository.ts server/src/storage/sqlite/prompt-registry-repository.ts server/src/storage/sqlite/settings-repository.ts server/src/storage/sqlite/template-repository.ts server/src/__tests__/storage/sqlite-config-repositories.test.ts`
- `./node_modules/.bin/eslint server/src/services/config-service.ts server/src/services/managed-list-service.ts server/src/services/prompt-registry-service.ts server/src/services/template-service.ts server/src/storage/file-storage.ts server/src/storage/index.ts server/src/storage/interfaces.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/managed-list-repository.ts server/src/storage/sqlite/prompt-registry-repository.ts server/src/storage/sqlite/settings-repository.ts server/src/storage/sqlite/template-repository.ts server/src/__tests__/storage/sqlite-config-repositories.test.ts --quiet`
- `pnpm --filter @veritas-kanban/server test -- src/__tests__/prompt-registry-service.test.ts src/__tests__/template-service.test.ts src/__tests__/storage/sqlite-config-repositories.test.ts`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm typecheck`
- `pnpm lint:budget`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- Live SQLite API smoke for `/api/settings/features`, `/api/projects`, `/api/templates`, `/api/prompt-registry`, prompt versions, prompt usage, prompt stats, and schema row counts
2026-05-30 20:49:35 -05:00
Brad Groux
df9c29cf05
feat: add SQLite task repository parity
## Summary

- adds the v5 SQLite task table, indexed task columns, and FTS5 task_search migration
- adds SqliteTaskRepository for full task JSON persistence plus active/archive/backlog state helpers
- wires TaskService SQLite mode for create/list/read/update/delete/archive/restore/reorder without task markdown writes
- preserves serialized task mutations in SQLite mode and adds repository, service, and route-shape coverage
- documents the task repository storage strategy in the SQLite schema guide

Closes #330.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Security Audit
- CI: Workspace Unit Tests
- `./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md server/src/services/task-service.ts server/src/storage/index.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/task-repository.ts server/src/__tests__/storage/sqlite-task-repository.test.ts server/src/__tests__/task-service-sqlite.test.ts server/src/__tests__/routes/tasks-sqlite.test.ts`
- `./node_modules/.bin/eslint server/src/services/task-service.ts server/src/storage/index.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/task-repository.ts server/src/__tests__/storage/sqlite-task-repository.test.ts server/src/__tests__/task-service-sqlite.test.ts server/src/__tests__/routes/tasks-sqlite.test.ts --quiet`
- `pnpm lint`
- `pnpm lint:budget`
- `pnpm typecheck`
- `pnpm --filter @veritas-kanban/server typecheck`
- `pnpm --filter @veritas-kanban/server test -- src/__tests__/storage/sqlite-task-repository.test.ts src/__tests__/task-service-sqlite.test.ts src/__tests__/routes/tasks-sqlite.test.ts`
- `pnpm --filter @veritas-kanban/server test`
- `pnpm build`
- `pnpm audit --prod --audit-level=high`
- live SQLite API smoke: POST/GET `/api/tasks` with `VERITAS_STORAGE=sqlite`, verified only `veritas.db` was created under the data dir

## Notes

- The production audit gate reports 3 moderate vulnerabilities and no high/critical failures.
2026-05-30 20:01:43 -05:00
Brad Groux
ec6bc83fd2
feat: add SQLite storage foundation
## Summary

- adds a dependency-free Node `node:sqlite` database foundation with safe PRAGMAs, schema_migrations tracking, checksum validation, and transactional migration rollback
- adds the SQLite storage provider shell, lifecycle shutdown, and isolated SQLite test helpers while file repositories remain the default behavior
- wires `VERITAS_STORAGE=file|sqlite` plus `VERITAS_SQLITE_PATH` through env validation, docs, and server startup/shutdown

Closes #329.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Workspace Unit Tests
- CI: Security Audit
- `./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md server/src/config/env.ts server/src/index.ts server/src/storage/index.ts server/src/storage/sqlite/database.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/test-helpers.ts server/src/__tests__/config/env.test.ts server/src/__tests__/storage/sqlite-database.test.ts server/src/__tests__/storage/sqlite-storage.test.ts`
- `./node_modules/.bin/eslint server/src --ext .ts --quiet`
- `pnpm --filter @veritas-kanban/server test -- src/__tests__/storage/sqlite-database.test.ts src/__tests__/storage/sqlite-storage.test.ts src/__tests__/config/env.test.ts`
- `pnpm --filter @veritas-kanban/server typecheck`
- `pnpm --filter @veritas-kanban/server build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
- SQLite startup smoke with `VERITAS_STORAGE=sqlite` against a fresh temp data dir and `/api/health` returning ok

## Notes

- File storage remains the default until the provider parity and migration/import issues land. SQLite mode currently owns database lifecycle and migrations, then delegates existing repositories to file storage.
2026-05-30 17:39:23 -05:00
Brad Groux
d78af4053e
docs: define v5 SQLite schema strategy
Some checks are pending
CI / Lint & Type Check (push) Waiting to run
CI / Workspace Unit Tests (push) Waiting to run
CI / Build (push) Waiting to run
CI / Security Audit (push) Waiting to run
## Summary

- adds the v5 SQLite schema and migration strategy document
- maps current file-backed objects to SQLite destinations
- documents migration numbering, rollback policy, FTS5 tables, multi-user-ready columns, and sensitive field handling
- links the design doc from the README roadmap section
- pins transitive tmp to a patched version for the security audit gate

Closes #328.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Workspace Unit Tests
- CI: Security Audit
- `./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md README.md`
- `git diff --check HEAD~2..HEAD`
- `pnpm audit --prod --audit-level=high`
2026-05-30 14:43:38 -05:00