Skip to content

manifest quoting/comment handling diverges from SPEC - SPEC’s own quoting example is rejected, quoted fields starting with # are treated as comments, single quotes unsupported #213

Description

@eljulians

Component: crates/core (parser.rs) + SPEC.md | Severity: Low-Medium | Status: Code-traced (unit-replicable)

SPEC §Quoting claims "POSIX shell quoting rules (shlex)" and §Inline Comments claims a # inside a quoted field is never a comment. The implementation:

  1. Only double quotes are recognized; single-quoted fields keep their quotes (then fail name validation or become literal path chars).
  2. strip_inline_comment runs AFTER quotes are stripped and drops any field that starts with # - so local skill x "#drafts/skill.md" loses the path field (treated as a comment), violating the SPEC rule.
  3. SPEC's own example line local skill "my skills/git commit.md" is rejected at parse time: the inferred name "git commit" contains a space → "invalid name … skipping". The spec example cannot work as written (explicit-name variants do).

Where: crates/core/src/parser.rs:53-71 (split_line), :73-79 (strip_inline_comment), :36-41 + :342-359 (name validation applied to the inferred spaced name); SPEC.md §Quoting/§Inline Comments/§Local example.

Repro (unit): parse_manifest_line("local skill \"#drafts/skill.md\"") → None/too-few-fields; parse_manifest over SPEC's example line → 0 entries + invalid-name warning.

Expected: parser and SPEC agree - either implement quote-aware comment stripping (track quoted-ness per token) + document "double quotes only", and fix the SPEC example to use an explicit name; or implement the documented shlex behavior.
Actual: three silent divergences.

Fix sketch: carry a was_quoted flag per token out of split_line; strip_inline_comment skips quoted tokens. Update SPEC (single quotes unsupported; example gains an explicit name, since spaced names are invalid by the name rule).

Tests: unit in parser.rs: quoted-# field preserved; SPEC example line parses (after SPEC correction, with explicit name); single-quote behavior documented by a test either way.

Activity

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

    bugSomething isn't workingcomponent: manifestSkillfile parsing, formatting, serialization, validation, and name ruleshelp wantedExtra attention is neededseverity: low-mediumLow-medium severity bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions