Repository navigation
feat(rpc): generate a shared params catalog from the host registry, gated on parse parity - #19961
Conversation
…ract Codemod-extracted, not hand-listed: every zod value reachable from a defineMethod `params:` now lives in a shared module a client can type against, while the method files keep their handlers and runtime imports. Methods that bound an inline schema get a named export so the registry can be read back by name. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The generator bundles the host registry together with the shared schema modules and maps each method to its params export by object identity, so a renamed or rebound schema shows up as catalog drift instead of a silent mismatch. `--check` exits non-zero on any regenerated byte difference and runs in `pnpm lint` and PR CI. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Runs every catalogued schema through the dispatcher's compiled safeParse path and through the same schema resolved against mobile's pinned zod, over a corpus of omitted/absent/undefined/null/wrong-type/transformed/defaulted/unknown-key inputs. Any accept, reject, throw or parsed-value difference fails unless recorded as a named delta. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
requiredString is z.unknown().transform(...): parsing params client-side would coerce a non-string to '' instead of rejecting it, rewriting the bytes on the wire. The AST check rejects every import shape that would emit a runtime require. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Why: RpcParams<M> exposes z.output as the send-side type. That is only sound if a parsed value parses back to itself, since z.input of these schemas is unknown. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
A pure type re-export, so it emits no module into the Metro graph while pulling all 83 contract modules into `pnpm --dir mobile typecheck` — which is what proves the host's schemas compile against mobile's pinned zod. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Too many files changed for review (176 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
Important
Two cross-environment defects in the new generator break pnpm lint on Windows and on a clean checkout. Both are quick, well-precedented fixes; details inline.
Reviewed changes
- Params catalog generator — new
config/scripts/generate-rpc-params-catalog.mjsesbuild-bundles the host RPC registry, maps each method to its bound params schema by object identity, and emits a byte-stable catalog viaoxfmt; wired intopnpm lintand CI with a--checkdrift gate. - Generated catalog —
rpc-params-catalog.generated.ts(607 entries) plusRpcParams<M>/RpcMethodNametypes and an explicitRPC_METHODS_WITHOUT_SHARED_PARAMSlist for the three schemas that reach intosrc/main. - Shared schema extraction — 82 zod params modules moved from method files into
src/shared/rpc-contract/*-params.ts; method files keep handlers and import the schemas,schemas.tsandgit-exec-options.tsbecome re-exports, and the duplicateRepoSelectoris consolidated. - Two gates — a parse-parity test (22,772 probes, host zod 4.5.4 vs mobile zod 4.4.3, plus a re-parse/idempotency round-trip) and a mobile type-only boundary test that rejects any value import of the contract modules.
ℹ️ Parse-parity gate does not pin move fidelity
The parity test compares the new host schema against the same schema re-imported under mobile's zod. It proves version-skew parity, but not that the ~4,970 moved lines are behaviorally identical to the schemas they replaced — host and client both bind the moved schema, so a codemod slip (a changed .min(), a dropped .strict(), a reordered .transform()) would alter the wire contract invisibly to every gate in this PR. No golden/snapshot pins pre-move behavior.
Technical details
# Parse-parity gate does not pin move fidelity
## Affected sites
- `src/main/runtime/rpc/rpc-params-parse-parity.test.ts` — re-imports `rpc-params-catalog.generated.ts` (the moved schemas), never the pre-move schema source.
## Required outcome
- Nothing blocking: the move is deliberately mechanical and the author flagged "review as a move." If desired, a one-shot golden snapshot (per-method accept/reject/output over a fixed corpus, captured from `main` before the move) would make a future re-move auditable, but this is optional given the scale and the manual review.
## Open questions for the human
- Is "review as a move" backed by any diff-side check (e.g. codemod + `git diff --color-moved`), or purely eyeballed? Worth a sentence in the PR so a future reviewer knows the fidelity argument's basis.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change centralizes RPC parameter schemas in shared Zod contract modules. Runtime RPC methods now import or re-export these contracts instead of defining local schemas. A generator creates and verifies the generated RPC parameter catalog. CI and lint run the verification command. Mobile code exposes catalog types through type-only exports and tests the import boundary. Shared OXC CLI resolution supports formatter and linter invocation. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to The parity gate may miss schema behavior changes, malformed Base64 input may reach file writes, and catalog generation may drift unpredictably. These should be resolved before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives substantial technical detail and testing evidence, but it omits required template information, including a linked issue, explicit Visual Proof with Resolution Update the description to include every required template section. Add a real linked issue after
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
src/shared/rpc-contract/worktree-params.ts (1)
106-106: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse string literal issue codes for Zod 4.
Zod 4 deprecates
ZodIssueCodein favor of raw string literals. Replace the five newz.ZodIssueCode.customusages in these worktree refinements withcode: 'custom'.src/shared/rpc-contract/terminal-orphan-params.ts (1)
14-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the shared pane-layout limits for orphan group layouts.
MAX_PANE_LAYOUT_DEPTHandMAX_PANE_LAYOUT_NODESare exported, and both validators walk the same recursivesplit/leaftree. Use the shared constants so the two layout validators cannot diverge when a limit changes.♻️ Proposed shared-cap reuse
-import { TerminalPaneLayoutNodeSchema } from './session-tabs-schemas-params' +import { + MAX_PANE_LAYOUT_DEPTH, + MAX_PANE_LAYOUT_NODES, + TerminalPaneLayoutNodeSchema +} from './session-tabs-schemas-params'- current.depth > 64 || - ++count > 1_024 || + current.depth > MAX_PANE_LAYOUT_DEPTH || + ++count > MAX_PANE_LAYOUT_NODES ||
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 7d0429ce-c6ce-429c-9c1f-d3025fdd051b
⛔ Files ignored due to path filters (1)
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (172)
.github/workflows/pr.yml.oxlintrc.jsonconfig/scripts/generate-rpc-params-catalog.mjsmobile/src/rpc-params-contract-type-only-boundary.test.tsmobile/src/transport/rpc-params-contract.tspackage.jsonsrc/main/git/command-runner/git-exec-options.tssrc/main/runtime/rpc/methods/accounts.tssrc/main/runtime/rpc/methods/agent-hooks.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/runtime/rpc/methods/ai-vault.tssrc/main/runtime/rpc/methods/artifacts.tssrc/main/runtime/rpc/methods/automation-schemas.tssrc/main/runtime/rpc/methods/browser-core.tssrc/main/runtime/rpc/methods/browser-extras.tssrc/main/runtime/rpc/methods/browser-schemas.tssrc/main/runtime/rpc/methods/browser-screencast.tssrc/main/runtime/rpc/methods/browser-tab-create-schema.tssrc/main/runtime/rpc/methods/client-events.tssrc/main/runtime/rpc/methods/client-settings-schemas.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/client-ui-workspace-filter-fields.tssrc/main/runtime/rpc/methods/clipboard.tssrc/main/runtime/rpc/methods/computer-schemas.tssrc/main/runtime/rpc/methods/computer.tssrc/main/runtime/rpc/methods/emulator.tssrc/main/runtime/rpc/methods/files-mutation-methods.tssrc/main/runtime/rpc/methods/files-target-schemas.tssrc/main/runtime/rpc/methods/files-terminal-artifact-methods.tssrc/main/runtime/rpc/methods/files.tssrc/main/runtime/rpc/methods/folder-workspace.tssrc/main/runtime/rpc/methods/git-admission-tier-schema.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/github-issue-methods.tssrc/main/runtime/rpc/methods/github-issue-update-schema.tssrc/main/runtime/rpc/methods/github-project-methods.tssrc/main/runtime/rpc/methods/github-pull-request-methods.tssrc/main/runtime/rpc/methods/github-pull-request-update-methods.tssrc/main/runtime/rpc/methods/github-repo-target-schemas.tssrc/main/runtime/rpc/methods/github-repo-work-item-methods.tssrc/main/runtime/rpc/methods/gitlab.tssrc/main/runtime/rpc/methods/hosted-review.tssrc/main/runtime/rpc/methods/jira.tssrc/main/runtime/rpc/methods/linear-agent-access.tssrc/main/runtime/rpc/methods/linear-issue-attribute-filter-schema.tssrc/main/runtime/rpc/methods/linear-issue-list-method.tssrc/main/runtime/rpc/methods/linear-project-create.tssrc/main/runtime/rpc/methods/linear.tssrc/main/runtime/rpc/methods/native-chat.tssrc/main/runtime/rpc/methods/notifications.tssrc/main/runtime/rpc/methods/orchestration/federation/federation-control.tssrc/main/runtime/rpc/methods/orchestration/federation/federation-relay.tssrc/main/runtime/rpc/methods/orchestration/federation/federation-start-schema.tssrc/main/runtime/rpc/methods/orchestration/gates/gates.tssrc/main/runtime/rpc/methods/orchestration/runs/mutation-request-show.tssrc/main/runtime/rpc/methods/orchestration/runs/runs.tssrc/main/runtime/rpc/methods/orchestration/schemas.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-control.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-release-schemas.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-release.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-schema.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-stop.tssrc/main/runtime/rpc/methods/plugins.tssrc/main/runtime/rpc/methods/preflight.tssrc/main/runtime/rpc/methods/project-runtime-rpc-methods.tssrc/main/runtime/rpc/methods/repo-update-schema.tssrc/main/runtime/rpc/methods/repo.tssrc/main/runtime/rpc/methods/runtime-client-capabilities.tssrc/main/runtime/rpc/methods/session-tabs-schemas.tssrc/main/runtime/rpc/methods/session-tabs.tssrc/main/runtime/rpc/methods/skills.tssrc/main/runtime/rpc/methods/speech.tssrc/main/runtime/rpc/methods/ssh.tssrc/main/runtime/rpc/methods/structured-agent-session-schemas.tssrc/main/runtime/rpc/methods/task-resume-state-schema.tssrc/main/runtime/rpc/methods/terminal-orphan.tssrc/main/runtime/rpc/methods/terminal-quick-command-rpc-schema.tssrc/main/runtime/rpc/methods/terminal/stream-schemas.tssrc/main/runtime/rpc/methods/terminal/terminal-viewport-methods.tssrc/main/runtime/rpc/methods/terminal/unary-schemas.tssrc/main/runtime/rpc/methods/terminal/viewport-schemas.tssrc/main/runtime/rpc/methods/ui-update-value-tolerance.tssrc/main/runtime/rpc/methods/updater.tssrc/main/runtime/rpc/methods/workspace-cleanup-ui-schema.tssrc/main/runtime/rpc/methods/workspace-ports.tssrc/main/runtime/rpc/methods/worktree-create-schemas.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree-visibility-defaults-schema.tssrc/main/runtime/rpc/rpc-params-parse-parity.test.tssrc/main/runtime/rpc/schemas.tssrc/shared/rpc-contract/accounts-params.tssrc/shared/rpc-contract/agent-hooks-params.tssrc/shared/rpc-contract/agent-session-params.tssrc/shared/rpc-contract/ai-vault-params.tssrc/shared/rpc-contract/artifacts-params.tssrc/shared/rpc-contract/automation-params.tssrc/shared/rpc-contract/browser-core-params.tssrc/shared/rpc-contract/browser-extras-params.tssrc/shared/rpc-contract/browser-params.tssrc/shared/rpc-contract/browser-screencast-params.tssrc/shared/rpc-contract/browser-tab-create-params.tssrc/shared/rpc-contract/client-events-params.tssrc/shared/rpc-contract/client-settings-params.tssrc/shared/rpc-contract/client-ui-params.tssrc/shared/rpc-contract/client-ui-workspace-filter-fields-params.tssrc/shared/rpc-contract/clipboard-params.tssrc/shared/rpc-contract/computer-params.tssrc/shared/rpc-contract/computer-schemas-params.tssrc/shared/rpc-contract/emulator-params.tssrc/shared/rpc-contract/files-mutation-params.tssrc/shared/rpc-contract/files-params.tssrc/shared/rpc-contract/files-target-params.tssrc/shared/rpc-contract/files-terminal-artifact-params.tssrc/shared/rpc-contract/folder-workspace-params.tssrc/shared/rpc-contract/git-admission-tier-params.tssrc/shared/rpc-contract/git-params.tssrc/shared/rpc-contract/github-issue-params.tssrc/shared/rpc-contract/github-issue-update-params.tssrc/shared/rpc-contract/github-project-params.tssrc/shared/rpc-contract/github-pull-request-params.tssrc/shared/rpc-contract/github-pull-request-update-params.tssrc/shared/rpc-contract/github-repo-target-params.tssrc/shared/rpc-contract/github-repo-work-item-params.tssrc/shared/rpc-contract/gitlab-params.tssrc/shared/rpc-contract/hosted-review-params.tssrc/shared/rpc-contract/jira-params.tssrc/shared/rpc-contract/linear-agent-access-params.tssrc/shared/rpc-contract/linear-issue-attribute-filter-params.tssrc/shared/rpc-contract/linear-issue-list-params.tssrc/shared/rpc-contract/linear-params.tssrc/shared/rpc-contract/linear-project-create-params.tssrc/shared/rpc-contract/native-chat-params.tssrc/shared/rpc-contract/notifications-params.tssrc/shared/rpc-contract/orchestration-federation-control-params.tssrc/shared/rpc-contract/orchestration-federation-relay-params.tssrc/shared/rpc-contract/orchestration-federation-start-params.tssrc/shared/rpc-contract/orchestration-gates-params.tssrc/shared/rpc-contract/orchestration-params.tssrc/shared/rpc-contract/orchestration-runs-mutation-request-show-params.tssrc/shared/rpc-contract/orchestration-runs-params.tssrc/shared/rpc-contract/orchestration-worker-control-params.tssrc/shared/rpc-contract/orchestration-worker-release-params.tssrc/shared/rpc-contract/orchestration-worker-release-schemas-params.tssrc/shared/rpc-contract/orchestration-worker-start-params.tssrc/shared/rpc-contract/orchestration-worker-stop-params.tssrc/shared/rpc-contract/plugins-params.tssrc/shared/rpc-contract/preflight-params.tssrc/shared/rpc-contract/project-runtime-params.tssrc/shared/rpc-contract/repo-params.tssrc/shared/rpc-contract/repo-update-params.tssrc/shared/rpc-contract/rpc-param-primitives.tssrc/shared/rpc-contract/runtime-client-capabilities-params.tssrc/shared/rpc-contract/session-tabs-params.tssrc/shared/rpc-contract/session-tabs-schemas-params.tssrc/shared/rpc-contract/skills-params.tssrc/shared/rpc-contract/speech-params.tssrc/shared/rpc-contract/ssh-params.tssrc/shared/rpc-contract/structured-agent-session-params.tssrc/shared/rpc-contract/task-resume-state-params.tssrc/shared/rpc-contract/terminal-orphan-params.tssrc/shared/rpc-contract/terminal-quick-command-params.tssrc/shared/rpc-contract/terminal-stream-params.tssrc/shared/rpc-contract/terminal-unary-params.tssrc/shared/rpc-contract/terminal-viewport-methods-params.tssrc/shared/rpc-contract/terminal-viewport-schemas-params.tssrc/shared/rpc-contract/ui-update-value-tolerance-params.tssrc/shared/rpc-contract/updater-params.tssrc/shared/rpc-contract/workspace-cleanup-ui-params.tssrc/shared/rpc-contract/workspace-ports-params.tssrc/shared/rpc-contract/worktree-create-params.tssrc/shared/rpc-contract/worktree-params.tssrc/shared/rpc-contract/worktree-visibility-defaults-params.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| export const TaskProviderIdentity = z | ||
| .custom<SharedTaskProviderIdentity>( | ||
| (value) => | ||
| value !== null && | ||
| typeof value === 'object' && | ||
| 'provider' in value && | ||
| ['github', 'gitlab', 'linear', 'jira'].includes(String(value.provider)) | ||
| ) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline src/shared/task-source-context.ts \
--items all \
--match 'TaskProviderIdentity' \
--view expanded
rg -n -C 16 \
'\b(type|interface)\s+TaskProviderIdentity\b|\bTaskProviderIdentity\b' \
src/shared/task-source-context.ts srcRepository: stablyai/orca
Length of output: 34600
Validate provider-specific fields in TaskProviderIdentity.
The schema accepts { provider: 'github' } even though GitHub identities require owner and repo; similar required fields exist for GitLab. This incomplete value can cross the RPC boundary as SharedTaskProviderIdentity. Use provider-specific object schemas.
There was a problem hiding this comment.
Correct that { provider: 'github' } passes without owner/repo — the z.custom guard only checks the discriminant. Unchanged from main (automation-schemas.ts:57), identical apart from export, so same call as the base64 one: out of scope for a move-only PR, worth its own.
There was a problem hiding this comment.
@Jinwoo-H, acknowledged. The validation gap predates this PR and the relocation does not expand its behavior.
A separate change should replace the discriminant-only z.custom guard with provider-specific schemas. Would you like me to open a follow-up issue for that work?
You are interacting with an AI system.
Mobile's only entry to the params contract is a pure `export type`, and rpc-params-contract-type-only-boundary.test.ts rejects a value import — so mobile never parses these schemas. The gate proved parity for a parse the design forbids, never ran in CI, and 88% of its probes set one field while omitting required siblings, so both sides rejected them for the wrong reason. What a type-only consumer needs is that the types resolve under mobile's zod, which `pnpm --dir mobile typecheck` already proves over all 83 contract modules. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ndows Two ways `pnpm lint` died before the catalog gate could run. It scratched in out/, which is gitignored and absent on a clean checkout, so mkdtempSync threw ENOENT; it is now created on demand. And it spawned node_modules/.bin/oxfmt, a .cmd shim on Windows that Node >= 20 refuses without shell:true — the same EINVAL that once took the oxlint gates down. resolveOxcCliInvocation generalises the fix oxlint already had: read the bin entry from the package manifest and run it under process.execPath. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
verify:rpc-params-catalog compares it byte-for-byte, so a CRLF checkout fails the gate — the same reason en-runtime-required.json and bundled-skill-guides.ts are pinned here. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Important
The parse-parity gate was dropped, but the PR's headline and its RpcParams<M> = z.output rationale still describe it as load-bearing.
Reviewed changes
- Fixed the two cross-environment generator defects —
scratchDir()nowmkdirSyncs the gitignoredout/beforemkdtempSync(the fresh-cloneENOENT), andformatted()runs oxfmt through a newresolveOxcCliInvocationhelper underprocess.execPathinstead of the Windows.cmdshim (theEINVAL). - Generalized the oxc shim resolution — extracted
resolveOxcCliInvocationinto its own module;oxlint-cli-invocation.mjsnow delegates to it, with a focused test covering the no-shim / no-shell spawn and the missing-bin error. - Pinned the generated catalog to LF —
.gitattributesmarksrpc-params-catalog.generated.tslinguist-generated+eol=lf, so the byte-for-byte drift gate survives a CRLF checkout. - Removed the host/mobile parse-parity test — deleted
rpc-params-parse-parity.test.ts(191 lines) on the grounds that mobile imports the contract type-only and never parses these schemas.
⚠️ Description and z.output soundness no longer match what landed
The deleted test carried two distinct things: the zod 4.5.4-vs-4.4.3 version-skew comparison, and the round-trip/idempotency assertion ("every accepted parse re-parses to itself") that the description cites as the proof making RpcParams<M> = z.output "a sound send-side type." Dropping the version-skew comparison is clearly right — mobile/src/transport/rpc-params-contract.ts is a pure export type, the boundary test rejects any value import, so mobile never parses these schemas and the skew is moot. But the round-trip assertion was the only thing backing the z.output decision documented in the generated catalog and in the "Send-side input type" section, and it is now gone with no replacement. The title ("gated on parse parity"), the "Parse parity is the real exit" section, the "two gates" enumeration, and the "Each gate was proven to fail" table all still describe a test this delta deleted, so the merge record is misleading.
Technical details
# Reconcile the description (and the z.output soundness claim) with the dropped gate
## Affected sites
- PR #19961 title and description — still claim "gated on parse parity", 22,772 probes, "two gates", and a proven-fail table for the deleted test.
- `src/shared/rpc-contract/rpc-params-catalog.generated.ts:1161` — the `RpcParams<M> = z.output` comment explains why `z.input` is unusable but no longer records how `z.output`'s send-side soundness is established.
## Required outcome
- Update the title/description so they reflect what actually landed (a type-only params contract, drift-gated, with no parse-parity gate).
- Either restore a bounded round-trip/idempotency assertion to keep the `z.output`-is-sound claim honest, or explicitly mark that soundness as unproven and deferred to the step-4 call-site migration (where `RpcParams<M>` first gets used to construct send values).
## Open questions for the human
- Is the round-trip soundness of `z.output` expected to be re-proven when call sites migrate in step 4, or is it acceptable to leave it asserted-by-comment until then?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Conflict in client-ui-schemas.ts: main (#19966) added dismissedUnexpectedSignoutVersion to UiUpdateFields while this branch moved UiUpdateFields to src/shared/rpc-contract/client-ui-params.ts. Kept the re-export and re-applied main's field at the schema's new home, so the signed-out-user prompt keeps its persisted dismissal field. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
createRepoUpdateSchema annotated its return as
z.ZodObject<T & { updates: z.ZodObject<z.ZodRawShape> }> and cast to match, so
z.output widened `updates` to Record<string, unknown>. That was harmless while
nothing read the type; this branch makes the catalog the params contract, so
RpcParams<'repo.update'> shipped as an open record and typed callers lost all
24 update fields. Inferring the return type restores them.
Type-only: the annotation and cast are erased, so the schema object and every
parse outcome are unchanged.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged
origin/main— the single new commit is a merge ofmaininto the branch. The net delta against the prior review is the propagation of one new persisted-UI field,dismissedUnexpectedSignoutVersion: NullableString.optional(), into the movedUiUpdateFieldsschema insrc/shared/rpc-contract/client-ui-params.ts, matching the fieldmainadded to the pre-moveclient-ui-schemas.ts. The propagation is exact (sameNullableStringtype, same position next todismissedUpdateVersion), so the method-file re-export and the shared source of truth stay in lockstep and the drift gate remains satisfied.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Kept
repo.update's named fields in its params type —createRepoUpdateSchemadropped its explicitz.ZodObject<T & { updates: z.ZodObject<z.ZodRawShape> }>return annotation (and the matchingascast) insrc/shared/rpc-contract/repo-update-params.ts, letting TypeScript infer the precise shape. The prior annotation widenedupdatesto an open record and erased all 24 named fields fromRpcParams<'repo.update'>; the inferred type restores them.
ℹ️ Type fidelity of RpcParams<M> is not pinned by any gate
This commit fixes a real regression — a widening annotation silently collapsed RpcParams<'repo.update'> to an open record — but nothing in CI would have caught it: the drift gate only compares schema object identity, the type-only boundary test only rejects value imports, and no test asserts the shape a catalogued schema produces. The fix was found by hand. Worth a sentence in the PR on whether a type-level assertion (e.g. a satisfies-style check that RpcParams<'repo.update'>['updates'] still names its fields) belongs here or is deferred until step 4 gives the type a real consumer.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The nightly orcinus-sync radar flagged a conflict every night since it was armed on 2026-09-07 (6 red runs). Resolved locally as the radar instructs and merged with a merge commit (never squash). Conflicts (5) and resolutions: - src/main/runtime/rpc/methods/client-ui-schemas.ts: upstream moved the schemas to src/shared/rpc-contract/client-ui-params.ts (stablyai#19961). Took upstream and re-added the fork's 'sftp' entry in STATIC_RIGHT_SIDEBAR_TABS. - tab-bar-surface.tsx: kept the fork's editorOnly wrapper (satellite D10) around upstream's <TabBarStaticCreateMenu/> component. - tab-drag-pointer-sensor.ts: upstream's `ended` guard first, then the fork's last-pointer recording in handleEnd. - useIpcEvents-lifecycle.test.ts: upstream's runtimeEnvironments.onStatusChanged rename plus the fork's satelliteWindow.* events. - worktree-activation.ts: fork's ActivateOtherWindowGuardOpts intersected with upstream's WorktreeActivationOptions / WorktreeActivationSurfaceSelection. Follow-ups so the fork gates pass on the merged tree: - src/shared/constants.ts: dropped the redundant `satelliteWindowSessions: []` default (the field is optional and every reader normalizes); the file is back within the max-lines budget and byte-identical to upstream. - worktree-activation-surface-caller-wiring.test.ts: registered the fork's seam file folder-workspace-initial-terminal.ts in the census. Gates on the merged tree: oxlint 0, typecheck 0, verify-orcinus-identity OK, fork contract tests + tests covering the conflict files green (25 files). Co-Authored-By: Claude Fable 5.1 <[email protected]>

Summary
Mobile has no typed knowledge of what any RPC method's params look like — it passes a method string and an object and hopes. The desktop host already binds a zod schema to every method through
defineMethod. This makes that binding a generated, shared source of truth.Step 2a of the mobile RPC contract plan. Params only — no readers, no result types, no descriptors, no acceptance policies, no call-site migration, and no change to the live send path.
Scale correction
The plan said 117 methods.
ALL_RPC_METHODSactually has 610. Everything here is at real scale and was done by codemod, not by hand. Estimates downstream of the 117 figure — step 4 in particular, already flagged as a placeholder — should be re-derived.What landed
config/scripts/generate-rpc-params-catalog.mjs(~190 lines). esbuild-bundles the host registry with the contract modules, maps method → params export by object identity, and pipes output throughoxfmtso bytes are stable. Wired intopnpm lintand CI.src/shared/rpc-contract/rpc-params-catalog.generated.ts: 607 entries (41params: null, 566 schema-backed, 457 distinct schemas, 20 name collisions auto-aliased). Three methods are explicitly excluded because their schemas neednode:pathor runtime orchestration modules.RepoSelectoris consolidated to one definition.Parse parity is the real exit
src/main/runtime/rpc/rpc-params-parse-parity.test.tsruns every catalogued schema through the dispatcher's compiledsafeParseand through the same module graph re-imported against mobile's pinned zod, over a corpus of omitted / absent / undefined / null / wrong-type / transformed / defaulted / unknown-key per field.22,772 probes, zero differences between zod 4.5.4 and 4.4.3. The version skew that motivated this gate does not currently produce one, and
ACCEPTED_DELTASis empty.Mobile imports are type-only, enforced
mobile/src/rpc-params-contract-type-only-boundary.test.tsrejectsimport, bareimport '…',export … from,require()and dynamicimport()of contract modules, with inline self-tests for each shape.This is load-bearing rather than stylistic:
requiredStringisz.unknown().transform(...), so a client-side parse would coerce a non-string to''instead of rejecting it — silently changing the bytes on the wire.mobile/src/transport/rpc-params-contract.tsis a pure type re-export that emits no Metro module while pulling all 83 contract modules into mobile's typecheck, which also proves the host schemas compile under zod 4.4.3.Send-side input type: settled, not half-built
z.inputis unusable as the plan anticipated —requiredStringisz.unknown().transform(...), so its inferred input admits non-strings and loses optional/default semantics. Rather than invent a derivation, this adds a round-trip assertion: every accepted parse re-parses to itself across all 22,772 probes, which makesRpcParams<M>=z.outputa sound send-side type. No input-type machinery was built.Each gate was proven to fail
'repo.hooks': null→--checkprints "is out of date", exit 1repo.hooksschema → 12 differences, test failedReview note
188 files across
src/mainandsrc/shared. Almost all of it is mechanical movement plus generated output, but the blast radius is real and larger than the earlier steps in this plan — worth reviewing as a move, not as new logic.Eleven fully-emptied modules were left as one-line re-exports rather than churning ~30 importers including tests. Deliberate, and easy to collapse later.