M11+N1: Wire ruleRole tiebreaker; prune dead code (closes #31, #32) - #49
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles two cleanup issues into one commit:
M11 (#31) — Wire
ruleRoleintoplanDedupe(restoring spec §8.1's drive-role-priority tiebreaker) and remove@preact/signals(declared but never imported anywhere).N1 (#32) — Remove
prettierroot devDep (in devDependencies but never called by any npm script), deletequarantineRootfunction (not exported, not called), and removeexportkeyword from 5 unused exported types.@hono/node-wsstays — its disposition is gated on F1 (#35).Decisions made
ruleRole: WIRE-UP chosen —planDedupenow loads rules from DB, finds the first matching rule for each duplicate group's copies, and passesmatchedRule.destinationRoleasruleRoleto the scorer. The scorer already handled this correctly in unit tests; the production call site had hardwirednull. Also threadsdestinationTemplatewhile at it.@preact/signals: REMOVED — no current imports anywhere inpackages/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 — removingexporttriggered an ESLintno-unused-varserror becausequarantine.tsitself never calls the function either.reconcile.tsuses its own localconst quarantineRoot = join(...), not an import.@testing-library/preact: LEFT IN PLACE — imported inuse-keyboard.test.tsx.jsdom: LEFT IN PLACE — configured asenvironment: 'jsdom'invitest.config.tsandvite.config.ts.Test plan
ruleRoleintegration test: file with matching rule whosedestinationRoleis set → keeper is the copy on the role-matched drive, not the one with lower fileIdnpm installafter dep removals — no errors@preact/signals,prettier,quarantineRoot, 5 unused type exports all gone from outputruleRoleintegration test)npm run lint— cleannpm run typecheck— cleanOut of scope
@hono/node-wsremoval (F1 / F1: [Decision] processPriority OS integration and spec §11 WebSocket — implement or defer? #35)createThrottleManagerRef(knip-flagged but not listed in N1: [Minor] Remove knip-confirmed dead devDeps and unused exports #32)Closes #31
Closes #32