From c77f2b092a9847be293cac77ef1dec9eacf531f2 Mon Sep 17 00:00:00 2001 From: Brad Groux Date: Wed, 28 Jan 2026 12:20:06 -0600 Subject: [PATCH] fix: add missing route imports in server index.ts (server crash fix) --- .../telemetry/events-2026-01-28.ndjson | 3 ++ README.md | 32 ++++++++++++++ server/.veritas-kanban/activity.json | 44 +++++++++++++++++++ server/src/index.ts | 8 ++++ server/src/routes/v1/index.ts | 4 +- 5 files changed, 89 insertions(+), 2 deletions(-) diff --git a/.veritas-kanban/telemetry/events-2026-01-28.ndjson b/.veritas-kanban/telemetry/events-2026-01-28.ndjson index 05ec3c6d..5a63f0f5 100644 --- a/.veritas-kanban/telemetry/events-2026-01-28.ndjson +++ b/.veritas-kanban/telemetry/events-2026-01-28.ndjson @@ -2167,3 +2167,6 @@ {"type":"task.created","taskId":"task_20260128_OgXGkk","status":"todo","id":"evt_WxsQ4lTtVVlo","timestamp":"2026-01-28T18:18:35.974Z"} {"type":"task.created","taskId":"task_20260128_N81BNu","status":"todo","id":"evt_DqdIl0sJ62OO","timestamp":"2026-01-28T18:18:35.974Z"} {"type":"task.created","taskId":"task_20260128_-MLrjY","status":"todo","id":"evt_Uq3tmL-gTpTY","timestamp":"2026-01-28T18:18:35.975Z"} +{"type":"task.status_changed","taskId":"task_20260128_HUc92E","project":"veritas-kanban","status":"done","previousStatus":"in-progress","id":"evt_100CucAjLnzI","timestamp":"2026-01-28T18:18:48.434Z"} +{"type":"task.status_changed","taskId":"task_20260128_vIi7cG","project":"veritas-kanban","status":"in-progress","previousStatus":"todo","id":"evt_HNmt6F9nP9y-","timestamp":"2026-01-28T18:19:18.519Z"} +{"type":"task.created","taskId":"task_20260128_Mobksx","status":"todo","id":"evt_8SCBvkLypJce","timestamp":"2026-01-28T18:19:22.117Z"} diff --git a/README.md b/README.md index fee00898..8c9cd099 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,38 @@ veritas-kanban/ └── agent-requests/ ``` +## API Versioning + +All API endpoints support versioned paths. The current (and default) version is **v1**. + +### URL Patterns + +| Path | Description | +|------|-------------| +| `/api/v1/tasks` | Canonical versioned endpoint | +| `/api/tasks` | Backwards-compatible alias (same as v1) | + +Both paths return identical responses. Existing clients using `/api/...` will continue to work without changes. + +### Version Header + +Every API response includes an `X-API-Version: v1` header. Clients may optionally send an `X-API-Version` request header to explicitly request a version: + +```bash +# Explicit version request +curl -H "X-API-Version: v1" http://localhost:3001/api/tasks + +# Requesting an unsupported version returns 400 +curl -H "X-API-Version: v99" http://localhost:3001/api/tasks +# → {"error":"Unsupported API version","supported":["v1"]} +``` + +### Versioning Strategy + +- **Non-breaking changes** (new fields, new endpoints) are added to the current version. +- **Breaking changes** will introduce a new version (`v2`). The previous version will remain available during a deprecation period. +- The unversioned `/api/...` alias always points to the latest stable version. + ## CLI ```bash diff --git a/server/.veritas-kanban/activity.json b/server/.veritas-kanban/activity.json index 1b9d7b34..495b5b09 100644 --- a/server/.veritas-kanban/activity.json +++ b/server/.veritas-kanban/activity.json @@ -1,4 +1,48 @@ [ + { + "id": "activity_1769624362117_qqkovb929", + "type": "task_created", + "taskId": "task_20260128_Mobksx", + "taskTitle": "test-cache-check", + "details": { + "type": "code", + "priority": "medium" + }, + "timestamp": "2026-01-28T18:19:22.117Z" + }, + { + "id": "activity_1769624358520_c3xljtn9p", + "type": "status_changed", + "taskId": "task_20260128_vIi7cG", + "taskTitle": "PERF: Memoize TaskCard cardMetrics to prevent unnecessary re-renders", + "details": { + "from": "todo", + "status": "in-progress" + }, + "timestamp": "2026-01-28T18:19:18.520Z" + }, + { + "id": "activity_1769624333283_mrcee6a4t", + "type": "comment_added", + "taskId": "task_20260128_HUc92E", + "taskTitle": "PERF: Implement in-memory caching for TaskService with file watchers", + "details": { + "author": "Veritas", + "preview": "Added in-memory Map cache with lazy ..." + }, + "timestamp": "2026-01-28T18:18:53.283Z" + }, + { + "id": "activity_1769624328434_x39kzrrt3", + "type": "status_changed", + "taskId": "task_20260128_HUc92E", + "taskTitle": "PERF: Implement in-memory caching for TaskService with file watchers", + "details": { + "from": "in-progress", + "status": "done" + }, + "timestamp": "2026-01-28T18:18:48.434Z" + }, { "id": "activity_1769624199491_2nk1070ar", "type": "status_changed", diff --git a/server/src/index.ts b/server/src/index.ts index 790a13cc..7943ac7e 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -23,6 +23,14 @@ import { apiRateLimit } from './middleware/rate-limit.js'; import { apiVersionMiddleware } from './middleware/api-version.js'; import { apiCacheHeaders } from './middleware/cache-control.js'; import type { AgentOutput } from './services/clawdbot-agent-service.js'; +import { taskArchiveRoutes } from './routes/task-archive.js'; +import { taskTimeRoutes } from './routes/task-time.js'; +import { taskRoutes } from './routes/tasks.js'; +import { taskCommentRoutes } from './routes/task-comments.js'; +import { taskSubtaskRoutes } from './routes/task-subtasks.js'; +import attachmentRoutes from './routes/attachments.js'; +import { configRoutes } from './routes/config.js'; +import { agentRoutes } from './routes/agents.js'; const app = express(); const PORT = process.env.PORT || 3001; diff --git a/server/src/routes/v1/index.ts b/server/src/routes/v1/index.ts index d0319c12..351f34cd 100644 --- a/server/src/routes/v1/index.ts +++ b/server/src/routes/v1/index.ts @@ -8,7 +8,7 @@ * - Archive and time routes MUST come before main taskRoutes so that * /archived and /time/summary are matched before the /:id param. */ -import { Router } from 'express'; +import { Router, type IRouter } from 'express'; // Task routes (order-sensitive — see note above) import { taskArchiveRoutes } from '../task-archive.js'; @@ -41,7 +41,7 @@ import { agentStatusRoutes } from '../agent-status.js'; import { statusHistoryRoutes } from '../status-history.js'; import digestRoutes from '../digest.js'; -const v1Router = Router(); +const v1Router: IRouter = Router(); // ── Task routes (order-sensitive) ──────────────────────────── v1Router.use('/tasks', taskArchiveRoutes);