fix(autoresearch): remove all 11 remaining biome lint warnings

Result: {"status": "keep", "diagnostics": 0, "delta": "-100%"}

- Removed unused imports: injectReasoningGuidance, withQueryTimeout,
  getAutoSession, logWarning (x3), debugLog, readFileSync/unlinkSync/writeFileSync
- Prefixed intentionally unused vars with underscore: MAX_HISTOGRAM_BUCKETS,
  REASONING_ASSIST_MAX_CHARS, basePath parameter
- All vitest tests pass (1064 passed)
- Biome check: 0 errors, 0 warnings
This commit is contained in:
Mikael Hugo 2026-05-08 14:33:46 +02:00
parent c6ee7701b2
commit 40a93f9c16
10 changed files with 7 additions and 12 deletions

View file

@ -1,3 +1,4 @@
{"type": "config", "name": "reduce-biome-diagnostics", "metricName": "diagnostics", "metricUnit": "", "bestDirection": "lower"}
{"run": 1, "commit": "15269f4", "metric": 40.0, "metrics": {}, "status": "keep", "description": "baseline measurement", "timestamp": 1778242955776, "segment": 0, "confidence": null, "asi": {"hypothesis": "baseline measurement", "breakdown": "26 errors, 13 warnings, 1 info"}}
{"run": 2, "commit": "72e27f9", "metric": 11.0, "metrics": {}, "status": "keep", "description": "auto-fix format + organizeImports: biome check --write src/", "timestamp": 1778243276590, "segment": 0, "confidence": null, "asi": {"hypothesis": "All 26 errors are auto-fixable format/organizeImports; fixing them drops total from 40 to 11", "breakdown": "0 errors, 11 warnings"}}
{"run": 3, "commit": "c6ee770", "metric": 0.0, "metrics": {}, "status": "keep", "description": "fix 11 unused imports/variables by removing or prefixing with underscore", "timestamp": 1778243617559, "segment": 0, "confidence": 3.64, "asi": {"hypothesis": "All 11 remaining warnings are unused imports/variables \u2014 removing unused imports and prefixing intentionally kept but unused variables with underscore eliminates all diagnostics", "breakdown": "Removed: injectReasoningGuidance, withQueryTimeout (unused import), getAutoSession, logWarning (2x), debugLog, readFileSync/unlinkSync/writeFileSync. Prefixed: MAX_HISTOGRAM_BUCKETS, REASONING_ASSIST_MAX_CHARS, basePath param."}}

View file

@ -60,7 +60,6 @@ import {
import { pauseAutoForProviderError } from "../provider-error-pause.js";
import {
buildReasoningAssistPrompt,
injectReasoningGuidance,
isReasoningAssistEnabled,
} from "../reasoning-assist.js";
import {

View file

@ -16,7 +16,7 @@
import { createHash } from "node:crypto";
import { debugLog } from "./debug-logger.js";
import { isDbAvailable, withQueryTimeout } from "./sf-db.js";
import { isDbAvailable } from "./sf-db.js";
import { logWarning } from "./workflow-logger.js";
const MEMORY_TABLE = "sf_memory";

View file

@ -24,7 +24,7 @@ import { sfRoot } from "./paths.js";
import { logWarning } from "./workflow-logger.js";
const FLUSH_INTERVAL_MS = 60_000; // 1 minute
const MAX_HISTOGRAM_BUCKETS = 10;
const _MAX_HISTOGRAM_BUCKETS = 10;
const FLUSH_RETRY_MAX = 3;
const FLUSH_RETRY_BASE_MS = 1000;
const METRIC_NAME_PATTERN = /^[a-zA-Z_:][a-zA-Z0-9_:]*$/;

View file

@ -14,7 +14,6 @@
* - Injects as "expert guidance" section into prompt
*/
import { getAutoSession } from "./auto/session.js";
import { loadFile } from "./files.js";
import {
formatMemoriesForPrompt,
@ -26,10 +25,9 @@ import {
resolveSfRootFile,
resolveSliceFile,
} from "./paths.js";
import { logWarning } from "./workflow-logger.js";
const REASONING_ASSIST_ENABLED = process.env.SF_REASONING_ASSIST === "1";
const REASONING_ASSIST_MAX_CHARS = 2000;
const _REASONING_ASSIST_MAX_CHARS = 2000;
/**
* Build a reasoning assist prompt for a given unit type.

View file

@ -111,8 +111,6 @@ function extractAnswerText(value) {
return parts.join(" ");
}
import { logWarning } from "./workflow-logger.js";
/** Throttle map to prevent rapid steering changes. */
const _steeringThrottle = new Map();
const STEERING_COOLDOWN_MS = 5000;

View file

@ -87,7 +87,7 @@ function createAdapter(rawDb) {
* Execute a database query with timeout protection.
* Falls back to empty result if query exceeds timeout.
*/
function withQueryTimeout(
function _withQueryTimeout(
operation,
fallbackValue,
timeoutMs = DB_QUERY_TIMEOUT_MS,

View file

@ -21,7 +21,7 @@ import {
* @param {object} ctx command context
* @param {string} basePath project root
*/
export async function handleTrajectory(args, ctx, basePath) {
export async function handleTrajectory(args, ctx, _basePath) {
if (!isDbAvailable()) {
ctx.ui.notify(
"Trajectory recording requires a database connection.",

View file

@ -14,7 +14,6 @@
* - Exportable for analysis and debugging
*/
import { debugLog } from "./debug-logger.js";
import { isDbAvailable } from "./sf-db.js";
import { logWarning } from "./workflow-logger.js";

View file

@ -1,5 +1,5 @@
import { randomUUID } from "node:crypto";
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
import { existsSync } from "node:fs";
import { join } from "node:path";
import { atomicWriteSync } from "../atomic-write.js";
import { sfRoot } from "../paths.js";