Repository navigation
test(cli): report CLI fields that admit values their contract refuses - #10575
Conversation
For every CLI command that reaches an MCP contract, compare each name-matched CLI field with its contract field on empty, NUL, caller-relative host path and numeric argv spellings. The 16 mismatches on main are recorded in a baseline with a counted ceiling that can only go down: a new mismatch fails, and so does a listed one that no longer occurs.
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. |
[Medium impact] The PR appears safe to merge; no new actionable issue was found. SummaryAdds a CLI-to-contract field check, shares command aliases, and lets both web trace commands resolve relative caller paths.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI[Registered CLI fields] --> Match[Match command and field names]
Contracts[Tool contracts] --> Match
Match --> Probes[Probe field admission]
Probes --> Compare[Compare parsed values]
Compare --> Baseline[Reject unrecorded or stale differences]
Reviews (8) · Last reviewed commit: "Merge branch 'main' into test/cli-contra..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6af13e2961
ℹ️ 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".
Numeric probes no longer require the contract to admit 0 or 1, so ranged fields such as inspect-byte-entropy --block-size (256..65536) are compared, with probes just past each declared bound.
…Windows spellings The relative-path CLI arguments lost their contract descriptions; they now describe the caller-relative resolution. absoluteCallerPath renders native separators on Windows, so the web trace acceptance tests use native manifest paths for CLI and MCP parity.
The CLI renders caller paths with native separators through absoluteCallerPath; MCP keeps the caller's spelling. The web trace parity tests now also call MCP with the forward-slash manifest spelling and expect the same trace with that path echoed, restoring the #1078 coverage.
|
The failing "Native package baseline (darwin arm64)" check ( |
Summary
CLI fields can admit inputs their corresponding tool contracts reject, or reject relative paths that the CLI is expected to resolve. This adds a report-only parity check for comparable fields, shares the command-to-contract mapping with the coverage test, and records known differences without allowing the baseline to silently grow.
The check probes constrained strings even when no generic valid sample is available, and compares fields shared by every branch of a union. CLI-only commands and contract shapes without a common field are explicitly accounted for. The expanded coverage exposed two web trace commands that rejected relative manifest paths; both now resolve caller paths at the CLI boundary, as does the source-map path, preserving symlink-sensitive traversal.
Validation
...npm run check:fastpassed.npm run test:focused -- tests/boundary/cli/cliContractSchemaParity.test.ts— 4 passed, baseline unchanged;npm run check:fast— passed.productCatalog.test.tsfailed without them), and the web trace acceptance tests use native manifest paths, becauseabsoluteCallerPathrenders Windows paths with native separators (the Windows lane failed on forward-slash expectations). Forward-slash Windows manifest coverage (fix(browser): normalize selected script manifest roots on Windows #1078) is kept in c5416d0: each parity test also calls MCP with the forward-slash spelling and expects the same trace with that path echoed. (CLI normalization of absolute Windows paths is deliberate, [Bug] Windows: rea analyze rejects backslash absolute paths with "Ambiguous Windows path component is unsupported" (Win32 50) #4707.)npm run test:focused -- tests/boundary/filesystem/productCatalog.test.ts tests/acceptance/webModuleCli.test.ts tests/acceptance/webSourceLocationCli.test.ts tests/boundary/cli/cliContractSchemaParity.test.ts— 23 passed on macOS; Windows not run locally.npm run check:fast— passed.No issue was filed; the gap was found during CLI contract review.
Author readiness
Human owner:
Before merge
type(scope): outcome.