Repository navigation
fix(cli): remove duplicate ADB package name declaration - #9677
lifetoldme wants to merge 2 commits into
Conversation
The inline schema added in morluto#9675 redeclared packageName, so the repository no longer typechecked (TS2451 at src/cli/adbCommands.ts:46 and :48). Keep the new schema and remove the stale reference.
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: a23fc3dc9b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…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.
Address the review finding: keep adbInputSchemas.pull_adb_package.shape.package as the single domain-owned rule and remove the inline duplicate added by morluto#9675.
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
`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.
|
Thank you for this fix. 8dfc47b removed the duplicate |
Summary
mainno longer typechecks because #9675 introduced a secondpackageNamedeclaration insrc/cli/adbCommands.ts. This removes the inline duplicate and keeps the domain-derivedadbInputSchemas.pull_adb_package.shape.package, so the CLI has one owner for the package-name rule. It also restores the multi-line union formatting that the same commit changed.npm run typecheckandnpm run format:checkpass again.There is no separate issue; the failure is a compile error on current
mainate9b6c87.Problem and expected behavior
At
e9b6c87,registerAdbCommandsdeclarespackageNametwice:src/cli/adbCommands.ts:46referencesadbInputSchemas.pull_adb_package.shape.package.src/cli/adbCommands.ts:48defines an inline package-name schema added by fix(cli): align ADB package-name schemas #9675.npm run typecheckfails with twoTS2451errors. The two schemas are equivalent (min(1),max(256), the same dot-separated Java-identifier regex), so every CLI command keeps the same validation.An earlier revision of this PR kept the inline schema and removed the domain reference. The review correctly pointed out that this creates a second owner for the package-name rule, so the final diff keeps the domain-derived declaration and drops the inline copy.
The same commit also collapsed a union type at line 374 onto one line, which violates the repository's 80-column
oxfmtconfiguration.npm run format:checkreports it. Restoring the parent's formatting is part of this fix.Expected:
npm run typecheckandnpm run format:checkpass on currentmain, and the ADB CLI keeps the intended package-name schema.Change and scope
Remove the inline duplicate, keep the domain-derived declaration, and restore the multi-line union formatting. No runtime behavior changes: the removed schema was a literal copy of the retained domain rule.
Contribution scope: ordinary fix within existing boundaries; no maintainer scope decision required.
Contract and boundary impact
packageNameSchemainsrc/domain/adb/adbDeviceAnalysis.tsremains the owner viaadbInputSchemas; the changed stage is the CLI argument-schema declaration. No consumer behavior changes.Expected effects: compile-only and formatting fix; no target interaction.
Evidence and regression coverage
typechecktask. The existing ADB CLI boundary suite exercises the affected commands.e9b6c87,npm run typecheckexits 1 withTS2451atsrc/cli/adbCommands.ts(46,9)and(48,9).npm run format:checkalso reportssrc/cli/adbCommands.ts.Validation performed
npm run typecheck— failed on the base revision with the twoTS2451errors; passes on the final commit.npm run format:check— passes on the final commit; the base revision reportssrc/cli/adbCommands.ts.npm run build— 3 of 3 turbo tasks succeeded, forced with no cache hits.npm run test:local -- src/domain/analysisView/analysisView.test.ts src/process/ProcessOwnership.test.ts— 62 tests passed.npm run test:focused -- tests/boundary/cli/adbCli.test.ts— 43 tests passed.Compatibility, safety, and release
Author readiness
Human owner: @lifetoldme
Before merge
type(scope): outcome.