Skip to content

feat: add public directive decomposition - #219

Merged
rlippmann merged 3 commits into
mainfrom
directive_decomposition
Aug 1, 2026
Merged

feat: add public directive decomposition#219
rlippmann merged 3 commits into
mainfrom
directive_decomposition

Conversation

@rlippmann

@rlippmann rlippmann commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What changed

  • add CanonicalDirective and decompose_directive(...) to context_compiler.grammar as a public syntax-only decomposition API
  • refactor grammar validation to project from the same decomposition path so grammar has one authoritative directive interpretation
  • migrate the engine parse boundary to consume the public grammar decomposition result without changing action, clarify, or state-transition semantics
  • extend the public grammar API contract, fixture harness, and grammar conformance fixtures to cover decomposition, zero-operand directives, invalid inputs, and operand text preservation
  • clean up stale test references to the retired private parser helper name now that decompose_directive(...) is the single grammar decomposition path
  • bump the package version from 0.9.0dev2 to 0.9.0dev3 and keep uv.lock in sync
  • document that decomposition exposes canonical syntax only and preserves grammar-recognized operand text rather than semantic normalization

Why

  • external consumers need a stable way to inspect directive kind and operands for already-valid canonical directives
  • this keeps syntax inspection in the grammar layer while preserving the existing boundary where engine semantics, clarification, and state transitions remain private
  • unifying validation and engine parsing around the same grammar representation reduces drift between the public grammar surface and internal consumers
  • the follow-up cleanup removes stale references to the retired private helper so tests describe current behavior rather than historical implementation details
  • the version bump makes the expanded public grammar surface explicit in the package metadata for this release candidate

Checklist

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

@rlippmann
rlippmann marked this pull request as ready for review August 1, 2026 02:09
@rlippmann
rlippmann merged commit 5e949a6 into main Aug 1, 2026
18 checks passed
@rlippmann
rlippmann deleted the directive_decomposition branch August 1, 2026 02:10
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