Skip to content

feat(arguments): bounded POSIX word parsing for tool output #202

Closed

Description

@zackees

Coordinated with FastLED/cli#242. The app uses shell_words::split only for em++ --cflags output (wasm_build.rs:494); command creation already belongs to the kernel. Add a feature-gated semantic arguments::parse_posix capability with private exact shell-words backend, standard owned strings and facade-owned errors. Preserve quoting, escapes, empty words, comments and literal expansion syntax without invoking a shell. Bound source bytes before backend allocation and output word count; reject NUL explicitly. No Windows command-line syntax claim, variable/glob/command expansion, new runtime or public backend types.

Acceptance: missing-API RED then quoting/limits/error GREEN; generic tests upstream; default graph excludes optional backend; strict Clippy and supported-target checks. App adoption must retain cache and empty-cflags policy locally, remove direct shell-words, and run a real WASM build because it touches native build code. Decisions: 1 MiB maximum input and 16384 output words, with typed errors rather than truncation. Source length bounds parser allocation even when output word count is rejected after parsing.

Activity

  1. zackees commented on Sep 16, 2026

    @zackees
    CollaboratorAuthor

    Complete and adopted on both sides; closing with the evidence rather than leaving it open.

    kernal-api — gated behind command-arguments, implemented in src/arguments.rs. with tests/posix_arguments.rs as its contract tests. It landed with #220's application-foundations rebase.

    FastLED — adopted through the pinned release tag: crates/fastled-cli/src/wasm_build.rs: kernal_api::arguments::parse_posix(stdout.trim()).context("parse em++ --cflags output")?

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions