@plurnk/plurnk-grammar 0.68.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -201,9 +201,9 @@ Errors are JSON-serializable. Shape: `{ line, column, source, message }` where `
201
201
 
202
202
  One generated [GBNF](https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md) grammar ships for llama.cpp constrained sampling, calibrated for the Fireworks/DeepSeek backend:
203
203
 
204
- - **`plurnk.gbnf` (PLAN-anchored turn)** — `root ::= preplan plan sep batch-step* send-final-any sep`. A Plurnk turn is a `*:PLAN:OPS:SEND[N]` sandwich: a FREE reasoning preamble (any text up to the first `<<PLAN`), then a MANDATORY `<<PLAN` anchoring a strict ops-only batch (bounded `WS{0,7}` separators, no free prose between), closed by exactly one terminal `SEND[102|200|202|300|499]` — structural termination (forced EOS), not an optional stop a near-greedy decoder can sail past.
204
+ - **`plurnk.gbnf` (PLAN-anchored turn)** — `root ::= preplan plan sep batch-step* send-final-any sep`. A Plurnk turn is a `*:PLAN:OPS:SEND[N]` sandwich: a FREE **op-free** reasoning preamble, then a MANDATORY `<<PLAN` anchoring a strict ops-only batch (bounded `WS{0,7}` separators, no free prose between), closed by exactly one terminal `SEND[102|200|202|300|499]` — structural termination (forced EOS), not an optional stop a near-greedy decoder can sail past.
205
205
 
206
- The preamble names **no reasoning delimiter** — it admits any text completing no `<<PLAN`. That keeps it format-agnostic across models and, crucially, never masks a model's native reasoning token: the model reasons freely (a reasoning model's CoT separates into `reasoning_content`; a non-reasoning model reasons in the `<<PLAN` body, the public statement of intent), then the mandatory `<<PLAN` anchors the strict turn. `PlurnkParser` discards everything before the first `<<PLAN`. The parser remains the permissive contract over the actionable turn: everything the grammar can generate, the parser accepts (and much it doesn't: word suffixes, richer slot internals).
206
+ The preamble names **no reasoning delimiter** — it admits any text completing no `<<OP` opener. That keeps it format-agnostic across models and never masks a model's native reasoning token: the model reasons freely (a reasoning model's CoT separates into `reasoning_content`; a non-reasoning model reasons in the `<<PLAN` body, the public statement of intent), then `<<PLAN` anchors the strict turn. The **ANTLR grammar enforces the same sandwich**: `PlurnkParser.parse(input)` parses a turn — free text before PLAN, a required PLAN, nothing but whitespace between/after ops, and a required terminal SEND; a packet without a PLAN *and* a terminal SEND is invalid. A Plurnk packet IS a turn there is no permissive fallback. `PlurnkParser.parseStatements(input)` parses a bare statement sequence (teaching-example collections, single ops); it is not for model output.
207
207
 
208
208
  ```ts
209
209
  import.meta.resolve("@plurnk/plurnk-grammar/plurnk.gbnf")