Repository navigation
fix: enforce whois account/read-only and live-search input contracts - #264
saariuslystoned wants to merge 1 commit into
Conversation
|
🦞👀 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 changesThe PR resolves whois account selectors, prevents read-only enrichment writes, and validates whois and live-search inputs through Effect failures. Example: Run whois "indexneedle" --account "@studio" against a prebuilt archive with BIRDCLAW_DEPLOYMENT_READ_ONLY=1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR repairs current account-selection, read-only lookup, and input-validation defects. The prior zero-limit finding is resolved, and no actionable blocker remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI commands call Effect-based identity and live-search services, which resolve account selectors, query SQLite archives, and optionally invoke enrichment or search transports. flowchart TD
CLI[CLI commands] --> Validation[Effect input validation]
Validation --> Whois[Whois service]
Validation --> Search[Live search service]
Whois --> Accounts[Shared account resolver]
Accounts --> Archive[SQLite archive]
Whois --> Archive
Search --> Transport[Bird or xurl transport]
Transport --> Archive
Technical reviewBest possible solution: Land the focused repairs while retaining the existing zero-limit, account-scope, and read-only contracts. Do we have a high-confidence way to reproduce the issue? Current-main source binds unresolved selectors and attempts whois index writes in read-only mode; supplied base CLI traces confirm the read-only failure and acceptance of invalid date windows. Is this the best way to solve the issue? The patch uses existing account, database, and Effect owners, preserves supported zero limits, and rejects malformed inputs before live-search database access or transport execution. 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. 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 9, 2026, 12:14 AM ET / 05:14 UTC (Revision 2). |
863a662 to
18d4de3
Compare
|
@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 account-scoped read-only whois and strict live-search validation 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
Hardens account resolution, read-only deployment isolation, and live-search input/Effect validation across
src/lib/whois.ts,src/lib/identity-search-index.ts, andsrc/lib/tweet-search-live.ts:whois&identity_search_indexaccount resolution, non-negative Effect input validation (--limit 0preserved), and read-only deployment isolation (src/lib/whois.ts,src/lib/identity-search-index.ts):ensureIdentitySearchIndexForDmProfilesandfindProfileEvidenceConversationIdspreviously bound the rawaccountstring directly againstc.account_id = ?, missing handle selectors (@studio,studio, padded/case variants) unlessidentity_search_indexwas already populated. Both now resolve explicit selectors viafindOperationAccount(db, account)(returning{ profiles: 0, entries: 0 }/[]for unknown selectors while preserving"all"andundefinedbehavior), andrunWhoisEffectpasses the canonicalized account selector to downstream DM and timeline queries.runWhoisEffectvalidatesoptions.limitandoptions.contextas non-negative safe integers (>= 0) insidetrySyncso programmatic callers receive invalid numeric errors in theEffectfailure channel (Effect.either) while preserving the documented and tested--limit 0contract (docs/search.md:10,#132).isReadOnlyDeployment()(BIRDCLAW_DEPLOYMENT_READ_ONLY=1) is active,runWhoisEffect,ensureIdentitySearchIndexForDmProfiles, andsyncIdentitySearchIndexForProfileIdsread existing identity rows and profile metadata viagetReadDb()and skipidentity_search_indexwrites as well as default live profile resolution and URL expansion cache writes (profileResolution === undefined,urlExpansions: []), instead of failing withattempt to write a readonly database.Effectfailure channel & strict calendar/range validation (src/lib/tweet-search-live.ts):normalizeLimit(limit),normalizeMaxPages(maxPages), andmodevalidation ("auto" | "bird" | "xurl" | "local") insidetrySyncinsyncTweetSearchEffectso invalid inputs fail in theEffecterror channel rather than throwing synchronously before theEffectexecutes or silently falling through to liveautosearch.normalizeLimitandnormalizeMaxPagesinstead of silently truncating fractional numbers.normalizeTime(rejecting impossible calendar dates like2026-02-30, hour24, or trailing junk) and rejects inverted ranges wherenormalizedSince > normalizedUntil(--since must be before or equal to --until).Real Shipped-CLI (
dist/cli/birdclaw.js) Base-Fail -> Head-Pass &v0.17.0Upgrade Verification1. Shipped CLI
whoisunderBIRDCLAW_DEPLOYMENT_READ_ONLY=1(Default Enrichment Options & Prebuilt Index)9895445ba0a2v0.17.0): Fails immediately withattempt to write a readonly databasewhenwhoisruns with default options underBIRDCLAW_DEPLOYMENT_READ_ONLY=1:18d4de3041f3) — Unindexed Archive with Default Enrichment Options: Succeeds withexit 0and writes0rows:18d4de3041f3) — Prebuilt Archive underBIRDCLAW_DEPLOYMENT_READ_ONLY=1with Default Enrichment (resolveProfiles=true,expandUrls=true) and--refresh-profile-cache --refresh-url-cache: Reads existingidentity_search_indexevidence for--account "@studio", suppresses default live profile resolution (profileResolutionomitted) and URL expansion (urlExpansions: []despitehttps://t.co/demoin bio), and leavesbirdclaw.sqlitebyte-for-byte unchanged (sha256=a9a7c14225a253ff76e3466310ff52a57ad0b7f8ef711d6a1f79bd4954b8fdb8):2. Shipped CLI
whois --limit 0(Preserved Non-Negative Zero-Limit Contract)18d4de3041f3): Preserves--limit 0compatibility (docs/search.md:10,#132) end-to-end through the realrunWhoisimplementation:3. Shipped CLI Live-Search Calendar & Chronological Range Validation (
discuss --source search)9895445ba0a2v0.17.0): Accepts impossible date2026-02-30(rolling it over to March 2) and inverted window--since 2026-11-08 --until 2026-11-01, proceeding directly to spawn thebirdtransport subprocess:18d4de3041f3): Rejects both invalid date inputs deterministically before touching the database or spawning any live transport subprocess:4.
v0.17.0-Seeded Archive Upgrade &backup export/backup validateVerification5. Focused Base-RED -> Fix-GREEN & Full Suite Verification
9895445ba0a2):44 failed | 35 passed (79)acrosssrc/lib/whois.test.ts(22 failed) andsrc/lib/tweet-search-live.test.ts(22 failed).18d4de3041f3):79 passed (79)(2 test files),format:check+lint+typecheckclean (0 warnings and 0 errors).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.
☁️