@plurnk/plurnk-contracts 3.3.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/plurnk.md CHANGED
@@ -1,13 +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.
5
-
6
- > [!IMPORTANT]
7
- > YOU MUST record at least one NOTE along with other operations.
8
-
9
- > [!TIP]
10
- > All operations (except NOTE) are converted into log items.
4
+ > YOU MUST ONLY emit fenced operation batches; with the parameters, pattern, and terse aside on the fenced operation line. No tool calls.
11
5
 
12
6
  ## Syntax
13
7
 
@@ -15,9 +9,12 @@
15
9
  body?
16
10
  ```
17
11
 
12
+ > [!TIP]
13
+ > You may use more than three backticks in your opening and closing outer fences to wrap, nest, and disambiguate.
14
+
18
15
  ## Core Operations
19
16
 
20
- * NOTE: Persistent Detailed Internal Register. Emit NOTE for every summary, finding, decision, and plan (and why).
17
+ * NOTE: Save all new plans, findings, and decisions for later turns.
21
18
  * FIND: List matching paths, or the match locations inside one path.
22
19
  * READ: Read files, entries, streams, or only the lines a pattern selects.
23
20
  * EDIT: Create a file or entry; replace existing text by scope or by pattern.
@@ -26,40 +23,43 @@ body?
26
23
  * KILL: Delete an entry, stop a process, or retire log items.
27
24
  * WORK: Delegate to a child worker (fresh log).
28
25
  * FORK: Delegate to a child worker (copied log).
29
- * WAIT: Yield to child workers and streams. You may include `[60]` to check in after 60 seconds. Not for awaiting user input.
26
+ * WAIT: Yield to child workers or streams. You may include `[60]` to check in after 60 seconds. Not for awaiting user input.
30
27
  * SEND: Message endpoints, workers, or Open Messages (when the path is omitted, the oldest Open Message).
31
28
 
32
29
  ## Loop Protocol
33
30
 
34
- ```NOTE <!-- summary -->
35
- Configuration exampleLoader.py load-order bug identified; fix and regression test pending.
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.
36
+
37
+ ```NOTE <!-- plan -->
38
+ the steps ahead and why
36
39
  ```
37
40
 
38
41
  ```NOTE <!-- finding -->
39
- exampleLoader.py:58 reads the config before exampleInit() sets its path, so every test sees the defaults.
42
+ a finding and its evidence
40
43
  ```
41
44
 
42
45
  ```NOTE <!-- decision -->
43
- Move configuration reading in exampleLoader.py into exampleInit() so it uses the initialized path. Plugin dependence on the old order is still unverified.
44
- ```
45
-
46
- ```NOTE <!-- plan -->
47
- Edit exampleLoader.py, then rerun exampleTest.py.
46
+ a decision and its reasons
48
47
  ```
49
48
 
50
- ```SEND
51
- This is an example of a continuing progress update response.
49
+ ```NOTE <!-- next -->
50
+ the next action and what it needs
52
51
  ```
53
52
 
54
- ```SEND [200]
55
- This is an example of a final deliverable response.
56
- ```
53
+ ````SEND
54
+ a continuing progress update response
55
+ ````
57
56
 
58
- > [!TIP]
59
- > YOU SHOULD include the Open Message's (path) to complete `[200]` or cancel `[499]` specific Open Messages.
57
+ ````SEND [200]
58
+ a final deliverable response
59
+ ````
60
60
 
61
61
  > [!CAUTION]
62
- > The loop continues until every Open Message has a `[200]` or `[499]` reply, operation results have been observed, and work held by the loop has settled.
62
+ > The loop continues until all Open Messages receive a `[200]` or `[499]` response and all Open Work is completed.
63
63
 
64
64
  ## Delegation (worker:///_plurnk/plurnk/delegation.md)
65
65
 
@@ -78,38 +78,40 @@ Describe the child's complete task in the body.
78
78
  | `&` | graph (treesitter symbols) | `&sym`, `&<sym`, `&>sym` |
79
79
  | none | literal or glob/extglob | `?(export )?(async )function *` |
80
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
+
81
94
  ## Workspace Navigation
82
95
 
83
- ```FIND (src/**/*.ts) /TODO/ <!-- paths with matches -->
96
+ ```FIND (src/**/*.ts) <1,-1> /TODO/ <!-- paths with matches -->
84
97
  ```
85
98
 
