Skip to content

Shrink the graph wire format, warm up the API at boot, and hide externals on demand - #41

Merged
Phoenixrr2113 merged 2 commits into
mainfrom
batch-a-window-polish
Aug 24, 2026
Merged

Shrink the graph wire format, warm up the API at boot, and hide externals on demand#41
Phoenixrr2113 merged 2 commits into
mainfrom
batch-a-window-polish

Conversation

@Phoenixrr2113

Copy link
Copy Markdown
Owner

What changed

  • Compact edge transport. All four graph endpoints (/api/graph/full, /files, /neighbors, /induced-edges) accept an opt-in edgeFormat=indexed-v1. Edges become index tuples against a node table plus a first-occurrence type table. Measured on a 3,605-edge window: 958KB legacy vs 283KB compact (70.5 percent smaller). Legacy stays the default and is byte-shape unchanged; invalid or repeated format values return clean 400s. The dashboard requests compact everywhere and validates it with a strict decoder that rejects malformed tables, tuples, out-of-range or negative-zero indexes, and whitespace identifiers.
  • Startup warmup. The API fires a non-blocking RETURN 1 through the shared graph client singleton right after it starts listening, so the first real query no longer pays the connection cost. Boot behavior is unchanged when storage is unreachable or blocked; 48 concurrent boot-time requests produced exactly one client and one ownership claim under verification.
  • Files-view externals toggle. GET /api/graph/files?includeExternals=false filters :External modules before totals, degree ordering, dedupe, and paging, so counts stay honest while filtered; edges are induced only among visible nodes. The dashboard adds an Externals control in Files mode (aria-pressed, keyboard operable), persisted in the URL and localStorage, resetting to page one on change.

Verification

Three fixers with disjoint file ownership, each with red-first test evidence. An independent verification round against live ephemeral FalkorDBLite fixtures found three blockers (repeated query params accepted; decoder accepted -0 indexes and whitespace node ids); all were fixed and confirmed in a second round by re-running the exact reproductions: ALL CLEAR. Full tree: build 21/21 forced, tests 36/36 tasks, typecheck 20/20.

Deliberately not in this PR

  • /full and /neighbors ignore includeExternals like any unknown param (documented behavior; the contract scopes it to /files).
  • Ledger: extensionless ESM imports in the built graph package block direct plain-Node import of packages/graph/dist (pre-existing); integration suites relocate long temp paths into ~/.codegraph/graphs/ (test-isolation cleanup candidate).

🤖 Generated with Claude Code

…les view hide externals

Graph window responses can now use an opt-in indexed edge format that cuts
payloads to about 30 percent of their old size. The API warms its graph
client right after it starts listening, so the first query no longer pays
the connection cost. The Files view gains a toggle to hide unresolved
external modules, with honest totals and paging while filtered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
v0-landing-page-build Skipped Skipped Aug 23, 2026 11:58pm

The Linux CI runner boots the tsx child about ten times slower than a
local machine, so the 10 second wait for the warmup warning was a latency
assertion in disguise. The ceiling now asserts eventual behavior only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Phoenixrr2113
Phoenixrr2113 merged commit 25c3f43 into main Aug 24, 2026
12 checks passed
@Phoenixrr2113
Phoenixrr2113 deleted the batch-a-window-polish branch August 24, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant