Skip to content

spec: ratify parser tolerance rules (closes #4)#5

Merged
zenprocess merged 1 commit intomainfrom
ratify-parser-tolerance
Apr 8, 2026
Merged

spec: ratify parser tolerance rules (closes #4)#5
zenprocess merged 1 commit intomainfrom
ratify-parser-tolerance

Conversation

@zenprocess
Copy link
Copy Markdown
Owner

Adds a normative "Parser tolerance rules" section to the CACP standard, resolving the interop ambiguity raised in #4.

What lands

  • Whitespace MUST toleranceSTATUS:ok, STATUS: ok, STATUS: ok, STATUS:\tok all parse identically
  • Case-insensitive field namesSTATUS / status / Status / STATus are equivalent
  • Enumerated value sets for STATUS, TESTS, BUILD (matches the additive fields already documented in the README)
  • Conformance test vector — 6 input lines that any conformant parser must collapse to the same (field, value) tuple
  • Prompt round-trip test recommendation — emitter and parser must agree

Why

The standard's whole value proposition is interop. Without explicit tolerance rules, the emitter side (system prompt) and the parser side can drift, and one production cascade was traced to exactly that — a single missing \s* in a parser regex caused a multi-release bug chain before anyone realized the spec didn't actually say which form was correct.

Closes #4.

Adds a normative section defining whitespace, case, and value tolerance
rules for CACP parsers. Resolves the interop ambiguity that allowed
emitters and parsers to diverge on whether 'STATUS: ok' (with space)
should round-trip through 'STATUS:ok' (canonical compact).

Includes:
- Whitespace tolerance MUST: space, multiple spaces, tab
- Field-name case-insensitivity MUST
- Enumerated STATUS / TESTS / BUILD value sets
- Conformance test vector (6 input lines, all parse to same tuple)
- Prompt round-trip test recommendation

Why: real production cascade traced to a single missing \s* in a parser
regex. The standard now states the rule explicitly so future
implementations can't accidentally diverge.

Closes #4.
@zenprocess zenprocess merged commit ff75f6e into main Apr 8, 2026
2 checks passed
@zenprocess zenprocess deleted the ratify-parser-tolerance branch April 8, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify parser tolerance rules in CACP wire spec — implementers diverge, causing interop bugs

1 participant