Skip to content

refactor(cli): replace Zod with ArkType everywhere#2729

Merged
riderx merged 7 commits into
mainfrom
chore/zod-to-arktype
Jul 22, 2026
Merged

refactor(cli): replace Zod with ArkType everywhere#2729
riderx merged 7 commits into
mainfrom
chore/zod-to-arktype

Conversation

@riderx

@riderx riderx commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Converted all Capgo CLI Zod schemas under cli/src/schemas/ to ArkType, matching the backend validation stack
  • Upgraded MCP from @modelcontextprotocol/sdk v1 to @modelcontextprotocol/server v2 beta so tools can register ArkType/Standard Schema inputSchema directly
  • Removed direct zod dependencies from root and CLI package.json (Zod may still appear transitively via MCP/knip)

Motivation (AI generated)

Backend validation already standardized on ArkType + Standard Schema. Keeping Zod only in the CLI duplicated dependencies and patterns. MCP SDK v2 accepts ArkType natively, so we can drop Zod from our direct dependency tree.

Business Impact (AI generated)

Smaller/simpler CLI dependency surface and one validation library across Capgo backend + CLI. MCP tool schemas stay LLM-friendly via ArkType .describe() metadata. Note: MCP server package is currently on a beta release.

Test Plan (AI generated)

  • bun run cli:lint
  • bun run cli:typecheck
  • bun run cli:build
  • MCP/upload CLI tests (test-upload-validation, test-mcp-live-update-onboarding, test-mcp-onboarding, test-mcp-build-tools, test-mcp-credentials-manage, test-mcp-oauth-reopen, test:mcp)
  • CI full suite
  • Smoke Capgo MCP server tool listing against a real client after merge

Generated with AI

Made with Cursor

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added Arktype-powered MCP input schemas, including live-update explain.
    • Introduced shared schema parsing helpers for consistent validation results and errors.
  • Bug Fixes
    • Improved validation error reporting with clearer, field-path-specific messages.
    • Standardized MCP tool/prompt registration to reliably enforce declared input schemas.
  • Refactor
    • Migrated CLI and MCP tool/prompt validation from Zod to Arktype and centralized shared schema definitions; updated MCP server wiring.
  • Tests
    • Updated MCP and validation tests to match the new registration and parsing APIs.
  • Documentation
    • None

Unify CLI schemas on ArkType (already used by the backend) and upgrade
the MCP server to the v2 beta Standard Schema API so Zod can be dropped
as a direct dependency.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4f5f6f7f-a667-43b4-8e4b-1324cab2e3c6

📥 Commits

Reviewing files that changed from the base of the PR and between 41e04fe and 5ccaa93.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • cli/package.json
  • cli/src/utils.ts
  • package.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

📝 Walkthrough

Walkthrough

The CLI migrates runtime schemas from Zod to ArkType, adds Standard Schema parsing helpers, and updates MCP tooling from server.tool to server.registerTool with centralized input schemas. Dependencies, server wiring, and related tests are updated.

Changes

ArkType validation and domain schemas

