You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix+perf: dogfood fixes 9.1-9.4 and sub-100ms incremental rebuilds (#640)
* fix: db version warning, barrel export tracing, quieter tsconfig, Set compat
9.1 — Warn on graph load when DB was built with a different codegraph
version. The check runs once per process in openReadonlyOrFail() and
suggests `build --no-incremental`.
9.2 — Barrel-only files now emit reexport edges during build. Previously
the entire file was skipped in buildImportEdges; now only non-reexport
imports are skipped, so `codegraph exports` can follow re-export chains.
9.3 — Demote "Failed to parse tsconfig.json" from warn to debug level
so it no longer clutters every build output.
9.4 — Document EXTENSIONS/IGNORE_DIRS Array→Set breaking change in
CHANGELOG. Add .toArray() convenience method and export ArrayCompatSet
type for consumers migrating from the pre-3.4 array API.
* docs: soften EXTENSIONS/IGNORE_DIRS changelog wording
* fix: address review feedback — version check, Set mutation, barrel edge duplication (#634)
- Move _versionWarned flag outside mismatch conditional to avoid
redundant build_meta queries when versions match.
- Wrap SUPPORTED_EXTENSIONS in new Set() to avoid mutating the
sibling module's export.
- Delete outgoing edges for barrel-only files before re-adding them
to fileSymbols during incremental builds, preventing duplicate
reexport edges.
* refactor: replace vendor.d.ts with @types/better-sqlite3
Delete the 39-LOC manual ambient type declarations for better-sqlite3
and use the community @types/better-sqlite3 package instead. The vendor
file was a migration-era shim (allowJs is long gone from tsconfig).
- Replace all BetterSqlite3.Database → BetterSqlite3Database (types.ts)
- Replace all BetterSqlite3.Statement → SqliteStatement (types.ts)
- Simplify constructor casts in connection.ts, branch-compare.ts,
snapshot.ts (no longer needed with proper @types)
- Clean up watcher.ts double-cast and info.ts @ts-expect-error
- Widen transaction() return type for @types compatibility
* fix: address Greptile review feedback
- Restore warn level for tsconfig/jsconfig parse errors (P1: was
incorrectly downgraded to debug; ENOENT is already guarded by
existsSync before the try block)
- Simplify openReadonlyOrFail constructor cast to match openDb pattern (P2)
- Use Object.assign in withArrayCompat instead of cast-then-mutate (P2)
- Remove unused BetterSqlite3Database import from branch-compare.ts
- Remove stale biome-ignore suppression from snapshot.ts
* fix: preserve transaction argument types via inline inference (#640)
* perf: sub-100ms 1-file incremental rebuilds (466ms → 78-90ms)
Four optimizations for small incremental builds (≤5 changed files):
1. Scope barrel re-parsing to related barrels only (resolve-imports.ts)
Instead of parsing ALL barrel files one-by-one (~93ms), only re-parse
barrels imported by or re-exporting from changed files, batch-parsed
in one call (~11ms).
2. Fast-path structure metrics (build-structure.ts)
For ≤5 changed files on large codebases (>20 files), use targeted
per-file SQL queries (~2ms) instead of loading ALL definitions from
DB and recomputing ALL metrics (~35ms).
3. Skip unnecessary finalize work (finalize.ts)
- Skip setBuildMeta writes for ≤5 files (avoids WAL transaction)
- Skip drift detection for ≤3 files
- Skip auto-registration dynamic import for incremental builds
- Move timing measurement before db.close()
4. Deferred db.close() for small incremental builds (connection.ts)
WAL checkpoint in db.close() costs ~250ms on Windows NTFS. Defer to
next event loop tick so buildGraph() returns immediately. Includes
flushDeferredClose() for test compatibility and auto-flush on openDb().
0 commit comments