Skip to content

[tracking] Codebase audit — 68 improvements across security, correctness, architecture & tooling #95

Description

@rahulkatiyar19955

Tracking issue for a full code-audit of DataPilot covering the Electron/Node layer, React renderer, backend multi-agent orchestration, LLM provider + FastAPI layer, the data/parser/Neo4j/MCP-worker layer, and build/CI/test/packaging infra.

Meta-finding: the project is well-architected and unusually well-documented (AGENT.md), but there is a consistent gap between the guarantees that document makes and what the code actually enforces — security ("zero-trust IPC", safeStorage-only secrets), grounding (every finding must cite a resolvable log_id), budgets (25k/turn, 200k/session), the <2s plan SLA, and quality gates (lint/test are exit 0 stubs) are specified but not wired up.

68 issues were filed (#27#94). Each is self-contained with file:line references, impact, and a suggested fix so it can be picked up independently. Security findings are written impact-focused (no exploit recipes).

Labels

  • Severity: severity:critical · severity:high · severity:medium · severity:low
  • Area: area:electron · area:frontend · area:agent · area:api · area:data · area:infra
  • Type: security · bug · tech-debt · enhancement

Suggested order of attack

  1. Security pass — the renderer→host and open-API holes: [electron] shell:openPath passes unvalidated renderer path to OS — enables host file/app launch #27, [electron] No runtime IPC payload validation on any ipcMain.handle handler #28, [api] Localhost backend is unauthenticated with wide-open CORS (allow_origins=["*"]) #64, [api] Provider API keys can be reflected to client/logs via str(e) on key-bearing settings endpoints #60, [api] Full prompts/responses logged unredacted to persistent file and served over an endpoint #61, [electron] API keys & Neo4j password injected as container env are exposed via docker inspect #32, [electron] Entire $HOME bind-mounted into backend and worker containers (over-broad scope) #33, [frontend] API keys copied out of safeStorage to backend over plain HTTP and to clipboard #39, [data] Bag file path opened without validation or containment checks #80.
  2. Data integrity — before more bags get ingested into a shared graph: [data] Cross-session Log.id collision corrupts causal edges and citations #68, [data] Log timestamps stored as str(timedelta) break ordering and long-bag causal timing #70.
  3. Stand up quality gates — so the rest is protected against regression: [infra] CI runs no typecheck/lint/tests/eval gate — broken PRs merge green #71, [infra] No ESLint config — pnpm lint always passes, AGENT.md rules unenforced #87, [infra] No frontend/TypeScript test setup — pnpm test is a no-op that exits 0 #85.
  4. Enforce documented invariants — budgets, grounding, timeouts, async Neo4j: [agent] Token budget (25k/turn, 200k/session) is never enforced #42, [agent] Citation grounding bypassed: uncited critical/warning findings pass the composer #50, [agent] No timeouts on LLM calls in the orchestration path #48, [agent] Synchronous Neo4j driver called from async nodes blocks the event loop #46, [api] Cloud provider clients construct SDKs with no request timeout — hung upstream stalls SSE + DB session #65.

area:electron (11)

Critical

High

Medium

Low

area:frontend (10)

Critical

High

Medium

Low

area:agent (12)

Critical

High

Medium

Low

area:api (11)

Critical

High

Medium

Low

area:data (11)

Critical

High

Medium

Low

area:infra (13)

Critical

High

Medium

Low

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions