Context
src/mcp/server.ts:175 imports four names from ../settings/autonomy:
import { AGENT_ACTION_CLASSES, AUTONOMY_LEVELS, isActingAutonomyLevel, resolveAutonomy } from "../settings/autonomy";
Only AUTONOMY_LEVELS is actually used elsewhere in the file (e.g. z.enum(AUTONOMY_LEVELS) in the
setActionAutonomyShape tool-input schema). AGENT_ACTION_CLASSES, isActingAutonomyLevel, and
resolveAutonomy appear nowhere else in src/mcp/server.ts — confirmed by an exact-identifier grep
returning only the import line itself for each of the three names, with no re-export.
This slips past both static-analysis layers that would normally catch it: src/** has no ESLint
config (only apps/loopover-miner-ui and apps/loopover-ui have eslint.config.js), and the root
tsconfig.json doesn't set noUnusedLocals/noUnusedParameters.
Note: MAINTAIN_AUTONOMY_ACTION_CLASSES (src/mcp/server.ts:623, a separate 6-item local subset) is
not related to this cleanup and must not be touched — it's an intentional, already-documented
divergence from AGENT_ACTION_CLASSES (see the comment in
packages/loopover-mcp/bin/loopover-mcp.ts:149-152: "do not sync it to the engine list").
Requirements
- Remove
AGENT_ACTION_CLASSES, isActingAutonomyLevel, and resolveAutonomy from the import at
src/mcp/server.ts:175, keeping only AUTONOMY_LEVELS.
- Do not remove or modify anything in
packages/loopover-engine/src/settings/autonomy.ts itself —
these exports are used elsewhere in the codebase (e.g. by packages/loopover-mcp/bin/loopover-mcp.ts)
and must stay exported as-is.
- Do not touch
MAINTAIN_AUTONOMY_ACTION_CLASSES at src/mcp/server.ts:623 — it is unrelated and
intentional.
- Confirm with a full-file rebuild/typecheck that no other reference to the three removed names exists
anywhere in src/mcp/server.ts after the edit.
Deliverables
Test Coverage Requirements
Pure dead-import removal with no behavioral change — no new test is required. Existing tests covering
src/mcp/server.ts's tool handlers (which exercise AUTONOMY_LEVELS-dependent code paths, e.g.
setActionAutonomyShape) must continue passing unmodified as the regression check that nothing else
depended on the removed names.
Expected Outcome
src/mcp/server.ts no longer imports three unused identifiers from ../settings/autonomy. No
behavior changes; the file's existing test suite passes unmodified.
Links & Resources
src/mcp/server.ts:175 — the import to trim
packages/loopover-engine/src/settings/autonomy.ts — source module (not to be modified)
packages/loopover-mcp/bin/loopover-mcp.ts:149-152 — the comment explaining why
MAINTAIN_AUTONOMY_ACTION_CLASSES intentionally diverges (context only, not in scope for this fix)
Context
src/mcp/server.ts:175imports four names from../settings/autonomy:Only
AUTONOMY_LEVELSis actually used elsewhere in the file (e.g.z.enum(AUTONOMY_LEVELS)in thesetActionAutonomyShapetool-input schema).AGENT_ACTION_CLASSES,isActingAutonomyLevel, andresolveAutonomyappear nowhere else insrc/mcp/server.ts— confirmed by an exact-identifier grepreturning only the import line itself for each of the three names, with no re-export.
This slips past both static-analysis layers that would normally catch it:
src/**has no ESLintconfig (only
apps/loopover-miner-uiandapps/loopover-uihaveeslint.config.js), and the roottsconfig.jsondoesn't setnoUnusedLocals/noUnusedParameters.Note:
MAINTAIN_AUTONOMY_ACTION_CLASSES(src/mcp/server.ts:623, a separate 6-item local subset) isnot related to this cleanup and must not be touched — it's an intentional, already-documented
divergence from
AGENT_ACTION_CLASSES(see the comment inpackages/loopover-mcp/bin/loopover-mcp.ts:149-152: "do not sync it to the engine list").Requirements
AGENT_ACTION_CLASSES,isActingAutonomyLevel, andresolveAutonomyfrom the import atsrc/mcp/server.ts:175, keeping onlyAUTONOMY_LEVELS.packages/loopover-engine/src/settings/autonomy.tsitself —these exports are used elsewhere in the codebase (e.g. by
packages/loopover-mcp/bin/loopover-mcp.ts)and must stay exported as-is.
MAINTAIN_AUTONOMY_ACTION_CLASSESatsrc/mcp/server.ts:623— it is unrelated andintentional.
anywhere in
src/mcp/server.tsafter the edit.Deliverables
src/mcp/server.ts:175's import trimmed to onlyAUTONOMY_LEVELS.npx tsc --noEmit(or the repo's standard typecheck script) passes clean on the changed file.Test Coverage Requirements
Pure dead-import removal with no behavioral change — no new test is required. Existing tests covering
src/mcp/server.ts's tool handlers (which exerciseAUTONOMY_LEVELS-dependent code paths, e.g.setActionAutonomyShape) must continue passing unmodified as the regression check that nothing elsedepended on the removed names.
Expected Outcome
src/mcp/server.tsno longer imports three unused identifiers from../settings/autonomy. Nobehavior changes; the file's existing test suite passes unmodified.
Links & Resources
src/mcp/server.ts:175— the import to trimpackages/loopover-engine/src/settings/autonomy.ts— source module (not to be modified)packages/loopover-mcp/bin/loopover-mcp.ts:149-152— the comment explaining whyMAINTAIN_AUTONOMY_ACTION_CLASSESintentionally diverges (context only, not in scope for this fix)