Skip to content

feat: add public directive grammar foundation#189

Merged
rlippmann merged 2 commits into
mainfrom
grammar-boundary
Jul 17, 2026
Merged

feat: add public directive grammar foundation#189
rlippmann merged 2 commits into
mainfrom
grammar-boundary

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

What changed

  • Added the public context_compiler.grammar submodule with DirectiveKind, ValidatedDirective, validate_directive(), is_canonical_directive(), and render_directive().
  • Added a private immutable grammar registry that drives canonical validation, rendering, operand requirements, and future parser reuse without exposing engine authority semantics.
  • Added focused unit tests, public API contract coverage, language-neutral grammar behavior fixtures, and concise API documentation.
  • Preserved the existing engine parser and deferred engine migration, consumer cleanup, broader read-only conformance work, and RLock hardening to follow-up PRs.

Why

  • Establish a narrow, stable grammar boundary that downstream consumers such as the directive drafter and example integrations can reuse without duplicating canonical syntax.
  • Separate syntax ownership from engine-owned authority, clarification, mutation, and state semantics.
  • Create the foundation for migrating the engine parser to a single grammar source of truth in a focused follow-up PR.

Checklist

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

@rlippmann
rlippmann merged commit 23ee6df into main Jul 17, 2026
18 checks passed
@rlippmann
rlippmann deleted the grammar-boundary branch July 17, 2026 05:08
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