Repository navigation
fix(sync,mcp,search): resolve account selectors, filter tombstoned FTS rows, and harden search/sync contracts - #263
Conversation
…S rows, and harden search/sync contracts
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR fixes account-alias handling, hidden-tweet search counts, original-only discussion filtering, and sync CLI validation and errors. Example: MCP search for pass11needle matches 1,001 deleted tweets and two visible tweets.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: both previous findings are resolved, and the reviewed patch has no remaining concrete blockers. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCLI and web requests invoke account-aware sync owners; Links, discussion, and MCP readers retrieve content from the shared SQLite archive. flowchart TD
CLI[Sync CLI] --> Sync[Live sync owners]
Web[Web sync dispatcher] --> Sync
Sync --> DB[SQLite archive]
DB --> Links[Link insights]
DB --> Discussion[Search discussion]
DB --> MCP[Read-only MCP tools]
Technical reviewBest possible solution: Land the focused contract repairs using the existing account resolver, numeric hook, and archive readers. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the failing selector, tombstone-count, metadata-reply, and TTL paths; contributor-supplied runtime output corroborates them, and no target code was executed during this review. Is this the best way to solve the issue? The revision repairs the existing owners directly, preserves account membership and transport checks, and resolves the previous competing-selector and validation concerns. 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:
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:13 PM ET / November 9, 2026, 00:13 UTC (Revision 2). |
…-ttl ms in numeric-options
|
@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 MCP tombstone filtering, original-only discussion filtering, sync errors/TTL bounds, and account-normalized web sync locks 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
Fixes account-selector resolution, soft-deleted FTS preflight filtering, reply-metadata exclusion in live search discussions, and sync CLI error/TTL contracts:
src/lib/link-insights.ts&src/lib/web-sync.ts: Reuse the sharedfindOperationAccount(db, account)resolver fromsrc/lib/account-selection.tsso@handle/ username selectors resolve to canonical storedaccount.idvalues (acct_primary,acct_studio, etc.) across Link Insights membership queries, web-sync transport mode selection (autovsxurl), and running-sync job lock keys (getRunningSyncKey).src/lib/mcp-tools.ts: Filtert.deleted_at is null and t.superseded_at is nullincountScopedTweetFtsMatchesso soft-deleted or superseded FTS rows do not inflate theMCP_MAX_FTS_MATCHES(1000) preflight check and reject visible search matches.src/lib/search-discussion.ts: Selectt.reply_to_idincollectLiveSearchTweets, exclude rows withBoolean(row.reply_to_id)whenoriginalsOnlyis set inliveSearchRowPassesFilters, and fail fast whenquery.trim()is empty.src/cli/numeric-options.ts&src/cli/register-sync.ts: Bound--cache-ttlmilliseconds conversion (Number.isFinite(number * 1000)) directly in the shared CLI numeric preAction hook (configureNumericOptions) before account selection, and emit structured JSON failure envelopes ({ ok: false, kind, mode, error }) withprocess.exitCode = 1onsync timeline,sync likes, andsync bookmarks.Shipped CLI & Server Behavior Proof (
dist/cli/birdclaw.jsBasev0.17.0@9895445ba0a2vs Head @678e606)1. Seed
v0.17.0Archive (9895445ba0a2) with Settings (transport: "bird"), Accounts, 1,001 Soft-Deleted Tombstones, Visible Original + Reply Tweets, Links, Collections, and DMs2. Base (
v0.17.0@9895445ba0a2) Shipped CLI &birdclaw serveFailures3. Head (
678e606) Shipped CLI &birdclaw servePass +v0.17.0Upgrade Compatibility ProofVerification
node ./scripts/run-vitest.mjs run src/lib/web-sync.test.ts src/lib/account-selection.test.ts src/lib/live-sync-engine.test.ts src/cli.test.ts src/cli/sync-contract.test.ts src/lib/link-insights.test.ts src/lib/mcp-tools.test.ts src/lib/search-discussion.test.ts: 236 passed (8 files)Known 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.
☁️