mirror of
https://github.com/morluto/rea.git
synced 2026-11-18 20:53:00 +00:00
fix(cli): bound advertised decimal-token schemas by the domain range (#9808)
`cliDecimalField` published the domain range on the integer branch and only the fixed `^[0-9]+$` guard on the decimal-token branch, and JSON Schema bounds do not constrain strings. A client validating raw argv text against `--schema` therefore admitted out-of-range tokens such as `--row-limit=0` or `--block-size=255` that the parser rejects with `VALIDATION_ERROR`. Publish the domain range on the token branch through the schema-constraint owner, keeping the CLI's decimal leading-zero convention and the existing parser diagnostics: the declaration is metadata, so accepted values and `too_small`/`too_big` messages are unchanged. Non-range refinements such as the power-of-two entropy block size stay parser-only, and an open-ended domain still publishes its floor. The getting-started guide states the same contract. Fixes #9348
This commit is contained in:
1 parent
41cf9654da
commit
80f533da8a
9 files changed
+338
-61
No files matched your search
@@ -55,6 +55,14 @@ relative inputs, auxiliary files or output destinations. An empty string never
|
||||
selects the working directory; use an explicit `.` when selecting that directory
|
||||
is supported by the command.
|
||||
|
||||
For a numeric option whose `--schema` also accepts decimal strings, the string
|
||||
branch carries the same numeric range as the integer branch, so a client that
|
||||
validates raw argv text rejects out-of-range tokens. Leading zeros remain
|
||||
decimal: `--row-limit=0001` means one row, while `--row-limit=0` is invalid. A
|
||||
lower bound is still published when the option has no upper bound, so only the
|
||||
ceiling stays open. Refinements that are not a range, such as requiring a
|
||||
power-of-two entropy block size, stay parser-only.
|
||||
|
||||
For example, a 334 MB Obsidian application Evidence file yields a summary view
|
||||
of about 10 KB. Replace the view with
|
||||
`{"kind": "page", "collection": "modules", "offset": 0, "limit": 32}` for a
|
||||
|
||||
Reference in new issue
Block a user