Skip to content

M11+N1: Wire ruleRole tiebreaker; prune dead code (closes #31, #32) - #49

Merged
curtyo18 merged 1 commit into
mainfrom
issue/M11-N1-dead-code-cleanup
May 17, 2026
Merged

M11+N1: Wire ruleRole tiebreaker; prune dead code (closes #31, #32)#49
curtyo18 merged 1 commit into
mainfrom
issue/M11-N1-dead-code-cleanup

Conversation

@curtyo18

Copy link
Copy Markdown
Owner

Summary

Bundles two cleanup issues into one commit:

M11 (#31) — Wire ruleRole into planDedupe (restoring spec §8.1's drive-role-priority tiebreaker) and remove @preact/signals (declared but never imported anywhere).

N1 (#32) — Remove prettier root devDep (in devDependencies but never called by any npm script), delete quarantineRoot function (not exported, not called), and remove export keyword from 5 unused exported types.

@hono/node-ws stays — its disposition is gated on F1 (#35).

Decisions made

  • ruleRole: WIRE-UP chosen — planDedupe now loads rules from DB, finds the first matching rule for each duplicate group's copies, and passes matchedRule.destinationRole as ruleRole to the scorer. The scorer already handled this correctly in unit tests; the production call site had hardwired null. Also threads destinationTemplate while at it.
  • @preact/signals: REMOVED — no current imports anywhere in packages/ui/src/, no adoption plan.
  • @hono/node-ws: PRESERVED — F1 (F1: [Decision] processPriority OS integration and spec §11 WebSocket — implement or defer? #35) hasn't decided WebSocket/SSE browser delivery yet.
  • prettier: REMOVED — declared in root devDeps but no npm script calls it.
  • quarantineRoot: DELETED ENTIRELY — removing export triggered an ESLint no-unused-vars error because quarantine.ts itself never calls the function either. reconcile.ts uses its own local const quarantineRoot = join(...), not an import.
  • @testing-library/preact: LEFT IN PLACE — imported in use-keyboard.test.tsx.
  • jsdom: LEFT IN PLACE — configured as environment: 'jsdom' in vitest.config.ts and vite.config.ts.

Test plan

  • ruleRole integration test: file with matching rule whose destinationRole is set → keeper is the copy on the role-matched drive, not the one with lower fileId
  • npm install after dep removals — no errors
  • knip re-run: @preact/signals, prettier, quarantineRoot, 5 unused type exports all gone from output
  • Engine tests: 311 pass (310 baseline + 1 new ruleRole integration test)
  • UI tests: 21 pass (baseline unchanged)
  • npm run lint — clean
  • npm run typecheck — clean

Out of scope

Closes #31
Closes #32

Closes #31 (M11) and #32 (N1) — bundled because both prune dead
infrastructure / unused exports.

M11:
- dedupe/planner now loads rules from DB and passes matchedRule?.destinationRole
  as ruleRole to the scorer, restoring spec §8.1's drive-role-priority tiebreaker.
  Production call site previously hardwired null, leaving the primary
  keeper-selection criterion dead at runtime.
- Also threads destinationTemplate from the matched rule to destinationTemplates.
- Remove @preact/signals from ui runtime deps; never imported, no adoption
  plan, was just bundle weight.
- @hono/node-ws is preserved — its disposition is gated on F1 (#35).

N1:
- Remove prettier from root devDeps (devDep but never called by any npm script).
- Delete quarantineRoot function from quarantine.ts entirely (not exported,
  not called — reconcile.ts uses its own local variable of the same name).
- Remove export from ScanProgressEvent and BatchStatusEvent (events.ts);
  both are used only within the EngineEvent union type in the same file.
- Remove export from LogLevel (log.ts); used only internally.
- Remove export from OperationKindPlanned, UnresolvedRole, RuleStat
  (organize/planner.ts); all confirmed unimported externally.
- @testing-library/preact and jsdom: LEFT IN PLACE — jsdom is the vitest
  environment in vitest.config.ts; @testing-library/preact is imported in
  use-keyboard.test.tsx.

Closes #31
Closes #32

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@curtyo18
curtyo18 merged commit a3a99af into main May 17, 2026
2 checks passed
@curtyo18
curtyo18 deleted the issue/M11-N1-dead-code-cleanup branch May 17, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

N1: [Minor] Remove knip-confirmed dead devDeps and unused exports M11: [Major] Wire or remove three dead deps/features (ruleRole, signals, node-ws)

1 participant