singularity-forge/autoresearch.md

48 lines
2.5 KiB
Markdown
Raw Normal View History

# Autoresearch: Reduce Biome Lint Diagnostics
## Objective
Minimize the total number of Biome lint diagnostics (errors + warnings + info) across `src/`, starting from baseline ~40 diagnostics. Errors are mostly `organizeImports`, warnings are `noUnusedImports`, `noUnusedVariables`, and `useConst`.
## Metrics
- **Primary**: `diagnostics` (count, lower is better) — sum of errors + warnings + info from `npx biome check src/`
- **Secondary**: `errors` (count, lower is better)
- **Secondary**: `warnings` (count, lower is better)
## How to Run
`bash autoresearch.sh` — runs Biome check, parses JSON summary, outputs `METRIC diagnostics=N` and `METRIC errors=N` and `METRIC warnings=N`.
## Files in Scope
All files under `src/` — but focus on the files flagged by Biome:
- `src/resources/extensions/sf/auto/phases.js`
- `src/resources/extensions/sf/commands/handlers/ops.js`
- `src/resources/extensions/sf/memory-repository.js`
- `src/resources/extensions/sf/metrics-central.js`
- `src/resources/extensions/sf/reasoning-assist.js`
- `src/resources/extensions/sf/remote-steering.js`
- `src/resources/extensions/sf/sf-db.js`
- `src/resources/extensions/sf/subagent-inheritance.js`
- `src/resources/extensions/sf/tests/memory-repository.test.mjs`
- `src/resources/extensions/sf/tests/metrics-central.test.mjs`
- `src/resources/extensions/sf/tests/trajectory-recorder.test.mjs`
- `src/resources/extensions/sf/trajectory-command.js`
- `src/resources/extensions/sf/trajectory-recorder.js`
- `src/resources/extensions/sf/uok/writer.js`
## Off Limits
- `biome.json` (don't change lint rules — fixing source is the goal)
- `node_modules/`, `dist/`, `.sf/`, `packages/` (outside `src/` scope)
- Test assertion logic (don't weaken tests to make linters pass)
## Constraints
- Existing vitest tests must pass: `npx vitest run --config vitest.config.ts`
- No new dependencies
- Don't introduce runtime behavior changes — only lint/import/style fixes
## Termination
Run until interrupted by the user.
## What's Been Tried
- **#2 (auto-fix)**: `biome check --write` — fixed 26 auto-fixable errors (format/organizeImports), dropped diagnostics from 40 to 11. Status: keep.
- **#3 (manual fixes)**: Removed 7 unused imports (`injectReasoningGuidance`, `withQueryTimeout`, `getAutoSession`, `logWarning` x3, `debugLog`, `readFileSync/unlinkSync/writeFileSync`) and prefixed 4 intentionally-unused items with underscore (`_MAX_HISTOGRAM_BUCKETS`, `_REASONING_ASSIST_MAX_CHARS`, `_basePath`, `_withQueryTimeout`). Dropped from 11 to 0. Status: keep.