@plurnk/plurnk-contracts 1.19.2 → 1.19.3

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.
Files changed (3) hide show
  1. package/SPEC.md +18 -10
  2. package/package.json +1 -1
  3. package/plurnk.md +16 -6
package/SPEC.md CHANGED
@@ -481,7 +481,7 @@ beside owner metadata, not only a matcher carried inside its `pattern` option.
481
481
  |---|---|
482
482
  | Fence name | Reserved native OP, otherwise a registered executor or attached MCP service |
483
483
  | `(path)` | Target/program/tool slot; COPY and MOVE each have two resource operands |
484
- | `[metadata]` | One JSON array of option objects, owner-interpreted; options, never the op's input |
484
+ | `[metadata]` | One owner-interpreted block; options, never the op's input |
485
485
  | `<scope>` | Operation-specific numeric or anchored coordinates |
486
486
  | `<!-- … -->` | Optional final, single-line aside |
487
487
  | Body | Literal content between framing newlines |
@@ -511,15 +511,23 @@ for the narrowly owned {§misplaced-aside-advisory}.
511
511
 
512
512
  §scheme-metadata-modifier A target may carry one single-line `[metadata]`
513
513
  block after its scope; executor and SEND fences also admit it without a target.
514
- Read with its brackets, the block is a JSON array of option objects, merged
515
- left to right with later keys winning; the keys belong to the selected scheme
516
- or executor, which owns interpretation, validation and authority. The language
517
- assigns no meaning to the content and stores each block's exact inner text:
518
- balanced brackets inside the block are retained, and double-quoted strings
519
- protect their brackets. Brackets inside `(path)` remain ordinary path and
520
- glob characters. A block that is not valid JSON, or a second block on one
514
+ The block belongs to the selected scheme or executor, which owns its shape,
515
+ interpretation, validation and authority. The language assigns no meaning to
516
+ the content and stores each block's exact inner text: balanced brackets inside
517
+ the block are retained, and double-quoted strings protect their brackets.
518
+ Brackets inside `(path)` remain ordinary path and
519
+ glob characters. A block the owner cannot read, or a second block on one
521
520
  operand, is the owner's `400`, never a parser diagnostic. An unfinished block
522
- or multiline metadata loses its boundary. Two keys never reach an owner:
521
+ or multiline metadata loses its boundary.
522
+
523
+ **House policy, not a language rule:** every first-party scheme and executor
524
+ reads its block through the shared `MetadataOptions` reader, which takes the
525
+ block with its brackets as a JSON array of option objects, merged left to
526
+ right with later keys winning. A third-party owner may read its block any way
527
+ it likes — the language guarantees only the exact inner text. Documentation
528
+ for a first-party owner therefore shows the bracketed array form.
529
+
530
+ Two keys never reach an owner:
523
531
  `pattern`, the language's own ({§matcher-option}), and `env`, reserved for the
524
532
  service's environment option on the operations that open a process or a
525
533
  Worker; the shared reader withholds both from the owner's options.
@@ -556,7 +564,7 @@ whose block left no metadata back bare when the bare form reads back identically
556
564
  | Executor name | Letters, digits, `_`, `.`, `+`, or `-`; reserved OPs win |
557
565
  | Fence | Three or more backticks, matched by exact count |
558
566
  | `(path)` | Local path, URI, program or tool name; §5 |
559
- | `[metadata]` | One JSON array of owner-defined option objects |
567
+ | `[metadata]` | One owner-interpreted block of owner-defined options |
560
568
  | `<scope>` | Numeric or anchored coordinates; §7 |
561
569
  | Body | Literal text; never recursively interpreted as operations |
562
570
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-contracts",
3
- "version": "1.19.2",
3
+ "version": "1.19.3",
4
4
  "description": "Canonical PLURNK language contract, schemas, generated types, and runtime-neutral wire contracts",
