[PR #3231] [CLOSED] fix(cli): advertise the nonnegative outline depth the parser enforces #5660

Closed
opened 2026-10-31 01:08:21 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3231
Author: @gongfpp
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/3211-outline-depth-schema-minimum


📝 Commits (2)

  • 5642832 fix(cli): advertise the nonnegative outline depth the parser enforces
  • 9c462a5 Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

3 files changed (+36 additions, -2 deletions)

View changed files

📝 src/cli/utilityCommands.ts (+1 -1)
📝 src/hopper/LinuxPrivateDisplayDiagnostic.ts (+1 -1)
📝 tests/boundary/cli/cliInputSchemaRequired.test.ts (+34 -0)

📄 Description

Summary

import-reference-source --schema advertised outlineDepth with minimum: -9007199254740991, while the command rejected -1 with Too small: expected number to be >=0. A consumer selecting arguments from the machine-readable schema could therefore submit a value the command refuses.

Refs #3211. The published constraint now matches the parser.

Problem and expected behavior

The parser chain stated .nonnegative() before .safe(). Zod's .safe() carries the safe-integer range and replaces the lower bound, so the published JSON Schema lost the nonnegative constraint while runtime validation, which applies both checks, kept it.

docs/cli.md documents --outline-depth as a nonnegative safe integer that requires --detail summary. Expected: the published schema states minimum: 0 and keeps maximum: 9007199254740991; negative depths keep failing runtime validation; the depth controls and the paired-option restriction keep their behavior.

Change and scope

  • src/cli/utilityCommands.ts: the outlineDepth chain is reordered to .int().safe().nonnegative(). The parsed values are unchanged; only the published lower bound changes from -9007199254740991 to 0.
  • src/hopper/LinuxPrivateDisplayDiagnostic.ts: the same ordering in xvfb_stderr_bytes is corrected with it, since that field carried the identical loss.
  • tests/boundary/cli/cliInputSchemaRequired.test.ts: a focused regression asserts the advertised bounds, validates the advertised schema with AJV, and checks the parser keeps the same lower bound.

Intentionally not included: no change to the command's runtime validation, to docs/cli.md, or to any other option.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the CLI option contract in utilityCommands.ts; the published schema and the parser share it.
  • Contribution scope fit: ordinary fix inside existing boundaries.
  • CLI and MCP/tool-catalog contract: the import-reference-source option schema gains minimum: 0; no option, name, default or parsed value changes.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.

Expected effects (check known effects; use documentation-only on its own).

  • 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: tests/boundary/cli/cliInputSchemaRequired.test.ts gains one focused case for import-reference-source; it fails against the previous ordering and passes with the fix.
  • Base reproduction: the issue's --schema --json and --outline-depth -1 commands reproduce the mismatch on the pre-change revision.
  • User-visible CLI/MCP output: the advertised option schema now states the lower bound the command enforces.
  • Remaining proof gaps: no real provider run is involved; the private-display field is covered by its existing boundary tests rather than a new one.

Validation performed

  • npx vitest run --project cli-boundary tests/boundary/cli/cliInputSchemaRequired.test.ts — 5 passed
  • npx vitest run --project boundary tests/boundary/providers/hopper/{linuxPrivateDisplay,hopperClient.startupFailures,bridgeLauncher}.test.ts — 39 passed
  • npx tsc --noEmit — clean
  • npx oxfmt --check <changed files> — correct format
  • npx oxlint <changed files> — 0 errors

Compatibility, safety, and release

  • Breaking changes or migration steps: none. The change narrows the advertised range to the range the command already enforced.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; option contracts only.
  • Package or release metadata impact: none. The generated catalog is not edited here.
  • Security, privacy, process, or containment review: none.

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3231 **Author:** [@gongfpp](https://github.com/gongfpp) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/3211-outline-depth-schema-minimum` --- ### 📝 Commits (2) - [`5642832`](https://github.com/morluto/rea/commit/5642832bae8d3a7936717dbde4bb6748349cf261) fix(cli): advertise the nonnegative outline depth the parser enforces - [`9c462a5`](https://github.com/morluto/rea/commit/9c462a5343056cf90ad025af96f00b9c870e6599) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **3 files changed** (+36 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/utilityCommands.ts` (+1 -1) 📝 `src/hopper/LinuxPrivateDisplayDiagnostic.ts` (+1 -1) 📝 `tests/boundary/cli/cliInputSchemaRequired.test.ts` (+34 -0) </details> ### 📄 Description ## Summary `import-reference-source --schema` advertised `outlineDepth` with `minimum: -9007199254740991`, while the command rejected `-1` with `Too small: expected number to be >=0`. A consumer selecting arguments from the machine-readable schema could therefore submit a value the command refuses. Refs #3211. The published constraint now matches the parser. ## Problem and expected behavior The parser chain stated `.nonnegative()` before `.safe()`. Zod's `.safe()` carries the safe-integer range and replaces the lower bound, so the published JSON Schema lost the nonnegative constraint while runtime validation, which applies both checks, kept it. `docs/cli.md` documents `--outline-depth` as a nonnegative safe integer that requires `--detail summary`. Expected: the published schema states `minimum: 0` and keeps `maximum: 9007199254740991`; negative depths keep failing runtime validation; the depth controls and the paired-option restriction keep their behavior. ## Change and scope - `src/cli/utilityCommands.ts`: the `outlineDepth` chain is reordered to `.int().safe().nonnegative()`. The parsed values are unchanged; only the published lower bound changes from `-9007199254740991` to `0`. - `src/hopper/LinuxPrivateDisplayDiagnostic.ts`: the same ordering in `xvfb_stderr_bytes` is corrected with it, since that field carried the identical loss. - `tests/boundary/cli/cliInputSchemaRequired.test.ts`: a focused regression asserts the advertised bounds, validates the advertised schema with AJV, and checks the parser keeps the same lower bound. Intentionally not included: no change to the command's runtime validation, to `docs/cli.md`, or to any other option. ## Contract and boundary impact - Semantic owner and earliest changed stage: the CLI option contract in `utilityCommands.ts`; the published schema and the parser share it. - Contribution scope fit: ordinary fix inside existing boundaries. - CLI and MCP/tool-catalog contract: the `import-reference-source` option schema gains `minimum: 0`; no option, name, default or parsed value changes. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. Expected effects (check known effects; use documentation-only on its own). - [x] 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: `tests/boundary/cli/cliInputSchemaRequired.test.ts` gains one focused case for `import-reference-source`; it fails against the previous ordering and passes with the fix. - Base reproduction: the issue's `--schema --json` and `--outline-depth -1` commands reproduce the mismatch on the pre-change revision. - User-visible CLI/MCP output: the advertised option schema now states the lower bound the command enforces. - Remaining proof gaps: no real provider run is involved; the private-display field is covered by its existing boundary tests rather than a new one. ## Validation performed - `npx vitest run --project cli-boundary tests/boundary/cli/cliInputSchemaRequired.test.ts` — 5 passed - `npx vitest run --project boundary tests/boundary/providers/hopper/{linuxPrivateDisplay,hopperClient.startupFailures,bridgeLauncher}.test.ts` — 39 passed - `npx tsc --noEmit` — clean - `npx oxfmt --check <changed files>` — correct format - `npx oxlint <changed files>` — 0 errors ## Compatibility, safety, and release - Breaking changes or migration steps: none. The change narrows the advertised range to the range the command already enforced. - Real Hopper/Ghidra, browser, or OS coverage: not applicable; option contracts only. - Package or release metadata impact: none. The generated catalog is not edited here. - Security, privacy, process, or containment review: none. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5660
No description provided.