@rse/ase 0.9.58 → 0.9.59

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.
@@ -6,7 +6,7 @@
6
6
  "homepage": "https://ase.tools",
7
7
  "repository": { "url": "git+https://github.com/rse/ase.git", "type": "git" },
8
8
  "bugs": { "url": "https://github.com/rse/ase/issues" },
9
- "version": "0.9.58",
9
+ "version": "0.9.59",
10
10
  "license": "Apache-2.0",
11
11
  "author": {
12
12
  "name": "Dr. Ralf S. Engelschall",
@@ -169,7 +169,28 @@ Procedure
169
169
  3. <step id="STEP 3: Detect Target Collisions"
170
170
  condition="<getopt-option-dry/> is not equal `true`">
171
171
 
172
- 1. Determine the *existing worktrees* and *existing branches* by
172
+ 1. Determine the *worktree directory* of every part by calling the
173
+ `ase_worktree_path(id: "<part-id/>", create: true)` tool of the
174
+ `ase` MCP server once per <part-id/> of <parts/> and capturing
175
+ its output into the <part-dir/> of that part.
176
+
177
+ You *MUST* *NEVER* assemble such a path yourself, as only this
178
+ tool rejects a path leading through a symbolic link, through a
179
+ non-directory, or out of the repository -- a path both `git
180
+ worktree add` and `git worktree remove` would otherwise silently
181
+ follow and thereby write outside the repository.
182
+
183
+ <if condition="this tool call fails for any part">
184
+ Only output the following <template/> and then immediately *STOP*
185
+ processing the entire current skill, leaving the working copy and
186
+ *all* existing worktrees and branches untouched:
187
+
188
+ <template>
189
+ ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ▶ ERROR: unsafe worktree directory -- cannot create worktrees
190
+ </template>
191
+ </if>
192
+
193
+ 2. Determine the *existing worktrees* and *existing branches* by
173
194
  running the corresponding commands (taken exactly as given) and
174
195
  capturing their outputs:
175
196
 
@@ -177,11 +198,11 @@ Procedure
177
198
 
178
199
  `git branch --list`
179
200
 
180
- 2. Set <collisions/> to all <part-id/> of <parts/> for which either
181
- a worktree directory `<repo-root/>/.ase/worktree/<part-id/>` or
182
- a branch `<part-id/>` already exists.
201
+ 3. Set <collisions/> to all <part-id/> of <parts/> for which either
202
+ the worktree directory <part-dir/> or a branch `<part-id/>`
203
+ already exists.
183
204
 
184
- 3. <if condition="<collisions/> is not empty AND <getopt-option-force/> is not equal `true`">
205
+ 4. <if condition="<collisions/> is not empty AND <getopt-option-force/> is not equal `true`">
185
206
  Only output the following <template/> -- with <collisions/>
186
207
  rendered as a comma-separated list of code spans -- and then
187
208
  immediately *STOP* processing the entire current skill, leaving
@@ -202,13 +223,13 @@ Procedure
202
223
  </ase-tpl-hint>
203
224
  </if>
204
225
 
205
- 4. <if condition="<collisions/> is not empty AND <getopt-option-force/> is equal `true`">
226
+ 5. <if condition="<collisions/> is not empty AND <getopt-option-force/> is equal `true`">
206
227
  *Remove* every colliding target by running the corresponding
207
228
  commands (taken exactly as given) per colliding <part-id/>, and
208
229
  silently ignore the failure of an individual command when the
209
230
  corresponding worktree or branch does not exist:
210
231
 
211
- `git worktree remove --force "<repo-root/>/.ase/worktree/<part-id/>"`
232
+ `git worktree remove --force "<part-dir/>"`
212
233
 
213
234
  `git worktree prune`
214
235
 
@@ -255,7 +276,7 @@ Procedure
255
276
  git-ignored, so the worktree itself never shows up as a
256
277
  change:
257
278
 
258
- `git worktree add "<repo-root/>/.ase/worktree/<part-id/>"`
279
+ `git worktree add "<part-dir/>"`
259
280
 
260
281
  <if condition="this command fails">
261
282
  Only output the following <template/>, then *continue* with
@@ -270,7 +291,7 @@ Procedure
270
291
  4. Apply the patch *inside* the freshly created worktree by
271
292
  running the corresponding command (taken exactly as given):
272
293
 
273
- `git -C "<repo-root/>/.ase/worktree/<part-id/>" apply --whitespace=nowarn "<tmp-dir/>/ase-dissect-<part-id/>.patch"`
294
+ `git -C "<part-dir/>" apply --whitespace=nowarn "<tmp-dir/>/ase-dissect-<part-id/>.patch"`
274
295
 
275
296
  <if condition="this command fails">
276
297
  Only output the following <template/>, then *continue* with
@@ -208,6 +208,20 @@ related to a set of code quality aspects.
208
208
  1. Set <file/> to the `file` field of <item/>.
209
209
  Set <change-hunks/> to the `change-hunks` field of <item/>.
210
210
 
211
+ Unless <ase-project-boxing/> is equal `grey` (where the
212
+ full unified diff is suppressed and no context lines are
213
+ rendered at all), *silently* read the current content of
214
+ <file/> with the `Read` tool - reusing the content read
215
+ for the same <file/> earlier in this iteration, unless
216
+ an `Edit` was applied to it in between - and set
217
+ <file-lines/> to its lines, *stripped* of the
218
+ line-number prefixes the tool adds. Set <file-lines/>
219
+ to empty if the file cannot be read.
220
+
221
+ This content is the *authoritative* source of the
222
+ context lines of substep 2 below, so the rendered diff
223
+ shows real context even when a sub-agent supplied none.
224
+
211
225
  Unless <ase-project-boxing/> is equal `grey` (where the
212
226
  full unified diff is suppressed and this per-file header is
213
227
  unused), set <diff-file/> to the following <template/>:
@@ -240,6 +254,18 @@ related to a set of code quality aspects.
240
254
  to its *last* two lines and <context-after/> to its
241
255
  *first* two lines.
242
256
 
257
+ Then, whenever <file-lines/> is non-empty,
258
+ *re-derive* both context parts from it, *overriding*
259
+ the sub-agent supplied values: set <context-before/>
260
+ to the *up to two* lines of <file-lines/> directly
261
+ *before* line <line/> (empty if <line/> is `1`) and
262
+ <context-after/> to the *up to two* lines of
263
+ <file-lines/> starting at line (<line/> + <n/>),
264
+ where <n/> is the number of lines in <old-text/>
265
+ (empty if that line is beyond the end of the file).
266
+ Keep the sub-agent supplied values only when
267
+ <file-lines/> is empty.
268
+
243
269
  2. *Skip* this substep entirely when <ase-project-boxing/>
244
270
  is equal `grey` - the full unified diff is suppressed
245
271
  there, so none of the <hunk-body/>, <old-count/>,
@@ -163,6 +163,27 @@ Analyze documents for spelling, punctuation, or grammar errors
163
163
  <context-before/> to its *last* two lines and
164
164
  <context-after/> to its *first* two lines.
165
165
 
166
+ Then, unless <ase-project-boxing/> is equal `grey` (where
167
+ the full unified diff is suppressed and no context lines are
168
+ rendered at all), *silently* read the current content of
169
+ <file/> with the `Read` tool - reusing the content read for
170
+ the same <file/> earlier in this iteration, unless an `Edit`
171
+ was applied to it in between - and set <file-lines/> to its
172
+ lines, *stripped* of the line-number prefixes the tool adds.
173
+ Set <file-lines/> to empty if the file cannot be read.
174
+
175
+ Whenever <file-lines/> is non-empty, *re-derive* both
176
+ context parts from it, *overriding* the sub-agent supplied
177
+ values, so the rendered diff shows real context even when a
178
+ sub-agent supplied none: set <context-before/> to the *up to
179
+ two* lines of <file-lines/> directly *before* line <line/>
180
+ (empty if <line/> is `1`) and <context-after/> to the *up
181
+ to two* lines of <file-lines/> starting at line (<line/> +
182
+ <n/>), where <n/> is the number of lines in <old-text/>
183
+ (empty if that line is beyond the end of the document).
184
+ Keep the sub-agent supplied values only when <file-lines/>
185
+ is empty.
186
+
166
187
  2. Report the problem with the following <template/>:
167
188
 
168
189
  <template>
@@ -82,25 +82,29 @@ Procedure
82
82
  directly usable as both a directory and a branch name. Do not
83
83
  output anything.
84
84
 
85
- 2. Determine the *repository root* by running the corresponding
86
- command (taken exactly as given) and capturing its output into
87
- <repo-root/>:
88
-
89
- `git rev-parse --show-toplevel`
90
-
91
- <if condition="this command fails">
92
- The current directory is not a Git repository, so no worktree can be
93
- created. Only output the following <template/> and then
94
- immediately *STOP* processing the entire current skill, leaving
95
- the working copy *untouched*:
85
+ 2. Determine the *worktree directory* by calling the
86
+ `ase_worktree_path(id: "<worktree-name/>", create: true)` tool of
87
+ the `ase` MCP server and capturing its output into
88
+ <worktree-dir/>.
89
+
90
+ You *MUST* *NEVER* assemble this path yourself, as only this tool
91
+ rejects a path leading through a symbolic link, through a
92
+ non-directory, or out of the repository -- a path `git worktree
93
+ add` would otherwise silently follow and thereby write outside
94
+ the repository.
95
+
96
+ <if condition="this tool call fails">
97
+ Either the current directory is not a Git repository or the
98
+ worktree directory is unsafe, so no worktree can be created. Only
99
+ output the following <template/> and then immediately *STOP*
100
+ processing the entire current skill, leaving the working copy
101
+ *untouched*:
96
102
 
97
103
  <template>
98
- ⧉ **ASE**: ☻ skill: **ase-task-implement**, ▶ ERROR: no Git repository -- cannot create worktree
104
+ ⧉ **ASE**: ☻ skill: **ase-task-implement**, ▶ ERROR: no Git repository or unsafe worktree directory -- cannot create worktree
99
105
  </template>
100
106
  </if>
101
107
 
102
- Then set <worktree-dir><repo-root/>/.ase/worktree/<worktree-name/></worktree-dir>.
103
-
104
108
  3. Determine the *existing worktrees* and *existing branches* by
105
109
  running the corresponding commands (taken exactly as given) and
106
110
  capturing their outputs: