@mergeline/agent 0.7.0 → 0.7.1
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/README.md +25 -9
- package/dist/init.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ secrets; commit it), so in that repository, and in the agents' worktrees of
|
|
|
26
26
|
it, the commands below use that board. The file also holds the kit's
|
|
27
27
|
version, which every claim sends with the package's: when the board expects
|
|
28
28
|
a newer kit, the claim's answer says to run
|
|
29
|
-
`npx -y @mergeline/agent@latest init --claude` again
|
|
29
|
+
`npx -y @mergeline/agent@latest init --claude` again; it keeps the file's
|
|
30
|
+
other keys (`test`, `review`). `login` checks the key with the
|
|
30
31
|
board and saves it in `~/.config/mergeline/credentials.json` (readable only
|
|
31
32
|
by you, outside any repository), per board and agent: `fe-1` on two boards
|
|
32
33
|
is two saved keys. `login` takes the address typed with `--url` (or
|
|
@@ -235,15 +236,15 @@ to inspect.
|
|
|
235
236
|
#### The reviewer: the same worker with a reviewer's key
|
|
236
237
|
|
|
237
238
|
An agent with the role `reviewer` runs the same command. Its worker claims
|
|
238
|
-
the board's review runs (a
|
|
239
|
+
the board's review runs (a developer's PR waiting in Agent review), never a
|
|
239
240
|
ticket of its own:
|
|
240
241
|
|
|
241
242
|
```sh
|
|
242
243
|
board watch --agent rv-1 --engine codex --follow
|
|
243
244
|
```
|
|
244
245
|
|
|
245
|
-
Every 0.7.0
|
|
246
|
-
rework, review); which one it gets decides what it does. A
|
|
246
|
+
Every worker from 0.7.0 on asks the board for all three kinds of run (implement,
|
|
247
|
+
rework, review); which one it gets decides what it does. A developer's
|
|
247
248
|
rework run (after the reviewer's or a person's return) is worked as any
|
|
248
249
|
other run, and its prompt says the run is done when each point of the
|
|
249
250
|
note is fixed or answered.
|
|
@@ -260,11 +261,23 @@ loses data, is a security issue, a red gate, a broken rule or a missed
|
|
|
260
261
|
requirement, and it comes with proof; nitpicks are not reported.
|
|
261
262
|
|
|
262
263
|
`rules.md` is the project's rules for reviews: the file that
|
|
263
|
-
`.mergeline.json`'s `review` key names
|
|
264
|
-
added by hand
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
`.mergeline.json`'s `review` key names. Both of the worker's keys are
|
|
265
|
+
added by hand, next to what `board init` wrote; `board init` keeps them
|
|
266
|
+
when it updates the file (0.7.1 and later):
|
|
267
|
+
|
|
268
|
+
```json
|
|
269
|
+
{
|
|
270
|
+
"board": "https://acme.mergeline.app",
|
|
271
|
+
"kit": 5,
|
|
272
|
+
"test": "npm test",
|
|
273
|
+
"review": "docs/review-rules.md"
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
The worker reads both from `origin/main`, never from the PR's branch, so a
|
|
278
|
+
PR cannot change the rules it is judged by. With no `review` key or no
|
|
279
|
+
file, the engine reviews by the prompt alone; with no `test` key, no test
|
|
280
|
+
command runs.
|
|
268
281
|
|
|
269
282
|
After the engine, the worker checks that neither the worktree's `HEAD` nor
|
|
270
283
|
the branch on origin moved; if one did, it sends nothing and releases the
|
|
@@ -275,6 +288,9 @@ is released, and the board queues the review again (three tries, then the
|
|
|
275
288
|
PR comes to a person marked not reviewed). The worktree is always removed:
|
|
276
289
|
what the engine changed there is never kept or pushed.
|
|
277
290
|
|
|
291
|
+
The review goes to the PR through `gh`, as the person who runs the worker,
|
|
292
|
+
when `gh` is logged in on that machine; to the board in any case.
|
|
293
|
+
|
|
278
294
|
When `gh` is installed and logged in, the worker reads the PR's checks
|
|
279
295
|
(as gates) and posts the review to the PR as one review comment, with a
|
|
280
296
|
line comment for each finding on a line of the diff, **as the person who
|
package/dist/init.js
CHANGED
|
@@ -215,9 +215,15 @@ export function init(opts) {
|
|
|
215
215
|
/** .mergeline.json: the kit's version and the board's address (from --url, else the one there). */
|
|
216
216
|
function repoFile(path, url) {
|
|
217
217
|
let current = {};
|
|
218
|
+
// Every key the file already has (test, review, and any of the project's own) is kept:
|
|
219
|
+
// init sets only board (when given) and kit.
|
|
220
|
+
let keep = {};
|
|
218
221
|
if (existsSync(path)) {
|
|
219
222
|
try {
|
|
220
223
|
current = readRepoFile(path);
|
|
224
|
+
const data = JSON.parse(readFileSync(path, "utf8"));
|
|
225
|
+
if (data && typeof data === "object" && !Array.isArray(data))
|
|
226
|
+
keep = data;
|
|
221
227
|
}
|
|
222
228
|
catch (err) {
|
|
223
229
|
if (!url) {
|
|
@@ -227,7 +233,7 @@ export function init(opts) {
|
|
|
227
233
|
}
|
|
228
234
|
}
|
|
229
235
|
const board = url ?? current.board;
|
|
230
|
-
const content = JSON.stringify({ ...(board ? { board } : {}), kit: KIT_VERSION }, null, 2) + "\n";
|
|
236
|
+
const content = JSON.stringify({ ...keep, ...(board ? { board } : {}), kit: KIT_VERSION }, null, 2) + "\n";
|
|
231
237
|
if (!existsSync(path)) {
|
|
232
238
|
write(path, content, "create");
|
|
233
239
|
record(path, "create");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mergeline/agent",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "The agent's side of a Mergeline board: an MCP server and the `board` CLI. Works with any agent tool that runs MCP servers or shell commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "frontender-ua",
|