Layer / File(s) Summary
Validation foundation and dependencies
cli/package.json, package.json, cli/src/schemas/ark_validation.ts, cli/src/schemas/validate.ts, cli/src/utils.ts
Adds Standard Schema parsing utilities, removes Zod dependencies, and updates validation consumers to use safeParseSchema and parseSchema.
Domain schema migration
cli/src/schemas/*.ts
Rewrites application, build, bundle, channel, organization, SDK, onboarding, authentication, and shared schemas with ArkType while updating inferred types and cross-field validation.

MCP registration migration

Layer / File(s) Summary
MCP schema and registration migration
cli/src/mcp/*, cli/src/build/onboarding/mcp/*, cli/src/init/mcp/*
Adds shared MCP input schemas, introduces McpRegistrar, and converts tool registration and tracking to registerTool.
Migration validation tests
cli/test/*, tests/organization-api.test.ts
Updates MCP test doubles, client imports, schema assertions, and parsing calls for the new APIs and schemas.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: codex

Suggested reviewers: wcaleniewolny

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing Zod with ArkType across the CLI.
Description check ✅ Passed The description covers summary and test plan well, but it omits the template's Screenshots and Checklist sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
cli/package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​modelcontextprotocol/​client@​2.0.0-beta.5781008397100
Added@​modelcontextprotocol/​server@​2.0.0-beta.5801008497100

View full report

@codspeed-hq

codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing chore/zod-to-arktype (5ccaa93) with main (4718532)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Update CLI MCP tests to @modelcontextprotocol/client, trim unused
ark_validation/config exports so knip passes, and keep only live types.

Co-authored-by: Cursor <cursoragent@cursor.com>
@riderx
riderx marked this pull request as ready for review July 22, 2026 16:41
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a6e7ac46-eabe-4b7e-a636-9ad616e28162)

@cursor
cursor Bot requested a review from WcaleNieWolny July 22, 2026 16:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), so I am not approving. Human review is needed for this CLI Zod→ArkType validation refactor; WcaleNieWolny assigned as reviewer.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), and this broad CLI Zod→ArkType validation refactor exceeds the low-risk approval threshold. Not approving; WcaleNieWolny is already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@riderx

riderx commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added the codex label Jul 22, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 36 files

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

Tip: instead of fixing issues one by one fix them all with cubic
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread cli/src/schemas/base.ts
Comment thread cli/src/mcp/tool-schemas.ts Outdated
Comment thread cli/src/mcp/server.ts
Comment thread cli/src/schemas/organization.ts Outdated
Comment thread cli/src/schemas/bundle.ts Outdated
Comment thread cli/src/schemas/sdk.ts Outdated
Comment thread cli/src/schemas/organization.ts
Comment thread cli/src/schemas/validate.ts Outdated
Comment thread cli/src/schemas/channel.ts
Comment thread cli/src/schemas/common.ts Outdated
Register prompts via registerPrompt, strip undeclared keys with ArkType
'+': 'delete', allow optional undefined, and add toJsonSchema fallback so
tools/list works with MCP Standard Schema export.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_31dd2a26-e4dd-4547-9214-aa62791e4ecd)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), and this broad CLI Zod→ArkType validation refactor exceeds the low-risk approval threshold. Not approving; WcaleNieWolny is already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), so I am not approving. WcaleNieWolny is already assigned for human review of this CLI Zod→ArkType validation refactor.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cli/src/mcp/server.ts (1)

429-478: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document why capgo_update_channel uses two schemas.

The advertised inputSchema (mcpUpdateChannelInputSchema) omits the mutual-exclusivity checks that updateChannelOptionsSchema.narrow(...) enforces (e.g. rolloutEnable/rolloutDisable, the rolloutPause/rolloutResume/rolloutRollback/rolloutPromote group, autoPauseEnabled/autoPauseDisabled), which is why parseSchema(updateChannelOptionsSchema, ...) re-validates inside the handler. This split is very likely required because ArkType .narrow() predicates aren't convertible to JSON Schema, so updateChannelOptionsSchema itself can't be used as the wire-facing inputSchema. Worth a short comment here (or at the two schema definitions) explaining that rationale, since it's easy for a future reader to "simplify" by collapsing the two schemas and unknowingly break tool registration or silently drop the narrow constraints.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/src/mcp/server.ts` around lines 429 - 478, Document the intentional
two-schema flow in capgo_update_channel: add a brief comment explaining that
mcpUpdateChannelInputSchema is used for wire-facing tool registration because
ArkType narrow predicates cannot be converted to JSON Schema, while
parseSchema(updateChannelOptionsSchema, ...) revalidates the mutual-exclusivity
constraints inside the handler. Keep both schemas and the existing validation
behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/src/mcp/tool-schemas.ts`:
- Around line 4-8: Update the bare fields in mcpAddAppInputSchema,
mcpUpdateAppInputSchema, mcpUploadBundleInputSchema,
mcpCleanupBundlesInputSchema, mcpGetStatsInputSchema,
mcpRequestBuildInputSchema, and the applicable fields of
mcpUpdateChannelInputSchema to use ArkType .describe() metadata, matching the
descriptive style of the already-documented schemas in this file. Add clear
descriptions for fields including rollout, force, nodeModules, and all
rollout/auto-pause flags without changing validation behavior.

In `@cli/src/schemas/validate.ts`:
- Around line 15-16: Factor out a shared Standard Schema path formatter that
converts `{ key }` segments to their keys, joins segments with dots, and returns
“value” for empty paths. Replace the direct path joining in
cli/src/schemas/validate.ts:15-16 and cli/src/utils.ts:2088-2090 with this
formatter; both sites require the change.

In `@cli/test/test-mcp-live-update-onboarding.mjs`:
- Around line 156-162: Update the schema validation assertions in the onboarding
test to parse the `inputSchema` captured from each registered tool in
`server.tools`, rather than the imported schema constants. Apply this to the
affected assertions around `capgo_live_update_onboarding_explain` and the
additional locations noted by the review, preserving the existing valid and
invalid fixture expectations.

---

Outside diff comments:
In `@cli/src/mcp/server.ts`:
- Around line 429-478: Document the intentional two-schema flow in
capgo_update_channel: add a brief comment explaining that
mcpUpdateChannelInputSchema is used for wire-facing tool registration because
ArkType narrow predicates cannot be converted to JSON Schema, while
parseSchema(updateChannelOptionsSchema, ...) revalidates the mutual-exclusivity
constraints inside the handler. Keep both schemas and the existing validation
behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f709bddf-7d74-43a4-a0b7-e9d2d4503270

📥 Commits

Reviewing files that changed from the base of the PR and between c1f6aa5 and 4e56ca9.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • cli/package.json
  • cli/src/build/onboarding/mcp/build-tool-schemas.ts
  • cli/src/build/onboarding/mcp/build-tools.ts
  • cli/src/build/onboarding/mcp/credentials-manage.ts
  • cli/src/build/onboarding/mcp/onboarding-tools.ts
  • cli/src/init/mcp/live-update-tools.ts
  • cli/src/mcp/registrar.ts
  • cli/src/mcp/server.ts
  • cli/src/mcp/tool-schemas.ts
  • cli/src/schemas/app.ts
  • cli/src/schemas/ark_validation.ts
  • cli/src/schemas/auth.ts
  • cli/src/schemas/base.ts
  • cli/src/schemas/build.ts
  • cli/src/schemas/bundle.ts
  • cli/src/schemas/channel.ts
  • cli/src/schemas/common.ts
  • cli/src/schemas/config.ts
  • cli/src/schemas/index.ts
  • cli/src/schemas/live-update-onboarding.ts
  • cli/src/schemas/onboarding.ts
  • cli/src/schemas/organization.ts
  • cli/src/schemas/sdk.ts
  • cli/src/schemas/validate.ts
  • cli/src/utils.ts
  • cli/test/test-capacitor-config-target.mjs
  • cli/test/test-mcp-build-tools.mjs
  • cli/test/test-mcp-credentials-manage.mjs
  • cli/test/test-mcp-live-update-onboarding.mjs
  • cli/test/test-mcp-oauth-reopen.mjs
  • cli/test/test-mcp-onboarding.mjs
  • cli/test/test-mcp.mjs
  • cli/test/test-upload-validation.mjs
  • package.json
  • tests/organization-api.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)
💤 Files with no reviewable changes (1)
  • cli/src/schemas/index.ts

Comment thread cli/src/mcp/tool-schemas.ts
Comment thread cli/src/schemas/validate.ts Outdated
Comment thread cli/test/test-mcp-live-update-onboarding.mjs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cli/src/mcp/tool-schemas.ts (1)

4-167: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Factor out shared MCP schema fragments.
These MCP inputs are intentional subsets of the SDK options, but the shared bounds and field shapes still live in two places. Reuse common fragments from cli/src/schemas/sdk.ts where possible to keep MCP and SDK validation from drifting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/src/mcp/tool-schemas.ts` around lines 4 - 167, Refactor the MCP schemas
in the exported mcp*InputSchema definitions to reuse applicable shared field
fragments and bounds from cli/src/schemas/sdk.ts instead of duplicating them
locally. Prioritize overlapping options such as rollout, retention, auto-pause,
and Capacitor configuration while preserving each MCP schema’s intentional
subset and existing validation behavior.

Source: Coding guidelines

cli/src/schemas/channel.ts (1)

9-26: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not narrow the public version field without a compatibility plan.

The schema now accepts only an optional object-shaped version, whereas the previous contract accepted any optional value. Existing API responses containing a scalar, array, null, or another valid legacy format will now fail parsing. Preserve the broad field shape, or gate the stricter object form by API/plugin version and add regression coverage.

As per coding guidelines, public APIs and plugin interfaces must remain backward compatible; do not change existing fields, meanings, formats, or status codes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/src/schemas/channel.ts` around lines 9 - 26, Update the version field in
channelSchema to preserve the previous broad optional-value contract instead of
requiring an object shape. Keep Channel inference compatible with scalar, array,
null, and other legacy version values, and do not narrow the public API field
without version gating.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/src/schemas/arktype_config.ts`:
- Around line 5-10: Update the ArkType JSON Schema configuration in configure so
fallback.default only returns ctx.base for unsupported optional-undefined cases;
make all other unsupported nodes throw or otherwise fail explicitly. Preserve
narrow constraints used by the channel and SDK schemas instead of silently
dropping them.

---

Outside diff comments:
In `@cli/src/mcp/tool-schemas.ts`:
- Around line 4-167: Refactor the MCP schemas in the exported mcp*InputSchema
definitions to reuse applicable shared field fragments and bounds from
cli/src/schemas/sdk.ts instead of duplicating them locally. Prioritize
overlapping options such as rollout, retention, auto-pause, and Capacitor
configuration while preserving each MCP schema’s intentional subset and existing
validation behavior.

In `@cli/src/schemas/channel.ts`:
- Around line 9-26: Update the version field in channelSchema to preserve the
previous broad optional-value contract instead of requiring an object shape.
Keep Channel inference compatible with scalar, array, null, and other legacy
version values, and do not narrow the public API field without version gating.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d1d70b95-8b10-43f1-8979-742470c8c909

📥 Commits

Reviewing files that changed from the base of the PR and between 4e56ca9 and 4f8c5dc.

📒 Files selected for processing (21)
  • cli/src/build/onboarding/mcp/build-tool-schemas.ts
  • cli/src/build/onboarding/mcp/onboarding-tools.ts
  • cli/src/init/mcp/live-update-tools.ts
  • cli/src/mcp/registrar.ts
  • cli/src/mcp/tool-schemas.ts
  • cli/src/schemas/app.ts
  • cli/src/schemas/ark_validation.ts
  • cli/src/schemas/arktype.ts
  • cli/src/schemas/arktype_config.ts
  • cli/src/schemas/auth.ts
  • cli/src/schemas/base.ts
  • cli/src/schemas/build.ts
  • cli/src/schemas/bundle.ts
  • cli/src/schemas/channel.ts
  • cli/src/schemas/common.ts
  • cli/src/schemas/live-update-onboarding.ts
  • cli/src/schemas/onboarding.ts
  • cli/src/schemas/organization.ts
  • cli/src/schemas/sdk.ts
  • cli/test/test-mcp-live-update-onboarding.mjs
  • cli/test/test-mcp-onboarding.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Comment thread cli/src/schemas/arktype_config.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 21 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread cli/src/schemas/sdk.ts Outdated
Comment thread cli/src/schemas/arktype_config.ts Outdated
Comment thread cli/src/schemas/build.ts Outdated
@riderx

riderx commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@riderx

riderx commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Use a unit-only toJsonSchema fallback for optional undefined, prefer
ArkType problem text in validateOptions, and trim/reject blank locale
keys for localized store release notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_84373d7d-6558-4ff3-9565-f5f8157fa6a6)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), and this broad CLI Zod→ArkType validation refactor exceeds the low-risk approval threshold. Not approving; WcaleNieWolny is already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), so I am not approving. WcaleNieWolny is already assigned for human review of this CLI Zod→ArkType validation refactor.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/src/schemas/build.ts`:
- Around line 4-18: Reject duplicate locale keys after trimming in the localized
release-notes validation: in cli/src/schemas/build.ts lines 4-18, check
Object.hasOwn(out, key) before assigning out[key] and reject duplicates; apply
the same validation in cli/src/schemas/sdk.ts lines 21-35. Preserve the existing
non-empty key and value checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b681ee39-87b9-4536-b8df-8b4f06d30a62

📥 Commits

Reviewing files that changed from the base of the PR and between 4f8c5dc and 8e17a4f.

📒 Files selected for processing (4)
  • cli/src/schemas/arktype_config.ts
  • cli/src/schemas/build.ts
  • cli/src/schemas/sdk.ts
  • cli/src/schemas/validate.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Comment thread cli/src/schemas/build.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: instead of fixing issues one by one fix them all with cubic
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cli/src/schemas/sdk.ts Outdated
Comment thread cli/src/schemas/build.ts Outdated
Comment thread cli/src/schemas/validate.ts Outdated
Comment thread cli/src/schemas/sdk.ts Outdated
Comment thread cli/src/schemas/build.ts Outdated
Comment thread cli/src/schemas/arktype_config.ts Outdated
Share one null-prototype locale-notes schema that rejects blank/duplicate
keys, keep paths on ArkType problems, and throw a typed error for
unsupported JSON Schema units.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_fbecb14f-2333-46ba-9558-d58f52d66417)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), so I am not approving. WcaleNieWolny is already assigned for human review of this CLI Zod→ArkType validation refactor.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), and this broad CLI Zod→ArkType validation refactor exceeds the low-risk approval threshold. Not approving; WcaleNieWolny is already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread cli/src/schemas/common.ts
Comment thread cli/src/schemas/validate.ts Outdated
Require a plain object for localized release notes, and always prefix
ArkType problems with the issue path in validateOptions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_58c80f81-61b7-4e1c-8d26-1b0ee3a35d9e)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), and this broad CLI Zod→ArkType validation refactor exceeds the low-risk approval threshold. Not approving; WcaleNieWolny is already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), so I am not approving. WcaleNieWolny is already assigned for human review of this CLI Zod→ArkType validation refactor.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cli/src/schemas/index.ts (1)

68-69: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Restore the removed config-schema exports.

Removing capacitorConfigSchema and extConfigPairsSchema breaks existing imports from this public barrel. Re-export both schemas alongside their types.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/src/schemas/index.ts` around lines 68 - 69, Update the Config exports in
the public schema barrel to re-export capacitorConfigSchema and
extConfigPairsSchema alongside CapacitorConfig and ExtConfigPairs, preserving
existing imports.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@cli/src/schemas/index.ts`:
- Around line 68-69: Update the Config exports in the public schema barrel to
re-export capacitorConfigSchema and extConfigPairsSchema alongside
CapacitorConfig and ExtConfigPairs, preserving existing imports.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8cea7b03-7b48-4ae2-8345-0abd4c1385ce

📥 Commits

Reviewing files that changed from the base of the PR and between 8e17a4f and 41e04fe.

📒 Files selected for processing (6)
  • cli/src/schemas/arktype_config.ts
  • cli/src/schemas/build.ts
  • cli/src/schemas/common.ts
  • cli/src/schemas/index.ts
  • cli/src/schemas/sdk.ts
  • cli/src/schemas/validate.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Resolve cli/package.json and bun.lock conflicts while keeping ArkType +
MCP v2 and main dependency bumps.

Co-authored-by: Cursor <cursoragent@cursor.com>
@riderx
riderx deployed to deepsec-pr July 22, 2026 18:44 — with GitHub Actions Active
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b0dcbd3f-cb91-4aaf-bb39-477efaaf48f5)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), and this broad CLI Zod→ArkType validation refactor exceeds the low-risk approval threshold. Not approving; WcaleNieWolny is already assigned for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot did not complete (check skipped — usage limit reached), so I am not approving. WcaleNieWolny is already assigned for human review of this CLI Zod→ArkType validation refactor.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@sonarqubecloud

Copy link
Copy Markdown

@riderx
riderx merged commit 276826d into main Jul 22, 2026
46 of 64 checks passed
@riderx
riderx deleted the chore/zod-to-arktype branch July 22, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant