From 41302d9f3636d745a7edaa4751305dc932ba5631 Mon Sep 17 00:00:00 2001 From: alvis Date: Mon, 4 May 2026 10:52:27 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20repair=20Docker=20build=20=E2=80=94=20TS?= =?UTF-8?q?=20errors=20and=20missing=20docs=20in=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unused `httpx` import from bench.ts (package does not exist) - Add explicit `IRouter` type on `router` in agent-outputs.ts and bench.ts to resolve TS2742 portable-type errors - Remove `docs` from .dockerignore so Dockerfile.admin can copy it into the runner image (DOCS_ROOT=/app/docs is read at runtime by the admin) Co-Authored-By: Claude Sonnet 4.6 --- .dockerignore | 1 - services/api/src/routes/agent-outputs.ts | 5 ++--- services/api/src/routes/bench.ts | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index 2c4b087..5878341 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,7 +12,6 @@ **/.env **/.env.local **/*.log -docs infra/docker/data **/__tests__ **/*.test.ts diff --git a/services/api/src/routes/agent-outputs.ts b/services/api/src/routes/agent-outputs.ts index 1a95d9d..5dff5ce 100644 --- a/services/api/src/routes/agent-outputs.ts +++ b/services/api/src/routes/agent-outputs.ts @@ -1,4 +1,4 @@ -import { Router } from 'express'; +import { Router, type Request, type Response, type IRouter } from 'express'; import { nanoid } from 'nanoid'; import { db } from '../db/index.js'; import { agentOutputs, tipFeedback, tipViews } from '../db/schema.js'; @@ -7,9 +7,8 @@ import { config } from '../config.js'; import { getProfile, type Profile } from '../profile/builder.js'; import { todoistSource } from '../signals/todoist.js'; import { SignalAggregator } from '../signals/aggregator.js'; -import type { Request, Response } from 'express'; -const router = Router(); +const router: IRouter = Router(); // Separate aggregator instance — avoids circular dep with recommender.ts. const _agentAggregator = new SignalAggregator().register(todoistSource); diff --git a/services/api/src/routes/bench.ts b/services/api/src/routes/bench.ts index b1c1a43..d395227 100644 --- a/services/api/src/routes/bench.ts +++ b/services/api/src/routes/bench.ts @@ -8,11 +8,10 @@ * GET /api/bench/leaderboard/:experiment — leaderboard by (model, prompt) */ -import { Router, Request, Response } from "express"; -import httpx from "httpx"; +import { Router, type Request, type Response, type IRouter } from "express"; import * as process from "process"; -const router = Router(); +const router: IRouter = Router(); const MLFLOW_URL = process.env.MLFLOW_URL || "http://mlflow:5000"; const MLFLOW_USER = process.env.MLFLOW_TRACKING_USERNAME || "admin";