Skip to content

docs: clarify directive grammar and semantic boundaries#195

Merged
rlippmann merged 1 commit into
mainfrom
grammar-audit
Jul 22, 2026
Merged

docs: clarify directive grammar and semantic boundaries#195
rlippmann merged 1 commit into
mainfrom
grammar-audit

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

What changed

  • Updated the normative directive grammar specification to make the syntax/semantics boundary explicit:
    • canonical parsing happens before semantic evaluation;
    • directive-shaped invalid input is outside the canonical language;
    • clarify applies only after a successful canonical parse when semantic evaluation requires clarification.
  • Updated README and API documentation to align with the canonical directive model:
    • removed wording that implied malformed grammar flows into clarification;
    • removed stale pending-confirmation language from the core boundary documentation.
  • Defined normative policy identity semantics:
    • separated parsed operand text from canonical policy identity;
    • clarified that policy identity is a semantic evaluation concern, not a parsing concern;
    • documented representation-level identity rules separately from language interpretation.
  • Clarified the policy identity contract:
    • Unicode normalization, apostrophe-character normalization, case folding, and whitespace normalization are representation canonicalization;
    • article removal, spelling correction, contraction expansion, dontdon't, synonym matching, and natural-language equivalence are not core identity rules.
  • Clarified premise handling:
    • premise values are semantically opaque strings with representation-level sanitation only;
    • premise values do not use policy-item identity rules.

Why

  • The previous documentation mixed grammar recognition, semantic clarification, and historical pending-confirmation behavior.
  • Core needs a deterministic canonical language boundary:
    • parse canonical directives first;
    • evaluate their meaning second.
  • Policy identity behavior was previously implied through implementation details rather than explicitly defined by the specification.
  • This update establishes the contract needed for future validator/conformance work and keeps language-level interpretation outside the compiler core.

Related:

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann
rlippmann merged commit e6f812a into main Jul 22, 2026
18 checks passed
@rlippmann
rlippmann deleted the grammar-audit branch July 22, 2026 07:28
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.

1 participant