From ab20f4ffe6f159b8a9dffa5cc4f98b150fd82ef5 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Mon, 14 Sep 2026 15:19:37 -0400 Subject: [PATCH] docs(mobile): drop the key-order claim from the PR param builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The oracle does not observe param key order: `captureValue` in recording-values.ts sorts keys, and no golden carries a raw frame string, so "the sender recordings pin the bytes" was not a fact the evidence supports. The assertion stays for the reason already in the doc — the builder is method-generic and returns a record. `GitHubPrParamOptions` goes back to private; nothing outside the module names it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- mobile/src/session/github-pr-repo-slug.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mobile/src/session/github-pr-repo-slug.ts b/mobile/src/session/github-pr-repo-slug.ts index b1d5eb6d876..85a7e0f5501 100644 --- a/mobile/src/session/github-pr-repo-slug.ts +++ b/mobile/src/session/github-pr-repo-slug.ts @@ -40,7 +40,7 @@ const METHODS_ACCEPTING_PR_REPO = new Set([ // does not), so headSha is forwarded just to that read. Check runs are commit-keyed. const METHODS_ACCEPTING_HEAD_SHA = new Set(['github.prChecks']) -export type GitHubPrParamOptions = { +type GitHubPrParamOptions = { prRepo?: GitHubPrRepoSlug | null headSha?: string | null } @@ -66,12 +66,8 @@ export function buildGithubPrParams( /** * The same record, presented as one method's send params — the single seam where the PR surface's - * record-shaped builder meets the typed operations. - * - * The builder cannot be typed per method: `repo` is prepended and `prRepo`/`headSha` appended from - * an allow-list, so the key order is a property of the builder rather than of any call site, and - * the wire payload is recorded as JSON with that order intact. Writing each call site's literal - * instead would reorder the bytes. One assertion here rather than one per wrapper. + * record-shaped builder meets the typed operations. The builder is method-generic and returns a + * record, so it cannot be typed per method; one assertion here rather than one per wrapper. */ export function githubPrRequestParams( method: Method, @@ -79,6 +75,6 @@ export function githubPrRequestParams( params: Record, options?: GitHubPrParamOptions ): RpcSendParams { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the caller supplies the method's own declared fields; this adds only `repo`, and `prRepo`/`headSha` for the methods whose schema declares them. The sender recordings pin the bytes. + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the caller supplies the method's own declared fields; this adds only `repo`, and `prRepo`/`headSha` for the methods whose schema declares them. return buildGithubPrParams(method, worktreeId, params, options) as RpcSendParams }