Skip to content

Remove dead file explorer/route.ts — orphaned, unrelated-project cruft, broken lowdb import #75

Description

@pinecone-groundskeeper

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 · ◷

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:maintenance-auditFiled by the maintenance audit agent; it recognizes its own backlog by this labelmaintenanceIn scope for the maintenance agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions