@eliya-oss/agent-diff 0.1.0-alpha.2 → 0.1.0-alpha.21

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
@@ -2,10 +2,12 @@
2
2
  "name": "@eliya-oss/agent-diff",
3
3
  "type": "module",
4
4
  "devDependencies": {
5
+ "@effect/tsgo": "^0.31.0",
5
6
  "@effect/vitest": "^4.0.0-beta.102",
6
7
  "@types/node": "^26.1.2",
7
8
  "effect": "^4.0.0-beta.102",
8
- "oxlint": "^1.76.0",
9
+ "oxlint": "1.77.0",
10
+ "oxlint-tsgolint": "^7.0.2001",
9
11
  "rolldown": "^1.2.1",
10
12
  "vitest": "^4.1.10"
11
13
  },
@@ -16,12 +18,12 @@
16
18
  "@opentui/core": "^0.4.5"
17
19
  },
18
20
  "engines": {
19
- "node": ">=26"
21
+ "node": ">=22"
20
22
  },
21
23
  "bin": {
22
24
  "adiff": "./bin/adiff.js"
23
25
  },
24
- "version": "0.1.0-alpha.2",
26
+ "version": "0.1.0-alpha.21",
25
27
  "description": "Review agent work across git worktrees like a PR, and hand the comments back to the agent.",
26
28
  "license": "MIT",
27
29
  "repository": {
@@ -41,7 +43,7 @@
41
43
  "check": "pnpm run typecheck && pnpm run lint && pnpm run build && pnpm test",
42
44
  "build": "rolldown -c rolldown.config.ts",
43
45
  "typecheck": "tsc --noEmit",
44
- "lint": "oxlint && node scripts/check-style.ts",
46
+ "lint": "oxlint && node scripts/check-rules.ts",
45
47
  "test": "NODE_OPTIONS=--experimental-ffi vitest run",
46
48
  "test:watch": "NODE_OPTIONS=--experimental-ffi vitest",
47
49
  "dev": "node --experimental-ffi --disable-warning=ExperimentalWarning src/main.ts",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: adiff
3
- description: Pick up review comments left on this worktree's diff in the adiff terminal, act on them, and write the story that explains the diff. Use when the user says they left comments, asks you to check adiff, asks you to watch for review feedback, or asks you to hand work over for review.
3
+ description: Pick up review comments left on this worktree's diff in the adiff terminal, act on them, and write the layers that explains the diff. Use when the user says they left comments, asks you to check adiff, asks you to watch for review feedback, or asks you to hand work over for review.
4
4
  ---
5
5
 
6
6
  # adiff
@@ -35,6 +35,41 @@ adiff comment take --worktree . --wait 300
35
35
  Blocks until a comment arrives or the timeout in seconds elapses, then returns the same envelope.
36
36
  An empty `comments` array means the wait expired with nothing new — that is not an error.
37
37
 
38
+ Run the wait in the background, not in the foreground. A foreground wait holds the turn, so you
39
+ cannot do anything else and the person you are working with cannot talk to you. Backgrounded, the
40
+ harness brings you back the moment a comment lands.
41
+
42
+ Re-arm it after each comment you handle, and keep it running while you work. A reviewer reads at
43
+ their own pace, so comments arrive minutes apart, and the whole point is that they reach you as
44
+ events rather than by you asking. When you finish a piece of work, say you are still listening.
45
+
46
+ ## Answering a comment
47
+
48
+ Say what you did, against the comment you were handed:
49
+
50
+ ```bash
51
+ adiff comment answer --worktree . --id <id> --body "Dropped it, and the import with it."
52
+ ```
53
+
54
+ The id comes from `comment take`. The reviewer sees the answer under their own words the next time
55
+ they read the branch, so this is how they learn a point was addressed rather than ignored.
56
+
57
+ Answer when the change alone does not carry the reasoning: what you did instead of what was asked,
58
+ what you found while doing it, or why the comment does not apply. A comment that asked a question
59
+ deserves an answer even when nothing changed.
60
+
61
+ Add `--asks` when you need the reviewer to decide before you continue:
62
+
63
+ ```bash
64
+ adiff comment answer --worktree . --id <id> --asks --body "Drop it, or keep it and map the error?"
65
+ ```
66
+
67
+ That marks the thread as waiting on them rather than on you. Do not use it to check in; use it when
68
+ the work genuinely stops without an answer.
69
+
70
+ Settling a thread is the reviewer's to do, not yours. They raised the point, so they decide it is
71
+ closed.
72
+
38
73
  ## Acting on a comment
39
74
 
40
75
  Read `snippet` before opening the file: the reviewer commented on the diff, and the file may have
@@ -58,21 +93,21 @@ Read `suggestion` before doing anything else — it names the command that resol
58
93
  Retry only when `retriable` is true. `UnknownBranch` means this worktree is not one adiff knows
59
94
  about, because the reviewer has not opened it; report that rather than looping.
60
95
 
61
- ## Handing work over: write the story
96
+ ## Handing work over: write the layers
62
97
 
63
98
  You know the order the change was built in. The reviewer does not, and rebuilding it by reading
64
99
  every file is the most expensive way to learn something you already have. When you finish a piece
65
- of work, write a **story**: an ordered set of steps over the diff, each one a claim about a span of
100
+ of work, write a **layers**: an ordered set of layers over the diff, each one a claim about a span of
66
101
  code. The reviewer then walks the argument instead of the filesystem.
67
102
 
68
103
  ```bash
69
- adiff story set --worktree . --json - <<'JSON'
104
+ adiff layers set --worktree . --json - <<'JSON'
70
105
  {
71
106
  "summary": "Team invitations, end to end",
72
- "steps": [
107
+ "layers": [
73
108
  {
74
109
  "title": "Add the invitation data model",
75
- "note": "The record every later step leans on",
110
+ "note": "The record every later layer leans on",
76
111
  "spans": [{ "path": "src/db/invites.ts", "start": 1, "end": 48 }]
77
112
  },
78
113
  {
@@ -91,35 +126,49 @@ adiff story set --worktree . --json - <<'JSON'
91
126
  JSON
92
127
  ```
93
128
 
94
- Rules that make a story worth reading:
129
+ Rules that make a layers worth reading:
95
130
 
96
- - **Order is the point.** Step 1 is what the reader must understand before step 2 makes sense.
131
+ - **Order is the point.** Layer 1 is what the reader must understand before layer 2 makes sense.
97
132
  Data model, then the code that uses it, then the surface, then the mechanical bits last.
98
133
  - **A title is a claim, not a file name.** "Add the invitation API", never "changes to
99
134
  src/api/invites.ts".
100
135
  - **Line numbers are the new side of the diff**, the same numbers `adiff comment take` reports.
101
- - **Cover everything.** adiff computes coverage itself and answers with the hunks no step claims;
102
- those show up for the reviewer under "not in any step" whatever you do. A story that quietly
103
- skips a third of the diff is worse than no story, so put the leftovers in a final step and say
136
+ - **Cover everything.** adiff computes coverage itself and answers with the hunks no layer claims;
137
+ those show up for the reviewer under "not in any layer" whatever you do. A layers that quietly
138
+ skips a third of the diff is worse than no layers, so put the leftovers in a final layer and say
104
139
  they are mechanical.
105
140
 
106
- The answer to `story set` is the honest report — check it before you claim to be done:
141
+ The answer to `layers set` is the honest report — check it before you claim to be done:
107
142
 
108
143
  ```json
109
- {"ok":true,"story":{"version":1,"stale":false,"covered":7,"total":9,"uncovered":[{"path":"src/api/router.ts","start":40,"end":52}],"vanished":[],"steps":[{"title":"Add the invitation data model","files":["src/db/invites.ts"]}]}}
144
+ {"ok":true,"layers":{"version":1,"stale":false,"covered":7,"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"]}]}}
110
145
  ```
111
146
 
112
- `covered`/`total` count hunks. `uncovered` names the ones no step claims — claim them and set the
113
- story again. `vanished` names paths a step points at that this branch does not change, which
147
+ `covered`/`total` count hunks. `uncovered` names the ones no layer claims — claim them and set the
148
+ layers again. `vanished` names paths a layer points at that this branch does not change, which
114
149
  usually means a typo in a path. Read it back at any time with:
115
150
 
116
151
  ```bash
117
- adiff story show --worktree . --fields covered,total,uncovered
152
+ adiff layers show --worktree . --fields covered,total,uncovered
118
153
  ```
119
154
 
120
- Setting a story again supersedes the previous one and bumps `version`; the story records the commit
155
+ Setting a layers again supersedes the previous one and bumps `version`; the layers records the commit
121
156
  it was written for, and adiff reports it as `stale` once the branch moves past that commit. After
122
- you address a review, write the story again.
157
+ you address a review, write the layers again.
158
+
159
+ ## Tell the reviewer how to read it
160
+
161
+ The person you are handing work to has to open the review themselves, so end your reply with the
162
+ command and the keys. Name the repository they should point at, which is the repository the
163
+ worktree belongs to:
164
+
165
+ > Open it with `adiff review open --repo <repo>`, then press `enter` on this branch. The sidebar
166
+ > lists the layers in reading order; `j` and `k` move between them and the diff follows. Inside a
167
+ > layer, `]` and `[` walk its files. Select lines with `v`, write a comment with `c`, stage it with
168
+ > `ctrl+a`, and send the whole review with `S`. Press `?` for the rest.
169
+
170
+ Say what you want looked at hardest, and where you are unsure. A reviewer who knows which layer you
171
+ doubt spends their attention there.
123
172
 
124
173
  ## Discovering the rest
125
174