Skip to content

fix: community fix wave — 10 PRs, 7 contributors (v0.9.1)#65

Merged
garrytan merged 5 commits into
garrytan/v001-skill-syncfrom
garrytan/fix-wave-onfire
Apr 12, 2026
Merged

fix: community fix wave — 10 PRs, 7 contributors (v0.9.1)#65
garrytan merged 5 commits into
garrytan/v001-skill-syncfrom
garrytan/fix-wave-onfire

Conversation

@garrytan

Copy link
Copy Markdown
Owner

Summary

Community fix wave: 10 PRs from 7 contributors, plus 2 bugs found during eng review (Codex outside voice) and 4 DX improvements from DX review.

Security (4 fixes, garagon):

  • Search DoS prevention: MAX_SEARCH_LIMIT=100, clampSearchLimit(), statement_timeout: 8s
  • Frontmatter slug hijack: path-authoritative slug enforcement
  • Symlink traversal: lstatSync + isSymbolicLink() in walker and importFromFile
  • Content size bomb: Buffer.byteLength guard on importFromContent

Crash fix (danbr):

  • PGLite concurrent access lock: atomic mkdir, PID+age stale detection, 30s timeout

Data integrity (12 fixes, win4r + Codex):

  • CTE searchKeyword rewrite (SQL-level LIMIT, not JS splice)
  • Write validation on addLink/addTag/addTimelineEntry/putRawData/createVersion
  • Health metrics (stale_pages, dead_links, orphan_pages) now measure real problems
  • Orphan chunk cleanup on empty pages
  • Stale embedding NULL'd when chunk_text changes (Codex finding)
  • contentHash now covers all PageInput fields
  • hybridSearch stops double-embedding query
  • MCP validateParams pre-check
  • type/exclude_slugs search filters now work
  • pgcrypto extension for Postgres < 13

Performance (sharziki + stephenhungg):

  • 30x embedAll speedup: sliding worker pool (20 concurrent, tunable via GBRAIN_EMBED_CONCURRENCY)
  • O(n²) chunk lookup in embedPage replaced with Map

DX (hnshah + doguabaris + review findings):

  • gbrain ask alias for query (CLI-only)
  • Search pagination (--offset param)
  • Clamp warning when search limit is capped
  • Actionable fix suggestions in error messages
  • Stdin 5MB size guard
  • Migration file v0.9.1.md for auto-update agent
  • .idea added to .gitignore

Closed PRs:

Test Coverage

  • 442 unit tests pass (0 fail)
  • 81 E2E tests pass (0 fail)
  • 6 new test files: search-limit, import-walker, pglite-lock, embed, updated import-file, utils, cli

Pre-Landing Review

Eng review (CLEAR) + DX review (CLEAR, 7/10) + Codex outside voice (9 findings, 3 accepted).

Test plan

  • All unit tests pass (442 pass, 0 fail)
  • All E2E tests pass (81 pass, 0 fail)
  • gbrain search "test" --limit 10000 clamps to 100
  • gbrain ask "test" behaves like gbrain query "test"
  • gbrain --tools-json does NOT include "ask"
  • Symlink in import dir skipped with warning
  • Frontmatter slug mismatch rejected
  • listPages({ limit: 100000 }) still works (not clamped)

🤖 Generated with Claude Code

garrytan and others added 5 commits April 11, 2026 22:32
… content bombs, stdin guard

4 security vulnerabilities closed:
- Search limit clamped to 100 (MAX_SEARCH_LIMIT) with statement_timeout 8s
- Frontmatter slug authority enforced (path-derived, mismatch rejected)
- Symlink traversal blocked (lstatSync in walker + importFromFile)
- Content size guard on importFromContent (Buffer.byteLength, 5MB)
- Stdin size guard in parseOpArgs (5MB cap)

Search pagination added (--offset param on search + query operations).
Clamp warning emitted when limit is capped.

Co-Authored-By: garagon <garagon@users.noreply.github.com>
File-based advisory lock using atomic mkdir with PID tracking
and 5-minute stale detection. Clear error messages show which
process holds the lock and how to recover.

Co-Authored-By: danbr <danbr@users.noreply.github.com>
CTE searchKeyword rewrite (SQL-level LIMIT, not JS splice).
Write validation on addLink/addTag/addTimelineEntry/putRawData/createVersion.
Health metrics now measure real problems (stale_pages, orphan_pages, dead_links).
Orphan chunk cleanup on empty pages. Embedding error logging.
contentHash now covers all PageInput fields.
Stale embedding NULL'd when chunk_text changes (prevents wrong vector on new text).
hybridSearch stops double-embedding query. MCP param validation.
type/exclude_slugs search filters now work. pgcrypto extension for Postgres <13.

Co-Authored-By: win4r <win4r@users.noreply.github.com>
Sliding worker pool (concurrency 20, tunable via GBRAIN_EMBED_CONCURRENCY).
O(n²) chunk lookup in embedPage replaced with Map.
gbrain ask alias for query (CLI-only, not in MCP tools-json).
.idea added to .gitignore.

Co-Authored-By: stephenhungg <stephenhungg@users.noreply.github.com>
Co-Authored-By: sharziki <sharziki@users.noreply.github.com>
Co-Authored-By: hnshah <hnshah@users.noreply.github.com>
Co-Authored-By: doguabaris <doguabaris@users.noreply.github.com>
Community fix wave: 10 PRs, 7 contributors.
4 security fixes, PGLite crash fix, 12 data integrity fixes,
30x embed speedup, search pagination, ask alias.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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