@a9n-shoji/rvw 0.2.3 β 0.2.4
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/CHANGELOG.md +8 -0
- package/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/package.json +15 -17
- package/skills/rvw-watch-comments/SKILL.md +20 -9
- package/skills/rvw-watch-comments/scripts/auto-ack.mjs +0 -0
- package/skills/rvw-watch-comments/scripts/preflight.mjs +0 -0
- package/skills/rvw-watch-comments/scripts/watch-driver.mjs +0 -0
- package/skills/rvw-watch-comments/scripts/watch-state.mjs +18 -7
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a9n-shoji/rvw",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"packageManager": "pnpm@11.21.0+sha512.UhcFvOaJkk6scvWjWHEi82JonvZXHlW6gAdv1jfBETLs/62ib61Op5xIW/3b/T1aKlsFgFp36JPeceyKbMo7sQ==",
|
|
3
|
+
"version": "0.2.4",
|
|
5
4
|
"description": "Human-centered repository viewer for understanding and refining GitHub pull request changes",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"code-review",
|
|
@@ -40,20 +39,6 @@
|
|
|
40
39
|
"node": ">=24.15.0",
|
|
41
40
|
"pnpm": "11.21.0"
|
|
42
41
|
},
|
|
43
|
-
"scripts": {
|
|
44
|
-
"dev": "tsx src/cli/main.ts open --no-open",
|
|
45
|
-
"demo": "node scripts/build.mjs && tsx scripts/demo.mjs",
|
|
46
|
-
"check": "tsc --noEmit && eslint . && prettier --check .",
|
|
47
|
-
"test": "vitest run",
|
|
48
|
-
"test:watch": "vitest",
|
|
49
|
-
"test:e2e": "node scripts/build.mjs && playwright test",
|
|
50
|
-
"test:package": "node scripts/package-smoke.mjs",
|
|
51
|
-
"build": "node scripts/build.mjs",
|
|
52
|
-
"start": "node dist/cli.mjs",
|
|
53
|
-
"release:verify": "tsx scripts/verify-release.ts",
|
|
54
|
-
"format": "prettier --write .",
|
|
55
|
-
"prepack": "node scripts/build.mjs"
|
|
56
|
-
},
|
|
57
42
|
"devDependencies": {
|
|
58
43
|
"@eslint/js": "^10.0.1",
|
|
59
44
|
"@hono/node-server": "^2.1.0",
|
|
@@ -91,5 +76,18 @@
|
|
|
91
76
|
"vite": "^8.2.1",
|
|
92
77
|
"vitest": "^4.1.10",
|
|
93
78
|
"zod": "^4.4.3"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"dev": "tsx src/cli/main.ts open --no-open",
|
|
82
|
+
"demo": "node scripts/build.mjs && tsx scripts/demo.mjs",
|
|
83
|
+
"check": "tsc --noEmit && eslint . && prettier --check .",
|
|
84
|
+
"test": "vitest run",
|
|
85
|
+
"test:watch": "vitest",
|
|
86
|
+
"test:e2e": "node scripts/build.mjs && playwright test",
|
|
87
|
+
"test:package": "node scripts/package-smoke.mjs",
|
|
88
|
+
"build": "node scripts/build.mjs",
|
|
89
|
+
"start": "node dist/cli.mjs",
|
|
90
|
+
"release:verify": "tsx scripts/verify-release.ts",
|
|
91
|
+
"format": "prettier --write ."
|
|
94
92
|
}
|
|
95
|
-
}
|
|
93
|
+
}
|
|
@@ -68,9 +68,11 @@ direct-database transport; an unavailable selected transport is fatal.
|
|
|
68
68
|
node '<SKILL_DIR>/scripts/preflight.mjs'
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
Before starting intake,
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
Before starting intake, target eight concurrent subagent slots for this task. When the runtime can
|
|
72
|
+
guarantee at least eight, reserve exactly eight and set `<RESERVED_WORKER_SLOTS>` to `8`. Otherwise
|
|
73
|
+
reserve the largest positive number it can guarantee and use that exact number; use `1` only when it
|
|
74
|
+
cannot guarantee more than one. Never set the value above reserved capacity. Start the bundled driver
|
|
75
|
+
with the state path and the matching in-flight limit. `--auto-ack` is the normal mode: it claims
|
|
74
76
|
eligible PR batches only while fewer than that limit are in flight, re-reads every thread, creates
|
|
75
77
|
`π η’ΊθͺδΈγ§γβ¦` (or restores it when retrying that batch), records suppression, and emits one
|
|
76
78
|
`batch-acknowledged` JSON line containing the lease and operations. The first `watch-ready` line
|
|
@@ -81,6 +83,10 @@ durable work up to the same capacity. The driver atomically owns one lock beside
|
|
|
81
83
|
path before spawning rvw. A second driver for the same state exits immediately; a later restart
|
|
82
84
|
removes a stale lock only when its recorded owner process no longer exists.
|
|
83
85
|
|
|
86
|
+
For an `investigate-and-reply`-only task, prefer the target of eight above whenever capacity permits.
|
|
87
|
+
Do not reduce capacity merely because multiple leases may inspect the same Pull Request or repository:
|
|
88
|
+
those workers are source-read-only and each batch owns a distinct status post.
|
|
89
|
+
|
|
84
90
|
```bash
|
|
85
91
|
node '<SKILL_DIR>/scripts/watch-driver.mjs' '<TASK_STATE_DB>' \
|
|
86
92
|
--auto-ack --max-in-flight '<RESERVED_WORKER_SLOTS>'
|
|
@@ -157,7 +163,9 @@ node '<SKILL_DIR>/scripts/watch-state.mjs' reserve-write \
|
|
|
157
163
|
```
|
|
158
164
|
|
|
159
165
|
The unique reservation prevents two leases from writing the same repository. A manually invoked
|
|
160
|
-
`auto-ack` may instead receive `--write-key` when that identity was already verified
|
|
166
|
+
`auto-ack` may instead receive `--write-key` when that identity was already verified and the immutable
|
|
167
|
+
task policy allows `fix-and-push`. An `investigate-and-reply`-only task cannot claim or reserve a write
|
|
168
|
+
key; its leases stay unreserved and may inspect the same repository concurrently.
|
|
161
169
|
|
|
162
170
|
## Delegate every acknowledged batch immediately
|
|
163
171
|
|
|
@@ -254,11 +262,14 @@ additional task-created posts. If a thread or its recorded status post disappear
|
|
|
254
262
|
complete it without creating a replacement and report it as gone. Comment and reply bodies are UTF-8
|
|
255
263
|
GFM Markdown up to 64 KiB, not 4 KiB; a 4093-byte result is within the contract.
|
|
256
264
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
265
|
+
In an `investigate-and-reply`-only task, an event for a PR with an active lease becomes a separate
|
|
266
|
+
eligible batch. The driver's state pump may acknowledge and delegate it immediately while reserved
|
|
267
|
+
capacity remains; do not wait for the preceding investigation to complete. Batch-scoped status posts
|
|
268
|
+
keep both final edits independent. When the immutable task policy allows `fix-and-push`, same-PR
|
|
269
|
+
follow-ups remain durable but ineligible until the active lease is released, and repository write
|
|
270
|
+
reservations serialize writers across different PRs. After retryable `fail`, let the pump wait through
|
|
271
|
+
the recorded `nextAttemptAt` and dispatch the restored lease when due. Never assign a follow-up or retry
|
|
272
|
+
to the previous subagent.
|
|
262
273
|
|
|
263
274
|
## Choose the worker mode
|
|
264
275
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -409,11 +409,13 @@ function listPending(database) {
|
|
|
409
409
|
ORDER BY first_sequence`,
|
|
410
410
|
)
|
|
411
411
|
.all(now);
|
|
412
|
+
const blockedStatuses =
|
|
413
|
+
getMeta(database, "own_mode") === "investigate-and-reply"
|
|
414
|
+
? "status = 'pending'"
|
|
415
|
+
: "status IN ('pending', 'in_flight')";
|
|
412
416
|
const blockedPullRequests = new Set(
|
|
413
417
|
database
|
|
414
|
-
.prepare(
|
|
415
|
-
"SELECT DISTINCT pull_request_url FROM batches WHERE status IN ('pending', 'in_flight')",
|
|
416
|
-
)
|
|
418
|
+
.prepare(`SELECT DISTINCT pull_request_url FROM batches WHERE ${blockedStatuses}`)
|
|
417
419
|
.all()
|
|
418
420
|
.map((row) => row.pull_request_url),
|
|
419
421
|
);
|
|
@@ -525,10 +527,16 @@ function claim(database, pullRequestUrl, writeKey) {
|
|
|
525
527
|
const canonicalWriteKey = writeKey === undefined ? undefined : normalizeWriteKey(writeKey);
|
|
526
528
|
return transaction(database, () => {
|
|
527
529
|
const now = new Date().toISOString();
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
530
|
+
const ownMode = getMeta(database, "own_mode");
|
|
531
|
+
if (canonicalWriteKey !== undefined && ownMode !== "fix-and-push") {
|
|
532
|
+
fail("Task policy does not allow repository write reservations");
|
|
533
|
+
}
|
|
534
|
+
if (ownMode !== "investigate-and-reply") {
|
|
535
|
+
const active = database
|
|
536
|
+
.prepare("SELECT id FROM batches WHERE pull_request_url = ? AND status = 'in_flight'")
|
|
537
|
+
.get(pullRequestUrl);
|
|
538
|
+
if (active) fail("Pull Request already has an in-flight batch");
|
|
539
|
+
}
|
|
532
540
|
let batch = database
|
|
533
541
|
.prepare(
|
|
534
542
|
`SELECT * FROM batches
|
|
@@ -592,6 +600,9 @@ function claim(database, pullRequestUrl, writeKey) {
|
|
|
592
600
|
function reserveWrite(database, leaseId, writeKey) {
|
|
593
601
|
const canonicalWriteKey = normalizeWriteKey(writeKey);
|
|
594
602
|
return transaction(database, () => {
|
|
603
|
+
if (getMeta(database, "own_mode") !== "fix-and-push") {
|
|
604
|
+
fail("Task policy does not allow repository write reservations");
|
|
605
|
+
}
|
|
595
606
|
const batch = database
|
|
596
607
|
.prepare("SELECT * FROM batches WHERE lease_id = ? AND status = 'in_flight'")
|
|
597
608
|
.get(leaseId);
|