Repository navigation
fix(importer): harden review jobs against NaN cap and proto keys - #1857
Conversation
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
PO acceptance: merge at 107f6fc |
Summary
apps/importer/src/shopee/jobs/review-ai-points.ts): Parsecost_usdandreserved_usdstrictly inmonthSpendUsdso non-finite or empty strings ("NaN",NaN,Infinity,"Infinity","-Infinity",""), missing/negative open-batchreserved_usd, invalid row objects, or malformedsubmitted_attimestamps return+Infinityinstead ofNaN; fall back to non-negativereserved_usdwhencost_usd < 0; parse month-boundary timestamps withDate.parse; and guardresult.cappedwhenmonthSpendUsdorreservedUsdis non-finite.apps/importer/src/shopee/jobs/review-ai-points.ts,apps/importer/src/shopee/product-points-ai-prompt.ts): Replaceif (key in total)withObject.hasOwn(total, key)(plus finite positive count check) instoreAiRows, and allocatebyCriterionviaObject.create(null)inmergeAndSelectAiProductPointsso__proto__,constructor, andtoStringnever read or mutateObject.prototype.apps/importer/src/shopee/review-ai-prompt.ts,apps/importer/src/shopee/jobs/review-ai-points.ts,apps/importer/src/shopee/jobs/review-values.ts): GuardbatchCostUsdwithisReviewAiModel(model),Number.isFinite(v) && v > 0, and pre-multiplication/ 1_000_000division; clamp accumulated request token usage incollectBatchtoNumber.MAX_SAFE_INTEGER; and guardexpectedMasterRatingsagainst non-finitecriteria_ratings,rating_star/rating_exact, non-finite or hugehelpfulness_weight(Math.min(weight, 3)), and prototype criterion keys beforetoUnits(..., BigInt).apps/importer/src/shopee/jobs/review-ai-points.ts,apps/importer/src/shopee/logger.ts): Normalize external batch/file IDs with.toWellFormed().trim()and reject empty, dot-segment (".",".."), slash, query/hash, or control-char resource IDs beforeencodeURIComponent; truncate at UTF-16 code-point boundaries plus.toWellFormed()insanitizeAiGeneratedTextso slicing atboundedInputorsafeMaxLennever leaves a lone surrogate or exceedsmaxLen.Verification
pnpm --filter @repo/crawlers testpnpm --filter @repo/crawlers test:distpnpm typecheckpnpm lintpnpm buildresearchsubagents (Correctness Reviewer Merge dev into main: Shopee captcha-safe export + duplicate-guard + v1.0.33 #1 + Security/Spend-Cap/Bounds Reviewer Merge pull request #1 from RateBox/dev #2; all Round 1 findings resolved in107f6fc7). Note: local Codex CLI (codex review) is out of quota until Nov 25, 2026 and was not run.Closes #1853
Claimant: antigravity:93ebb889-4915-4c9f-bb0b-53a96791ec91