Skip to content

fix(cli): remove duplicate ADB package name declaration - #9677

Closed
lifetoldme wants to merge 2 commits into
morluto:mainfrom
lifetoldme:fix/adb-package-name-redeclare
Closed

lifetoldme wants to merge 2 commits into
morluto:mainfrom
lifetoldme:fix/adb-package-name-redeclare

Conversation

@lifetoldme

@lifetoldme lifetoldme commented Nov 9, 2026 •

Copy link
Copy Markdown

Summary

main no longer typechecks because #9675 introduced a second packageName declaration in src/cli/adbCommands.ts. This removes the inline duplicate and keeps the domain-derived adbInputSchemas.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 typecheck and npm run format:check pass again.

There is no separate issue; the failure is a compile error on current main at e9b6c87.

Problem and expected behavior

At e9b6c87, registerAdbCommands declares packageName twice:

npm run typecheck fails with two TS2451 errors. 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 oxfmt configuration. npm run format:check reports it. Restoring the parent's formatting is part of this fix.

Expected: npm run typecheck and npm run format:check pass on current main, 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

  • Semantic owner and earliest changed stage: packageNameSchema in src/domain/adb/adbDeviceAnalysis.ts remains the owner via adbInputSchemas; the changed stage is the CLI argument-schema declaration. No consumer behavior changes.
  • Contribution scope fit and linked maintainer decision: ordinary fix, not applicable.
  • CLI and MCP/tool-catalog contract: unchanged. The CLI uses the same domain rule as the MCP contract.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects: compile-only and formatting fix; no target interaction.

Evidence and regression coverage

  • Tests added or updated: none. The regression is compile-time and is covered by the existing typecheck task. The existing ADB CLI boundary suite exercises the affected commands.
  • Base reproduction: at e9b6c87, npm run typecheck exits 1 with TS2451 at src/cli/adbCommands.ts(46,9) and (48,9). npm run format:check also reports src/cli/adbCommands.ts.
  • User-visible CLI/MCP output: none. Validation behavior is unchanged.
  • Remaining proof gaps: none for this change; no runtime path changes.

Validation performed

  • npm run typecheck — failed on the base revision with the two TS2451 errors; passes on the final commit.
  • npm run format:check — passes on the final commit; the base revision reports src/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

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; no provider or target path changed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @lifetoldme

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

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.
@lifetoldme
lifetoldme marked this pull request as ready for review November 9, 2026 16:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T17:31:50.398485Z 752bc2c Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread src/cli/adbCommands.ts Resolved
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 9, 2026
…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.
@lifetoldme

Copy link
Copy Markdown
Author

@codex review

I removed the inline copy and kept the domain-derived declaration in 752bc2c.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 752bc2cad2

ℹ️ 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".

XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 10, 2026
`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.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 10, 2026
…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.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 10, 2026
`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.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 10, 2026
…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.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 12, 2026
`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.
@morluto

morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Thank you for this fix. 8dfc47b removed the duplicate packageName declaration in src/cli/adbCommands.ts on main, and merging this branch into current main produces no change. Closing because nothing in this PR is left to merge.

@morluto morluto closed this Nov 15, 2026
@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants