@eliya-oss/agent-diff 0.1.0-alpha.106 → 0.1.0-alpha.108

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/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "bin": {
24
24
  "adiff": "./bin/adiff.js"
25
25
  },
26
- "version": "0.1.0-alpha.106",
26
+ "version": "0.1.0-alpha.108",
27
27
  "description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
28
28
  "license": "MIT",
29
29
  "repository": {
@@ -167,6 +167,16 @@ long enough that the order matters, say you can publish one and let them decide.
167
167
  Only when the reviewer asks. A reading order is a real piece of work, it can be wrong, and one
168
168
  nobody wanted spends their attention on your summary rather than on the code.
169
169
 
170
+ The ask often arrives as a comment. Pressing `L` in the review sends you one of these:
171
+
172
+ - "Please write a reading order for this branch with `adiff layers set` …" — there is none yet.
173
+ - "The reading order on this branch describes an older commit …" — read the diff again from
174
+ scratch. Do not patch the old layers; line numbers have moved.
175
+ - "Please revise the reading order …" — there is one and the reviewer wants it different. Ask what
176
+ is wrong with it if the comment does not say.
177
+
178
+ Answer it like any other comment when you are done.
179
+
170
180
  When they do ask, write **layers**: an ordered set over the diff, each one a claim about a span of
171
181
  code. The reviewer then walks the argument instead of the filesystem.
172
182
 
@@ -212,7 +222,16 @@ Rules that make a layers worth reading:
212
222
  The answer to `layers set` is the honest report — check it before you claim to be done:
213
223
 
214
224
  ```json
215
- {"ok":true,"layers":{"version":1,"stale":false,"covered":7,"partial":1,"total":9,"uncovered":[{"path":"src/api/router.ts","start":40,"end":52}],"vanished":[],"layers":[{"title":"Add the invitation data model","files":["src/db/invites.ts"]}]}}
225
+ {"ok":true,"layers":{"version":1,"stale":false,"covered":7,"partial":1,"total":9,"uncovered":[{"path":"src/api/router.ts","start":40,"end":52}],"vanished":[],"layers":[{"title":"Add the invitation data model","files":["src/db/invites.ts"],"covered":1,"partial":0,"vanished":[]}]}}
226
+
227
+ `covered`, `partial` and `vanished` appear per layer as well as for the document, so you can tell
228
+ which of your own layers is the thin one. `vanished` on a layer names paths it claims that are not
229
+ in the diff — usually a typo or a file that moved.
230
+
231
+ `layers set` refuses a document it cannot use and says which layer is wrong and why: a span that
232
+ ends before it starts, a span starting below line 1, a start or end that is not a whole number, a
233
+ block with no `kind`, a layer with no title. It no longer drops a bad span quietly, so a layer that
234
+ used to cover less than you thought now fails loudly instead.
216
235
  ```
217
236
 
218
237
  `total` counts hunks. `covered` counts the ones where every changed line sits inside a layer, and
@@ -235,6 +254,35 @@ the files, each layer shows the files it covers with the ones already reviewed t
235
254
  and `[` walk those files in the order you put them in — from the last file of one layer into the
236
255
  first of the next.
237
256
 
257
+ ## Helping draft a review of somebody else's pull request
258
+
259
+ Sometimes the reviewer is not reading your work — they are reading a stranger's pull request and
260
+ want you to think it through with them before they say anything on it. There, a comment is not an
261
+ instruction to you. It is a draft of what the reviewer will say, in the reviewer's name.
262
+
263
+ Comments on a pull request are **held**. Nothing reaches the forge until the reviewer sends them.
264
+
265
+ ```bash
266
+ adiff draft list --repo . --branch their-change
267
+ adiff draft add --repo . --branch their-change --file src/api.ts --start 40 --end 52 --body "…"
268
+ adiff draft edit --repo . --branch their-change --id d1 --body "…"
269
+ adiff draft drop --repo . --branch their-change --id d1
270
+ ```
271
+
272
+ `draft add` anchors the same way `comment send` does, so `--side old` is the version being replaced.
273
+
274
+ Rules for drafting on somebody else's behalf:
275
+
276
+ - **You never send.** There is no command that dispatches, on purpose. The reviewer signs the
277
+ review, so the reviewer sends it.
278
+ - **Write what the reviewer meant, not what you would say.** They told you the point; your job is
279
+ the wording. If you are not sure what the point is, ask rather than inventing one.
280
+ - **One draft per point.** A held comment that covers three things cannot be dropped in part.
281
+ - **Say what you drafted.** List the drafts back after you write them, so the reviewer can read
282
+ them over rather than discovering them at the moment of sending.
283
+ - **A draft is not a review of the reviewer.** Do not soften a point they meant sharply, or sharpen
284
+ one they meant gently.
285
+
238
286
  ## Discovering the rest
239
287
 
240
288
  ```bash