What β delete three modules that nothing imports.
Why β 131 lines of code that reads as live API but has no caller. One of them is a service whose own tests state it was dropped during an earlier simplification; the file outlived its deletion.
Scope β remove modules/billing/services/billing.refund.service.js (53 lines), lib/middlewares/analytics.requireFeatureFlag.js (58), lib/helpers/authorize.js (20). Verified on master: zero non-test references in this repo, and zero imports in any downstream consumer repo.
Test files β read before deleting, they are not symmetrical:
lib/middlewares/tests/analytics.requireFeatureFlag.unit.tests.js covers only the removed middleware β delete.
lib/middlewares/tests/analytics.comprehensive.unit.tests.js covers the live analytics middleware and the removed one β keep the file, remove only the block importing the deleted module. Deleting this file drops live coverage.
- The billing admin integration test mentions the removed service in a comment only β leave untouched.
- For the two refund test files: open each and delete it only if its entire subject is the removed service; if it covers surviving behaviour, keep it and drop the dead import.
Definition of done: re-run the emptiness check immediately before deleting (this issue's snapshot is not evidence at execution time β any new reference means stop and re-scope), then the full suite passes. Coverage percentages will move because the denominator changes; confirm thresholds still hold. A threshold that now fails is information about the threshold, not licence to lower it.
Scope: validated 2026-07-28
Created via /dev:issue
Baseline: line numbers and counts here were verified against master @ c8049d69 (2026-07-28). Master moves β re-verify against current master before starting; the invariants above are what must hold regardless of where the code has drifted to.
What β delete three modules that nothing imports.
Why β 131 lines of code that reads as live API but has no caller. One of them is a service whose own tests state it was dropped during an earlier simplification; the file outlived its deletion.
Scope β remove
modules/billing/services/billing.refund.service.js(53 lines),lib/middlewares/analytics.requireFeatureFlag.js(58),lib/helpers/authorize.js(20). Verified on master: zero non-test references in this repo, and zero imports in any downstream consumer repo.Test files β read before deleting, they are not symmetrical:
lib/middlewares/tests/analytics.requireFeatureFlag.unit.tests.jscovers only the removed middleware β delete.lib/middlewares/tests/analytics.comprehensive.unit.tests.jscovers the live analytics middleware and the removed one β keep the file, remove only the block importing the deleted module. Deleting this file drops live coverage.Definition of done: re-run the emptiness check immediately before deleting (this issue's snapshot is not evidence at execution time β any new reference means stop and re-scope), then the full suite passes. Coverage percentages will move because the denominator changes; confirm thresholds still hold. A threshold that now fails is information about the threshold, not licence to lower it.
Scope: validated 2026-07-28
Created via /dev:issue
Baseline: line numbers and counts here were verified against
master @ c8049d69(2026-07-28). Master moves β re-verify against current master before starting; the invariants above are what must hold regardless of where the code has drifted to.