From 2c386052c23515d0cd878c3d5428bbe6196dd103 Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Fri, 8 May 2026 13:52:43 +0200 Subject: [PATCH 1/2] fix: remove target directory from opencode plugin install success message The opencode install success message included the target directory path, unlike every other editor which simply confirms the install. Align the opencode case with claude, copilot, and cursor by dropping the path detail and removing the now-unused opencodeAgentsDir import. Signed-off-by: Rhuan Barreto --- src/commands/plugin/install.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/commands/plugin/install.ts b/src/commands/plugin/install.ts index d088bb4f..8817702a 100644 --- a/src/commands/plugin/install.ts +++ b/src/commands/plugin/install.ts @@ -12,7 +12,7 @@ import { exitWith } from "../../helpers/exit"; import { EDITOR_LABELS } from "../../helpers/init-project"; import type { EditorTarget } from "../../helpers/init-project"; import { logError, logInfo, logWarn } from "../../helpers/log"; -import { findProjectRoot, opencodeAgentsDir } from "../../helpers/paths"; +import { findProjectRoot } from "../../helpers/paths"; import { buildMarketplaceUrl, buildVscodeMarketplaceUrl, @@ -102,10 +102,7 @@ async function installForEditor( break; } await installOpencodePlugin(token); - logInfo( - `Archgate agents installed for ${label}.`, - `Target directory: ${opencodeAgentsDir()}` - ); + logInfo(`Archgate agents installed for ${label}.`); break; } case "vscode": { From 374fc4f74fa43068a5eb035edece27f101db711b Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Fri, 8 May 2026 14:29:51 +0200 Subject: [PATCH 2/2] refactor: remove dead code across src/ - Delete 3 unused test-hook functions that were never called: _resetPlatformCache (superseded by _resetAllCaches), _resetGitFilesCache, and _resetAdrParseCache - Unexport 25 interfaces that are only used within their own module: LoadedAdr, BlockedAdr, ParsedAdrEntry, AdrBriefing, DomainContext, ReviewContext, BriefAdrOptions, BuildReviewContextOptions, BuildSummaryOptions, RuleResult, SourcePos, DeviceCodeResponse, GitHubUserInfo, CreateAdrResult, UpdateAdrResult, InitOptions, PluginResult, InitResult, SignupResult, ClaudeSessionSummary, CursorSessionSummary, ReadCursorSessionOptions, CopilotSessionSummary, ReadCopilotSessionOptions, OpencodeSessionSummary, ReadOpencodeSessionOptions Signed-off-by: Rhuan Barreto --- src/engine/context.ts | 10 +++++----- src/engine/git-files.ts | 5 ----- src/engine/loader.ts | 11 +++-------- src/engine/reporter.ts | 2 +- src/engine/runner.ts | 2 +- src/engine/source-positions.ts | 2 +- src/helpers/adr-writer.ts | 4 ++-- src/helpers/auth.ts | 4 ++-- src/helpers/init-project.ts | 6 +++--- src/helpers/platform.ts | 7 ------- src/helpers/session-context-copilot.ts | 4 ++-- src/helpers/session-context-opencode.ts | 4 ++-- src/helpers/session-context.ts | 6 +++--- src/helpers/signup.ts | 2 +- 14 files changed, 26 insertions(+), 43 deletions(-) diff --git a/src/engine/context.ts b/src/engine/context.ts index 596c90fd..ddc1bef1 100644 --- a/src/engine/context.ts +++ b/src/engine/context.ts @@ -5,7 +5,7 @@ import type { ReportSummary } from "./reporter"; import { buildSummary } from "./reporter"; import { runChecks } from "./runner"; -export interface AdrBriefing { +interface AdrBriefing { id: string; title: string; domain: AdrDomain; @@ -15,13 +15,13 @@ export interface AdrBriefing { dosAndDonts: string; } -export interface DomainContext { +interface DomainContext { domain: AdrDomain; changedFiles: string[]; adrs: AdrBriefing[]; } -export interface ReviewContext { +interface ReviewContext { allChangedFiles: string[]; truncatedFiles: boolean; domains: DomainContext[]; @@ -69,7 +69,7 @@ export function extractAdrSections( return result; } -export interface BriefAdrOptions { +interface BriefAdrOptions { /** Max chars per section. 0 = unlimited. Default: 2000. */ maxSectionChars?: number; } @@ -190,7 +190,7 @@ const EMPTY_SUMMARY: ReportSummary = { durationMs: 0, }; -export interface BuildReviewContextOptions { +interface BuildReviewContextOptions { runChecks?: boolean; staged?: boolean; domain?: AdrDomain; diff --git a/src/engine/git-files.ts b/src/engine/git-files.ts index a308830b..1fcf2ab5 100644 --- a/src/engine/git-files.ts +++ b/src/engine/git-files.ts @@ -56,11 +56,6 @@ export function getGitTrackedFiles( return promise; } -/** Reset the tracked-files cache. For testing only. */ -export function _resetGitFilesCache(): void { - trackedFilesCache.clear(); -} - /** Resolve scoped files for an ADR based on its files globs. Respects .gitignore. */ export async function resolveScopedFiles( projectRoot: string, diff --git a/src/engine/loader.ts b/src/engine/loader.ts index c61863ce..46ccd3c4 100644 --- a/src/engine/loader.ts +++ b/src/engine/loader.ts @@ -30,12 +30,12 @@ import { projectPaths } from "../helpers/paths"; import { ensureRulesShim } from "../helpers/rules-shim"; import { scanRuleSource } from "./rule-scanner"; -export interface LoadedAdr { +interface LoadedAdr { adr: AdrDocument; ruleSet: RuleSet; } -export interface BlockedAdr { +interface BlockedAdr { adr: AdrDocument; error: string; violations: Array<{ @@ -137,7 +137,7 @@ function checkRuleSyntax(source: string): SyntaxViolation[] { return violations; } -export interface ParsedAdrEntry { +interface ParsedAdrEntry { file: string; adr: AdrDocument; } @@ -153,11 +153,6 @@ export interface ParsedAdrEntry { */ const parsedAdrsCache = new Map>(); -/** Reset the parsed-ADRs cache. For testing only. */ -export function _resetAdrParseCache(): void { - parsedAdrsCache.clear(); -} - /** * Read and parse every ADR markdown file in the project, caching the result * per-process. Returns entries in directory order. Unparseable files are diff --git a/src/engine/reporter.ts b/src/engine/reporter.ts index 26f83708..cd3ad82d 100644 --- a/src/engine/reporter.ts +++ b/src/engine/reporter.ts @@ -36,7 +36,7 @@ export interface ReportSummary { durationMs: number; } -export interface BuildSummaryOptions { +interface BuildSummaryOptions { /** Maximum violations per rule. When exceeded, only the first N are kept. Omit or 0 for unlimited. */ maxViolationsPerRule?: number; } diff --git a/src/engine/runner.ts b/src/engine/runner.ts index 8510028c..2cd03a20 100644 --- a/src/engine/runner.ts +++ b/src/engine/runner.ts @@ -56,7 +56,7 @@ function safeGlob(pattern: string): void { } const RULE_TIMEOUT_MS = 30_000; -export interface RuleResult { +interface RuleResult { ruleId: string; adrId: string; description: string; diff --git a/src/engine/source-positions.ts b/src/engine/source-positions.ts index 91278260..19fa968d 100644 --- a/src/engine/source-positions.ts +++ b/src/engine/source-positions.ts @@ -3,7 +3,7 @@ * original TypeScript source, skipping matches in comments and strings. */ -export interface SourcePos { +interface SourcePos { line: number; column: number; endLine: number; diff --git a/src/helpers/adr-writer.ts b/src/helpers/adr-writer.ts index 30ce7428..809678d0 100644 --- a/src/helpers/adr-writer.ts +++ b/src/helpers/adr-writer.ts @@ -65,7 +65,7 @@ ${opts.body} }); } -export interface CreateAdrResult { +interface CreateAdrResult { id: string; fileName: string; filePath: string; @@ -138,7 +138,7 @@ export async function findAdrFileById( return results.find((adr) => adr?.frontmatter.id === id) ?? null; } -export interface UpdateAdrResult { +interface UpdateAdrResult { id: string; fileName: string; filePath: string; diff --git a/src/helpers/auth.ts b/src/helpers/auth.ts index d6b8a6db..8fe09ec8 100644 --- a/src/helpers/auth.ts +++ b/src/helpers/auth.ts @@ -27,7 +27,7 @@ const GITHUB_CLIENT_ID = "Ov23liZUI9Aiv2ZrSAgn"; // Types // --------------------------------------------------------------------------- -export interface DeviceCodeResponse { +interface DeviceCodeResponse { device_code: string; user_code: string; verification_uri: string; @@ -151,7 +151,7 @@ export async function pollForAccessToken( throw new Error("Device code expired. Please try again."); } -export interface GitHubUserInfo { +interface GitHubUserInfo { login: string; email: string | null; } diff --git a/src/helpers/init-project.ts b/src/helpers/init-project.ts index a9333f7f..ef955864 100644 --- a/src/helpers/init-project.ts +++ b/src/helpers/init-project.ts @@ -29,13 +29,13 @@ export const EDITOR_LABELS: Record = { opencode: "opencode", }; -export interface InitOptions { +interface InitOptions { editor?: EditorTarget; /** When true, attempt to install the archgate plugin using stored credentials. */ installPlugin?: boolean; } -export interface PluginResult { +interface PluginResult { installed: boolean; /** For claude manual: marketplace URL; for cursor: file count summary */ detail?: string; @@ -43,7 +43,7 @@ export interface PluginResult { autoInstalled?: boolean; } -export interface InitResult { +interface InitResult { projectRoot: string; adrsDir: string; lintDir: string; diff --git a/src/helpers/platform.ts b/src/helpers/platform.ts index 5a3734f5..af9decc8 100644 --- a/src/helpers/platform.ts +++ b/src/helpers/platform.ts @@ -97,13 +97,6 @@ export function isSupportedPlatform(): boolean { return runtime === "darwin" || runtime === "linux" || runtime === "win32"; } -/** - * Reset the cached platform info. For testing only. - */ -export function _resetPlatformCache(): void { - cachedPlatformInfo = null; -} - // --------------------------------------------------------------------------- // Path Conversion (async, WSL only) // --------------------------------------------------------------------------- diff --git a/src/helpers/session-context-copilot.ts b/src/helpers/session-context-copilot.ts index 35ad665c..04cb96c6 100644 --- a/src/helpers/session-context-copilot.ts +++ b/src/helpers/session-context-copilot.ts @@ -10,7 +10,7 @@ import { getContentPreview, } from "./session-context"; -export interface CopilotSessionSummary { +interface CopilotSessionSummary { sessionId: string; sessionFile: string; totalEntries: number; @@ -18,7 +18,7 @@ export interface CopilotSessionSummary { transcript: Array<{ role: string; contentPreview: string }>; } -export interface ReadCopilotSessionOptions extends ReadSessionOptions { +interface ReadCopilotSessionOptions extends ReadSessionOptions { sessionId?: string; } diff --git a/src/helpers/session-context-opencode.ts b/src/helpers/session-context-opencode.ts index c09a3f09..52f1cef5 100644 --- a/src/helpers/session-context-opencode.ts +++ b/src/helpers/session-context-opencode.ts @@ -12,14 +12,14 @@ import { getContentPreview, } from "./session-context"; -export interface OpencodeSessionSummary { +interface OpencodeSessionSummary { sessionId: string; totalEntries: number; relevantEntries: number; transcript: Array<{ role: string; contentPreview: string }>; } -export interface ReadOpencodeSessionOptions extends ReadSessionOptions { +interface ReadOpencodeSessionOptions extends ReadSessionOptions { sessionId?: string; } diff --git a/src/helpers/session-context.ts b/src/helpers/session-context.ts index 3eff3b1d..293a8778 100644 --- a/src/helpers/session-context.ts +++ b/src/helpers/session-context.ts @@ -55,14 +55,14 @@ export interface TranscriptEntry { [key: string]: unknown; } -export interface ClaudeSessionSummary { +interface ClaudeSessionSummary { sessionFile: string; totalEntries: number; relevantEntries: number; transcript: Array<{ type: string; role?: string; contentPreview: string }>; } -export interface CursorSessionSummary { +interface CursorSessionSummary { sessionId: string; sessionFile: string; totalEntries: number; @@ -109,7 +109,7 @@ export interface ReadSessionOptions { maxEntries?: number; } -export interface ReadCursorSessionOptions extends ReadSessionOptions { +interface ReadCursorSessionOptions extends ReadSessionOptions { sessionId?: string; } diff --git a/src/helpers/signup.ts b/src/helpers/signup.ts index 737f3a26..2e95a325 100644 --- a/src/helpers/signup.ts +++ b/src/helpers/signup.ts @@ -28,7 +28,7 @@ export function isSignupRequiredError(message?: string): boolean { ); } -export interface SignupResult { +interface SignupResult { ok: boolean; /** Token returned by the API when signup is auto-approved. */ token: string | null;