Repository navigation
Description
Context
FastLED's migration branch now routes reusable filesystem, HTTP, archive, terminal, TOML, C++ analysis, JSON, and tool-output parsing through kernal-api. Its only direct Rust dependencies are clap and anyhow.
The remaining CLI declaration is in crates/fastled-cli/src/cli.rs: it has two subcommand trees, about 30 flags, value enums, optional values, repeated options, conflict/requires rules, defaults, grouped help, and hidden internal flags. The current kernal-api manifest has no command-schema capability and no clap dependency. Replacing this with a product-local parser would retain generic parsing mechanics in the app and make cross-repository reuse harder.
Proposal
Add an opt-in command-schema capability that privately adapts one exact parser backend while exposing only facade-owned schema, parsed values, diagnostics, and rendering. It must support declarative commands/subcommands; positionals; long options; string, bool, finite floating-point, and bounded unsigned values; enums; optional values with defaults; repeated values; conflicts/requires; hidden flags; and deterministic help/version output.
Do not re-export Clap types, derives, traits, or errors. Applications retain their command names, field mapping, business validation, filesystem/network effects, and compatibility tests. Default kernal-api users must not resolve the parser backend.
Acceptance criteria
- RED: a focused kernel test demonstrates that the missing facade cannot express FastLED's command shape; then implementation turns it GREEN.
- The public API uses facade-owned values/errors and exposes no parser-backend type, trait, macro, or derive contract.
- Explicit source byte, argument count, option value byte, and repeated-value limits are applied before unbounded allocation; diagnostics do not echo unrestricted input.
- Contract tests cover FastLED-equivalent nested subcommands,
--option=value, separate option values, defaults, optional option values, repeated strings, enum rejection, non-finite float rejection, unsigned-range rejection, conflicts/requires, hidden flags, unknown options, and--handling. - Help/version rendering is stable under documented rules; no promise of byte identity with Clap unless tests establish it.
- The backend is feature-gated and absent from the default dependency graph; strict Clippy and supported-target checks pass.
- FastLED adopts the facade through an application-owned mapping, removes direct
clap, retains CLI behavior tests and real WASM compile validation, and consumes a verified exact published kernal-api release before removing its migration patch.
Decisions
- Priority P2: it is the final reusable direct dependency but CLI behavior is a large compatibility surface.
- Scope is a bounded declarative command schema, not a universal argument DSL, shell parser, process launcher, or configuration framework.
- Keep
anyhowseparate: it is application error composition, while this issue owns only generic CLI mechanics. - Use the existing parser behavior as the initial compatibility oracle; applications should not receive the backend as their public API.
- Related FastLED migration work is tracked by Rebase FastLED infrastructure onto kernal-api FastLED/cli#242.
Open questions
- Whether the facade needs a builder-only API or a supported macro layer should be settled by the smallest implementation that preserves backend isolation and FastLED's testable schema.
Activity
feat(command): support option relations and repeats
feat(command): add positional schema values
feat(command): parse bounded numeric scalars
feat(command): render facade-owned help
fix(command): reject non-finite floating values
feat(command): support hidden options
feat(command): render facade-owned version text
refactor(cli): model primary grammar with kernal-api
fix(command): distinguish explicit options from defaults
refactor(cli): map primary arguments through kernal-api
feat(command): preserve declared native path values
refactor(cli): remove direct clap dependency
refactor(cli): model primary grammar with kernal-api
refactor(cli): map primary arguments through kernal-api
refactor(cli): remove direct clap dependency
feat(command): add bounded command schema foundation (#216)
feat(command): add bounded schema facade
feat(command): support option relations and repeats
feat(command): add positional schema values
feat(command): parse bounded numeric scalars
feat(command): render facade-owned help
fix(command): reject non-finite floating values
feat(command): support hidden options
feat(command): render facade-owned version text
fix(command): distinguish explicit options from defaults
feat(command): preserve declared native path values
feat: rebase application foundations onto kernal-api (#220)
zackees commentedon Sep 16, 2026
Complete and adopted on both sides; closing with the evidence rather than leaving it open.
kernal-api — gated behind
command-schema, implemented insrc/command.rs. withtests/command_schema_contract.rsas its contract tests. It landed with #220's application-foundations rebase.FastLED — adopted through the pinned release tag: crates/fastled-cli/src/cli.rs:
use kernal_api::command::{Command as SchemaCommand, OptionSpec, ValueKind};🤖 Generated with Claude Code