5
5
  "keywords": [
6
6
  "plurnk",
package/plurnk.md CHANGED
@@ -9,12 +9,12 @@ Pattern Lookup Universal Resource NetworK: find anything by pattern, read it by
9
9
  ````
10
10
 
11
11
  > [!IMPORTANT]
12
- > YOU MUST ONLY respond with either valid Operation Syntax OPs or prose. Any prose in the body concludes the loop. Not both.
12
+ > YOU MUST ONLY respond with valid Operation Syntax OPs, responding with only fenced markdown if concluding.
13
13
 
14
14
  > [!WARNING]
15
15
  > YOU MUST offset any example OP you do not intend to execute with a hard or soft tab.
16
16
 
17
- * `[metadata]`: optional one-line JSON array of special configuration.
17
+ * `[metadata]`: optional one-line special configuration.
18
18
  * `<!-- aside -->`: optional terse note.
19
19
  * All parameters and the aside must appear on the same line as OP.
20
20
  * OP may be either a Plurnk Operation or one of the tools.
@@ -32,10 +32,19 @@ Pattern Lookup Universal Resource NetworK: find anything by pattern, read it by
32
32
  * WORK: Deploy a child worker (fresh log).
33
33
  * FORK: Deploy a forked worker (forked log).
34
34
  * BARE: Deploy an isolated inference query (no log or tools).
35
- * WAIT: Yield until the next wake: a child's result, a message, a stream's end.
35
+ * WAIT: Yield until the next wake: a child worker's result, a message, a stream's end.
36
+
37
+ * markdown: Final response alone, concluding the entire loop. All other OPs, child workers, or streams are finished.
36
38
 
37
39
  ## Workflow Management
38
40
 
41
+ > [!IMPORTANT]
42
+ > The markdown response must be the only OP emitted in the final turn.
43
+
44
+ ````markdown
45
+ The answer is 42.
46
+ ````
47
+
39
48
  > [!INFO]
40
49
  > To cancel all unfinished work in your worker and its descendants, KILL your own worker address.
41
50
 
@@ -51,7 +60,6 @@ Pattern Lookup Universal Resource NetworK: find anything by pattern, read it by
51
60
  * Log item paths nest: `log:///1/2/3/READ` is loop/turn/item/operation.
52
61
  * FIND results hold one inner array per path: its channels, default first; append `#channel` to select another.
53
62
  * Percent-encode `(` as `%28` and `)` as `%29`.
54
- * Creating a file creates missing parent directories.
55
63
 
56
64
  ## File Editing
57
65
 
@@ -71,6 +79,9 @@ Pattern Lookup Universal Resource NetworK: find anything by pattern, read it by
71
79
  > [!TIP]
72
80
  > The EDIT body is literal text. YOU SHOULD address lines by `<@hash>` or `<@start,@end>`; stale targets are rejected.
73
81
 
82
+ > [!TIP]
83
+ > Creating a file creates missing parent directories.
84
+
74
85
  ## Delegation
75
86
 
76
87
  ````WORK (worker://reviewer) [{"env": {"NODE_ENV": "test"}}] <!-- the child's result lands in your log -->
@@ -118,9 +129,8 @@ All member files and entries are mapped, indexed, and universally pattern search
118
129
  | prefix | dialect | example |
119
130
  |--------|-----------------------------|---------------------------------|
120
131
  | `/` | regex (ECMAScript) | `/\btimeout\b/i` |
121
- | `^` | regex anchored to a line | `^ERROR:.*` |
122
132
  | `//` | xpath (1.0) | `//dependencies/*` |
123
133
  | `$` | jsonpath (RFC 9535) | `$.items[?(@.price>500)]` |
124
134
  | `~` | full-text (SQLite FTS5) | `~retry` |
125
- | `&` | graph: (treesitter symbols) | `&sym`, `&<sym`, `&>sym` |
135
+ | `&` | graph (treesitter symbols) | `&sym`, `&<sym`, `&>sym` |
126
136
  | none | literal or extglob | `?(export )?(async )function *` |