Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4f0b422 to
d146a61
Compare
Greptile SummaryThis PR introduces a security scan verification endpoint ( Notable changes:
Confidence Score: 4/5
|
| })), | ||
| security, | ||
| security: security ?? undefined, | ||
| }, | ||
| }, | ||
| 200, | ||
| rate.headers, | ||
| ) |
There was a problem hiding this comment.
security field is undefined vs null inconsistency
In the versions detail response, security is spread as security: security ?? undefined, meaning the field is omitted when there is no scan data. In the scan endpoint response (line ~778), security is spread directly and can be null.
The OpenAPI schema for SkillScanResponse documents security as anyOf: [SecuritySnapshot, null], which correctly captures the null case. But the versions response uses undefined (field absent), whereas the OpenAPI SkillVersionResponse schema references SecuritySnapshot without null. While both work from a consumer perspective, making the field consistently null (and always present) across both response shapes would make client-side handling simpler.
Prompt To Fix With AI
This is a comment left during a code review.
Path: convex/httpApiV1/skillsV1.ts
Line: 706-712
Comment:
**`security` field is `undefined` vs `null` inconsistency**
In the versions detail response, `security` is spread as `security: security ?? undefined`, meaning the field is omitted when there is no scan data. In the scan endpoint response (line ~778), `security` is spread directly and can be `null`.
The OpenAPI schema for `SkillScanResponse` documents `security` as `anyOf: [SecuritySnapshot, null]`, which correctly captures the `null` case. But the versions response uses `undefined` (field absent), whereas the OpenAPI `SkillVersionResponse` schema references `SecuritySnapshot` without `null`. While both work from a consumer perspective, making the field consistently `null` (and always present) across both response shapes would make client-side handling simpler.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f0b422464
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const entry of entries) { | ||
| const skill = await ctx.db.get(entry.skillId) | ||
| if (!skill || skill.softDeletedAt || isSkillSuspicious(skill)) continue |
There was a problem hiding this comment.
Bound non-suspicious scan to avoid Convex read-limit failures
takeTopNonSuspiciousTrendingEntries performs a ctx.db.get for each candidate entry until it finds limit clean skills, and in rebuildTrendingLeaderboardAction the entries input is built from every skill seen in the 7-day window. In high-churn windows (especially when many top-ranked skills are suspicious/deleted), this loop can read thousands of skills docs in one query and hit Convex documentsReadLimit (32K), causing the non-suspicious leaderboard rebuild to fail and leaving sort=trending&nonSuspiciousOnly=true stale.
Useful? React with 👍 / 👎.
Summary
Adds API support for skill security scan verification and aligns API filtering with website behavior for hiding suspicious skills.
What Changed
GET /api/v1/skills/{slug}/scanfor normalized security scan verification details.nonSuspiciousOnlysupport toGET /api/v1/searchandGET /api/v1/skills.nonSuspiciousOnly=trueto use a dedicated clean leaderboard instead of filtering the first overall entries.acceptLicenseTermswhile still rejecting explicitfalse.api.skills.getBySlugand re-added regression coverage.Validation
bun run testbun x tsc -p packages/schema/tsconfig.json --noEmitbun x tsc -p packages/clawdhub/tsconfig.json --noEmitReplacement for #537 because the original PR head lives on an external fork branch that could not be updated directly.