Repository navigation
fix(cli): remove duplicate ADB package schema - #9678
ShuaixinHuang wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d451e0ede9
ℹ️ 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".
| ); | ||
| const packageName = adbInputSchemas.pull_adb_package.shape.package; | ||
|
|
||
| const packageName = z |
There was a problem hiding this comment.
Keep the domain-owned package schema and remove the inline copy
This repair removes the canonical schema reference while retaining a duplicate of packageNameSchema from src/domain/adb/adbDeviceAnalysis.ts:24–31. The five package CLI commands consequently maintain their validation rules separately from the shared service and MCP contracts, although the constraints currently match. AGENTS.md requires bug fixes to resolve duplicated interpretation and “remove superseded code”; keep adbInputSchemas.pull_adb_package.shape.package and delete the redundant inline z.string() chain instead.
AGENTS.md reference: AGENTS.md:L29-L29
Useful? React with 👍 / 👎.
…quest
Two review findings, each measured on Node 24.22.1. Both were real.
**An erased TypeScript assertion hides the options object.** `http.request(({host: "h",
method: "BAD METHOD"}) as any)` throws `ERR_INVALID_HTTP_TOKEN` at runtime because the
assertion is erased, but `node.arguments[0]` is a `TSAsExpression`, so the raw
`isObjectExpression` test chose the absent second argument and returned false before the
unwrap. The first argument is now unwrapped before the slot is chosen.
**A leading spread shifts the options slot.** `http.request(...[{host, path}, () => {}],
{method: "BAD METHOD"})` spreads the options and the callback into the two runtime slots and
ignores the trailing object, so Node builds a GET request — measured on Node 24.22.1, it
returns OK. This branch inspected that trailing object and dropped a real request. A spread
argument now leaves the position unresolved and keeps the request.
18 cases; the two new ones fail against the pre-fix file and pass here.
`src/domain/javascript`: 5402 to 5404 passing.
`tsc`, `lint` and `build` still fail only on the pre-existing `adbCommands.ts` duplicate
`packageName`, which `main` has and `morluto#9677`/`morluto#9678` fix.
|
Superseded by the merged #9675, which already aligns the ADB package-name schemas with the runtime contract. |
`http.request` and `https.request` validate `options.path` before they build the request, so a literal carrying an unescaped character throws `ERR_UNESCAPED_CHARACTERS` from the call itself and no request exists. The analysis reported one anyway. The accepted set was measured rather than guessed: every ASCII code point was placed inside a literal path on Node 24.22.1 and exactly `0x00`-`0x20` are refused while `0x21`-`0x7f` are accepted. That makes it a closed range, not a list of known-bad characters, and three consequences follow that a hand-written list would get wrong: | `options.path` | outcome | | --- | --- | | `"/a b"`, `" "`, `"\t"`, `"\n"`, `"\u0000"` | THREW `ERR_UNESCAPED_CHARACTERS` | | `"/a%20b"` | request constructed — the escape is what the literal above should have been | | `"/aéb"` | request constructed — non-ASCII is inside the accepted range | | `""` | request constructed — Node reads it as "not given" and falls back to `/` | `fetch` reads a different member and validates no path. A spread argument or a binding leaves the answer to the runtime, the same rule the sibling overload-slot readers use. 14 cases, 7 failing before this commit. `src/domain/javascript`: 5372 to 5386 passing. `tsc` reports only the pre-existing `adbCommands.ts` duplicate `packageName`, which `main` already has and `morluto#9677`/`morluto#9678` fix.
…quest
Two review findings, each measured on Node 24.22.1. Both were real.
**An erased TypeScript assertion hides the options object.** `http.request(({host: "h",
method: "BAD METHOD"}) as any)` throws `ERR_INVALID_HTTP_TOKEN` at runtime because the
assertion is erased, but `node.arguments[0]` is a `TSAsExpression`, so the raw
`isObjectExpression` test chose the absent second argument and returned false before the
unwrap. The first argument is now unwrapped before the slot is chosen.
**A leading spread shifts the options slot.** `http.request(...[{host, path}, () => {}],
{method: "BAD METHOD"})` spreads the options and the callback into the two runtime slots and
ignores the trailing object, so Node builds a GET request — measured on Node 24.22.1, it
returns OK. This branch inspected that trailing object and dropped a real request. A spread
argument now leaves the position unresolved and keeps the request.
18 cases; the two new ones fail against the pre-fix file and pass here.
`src/domain/javascript`: 5402 to 5404 passing.
`tsc`, `lint` and `build` still fail only on the pre-existing `adbCommands.ts` duplicate
`packageName`, which `main` has and `morluto#9677`/`morluto#9678` fix.
`http.request` and `https.request` validate `options.path` before they build the request, so a literal carrying an unescaped character throws `ERR_UNESCAPED_CHARACTERS` from the call itself and no request exists. The analysis reported one anyway. The accepted set was measured rather than guessed: every ASCII code point was placed inside a literal path on Node 24.22.1 and exactly `0x00`-`0x20` are refused while `0x21`-`0x7f` are accepted. That makes it a closed range, not a list of known-bad characters, and three consequences follow that a hand-written list would get wrong: | `options.path` | outcome | | --- | --- | | `"/a b"`, `" "`, `"\t"`, `"\n"`, `"\u0000"` | THREW `ERR_UNESCAPED_CHARACTERS` | | `"/a%20b"` | request constructed — the escape is what the literal above should have been | | `"/aéb"` | request constructed — non-ASCII is inside the accepted range | | `""` | request constructed — Node reads it as "not given" and falls back to `/` | `fetch` reads a different member and validates no path. A spread argument or a binding leaves the answer to the runtime, the same rule the sibling overload-slot readers use. 14 cases, 7 failing before this commit. `src/domain/javascript`: 5372 to 5386 passing. `tsc` reports only the pre-existing `adbCommands.ts` duplicate `packageName`, which `main` already has and `morluto#9677`/`morluto#9678` fix.
…quest
Two review findings, each measured on Node 24.22.1. Both were real.
**An erased TypeScript assertion hides the options object.** `http.request(({host: "h",
method: "BAD METHOD"}) as any)` throws `ERR_INVALID_HTTP_TOKEN` at runtime because the
assertion is erased, but `node.arguments[0]` is a `TSAsExpression`, so the raw
`isObjectExpression` test chose the absent second argument and returned false before the
unwrap. The first argument is now unwrapped before the slot is chosen.
**A leading spread shifts the options slot.** `http.request(...[{host, path}, () => {}],
{method: "BAD METHOD"})` spreads the options and the callback into the two runtime slots and
ignores the trailing object, so Node builds a GET request — measured on Node 24.22.1, it
returns OK. This branch inspected that trailing object and dropped a real request. A spread
argument now leaves the position unresolved and keeps the request.
18 cases; the two new ones fail against the pre-fix file and pass here.
`src/domain/javascript`: 5402 to 5404 passing.
`tsc`, `lint` and `build` still fail only on the pre-existing `adbCommands.ts` duplicate
`packageName`, which `main` has and `morluto#9677`/`morluto#9678` fix.
`http.request` and `https.request` validate `options.path` before they build the request, so a literal carrying an unescaped character throws `ERR_UNESCAPED_CHARACTERS` from the call itself and no request exists. The analysis reported one anyway. The accepted set was measured rather than guessed: every ASCII code point was placed inside a literal path on Node 24.22.1 and exactly `0x00`-`0x20` are refused while `0x21`-`0x7f` are accepted. That makes it a closed range, not a list of known-bad characters, and three consequences follow that a hand-written list would get wrong: | `options.path` | outcome | | --- | --- | | `"/a b"`, `" "`, `"\t"`, `"\n"`, `"\u0000"` | THREW `ERR_UNESCAPED_CHARACTERS` | | `"/a%20b"` | request constructed — the escape is what the literal above should have been | | `"/aéb"` | request constructed — non-ASCII is inside the accepted range | | `""` | request constructed — Node reads it as "not given" and falls back to `/` | `fetch` reads a different member and validates no path. A spread argument or a binding leaves the answer to the runtime, the same rule the sibling overload-slot readers use. 14 cases, 7 failing before this commit. `src/domain/javascript`: 5372 to 5386 passing. `tsc` reports only the pre-existing `adbCommands.ts` duplicate `packageName`, which `main` already has and `morluto#9677`/`morluto#9678` fix.
Summary
Follow-up to #9675. The merged ADB package-name schema change left two
const packageNamedeclarations insrc/cli/adbCommands.ts, so the currentmainbranch fails TypeScript compilation before tests run.Change
Remove the stale declaration and keep the validated dot-separated Java-identifier schema used by the ADB CLI commands. This is a one-file CLI-only repair; runtime behavior and the package-name contract remain unchanged.
Validation
npm run test:focused -- tests/boundary/mcp/sourcePublicationComposed.test.ts— 12 tests passed.npm run check:fast— typecheck and lint passed.check:fastsuccessfully.Contract and scope
Author readiness
Human owner: @ShuaixinHuang
Before merge
type(scope): outcome.