86
- ```READ (src/**/*.ts) /TODO/ <!-- the matching lines in every file -->
99
+ ```READ (src/**/*.ts) <1,-1> /TODO/ <!-- the matching lines in every file -->
87
100
  ```
88
101
 
89
102
  ```COPY (sh:///ab3d5678) (build.log) <!-- the command's output lands in a file, never in your context -->
90
103
  ```
91
104
 
92
- ```members (add) <!-- adding membership tracking for files outside of the project folder -->
93
- {"files": ["../exampleSisterProject/*.md", "../exampleSisterProject/example.json"]}
94
- ```
95
-
96
105
  * `(path)` may be a glob/extglob, permitting bulk operations.
97
106
  * Log item paths nest: `log:///1/2/3/READ` is loop/turn/item/OP.
98
107
  * FIND results hold one inner array per path: its channels, default first; append `#channel` to the path to select another: `(sh:///ab3d5678#stderr)`.
99
108
  * Percent-encode in paths `(` as `%28` and `)` as `%29`.
100
109
 
101
- ## `<scope|range>`
102
-
103
- > [!TIP]
104
- > Text scopes use 1-based lines and Unicode code-point columns across textual mimetypes:
110
+ ## Membership (worker:///_plurnk/plurnk/members.md)
105
111
 
106
- | form | endpoint rule |
107
- |-----------------|--------------------------------|
108
- | `<L>`, `<@hash>` | one line |
109
- | `<SL,EL>`, `<@start,@end>` | lines SL through EL, inclusive |
110
- | `<SL,SC,EL,EC>` | start included, end excluded — `<@abcde,5,@abcde,8>` is `bar` in line 42 `foo bar baz` |
111
- | `<L,1,L,1>`, `<@hash,1,@hash,1>` | insert before that line |
112
- | `<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
+ ```
113
115
 
114
116
  ## Editing
115
117
 
@@ -140,22 +142,16 @@ bar
140
142
  ```EDIT (books.xml) //book[price > 35.00] <!-- an empty body removes each match -->
141
143
  ```
142
144
 
143
- ````EDIT (edit-example.md)
144
- ```EDIT (create-example.md)
145
- Nesting can be resolved with increased outer fences.
146
- ```
147
- ````
148
-
149
145
  > [!TIP]
150
146
  > YOU SHOULD address lines by `<@hash>` or `<@start,@end>` to protect against stale targets.
151
147
 
152
148
  ## Context Curation
153
149
 
154
- ```READ (largeExampleFile.txt) <101,200> <!-- READing in chunks to not exceed budget -->
150
+ ```READ (largeExampleFile.txt) <101,200> <!-- READing in chunks if budget constrained -->
155
151
  ```
156
152
 
157
153
  ```KILL (log:///1/[1-7]/*/{READ,emission}) <!-- old results and your own old programs, in bulk; the body survives as a NOTE -->
158
- exampleModule.py: exampleFunction() returns 42 on empty input (lines 12–40); both callers in exampleTest.py expect it.
154
+ example distillation or summarization
159
155
  ```
160
156
 
161
157
  ## Environment (worker:///_plurnk/plurnk/env.md)
@@ -1,104 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.plurnk.xyz/v0/ClientStatement.json",
4
- "title": "ClientStatement",
5
- "description": "The client-tier AST returned by PlurnkParser.parseClient: the closed protocol PlurnkStatement union plus the read-shaped LOOK utility statement.",
6
- "oneOf": [
7
- {
8
- "$ref": "https://schemas.plurnk.xyz/v0/PlurnkStatement.json"
9
- },
10
- {
11
- "$ref": "#/$defs/LookStatement"
12
- }
13
- ],
14
- "$defs": {
15
- "AsideOrNull": {
16
- "type": [
17
- "string",
18
- "null"
19
- ]
20
- },
21
- "SchemeMetadataOrNull": {
22
- "oneOf": [
23
- {
24
- "type": "array",
25
- "items": {
26
- "type": "string"
27
- }
28
- },
29
- {
30
- "type": "null"
31
- }
32
- ]
33
- },
34
- "PathOrNull": {
35
- "oneOf": [
36
- {
37
- "$ref": "https://schemas.plurnk.xyz/v0/ParsedPath.json"
38
- },
39
- {
40
- "type": "null"
41
- }
42
- ]
43
- },
44
- "TextLineMarkerOrNull": {
45
- "oneOf": [
46
- {
47
- "$ref": "https://schemas.plurnk.xyz/v0/TextLineMarker.json"
48
- },
49
- {
50
- "type": "null"
51
- }
52
- ]
53
- },
54
- "MatcherBodyOrNull": {
55
- "oneOf": [
56
- {
57
- "$ref": "https://schemas.plurnk.xyz/v0/MatcherBody.json"
58
- },
59
- {
60
- "type": "null"
61
- }
62
- ]
63
- },
64
- "PositionRef": {
65
- "$ref": "https://schemas.plurnk.xyz/v0/Position.json"
66
- },
67
- "LookStatement": {
68
- "type": "object",
69
- "required": [
70
- "op",
71
- "aside",
72
- "metadata",
73
- "target",
74
- "lineMarker",
75
- "body",
76
- "position"
77
- ],
78
- "additionalProperties": false,
79
- "properties": {
80
- "op": {
81
- "const": "LOOK"
82
- },
83
- "aside": {
84
- "$ref": "#/$defs/AsideOrNull"
85
- },
86
- "metadata": {
87
- "$ref": "#/$defs/SchemeMetadataOrNull"
88
- },
89
- "target": {
90
- "$ref": "#/$defs/PathOrNull"
91
- },
92
- "lineMarker": {
93
- "$ref": "#/$defs/TextLineMarkerOrNull"
94
- },
95
- "body": {
96
- "$ref": "#/$defs/MatcherBodyOrNull"
97
- },
98
- "position": {
99
- "$ref": "#/$defs/PositionRef"
100
- }
101
- }
102
- }
103
- }
104
- }