Problem
explorer/route.ts sits at the top level of the explorer/ package, not under
explorer/src/app/**. Next.js App Router only registers route.ts files found
under the app directory, so this file is not part of the routing tree and is
never invoked by next dev, next build, or next start — it is dead code.
The real, working equivalent of this handler already lives at
explorer/src/app/api/opinion/route.ts, which is wired into the app correctly.
Evidence this is leftover cruft rather than a working alternate implementation:
- It imports
FileSync from lowdb/adapters/FileSync (line 7):
import FileSync from 'lowdb/adapters/FileSync'
That subpath does not exist in the pinned lowdb@^7.0.1 — lowdb's
package.json "exports" map only defines ., ./node, and ./browser
(confirmed by inspecting the installed package). lowdb/adapters/FileSync is
a lowdb v1-era import path. If this file were ever wired into the app and
executed under Node's strict ESM resolution, that import would throw
ERR_PACKAGE_PATH_NOT_EXPORTED. FileSync is imported but never even used in
the file — LowSync/JSONFileSync (the v7-correct API, also used by the real
src/app/api/opinion/route.ts) are used instead, further confirming this is a
stale, half-migrated leftover.
- It hardcodes six-levels-up relative paths to JSON files that aren't part of
this repo: path.resolve(__dirname, '../../../../../../cases.db.json'),
'../../../../../opinions.db.json', and '../../../../../../final.db.json'.
- It contains a top-level
fs.readFile(...) side effect with a bare
console.log('File length:', data.length), plus large blocks of commented-out
code referencing Sender: ${n.address}, Recipients: ${m.address}, Subject,
and a Neo4j query over an email graph — vestiges of an unrelated Enron email
demo (the package is literally still named enron-explorer in
explorer/package.json), not this repo's actual Neo4j/SCOTUS case-search
domain.
Acceptance criteria
explorer/route.ts is deleted.
pnpm run build and pnpm run lint in explorer/ still succeed (this file
is not imported by anything else, so removing it should have no effect on the
working app).
- No remaining reference to
explorer/route.ts anywhere in the repo.
Scope
Delete the single orphaned file explorer/route.ts. Out of scope: any changes
to the real, working route at explorer/src/app/api/opinion/route.ts, or to
lowdb usage elsewhere in the app.
Generated by GitHub Maintenance Audit · sonnet50 · 80.4 AIC · ⌖ 6.1 AIC · ⊞ 7.9K · ◷
Problem
explorer/route.tssits at the top level of theexplorer/package, not underexplorer/src/app/**. Next.js App Router only registersroute.tsfiles foundunder the
appdirectory, so this file is not part of the routing tree and isnever invoked by
next dev,next build, ornext start— it is dead code.The real, working equivalent of this handler already lives at
explorer/src/app/api/opinion/route.ts, which is wired into the app correctly.Evidence this is leftover cruft rather than a working alternate implementation:
FileSyncfromlowdb/adapters/FileSync(line 7):lowdb@^7.0.1—lowdb'spackage.json"exports"map only defines.,./node, and./browser(confirmed by inspecting the installed package).
lowdb/adapters/FileSyncisa lowdb v1-era import path. If this file were ever wired into the app and
executed under Node's strict ESM resolution, that import would throw
ERR_PACKAGE_PATH_NOT_EXPORTED.FileSyncis imported but never even used inthe file —
LowSync/JSONFileSync(the v7-correct API, also used by the realsrc/app/api/opinion/route.ts) are used instead, further confirming this is astale, half-migrated leftover.
this repo:
path.resolve(__dirname, '../../../../../../cases.db.json'),'../../../../../opinions.db.json', and'../../../../../../final.db.json'.fs.readFile(...)side effect with a bareconsole.log('File length:', data.length), plus large blocks of commented-outcode referencing
Sender: ${n.address},Recipients: ${m.address},Subject,and a Neo4j query over an email graph — vestiges of an unrelated Enron email
demo (the package is literally still named
enron-explorerinexplorer/package.json), not this repo's actual Neo4j/SCOTUS case-searchdomain.
Acceptance criteria
explorer/route.tsis deleted.pnpm run buildandpnpm run lintinexplorer/still succeed (this fileis not imported by anything else, so removing it should have no effect on the
working app).
explorer/route.tsanywhere in the repo.Scope
Delete the single orphaned file
explorer/route.ts. Out of scope: any changesto the real, working route at
explorer/src/app/api/opinion/route.ts, or tolowdbusage elsewhere in the app.