spec: ratify parser tolerance rules (closes #4)#5
Merged
zenprocess merged 1 commit intomainfrom Apr 8, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a normative "Parser tolerance rules" section to the CACP standard, resolving the interop ambiguity raised in #4.
What lands
STATUS:ok,STATUS: ok,STATUS: ok,STATUS:\tokall parse identicallySTATUS/status/Status/STATusare equivalentSTATUS,TESTS,BUILD(matches the additive fields already documented in the README)(field, value)tupleWhy
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.