From 69d03312e63a03a84ca89eb05cbb7706db28d843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 20 Apr 2026 13:39:56 -0400 Subject: [PATCH] Cleanup residual dead code and stale annotations (N-scan residual) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Drop the "pass-through remains for back-compat" note on AppDatabaseBase's domain modules; the pass-through layer is gone, so the comment was out of date. Replace with a pointer to the ESLint guard that blocks regression. - Flag the two remaining >500-line files (`agent-runtime/runtime-bridge.ts` 648 LOC, `agent-runtime/artifact-projector.ts` 637 LOC) with an inline `TODO: decompose — M-followup` note. No structural change; the decomposition is tracked for a later milestone to keep this pass scope-safe. --- src/main/agent-runtime/artifact-projector.ts | 3 +++ src/main/agent-runtime/runtime-bridge.ts | 4 ++++ src/main/database-base.ts | 7 ++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/agent-runtime/artifact-projector.ts b/src/main/agent-runtime/artifact-projector.ts index d328fc26..949392fb 100644 --- a/src/main/agent-runtime/artifact-projector.ts +++ b/src/main/agent-runtime/artifact-projector.ts @@ -1,3 +1,6 @@ +// TODO: decompose — M-followup. File is 637 lines and mixes fs-walk +// baseline capture, git-diff projection, and work-product reconciliation. +// Split into baseline / diff / projector modules in a future milestone. import { isAbsolute, relative, resolve } from "node:path"; import { execFileSync } from "node:child_process"; import { readdirSync, statSync } from "node:fs"; diff --git a/src/main/agent-runtime/runtime-bridge.ts b/src/main/agent-runtime/runtime-bridge.ts index 45783416..db4c2c60 100644 --- a/src/main/agent-runtime/runtime-bridge.ts +++ b/src/main/agent-runtime/runtime-bridge.ts @@ -1,3 +1,7 @@ +// TODO: decompose — M-followup. File is 648 lines; split into +// sqlite-session-store wiring, cost/metrics routing, and hook-dispatch +// assembly. Tracked as a future milestone; no structural change in this +// pass. import type { AgentMessage } from "@mariozechner/pi-agent-core"; import type { AppDatabase } from "@main/database"; import type { AgentMessageRecord, DesktopEvent } from "@shared/types"; diff --git a/src/main/database-base.ts b/src/main/database-base.ts index 0a2d3201..353f4787 100644 --- a/src/main/database-base.ts +++ b/src/main/database-base.ts @@ -52,9 +52,10 @@ export class AppDatabaseBase { readonly vault: SecretVault; protected db: DatabaseSync; - // Domain modules. New code should prefer `db.tasks.saveTask(...)` over the - // legacy pass-through methods on AppDatabase. Pass-through remains for - // back-compat until all call sites migrate. + // Domain modules. The canonical surface — call these directly from + // every consumer (`db.tasks.saveTask(...)`, not `db.saveTask(...)`). + // The ESLint rule in eslint.config.mjs blocks new top-level methods + // on AppDatabase so the old pass-through layer cannot grow back. public readonly threads: ReturnType; public readonly company: ReturnType; public readonly agents: ReturnType;