@plurnk/plurnk-contracts 1.21.0 → 1.21.1

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 +12 -10
  2. package/package.json +1 -1
  3. package/plurnk.md +32 -32
package/SPEC.md CHANGED
@@ -506,7 +506,7 @@ beside owner metadata, not only a matcher carried inside its `pattern` option.
506
506
  | `<scope>` | Operation-specific numeric or anchored coordinates |
507
507
  | `<!-- … -->` | Optional final, single-line aside |
508
508
  | Body | Literal content between framing newlines |
509
- | Closing fence | The opening backtick count and delimiter, on its own line |
509
+ | Closing fence | The opening backtick count, on its own line |
510
510
 
511
511
  §slot-order Producers put target, scope, metadata, then aside, separated
512
512
  by one ASCII space. Target and scope form one resource selection; COPY/MOVE
@@ -610,12 +610,12 @@ governed by {§canonical-statement}; runtime conditions remain explicit below.
610
610
 
611
611
  | OP | `(path)` | `<scope>` | `body` |
612
612
  |------|----------------------------------------------|---------------------------------|--------------------------------|
613
- | FIND | required target or glob | optional result range | optional matcher |
613
+ | FIND | required target or glob | optional result range | empty |
614
614
  | READ | required target | optional text region | empty |
615
615
  | EDIT | required file or entry | required for an existing target | literal text |
616
616
  | COPY | required source and destination | optional region after each path | empty |
617
617
  | MOVE | required source and destination | optional region after each path | empty |
618
- | execution | the fence name is the runtime; optional program/tool path ({§exec-executor-slot}) | optional timeout, poll | optional program input |
618
+ | execution | the fence name is the runtime; optional program/tool path ({§exec-executor-slot}) | none ({§exec-lifetime}) | optional program input |
619
619
  | BARE | optional prompt resource | none | prompt; optional with a path |
620
620
  | WORK | optional fresh `worker://name`, or a prompt resource ({§worker-spawn-prompt-resource}) | none | prompt; optional with a resource |
621
621
  | FORK | optional context-inheriting `worker://name`, or a prompt resource | none | prompt; optional with a resource |
@@ -751,8 +751,8 @@ Without a `#` the field is absent, so an older `LocalPath` literal stays valid.
751
751
  §read-exact-target READ targets one exact resource (a local path or scheme
752
752
  URL, with optional `#channel` fragment or `[metadata]`) and has no body. A
753
753
  `<scope>` on READ selects
754
- a text region from that exact target. Without a scope, READ defaults to
755
- `<1,16>`; `<1,-1>` explicitly selects all text. Decimal scope components are
754
+ a text region from that exact target. Without a scope, READ takes the configured
755
+ first page ({§markerless-first-page}); `<1,-1>` explicitly selects all text. Decimal scope components are
756
756
  invalid on READ.
757
757
 
758
758
  Mutation semantics:
@@ -790,7 +790,8 @@ Mutation semantics:
790
790
  unit. An exact target with a matcher pages flat match locations; a glob or
791
791
  folder target, and every matcher-less FIND, pages resources. Resolving a glob to
792
792
  one resource does not make it exact. The same `<N>`, inclusive `<N,M>`,
793
- markerless `<1,16>`, and explicit-all `<1,-1>` forms apply to either unit.
793
+ configured markerless first page ({§markerless-first-page}), and explicit-all
794
+ `<1,-1>` forms apply to either unit.
794
795
 
795
796
  §copy-move-observation COPY and MOVE log projections preserve both admitted operand selections,
796
797
  including their independent scopes, whether the result changed state, was a
@@ -808,7 +809,8 @@ retrieval never returns inline within the emitting turn.
808
809
  ## §path-syntax 5. Target and path grammar
809
810
 
810
811
  The target slot contains either a local path or a scheme URL. Exact addresses
811
- and path globs share the slot; content matchers belong in the body.
812
+ and path globs share the slot; content matchers follow the heading forms in
813
+ {§matcher-option}.
812
814
 
813
815
  | Form | Typed admission | Runtime meaning |
814
816
  |-------------------------|---------------------------------------------------------------------|------------------------------------------------------|
@@ -935,13 +937,13 @@ The operation column names the canonical AST operation after
935
937
 
936
938
  | Operation | Canonical components | Meaning |
937
939
  |-----------------------|----------------------------------------|----------------------------------------------------------------------------|
938
- | FIND | optional threshold, then 0–2 positions | Inclusive resource or exact-target location positions ({§find-result-unit}; defaults to `<1,16>`) |
940
+ | FIND | 0–2 positions | Inclusive resource or exact-target location positions ({§find-result-unit}; markerless first page under {§markerless-first-page}) |
939
941
  | READ / client LOOK | 0/1/2/4 text coordinates | Text projection from one exact selected file, entry, or log item |
940
942
  | EDIT | 0/1/2/4 text coordinates | Text replacement, deletion, prepend, or append |
941
943
  | COPY/MOVE source | 0/1/2/4 text coordinates | Region copied or moved from the selected source |
942
944
  | COPY/MOVE destination | 0/1/2/4 text coordinates after target | Region replaced or insertion point at the destination |
943
945
  | KILL | 0/1/2 text coordinates | Whole target when absent; one physical line or inclusive range when present ({§kill-scope}) |
944
- | execution | `timeout[,poll]` | Spawn lifetime bound and poll cadence in minutes |
946
+ | execution | None | Lifetime uses metadata; observation cadence belongs to the daemon ({§exec-lifetime}) |
945
947
  | WAIT | None | Scope is ignored ({§send-wait-scope}) |
946
948
  | Directed SEND | Owner-defined numeric scope | Carried to the addressed owner; worker actors refuse it ({§send-directed-scope}) |
947
949
 
@@ -1618,7 +1620,7 @@ diagnostics are:
1618
1620
  - §invalid-scope-diagnostic **Malformed scope content.** After a properly spaced
1619
1621
  scope opener, report the offending scope (at most 64 code points, ending at
1620
1622
  `>` or the heading's line end) and its operation's constraint: FIND result
1621
- positions, execution minutes, text coordinates, or no scope. Do not append advice for
1623
+ positions, text coordinates, or no scope. Do not append advice for
1622
1624
  other operations or infer why the producer supplied the value. Spacing and
1623
1625
  boundary-loss diagnostics retain their own contracts.
1624
1626
  - §misplaced-aside-advisory **Aside in the body.** A READ or FIND whose
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-contracts",
3
- "version": "1.21.0",
3
+ "version": "1.21.1",
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
@@ -2,16 +2,16 @@
2
2
 
3
3
  ## Plurnk OP Syntax
4
4
 
5
- ```OP (path)? <scope|range>? [metadata]? pattern? <!-- aside -->?
6
- body?
7
- ```
5
+ ```OP (path)? <scope|range>? [metadata]? pattern? <!-- aside -->?
6
+ body?
7
+ ```
8
8
 
9
9
  > [!IMPORTANT]
10
10
  > YOU MUST ONLY use valid Plurnk OPs, with all parameters and the optional terse aside on the fenced OP line.
11
11
 
12
12
  ## Core Plurnk OPs
13
13
 
14
- * NOTE: Reasoning scratchpad for recording conclusions, decisions, and facts.
14
+ * NOTE: Reasoning scratchpad for recording conclusions, decisions, facts, and plans.
15
15
  * FIND: List matching paths, or the match locations inside one path.
16
16
  * READ: Read files, entries, streams, or only the lines a pattern selects.
17
17
  * EDIT: Create a file or entry; replace existing text by scope or by pattern.
@@ -27,19 +27,19 @@
27
27
  ## Workflow Management
28
28
 
29
29
  > [!IMPORTANT]
30
- > YOU MUST deliver the final response as a turn with ONLY a single parameterless KILL with the response in the body:
30
+ > YOU MAY deliver the final deliverable response when done: KILL the loop with a turn containing a single parameterless KILL.
31
31
 
32
- ```KILL
33
- This is an example final deliverable response. It's alone. All child workers and streams are resolved and reviewed.
34
- ```
32
+ ```KILL
33
+ This is an example final deliverable response. It's alone. All child workers and streams are resolved and reviewed.
34
+ ```
35
35
 
36
36
  ## Workspace Navigation
37
37
 
38
- ```FIND (src/**/*.ts) /TODO/ <!-- paths with matches -->
39
- ```
38
+ ```FIND (src/**/*.ts) /TODO/ <!-- paths with matches -->
39
+ ```
40
40
 
41
- ```READ (belfry.md) /\bbats?\b/i <!-- only the lines matching "bat" or "bats" -->
42
- ```
41
+ ```READ (README.md) /^#{1,3} / <!-- only level 1–3 headings -->
42
+ ```
43
43
 
44
44
  * `(path)` may be a glob/extglob, permitting bulk operations.
45
45
  * Log item paths nest: `log:///1/2/3/READ` is loop/turn/item/OP.
@@ -48,34 +48,34 @@
48
48
 
49
49
  ## File Editing
50
50
 
51
- ```EDIT (example.md) <@abcde>
52
- literal replacement text
53
- ```
51
+ ```EDIT (example.md) <@abcde>
52
+ literal replacement text
53
+ ```
54
54
 
55
- ```EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
56
- ```
55
+ ```EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
56
+ ```
57
57
 
58
- ````EDIT (edit-example.md) <!-- Nesting can be resolved with increased outer fences. Examples can use tabbed offset. -->
59
- ```EDIT (create-example.md)
60
- When representing markdown, `~~~` notation can disambiguate nested content.
61
- ```
62
- ````
58
+ ````EDIT (edit-example.md) <!-- Nesting can be resolved with increased outer fences. Examples can use tabbed offset. -->
59
+ ```EDIT (create-example.md)
60
+ When representing markdown, `~~~` notation can disambiguate nested content.
61
+ ```
62
+ ````
63
63
 
64
64
  > [!TIP]
65
65
  > The EDIT body is literal text. YOU SHOULD address lines by `<@hash>` or `<@start,@end>`; stale targets are rejected.
66
66
 
67
67
  ## Delegation
68
68
 
69
- ```WORK (worker://alice) <!-- the child's result lands in your log -->
70
- The child's complete task.
71
- ```
69
+ ```WORK (worker://alice) <!-- the child's result lands in your log -->
70
+ The child's complete task.
71
+ ```
72
72
 
73
- ```BARE
74
- A self-contained prompt.
75
- ```
73
+ ```BARE
74
+ A self-contained prompt.
75
+ ```
76
76
 
77
- ```KILL (sh:///ab3d5678) <!-- stops a running command -->
78
- ```
77
+ ```KILL (sh:///ab3d5678) <!-- stops a running command -->
78
+ ```
79
79
 
80
80
  > [!TIP]
81
81
  > `SEND (worker://name)` messages a live worker.
@@ -85,8 +85,8 @@
85
85
  > [!CAUTION]
86
86
  > logTokensTotal must not exceed logTokensMax. Successful log KILL receipts are not shown.
87
87
 
88
- ```KILL (log:///1/[1-7]/*/{NOTE,READ}) <17, -1> <!-- trims matching log items, recovering context -->
89
- ```
88
+ ```KILL (log:///1/[1-7]/*/{NOTE,READ}) <17, -1> <!-- trims matching log items, recovering context -->
89
+ ```
90
90
 
91
91
  ## `<scope|range>`
92
92