Skip to content

fix(cli): remove duplicate ADB package schema - #9678

Closed
ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/duplicate-adb-package-schema
Closed

ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/duplicate-adb-package-schema

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #9675. The merged ADB package-name schema change left two const packageName declarations in src/cli/adbCommands.ts, so the current main branch 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.
  • The pre-push hook ran check:fast successfully.

Contract and scope

  • Semantic owner: CLI schema declaration.
  • Scope fit: routine regression repair; no new provider or target authority.
  • CLI/MCP contract: restores compilation; package-name validation remains unchanged.
  • Runtime/provider/evidence/package impact: none.

Author readiness

Human owner: @ShuaixinHuang

  • 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.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review November 9, 2026 15:58
@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-09T16:01:41.868889Z d451e0e Draft marked ready
ℹ️ 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: 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".

Comment thread src/cli/adbCommands.ts
);
const packageName = adbInputSchemas.pull_adb_package.shape.package;

const packageName = z

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

Copy link
Copy Markdown
Contributor Author

Superseded by the merged #9675, which already aligns the ADB package-name schemas with the runtime contract.

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 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