Repository navigation
fix(search): reject tokenless FTS widening, scope search dms by account, and guard empty author filters - #258
Conversation
…nt, and guard empty author filters
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: ready, awaiting a maintainer decision. What this changesThis PR prevents tokenless searches and empty author selectors from returning unrelated rows and adds account selection to DM search. Example: Run birdclaw search dms "!!!" against the populated demo archive.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep open: this PR provides useful search corrections with no concrete introduced defect found, but replacing tested behavior and extending account defaults still needs an owner decision. Priority: P2 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI, web, and MCP consumers pass search text and filters to shared SQLite read models, which return matching cached tweets, conversations, and links. flowchart TD
A[CLI search commands] --> B[Operation account selection]
B --> C[Shared search read models]
D[Web and MCP consumers] --> C
C --> E[SQLite archive and indexes]
E --> F[Filtered results]
Technical reviewBest possible solution: Keep the focused implementation in the existing search owners if the owner approves its search and account-default semantics. Do we have a high-confidence way to reproduce the issue? Current-main source shows dropped tokenless filters, fallback from empty authors, and no DM-search account option; the contributor also supplies matching base/head CLI output, which this read-only review did not rerun. Is this the best way to solve the issue? The implementation is narrow, preserves blank browsing and valid author precedence, and reuses account selection; its changed product contract needs owner approval. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 9895445ba0a2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 8, 2026, 7:16 PM ET / November 9, 2026, 00:16 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Consolidate verified fixes from #257, #258, #259, #260, #261, #262, #263, #264, and #265. Repair account selection, cache restoration, search bounds, input validation, and read-only analysis while preserving existing account and data-safety contracts. Also reject unsafe Git indexes before backup publication and keep recovery snapshots private. Co-authored-by: Bobby Bones <saariuscrypto@gmail.com> Co-authored-by: sm0ky <smokyproductcompany@gmail.com>
|
Thanks for the fixes. I reproduced the reported defects against v0.17.0 and consolidated tokenless and empty-author search bounds plus account-scoped DM search into #266, now landed. The overlapping cache ingestion changes from #257 and #261 are included once. The consolidation preserves contributor credit in the changelog and squash commit. Synthetic regressions, independent P0–P2 review, and exact-head CI cover the result; no paid X requests were used. Closing this PR as superseded by the landed consolidation. |
Summary
Prevents non-empty tokenless searches and empty author selectors from widening results to unfiltered rows, and extends per-operation account selection to
search dms:src/lib/timeline-read-model.ts: TrackhasUnmatchableTextwhen a non-blank search string produces no FTS tokens after strippingfrom:selectors, and preserve explicit empty--author/from:@/from:selectors as""instead of falling back toundefinedso unmatchable searches return[].src/lib/dm-read-model.ts&src/lib/link-index.ts: Return[]when a non-blanksearchquery produces no FTS tokens (listDmConversations) or no URL/word terms (searchLinks), while keeping absent/blank queries unfiltered.src/cli/register-search.ts: Add--account <username>tosearch dms <query>and forwardoptions.accounttoenrichDmItemsso DM search honors both configuredaccounts.defaultand explicit--accountoverrides via the sharedconfigureOperationAccountSelectionpreAction hook.Shipped CLI Behavior Proof (
dist/cli/birdclaw.jsBasev0.17.0@9895445ba0a2vs Head @2357d10abc89)1. Seed
v0.17.0Archive (9895445ba0a2) with Settings (accounts.default: "@steipete"), Accounts, Tweets, Collections, Links, and DMs2. Base (
v0.17.0@9895445ba0a2) Shipped CLI Failures3. Head (
2357d10abc89) Shipped CLI Pass &v0.17.0Upgrade Compatibility ProofVerification
node ./scripts/run-vitest.mjs run src/lib/query-models.test.ts src/lib/link-index.test.ts src/cli/search-account.test.ts: 99 passedKnown gaps
GitHub Actions CI has not run on this head. The workflow is waiting for a maintainer to approve it. The verification above is local: unit tests and the shipped CLI against a local archive, not a live X account.
☁️