Skip to content

feat(index): HNSW writer bridge for Pebble crawl path + ops systemd units#36

Merged
TeoSlayer merged 1 commit into
fix/warn-high-crawl-embed-concurrencyfrom
feat/hnsw-writer-and-units
Jul 23, 2026
Merged

feat(index): HNSW writer bridge for Pebble crawl path + ops systemd units#36
TeoSlayer merged 1 commit into
fix/warn-high-crawl-embed-concurrencyfrom
feat/hnsw-writer-and-units

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Summary

  • Adds internal/index/hnsw_writer.go, a PassageWriter implementation that bridges passages into an in-memory HNSW graph and periodically persists to a store.PebbleStore (checkpoint-on-threshold + manual Flush). Covered by internal/index/hnsw_writer_test.go.
  • Note: this is not yet wired into cmd_crawl/cmd_serve — those currently use their own hnswPassageWriter defined in cmd/cosift. This is an independently tested, standalone implementation added for review; wiring/dedup is a follow-up decision, not done here.
  • Adds the systemd unit/timer files actually used to run cosift in production: cosift-crawl.service/.timer, cosift-serve.service, cosift-snapshot.service/.timer, ollama.service, ollama-replica.service.tmpl. Checked for secrets — the snapshot service loads its admin token via EnvironmentFile=-/etc/cosift/snapshot.env, nothing is inlined.

What's intentionally excluded

  • A stale, untracked, byte-identical-to-a-pre-refactor-commit cmd/cosift/pebble_serve.go was found causing duplicate declarations against serve_admin.go/serve_answer.go/serve_search.go (go build ./... failed). It was removed locally (never tracked, so nothing to commit) — this is what makes the base branch build again.
  • output/, paper/, tmp/ scratch dirs (~49MB, LaTeX/PDF scratch) and docs/STARVATION-REQUIREMENTS.md (stale, unrelated draft) were left untouched and not staged.

Test plan

  • go build ./... passes
  • go test ./internal/index/... passes
  • Staged diff grepped for secrets/tokens — none found (only a comment naming the env var)

🤖 Generated with Claude Code

…md units

internal/index/hnsw_writer.go implements PassageWriter against a Pebble
store + in-memory HNSW graph, with periodic checkpointing and a manual
Flush for shutdown. Covered by hnsw_writer_test.go (bridges passages into
the graph, and verifies the auto-flush-at-threshold contract). Not yet
wired into cmd_crawl/cmd_serve — those already use their own
hnswPassageWriter in cmd/cosift; this is an alternate, independently
tested implementation living in internal/index for review.

Also adds the systemd unit/timer files used to run cosift-crawl,
cosift-serve, cosift-snapshot, and the ollama service(s) in production.
No secrets included — cosift-snapshot.service loads its admin token via
EnvironmentFile from /etc/cosift/snapshot.env, not inline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TeoSlayer
TeoSlayer merged commit 3daf95b into fix/warn-high-crawl-embed-concurrency Jul 23, 2026
3 checks passed
@TeoSlayer
TeoSlayer deleted the feat/hnsw-writer-and-units branch July 23, 2026 21:19
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.

2 participants