Repository navigation
fix(moderation,import,backup): validate explicit moderation transport, x-json metrics, and backup schema/shard bounds - #262
Conversation
…, x-json metrics, and backup schema/shard bounds
|
🦞👀 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 rejects unsupported moderation transports, negative or fractional imported metrics, and malformed backup versions, and validates shard limits earlier. Example: Import tweet 1900000000000000001 with like_count -5 when its stored count is 42.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs validation defects present in v0.17.0, and the new CLI evidence resolves the earlier proof hold; no blocking correctness or security finding remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI arguments, saved X API JSON, and backup manifests enter existing validators before moderation transports, transactional SQLite ingestion, or backup processing. flowchart TD
A[Moderation arguments] --> B[CLI and action validation]
B --> C[Account checks and transports]
D[Saved X JSON] --> E[Import validation]
E --> F[SQLite ingestion]
G[Backup options and manifests] --> H[Backup validation and export]
Technical reviewBest possible solution: Land the focused validation repairs in the existing owners while preserving valid inputs, archive formats, and transport preferences. Do we have a high-confidence way to reproduce the issue? The base source exposes all reported validation paths, and the contributor supplies v0.17.0 CLI failures followed by corrected output on the reviewed head; no target code was executed during this review. Is this the best way to solve the issue? The patch repairs existing validation owners without adding machinery; the PR body's safe-integer wording overstates Number.isInteger, which enforces integrality without a safe-integer upper bound. 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, 6:50 PM ET / 23:50 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 moderation transport validation, non-negative safe imported metrics, and backup input 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 CLI moderation transport validation,
x-jsonpublic-metric validation, and backup manifest/shard validation bounds:src/cli-moderation.ts&src/cli/register-moderation.ts: Validate explicit--transportvalues (auto,bird,xurl) before resolving account state or invoking livebird/xurlCLI transports; reject unsupported values (--transport must be auto, bird, or xurl).src/lib/x-json-import.ts: Validatetweet.public_metrics.*anduser.public_metrics.*as non-negative safe integers (Number.isInteger(value) && value >= 0) so negative or fractional counts cannot clobber existing stored metrics duringimport x-json.src/lib/backup.ts: ValidatemaxShardBytesbefore creating destination backup directories inexportBackupUnlockedEffect, and requireNumber.isInteger(parsed.schemaVersion)inreadManifestEffectso fractional schema versions (e.g.1.5) are rejected.Shipped CLI Behavior Proof (
dist/cli/birdclaw.jsBasev0.17.0@9895445ba0a2vs Head @dd7c6fd8d4b4)1. Seed
v0.17.0Archive (9895445ba0a2) with Settings, Accounts, Tweets, Collections, and DMs2. Base (
v0.17.0@9895445ba0a2) Shipped CLI Failures3. Head (
dd7c6fd8d4b4) Shipped CLI Pass &v0.17.0Archive Upgrade Compatibility ProofVerification
pnpm test src/cli-moderation.test.ts src/cli/moderation-contract.test.ts src/lib/x-json-import.test.ts src/lib/backup.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.
☁️