Skip to content

fix(cli): describe universal Mach-O slice selection without a single-dash flag - #14912

Merged
morluto merged 2 commits into
mainfrom
fix/cli-universal-slice-help
Nov 27, 2026
Merged

morluto merged 2 commits into
mainfrom
fix/cli-universal-slice-help

Conversation

@morluto

@morluto morluto commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Summary

main fails tests/boundary/cli/cliOptionAliases.test.ts ("register only single-character short flags"). The --architecture help of four commands says "as lipo -thin does". CLI help must never show a multi-letter single-dash spelling, because the CLI parses -abc as stacked one-letter flags. The test was skipped by CI selection on the #14881 merge, so it shows up on later PRs whose selection includes the CLI boundary shard. For example, #14895 fails "Test shard (6/12)" and "Portable tests" on its merge with main.

No issue is linked. This is a red main test introduced by #14881's help text.

Problem and expected behavior

  • Trigger: rea inspect-dwarf-units --help, inspect-go-binary --help, inspect-native-initializers --help and inspect-rust-binary --help each print -thin.
  • Violated invariant: help advertises no multi-letter -flag spelling.
  • Expected: these help texts describe the slice rule without one.

Change and scope

The four options each carried their own copy of the slice help, in two variants. inspect-dwarf-units omitted the same-family subtype rule that its selection, selectMachoTarget, applies like the others.

They now share one description, UNIVERSAL_SLICE_ARCHITECTURE_HELP in src/cli/universalSliceOption.ts. It names lipo without the flag spelling: "the same match lipo uses when it thins a file". No behavior change beyond help text.

Not changed: the MCP schema description in src/domain/apple/machoTargetSelection.ts and the guides, which quote lipo -thin in code spans. Neither is CLI help, and the test does not cover them.

Contract and boundary impact

  • Semantic owner and earliest changed stage: CLI option help, src/cli/universalSliceOption.ts. It replaces four duplicated strings in binaryDiagnosticsCommands.ts, goCommands.ts and rustCommands.ts.
  • Contribution scope fit and linked maintainer decision: not applicable, help-text fix within existing boundaries.
  • CLI and MCP/tool-catalog contract: CLI --help text for four commands only. MCP is unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: none. The existing cliOptionAliases.test.ts is the regression.
  • Base reproduction or other evidence: on origin/main (2e59f08), with build:cached run first, npm run test:focused -- tests/boundary/cli/cliOptionAliases.test.ts fails. It reports inspect-dwarf-units help: -thin, inspect-go-binary help: -thin, inspect-native-initializers help: -thin and inspect-rust-binary help: -thin. With this change it passes.
  • User-visible CLI/MCP output (if applicable): --architecture now reads "Slice to read from a universal Mach-O, by CPU family; arm64e and arm64e.x1 read only a slice of that subtype, the same match lipo uses when it thins a file; when several slices share a family, arm64 (arm64 or arm64v8) or x86_64 names the subtype, and a value matching several slices is refused; required for universal files".
  • Remaining proof gaps: none known.

For evidence-bearing changes: not applicable.

Validation performed

  • npm run build:cached: passed.
  • npm run test:focused -- tests/boundary/cli/cliOptionAliases.test.ts: 4 passed. The same command on unmodified main fails with the four -thin entries.
  • npm run docs:check: passed.
  • oxlint on the four touched files: no new findings. It still reports the existing max-lines warnings on binaryDiagnosticsCommands.ts.

Compatibility, safety, and release

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

Author readiness

Human owner:

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

Author checklist (completed by the PR author before requesting review)

  • 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.
  • I ran every test, build, or measurement needed to validate this change, reported a browser, GPU, or environment gap only when that runtime or hardware is unavailable, and reported the checks I ran and their results without presenting inferred correctness or speedups as measured.
  • Comments explain constraints or non-obvious decisions; task history and conversations stay out of code and docs.
  • Documentation is concise and factual, without punchy slogans or promotional language.
  • This change fixes the root cause and follows the engineering rules in AGENTS.md.
  • Formatted input is interpreted once at the owning boundary, and consumers use the owner's parsed facts. See Interpret boundary facts once.
  • Combined failures preserve partial observations, remaining resources, and cleanup facts. See Own the lifecycle.
  • A hardcoded limit is an REA_ runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.

…dash flag

Four --architecture options carried their own copy of the slice help,
in two variants, and each said "as lipo -thin does". CLI help must not
show a multi-letter single-dash spelling, because -abc parses as stacked
one-letter flags, so tests/boundary/cli/cliOptionAliases.test.ts fails
on main for inspect-dwarf-units, inspect-go-binary,
inspect-native-initializers and inspect-rust-binary.

The commands share one description, UNIVERSAL_SLICE_ARCHITECTURE_HELP,
which names lipo without the flag spelling. inspect-dwarf-units now
states the same-family subtype rule the other three already stated; its
selection uses the same selectMachoTarget rule.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 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-27T16:23:37.233228Z 2f69138 PR opened
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issues remain.RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Low impact] The PR appears safe to merge; no blocking issues remain.

Summary

The PR replaces four duplicated CLI help strings with UNIVERSAL_SLICE_ARCHITECTURE_HELP, removing the misleading -thin spelling.

  • Four Mach-O commands share a clearer architecture option description.

Reviews (3) · Last reviewed commit: "docs(cli): name the slice selection owne..." · Reviewed by Greptile

Comment thread src/cli/universalSliceOption.ts Resolved
@morluto
morluto merged commit 3097263 into main Nov 27, 2026
4 checks passed
@morluto
morluto deleted the fix/cli-universal-slice-help branch November 27, 2026 16:39
vincentkoc added a commit that referenced this pull request Nov 27, 2026
…pgp-633-20261127

* commit '3097263763611eb0c32c502d5a222060cf02f468':
  fix(cli): describe universal Mach-O slice selection without a single-dash flag (#14912)
  fix(iso9660): read Joliet trees whose .. records name their own directory (#14817)
  feat(gpu)!: add per-call object, work, report, metadata, structure, and parser budgets to inspect_gpu_code_objects (#14882)
  fix(macho)!: select arm64e.x1 slices of universal Mach-O files by exact subtype (#14881)
  refactor(views): share bounded parent and report limitations (#14902)
  refactor(desktop): share XML parent pointers in task drafts (#14905)
  feat(ghidra): define function-pointer members and typedefs (#14889)
  refactor(setup): share publication destination checks (#14904)
  perf(ci): skip unused test runtime uploads (#14903)
  fix(nuget): preserve explicitly spaced publisher metadata (#14906)
  fix(artifacts): keep uImage coverage unknown when bytes follow the declared payload (#14896)
  fix(artifacts): report incomplete Android sparse coverage (#14883)
  fix(tar): require both end-of-archive blocks for complete coverage (#14884)
  refactor(views): centralize indexed row paging (#14878)
  refactor(views): reuse optional filters in report projections (#14877)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant