@plurnk/plurnk-contracts 4.0.0 → 4.1.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/SPEC.md CHANGED
@@ -410,7 +410,7 @@ repaired reading: a complete nested interpretation takes precedence. Each class
410
410
  | Counted | Complete readings | Repaired readings | Why |
411
411
  |---|---|---|---|
412
412
  | Hidden operations: a heading that will not run, written at its block's width or wider | 1, together with the next row | 1 | Every operation the author wrote should run |
413
- | Repairs: a supplied closer (except a message's run to the end of the input, {§message-run-on}), a fence read as a stray, a narrower closer accepted, a body under an operation that takes none (FIND, READ, COPY, MOVE, non-log targeted KILL), a body not well-formed in the media type its runtime declares ({§executor-invocation}) | none by definition | 2 | The least-errors distance |
413
+ | Repairs: a supplied closer (except a message's run to the end of the input, {§message-run-on}), a fence read as a stray, a narrower closer accepted, a body under an operation that takes none (COPY, MOVE, non-log targeted KILL), a body not well-formed in the media type its runtime declares ({§executor-invocation}) | none by definition | 2 | The least-errors distance |
414
414
  | Literal by declaration: a heading narrower than its block, or no wider than the labeled block or example holding it, or inside a quotation or a KILL, or an executor heading inside a SEND, WORK, FORK or BARE body ({§prose-code-blocks}); a labeled fence in a body read as text | 1, together with the row above | 3 | Every code block the author declared should stand |
415
415
  | Supplied closers | 2 | 4 | A block the author opened should end at a fence the author wrote |
416
416
  | Other fences read as text | 3 | 5 | The least departure from the fences as written |
@@ -747,8 +747,7 @@ matcher." ({§diagnostic-observation}).
747
747
  §operation-aside The final header modifier may be one single-line HTML
748
748
  comment. AstBuilder removes its delimiters and surrounding whitespace into
749
749
  `aside: string | null`. It is durable descriptive text, not authority,
750
- routing, timing, or body input. Comments inside a body remain literal except
751
- for the narrowly owned {§misplaced-aside-advisory}.
750
+ routing, timing, or body input. Comments inside a body remain literal.
752
751
 
753
752
  §scheme-metadata-modifier A target may carry one single-line `[metadata]`
754
753
  block, placed under {§slot-order}; executor and SEND fences also admit it without a target.
@@ -786,13 +785,10 @@ the owner verbatim, and the owner's reader treats `pattern` as reserved. The
786
785
  language lifts only from one block that parses as a JSON array of objects;
787
786
  anything else lifts nothing and reaches the owner's `400` untouched. A
788
787
  `pattern` that is present but not a string is the language's own positioned
789
- diagnostic, as is a matcher of a claimed dialect that fails admission. FIND,
790
- READ, and targeted KILL take no body: a body beneath their heading is not used and
791
- the operation still runs, with one warning-severity advisory naming the lines not
792
- used (`FIND takes no body; lines 4–6 were not used.`); it is never silently read as a
793
- matcher, and it never strikes ({§matcher-body-redirect}). The heading line itself
794
- is the matcher's home ({§naked-pattern}). A body that is only an HTML comment is
795
- still the aside under {§misplaced-aside-advisory}. EDIT keeps its literal body:
788
+ diagnostic, as is a matcher of a claimed dialect that fails admission. FIND and
789
+ READ bodies become memory under {§retrieval-annotation}; a non-log KILL's body is
790
+ unused and receives the advisory under {§matcher-body-redirect}. The heading line
791
+ is the matcher's home ({§naked-pattern}). EDIT keeps its literal body:
796
792
  with a matcher it is the replacement for every selected span ({§edit-pattern}),
797
793
  and an absent body deletes them. `PlurnkParser.stringify` writes a lifted matcher
798
794
  whose block left no metadata back bare when the bare form reads back identically
@@ -817,8 +813,8 @@ governed by {§canonical-statement}; runtime conditions remain explicit below.
817
813
 
818
814
  | OP | `(path)` | `<scope>` | `body` |
819
815
  |------|----------------------------------------------|---------------------------------|--------------------------------|
820
- | FIND | required target or glob | optional result range | empty |
821
- | READ | required target | optional text region | empty |
816
+ | FIND | required target or glob | optional result range | annotation normalized to NOTE |
817
+ | READ | required target | optional text region | annotation normalized to NOTE |
822
818
  | EDIT | required file or entry | required for an existing target | literal text |
823
819
  | COPY | required source and destination | optional region after each path | empty |
824
820
  | MOVE | required source and destination | optional region after each path | empty |
@@ -831,11 +827,22 @@ governed by {§canonical-statement}; runtime conditions remain explicit below.
831
827
  | NOTE | none | none | literal working memory |
832
828
  | WAIT | optional label ({§send-wait-scope}) | none; duration is `[seconds]` metadata | explanation of the wait |
833
829
 
830
+ §retrieval-annotation **A retrieval's authored body is memory, not selection or output.**
831
+ A nonblank body beneath FIND or READ becomes one ordinary NOTE immediately before
832
+ the retrieval, including a body consisting of a pattern or an HTML comment. A
833
+ grouped READ contributes one NOTE before its expanded statements. The retrieval
834
+ itself has no body; its selector comes only from its header. Normalization is the
835
+ same in content and exposed reasoning and never executes quoted body text. The
836
+ canonical rendering is NOTE followed by bodyless retrieval; exact submitted text
837
+ remains source evidence. The NOTE persists independently of retrieval success and
838
+ is curated normally. Explicit NOTE remains the taught form.
839
+
834
840
  §note-value NOTE retains its literal body as ordinary model-owned working memory.
835
841
  It has no target, scope, metadata, or lifecycle effect. Its full body participates
836
842
  in ordinary log token accounting and model-driven curation; prior notes are not
837
- automatically hidden. A NOTE-only turn does not request completion; ordinary
838
- repetition and strike rules still apply.
843
+ automatically hidden. Each turn may contain zero or more NOTEs; their omission
844
+ produces neither a notice nor a failure. A NOTE-only turn does not request
845
+ completion; ordinary repetition and strike rules still apply.
839
846
 
840
847
  §reasoning-operations The shared fence parser admits complete, line-leading NOTE,
841
848
  FIND and READ statements from exposed provider reasoning. Admission is part of
@@ -1779,7 +1786,7 @@ not infer it from diagnostic wording. It does not independently prescribe a stri
1779
1786
  §parse-recovery **Every hard diagnostic carries its working form.** A `severity: "error"`
1780
1787
  diagnostic names, in `recovery`, the form of the construct it refused, in the model's terms: a
1781
1788
  refused heading carries the operation's canonical line (`` `READ (path) <L,M>? pattern? <!-- aside -->?`
1782
- on the opening fence line; READ takes no body. ``), a refused scope the scope's form, and a refused
1789
+ on the opening fence line. ``), a refused scope the scope's form, and a refused
1783
1790
  matcher its dialect's form with an example (`` A pattern is a regex written `/pattern/flags`, such
1784
1791
  as `/timeout/i`. ``). The working form is the language's, never a reconstruction of the input
1785
1792
  ({§diagnostic-observation}). The runtime projects `recovery` as the Problem's `recovery` beside the
@@ -1868,7 +1875,7 @@ diagnostics are:
1868
1875
  that already names a channel keeps such a token as its pattern. Those
1869
1876
  matchers remain independent of owner options: a block without `pattern` never
1870
1877
  erases the heading matcher, and invalid blocks still reach the owning validator.
1871
- These operations take no body, so heading-line text can mean nothing else. On EDIT only
1878
+ Their heading-line text owns selection independently of annotation or distillation bodies. On EDIT only
1872
1879
  a sigil lifts, because plain heading-line text is the replacement body it always
1873
1880
  was; the lines beneath the heading are then the replacement, and none deletes each
1874
1881
  match ({§edit-pattern}). A trailing `<!-- aside -->` on the same line stays the
@@ -1929,15 +1936,12 @@ diagnostics are:
1929
1936
  body instead, the anchor would be written into the file, or the EDIT refused for want of a line
1930
1937
  marker (14 distinct recorded headings). On READ and KILL the same text stays a literal matcher,
1931
1938
  since `@patch` is a search a model means.
1932
- - §matcher-body-redirect **Unread body text on bodyless operations.** FIND, READ and bodyless
1933
- KILL keep the statement but do not use text the matcher did not consume, with one warning
1934
- naming where it stands: `READ takes no body; lines 4–38 were not used.`, or `the text after its
1935
- heading on line 3` when it shares the heading's line. KILL's advisory says `This KILL`, limiting the claim to that invocation:
1936
- log distillation bodies remain valid. Delivered like
1937
- {§misplaced-aside-advisory} as a `parse_advisory` notice (a warning, never an error).
1938
- One sigil line beneath a bodyless heading is the bare form written a line low and still lifts;
1939
- nothing else is promoted into a matcher from below the heading. An option block's `pattern`
1940
- prevents that lift, and the advisory never echoes the discarded text.
1939
+ - §matcher-body-redirect **Unread selector text.** An option block's `pattern` owns the
1940
+ selector; surplus heading text is unused with one warning naming its location.
1941
+ A non-log KILL's body is likewise unused: `This KILL takes no body; line 2 was not used.`
1942
+ Neither warning echoes discarded text. No operation recovers a matcher from below
1943
+ its header. READ/FIND bodies follow {§retrieval-annotation}; log KILL bodies follow
1944
+ {§log-kill-distillation}.
1941
1945
  - §combined-anchor-tolerance **Combined line number and anchor in a scope.** A
1942
1946
  text-coordinate scope written `L<@hash>` — digits immediately before the opener — is the
1943
1947
  displayed `42<@abcde>` row prefix copied whole: the scope is the anchor, the number is dropped, and one
@@ -1953,15 +1957,6 @@ diagnostics are:
1953
1957
  states the anchor rule instead, with the scope marked: `` every line anchor carries
1954
1958
  its `@`: `<@abcde,@fghij>` ``. Spacing and boundary-loss diagnostics retain their own
1955
1959
  contracts.
1956
- - §misplaced-aside-advisory **Aside in the body.** A READ or FIND whose
1957
- body is solely an HTML comment (`<!-- … -->`) can never carry a matcher: it is
1958
- the aside the model put on the line below the heading. The builder takes
1959
- the comment as the aside when the heading has none, builds the operation
1960
- with no body, and raises one warning-severity advisory stating that observed
1961
- normalization; the parser places the advisory right after its statement and
1962
- the service delivers it as a `parse_advisory` notice with its position. A body
1963
- with any other content is ignored under the same advisory path
1964
- ({§matcher-body-redirect}).
1965
1960
 
1966
1961
  §error-shape The diagnostic class determines the parts of a message; every class says what
1967
1962
  happened, never why ({§diagnostic-observation}). Advisories belong to one successfully built statement. A rejected
@@ -153,7 +153,7 @@
153
153
  },
154
154
  "body": {
155
155
  "type": "null",
156
- "description": "FIND takes no body; its matcher is the `pattern` option."
156
+ "description": "Retrieval bodies normalize to separate NOTE statements; selection belongs to the header ({§retrieval-annotation})."
157
157
  },
158
158
  "position": {
159
159
  "$ref": "#/$defs/PositionRef"
@@ -228,7 +228,7 @@ export interface FindStatement {
228
228
  */
229
229
  matcher: (MatcherBody | null);
230
230
  /**
231
- * FIND takes no body; its matcher is the `pattern` option.
231
+ * Retrieval bodies normalize to separate NOTE statements; selection belongs to the header ({§retrieval-annotation}).
232
232
  */
233
233
  body: null;
234
234
  position: Position;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-contracts",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Canonical PLURNK language contract, schemas, generated types, and runtime-neutral wire contracts",
5
5
  "keywords": [
6
6
  "plurnk",
@@ -72,5 +72,5 @@
72
72
  "devDependencies": {
73
73
  "json-schema-to-typescript": "^16.0.0"
74
74
  },
75
- "gitHead": "9f92ceac0af7bdb64e57ebc73c0288bb0f36b720"
75
+ "gitHead": "52020b981eb3c10ddab9dc9b91c0e199eb7598ab"
76
76
  }
package/plurnk.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Plurnk Operation Protocol
2
2
 
3
3
  > [!IMPORTANT]
4
- > YOU MUST ONLY emit fenced operations; with the parameters, pattern, and terse aside on the fenced operation line.
4
+ > YOU MUST ONLY emit fenced operation batches; with the parameters, pattern, and terse aside on the fenced operation line. No tool calls.
5
5
 
6
6
  ## Syntax
7
7
 
@@ -9,9 +9,12 @@
9
9
  body?
10
10
  ```
11
11
 
12
+ > [!TIP]
13
+ > You may use more than three backticks in your opening and closing outer fences to wrap, nest, and disambiguate.
14
+
12
15
  ## Core Operations
13
16
 
14
- * NOTE: Internal Working Memory Register recording **every** plan, finding, decision, and next action.
17
+ * NOTE: Save all new plans, findings, and decisions for later turns.
15
18
  * FIND: List matching paths, or the match locations inside one path.
16
19
  * READ: Read files, entries, streams, or only the lines a pattern selects.
17
20
  * EDIT: Create a file or entry; replace existing text by scope or by pattern.
@@ -25,8 +28,11 @@ body?
25
28
 
26
29
  ## Loop Protocol
27
30
 
28
- > [!TIP]
29
- > YOU SHOULD record every plan, finding, decision, and next action in detailed NOTEs to avoid permanent loss of information.
31
+ > [!IMPORTANT]
32
+ > YOU MUST Recall, Record, and React:
33
+ > * **Recall**: Review the Open Work and Open Messages against the prior NOTE entries and log items.
34
+ > * **Record**: NOTE entries are your ONLY chain of thought. Persist all new plans, findings, and decisions.
35
+ > * **React**: When the necessary operations are identified, stop reflecting and emit the batch of notes and operations.
30
36
 
31
37
  ```NOTE <!-- plan -->
32
38
  the steps ahead and why
@@ -44,13 +50,13 @@ a decision and its reasons
44
50
  the next action and what it needs
45
51
  ```
46
52
 
47
- ```SEND
53
+ ````SEND
48
54
  a continuing progress update response
49
- ```
55
+ ````
50
56
 
51
- ```SEND [200]
57
+ ````SEND [200]
52
58
  a final deliverable response
53
- ```
59
+ ````
54
60
 
55
61
  > [!CAUTION]
56
62
  > The loop continues until all Open Messages receive a `[200]` or `[499]` response and all Open Work is completed.
@@ -72,38 +78,40 @@ Describe the child's complete task in the body.
72
78
  | `&` | graph (treesitter symbols) | `&sym`, `&<sym`, `&>sym` |
73
79
  | none | literal or glob/extglob | `?(export )?(async )function *` |
74
80
 
81
+ ## `<scope|range>`
82
+
83
+ > [!TIP]
84
+ > Text scopes use 1-based lines and Unicode code-point columns across textual mimetypes:
85
+
86
+ | form | endpoint rule |
87
+ |-----------------|--------------------------------|
88
+ | `<L>`, `<@hash>` | one line |
89
+ | `<SL,EL>`, `<@start,@end>` | lines SL through EL, inclusive |
90
+ | `<SL,SC,EL,EC>` | start included, end excluded — `<@abcde,5,@abcde,8>` is `bar` in line 42 `foo bar baz` |
91
+ | `<L,1,L,1>`, `<@hash,1,@hash,1>` | insert before that line |
92
+ | `<0>`, `<-1>` | prepend / append on mutations; as an end line, `-1` is the last line |
93
+
75
94
  ## Workspace Navigation
76
95
 
77
- ```FIND (src/**/*.ts) /TODO/ <!-- paths with matches -->
96
+ ```FIND (src/**/*.ts) <1,-1> /TODO/ <!-- paths with matches -->
78
97
  ```
79
98
 
80
- ```READ (src/**/*.ts) /TODO/ <!-- the matching lines in every file -->
99
+ ```READ (src/**/*.ts) <1,-1> /TODO/ <!-- the matching lines in every file -->
81
100
  ```
82
101
 
83
102
  ```COPY (sh:///ab3d5678) (build.log) <!-- the command's output lands in a file, never in your context -->
84
103
  ```
85
104
 
86
- ```members (add) <!-- adding membership tracking for files outside of the project folder -->
87
- {"files": ["../exampleSisterProject/*.md", "../exampleSisterProject/example.json"]}
88
- ```
89
-
90
105
  * `(path)` may be a glob/extglob, permitting bulk operations.
91
106
  * Log item paths nest: `log:///1/2/3/READ` is loop/turn/item/OP.
92
107
  * FIND results hold one inner array per path: its channels, default first; append `#channel` to the path to select another: `(sh:///ab3d5678#stderr)`.
93
108
  * Percent-encode in paths `(` as `%28` and `)` as `%29`.
94
109
 
95
- ## `<scope|range>`
110
+ ## Membership (worker:///_plurnk/plurnk/members.md)
96
111
 
97
- > [!TIP]
98
- > Text scopes use 1-based lines and Unicode code-point columns across textual mimetypes:
99
-
100
- | form | endpoint rule |
101
- |-----------------|--------------------------------|
102
- | `<L>`, `<@hash>` | one line |
103
- | `<SL,EL>`, `<@start,@end>` | lines SL through EL, inclusive |
104
- | `<SL,SC,EL,EC>` | start included, end excluded — `<@abcde,5,@abcde,8>` is `bar` in line 42 `foo bar baz` |
105
- | `<L,1,L,1>`, `<@hash,1,@hash,1>` | insert before that line |
106
- | `<0>`, `<-1>` | prepend / append on mutations; as an end line, `-1` is the last line |
112
+ ```members (add) <!-- adding membership tracking for files outside of the project folder -->
113
+ {"files": ["../exampleSisterProject/*.md", "../exampleSisterProject/example.json"]}
114
+ ```
107
115
 
108
116
  ## Editing
109
117
 
@@ -134,12 +142,6 @@ bar
134
142
  ```EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
135
143
  ```
136
144
 
137
- ````EDIT (edit-example.md)
138
- ```EDIT (create-example.md)
139
- Nesting can be resolved with increased outer fences.
140
- ```
141
- ````
142
-
143
145
  > [!TIP]
144
146
  > YOU SHOULD address lines by `<@hash>` or `<@start,@end>` to protect against stale targets.
145
147