Missing First-Class Data Types in Manifest (e.g., Ranges) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The ZerOS TOML manifest relies on the terminal to validate inputs before execution to provide a declarative CLI schema. However, some very common input formats are currently relegated to plain strings, which completely bypasses the terminal's ahead-of-time validation phase.
For devs: The
opencommand currently defines the--lines(or-l) option withtype = "string"to accept values like10:20or:50. Because the manifest type is just a string, the terminal's AST parser has no structural understanding of what a valid line range looks like. It cannot validate if10:20is a structurally sound range, or if the user accidentally typed10:A0.If the terminal doesn't validate it, the
openprogram is forced to parse the string and handle the error itself during execution. This directly violates the "Fail fast and loud" engineering directive and the core promise of the declarative CLI schema, which dictates that applications should receive fully validated, strongly typed structs.For users:
Without native type understanding, the shell cannot provide real-time syntax highlighting for invalid ranges (e.g., turning the text red when a letter is typed in a numeric range). Users only find out they made a typo after pressing Enter and reading an error from the application.
Test Examples
open -l 10:20 server.log(Valid range)open -l abc:def server.log(Invalid range that should be caught by the shell before the program spawns)open -l 10: server.log(Open-ended valid range)