feat: queue embeddings for live Discord events with opt-in - #159
Conversation
Co-authored-by: Hannes Rudolph <49103247+hannesrudolph@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 12:27 AM ET / 04:27 UTC. ClawSweeper reviewWhat this changesAdds Merge readinessThis PR is still necessary: current Priority: P2 Review scores
Verification
How this fits togetherDiscrawl's tail subsystem receives live Discord Gateway events and writes them to the local SQLite archive; the optional embedding queue records archive changes for a later flowchart LR
A[Discord Gateway events] --> B[tail command]
C[Replay and repair inputs] --> B
B --> D{with-embeddings enabled?}
D -->|No| E[Archive messages]
D -->|Yes| F[Archive messages and queue jobs]
E --> G[SQLite archive]
F --> G
G --> H[embed command drains jobs]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the explicit Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request; the PR nonetheless provides a high-confidence after-fix production-path proof using Is this the best way to solve the issue? Yes. An explicit tail-only opt-in is the narrowest upgrade-safe solution because it adds live queueing without silently changing existing installations that enabled embeddings for batch sync. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 48b28c60866c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review The PR body now includes the requested enabled-versus-default integration proof through production |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The P2 migration finding is fixed in The contributor changelog entry is removed as requested. The PR body now identifies the credited release note as maintainer landing-owned, consistent with the repository's prior |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Landed as Verification on refreshed exact head
No release or tag was created. |
Summary
tail --with-embeddingsopt-inThis replacement keeps Hannes's original commit intact and adds focused maintainer repair and regression-test commits. It supersedes #154 because that branch derives tail queueing directly from global
search.embeddings.enabled, which would silently expand work for existing installations after upgrade.Validation
Passed module verification/tidiness, gofumpt, golangci-lint, go vet, staticcheck, gosec, govulncheck, dead-code analysis, 85.1% coverage, the race suite, CLI smoke checks, and a six-platform GoReleaser snapshot.
The focused existing-archive regression creates a populated schema-v5 database, removes
idx_embedding_jobs_pending_order, reopens it through the production migration path, and verifies both index recreation and preservation of the original message and pending job.Live built-binary proof against an isolated fresh archive:
The CLI proof used an isolated config, SQLite database, cache, and log root with a placeholder token; replay had no candidates and made no Discord request.
To prove the actual queue transition, a temporary uncommitted integration executable injected one synthetic Discord message through the production
Syncer.RunTailevent handler and real SQLite store twice, then queriedembedding_jobsdirectly:The integration executable exited nonzero unless the default path produced zero jobs and the opted-in path produced exactly one. Its temporary source was removed after the proof run; no fixture or generated artifact is part of this PR.
AutoReview found no code or test defect in the final patch. Its only remaining P3 proposed restoring the contributor changelog entry; that was rejected because repository history removes contributor notes during review and adds the credited entry from the maintainer landing/release commit.