loopwright 0.1.7 → 0.1.9
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 +4 -1
- package/content/agents/implementer.md +2 -0
- package/content/agents/reviewer.md +5 -5
- package/content/agents/tester.md +2 -0
- package/content/hooks/default-config.json +1 -0
- package/content/hooks/lw.mjs +257 -39
- package/content/prompts/reviewer.md +6 -3
- package/content/prompts/simplifier.md +42 -0
- package/content/prompts/standards.md +1 -0
- package/content/skills/loopwright-build/SKILL.md +9 -2
- package/content/skills/loopwright-done/SKILL.md +8 -1
- package/content/skills/loopwright-flow/SKILL.md +5 -3
- package/content/skills/loopwright-review/SKILL.md +33 -3
- package/content/skills/loopwright-test/SKILL.md +6 -4
- package/dist/cli.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,9 @@ flowchart TD
|
|
|
50
50
|
tier -- "standard" --> test["Test<br/>tester writes and locks acceptance tests"]
|
|
51
51
|
tier -- "large" --> slices["Split into slices<br/>each runs Test, Build, Review,<br/>then one whole-branch review"]
|
|
52
52
|
test --> build["Build<br/>implementer makes the tests pass"]
|
|
53
|
-
build -->
|
|
53
|
+
build -- "round 1: standard, large, fix" --> simplify["Simplify<br/>reviewer proposes cuts, you pick,<br/>approved ones are applied"]
|
|
54
|
+
build -- "small feature or fix round" --> review
|
|
55
|
+
simplify --> review{"Review<br/>separate reviewer: passes?"}
|
|
54
56
|
review -- "blocking findings, rounds left" --> build
|
|
55
57
|
review -- "fix-round cap reached" --> you{{"You decide"}}
|
|
56
58
|
review -- "pass" --> done["Done<br/>AGENTS.md proposals, commit and PR draft"]
|
|
@@ -61,6 +63,7 @@ flowchart TD
|
|
|
61
63
|
- **Plan** runs in your session. Plan first restates your goal for you to confirm or correct. A read-only scout then maps the repo, then you answer the high-impact questions one at a time and confirm the plan. Nothing is built before that.
|
|
62
64
|
- **Test** (standard, large, and every fix): a tester subagent, which never sees the implementation, writes acceptance tests from your confirmed criteria and locks them.
|
|
63
65
|
- **Build**: an implementer subagent makes the locked tests pass. Small feature tasks skip Test, so the implementer writes the tests; a fix never skips it.
|
|
66
|
+
- **Simplify** (standard, large, and every fix): a read-only reviewer proposes behavior-preserving cuts to the diff, each with its net line change and what it gives up. You choose which to apply; nothing changes without your approval, and you are not asked when there is nothing to cut.
|
|
64
67
|
- **Review**: a reviewer that starts blind runs your checks, confirms the locked tests are untouched, and reports only proven, high-impact findings. Blocking findings send the task back to Build, up to 3 rounds by default; findings it cannot confirm come to you to fix or dismiss.
|
|
65
68
|
- **Done**: proposes `AGENTS.md` updates and drafts the commit and PR message. You approve each change; loopwright never commits.
|
|
66
69
|
|
|
@@ -9,6 +9,8 @@ You are the loopwright implementer. You make the smallest change that satisfies
|
|
|
9
9
|
|
|
10
10
|
The main thread gives you the task file path, and on a fix round the reviewer's Blocking findings. Read the task file fresh every time: goal, decisions (`D…`), acceptance criteria (`AC…`), check commands, locked tests. The task file wins over any summary in your prompt.
|
|
11
11
|
|
|
12
|
+
Approved simplifications (the main thread lists them verbatim, each approved by the user): apply only those, in place of Step 3's implementing, and add no unit tests. They are exempt from "no unrelated cleanups"; behavior must stay identical. Steps 1, 2 and 4 still run; skip Step 5, your own simplify pass, which could cut what the user did not approve. Write no `Root cause:` line on that run, even on a fix task.
|
|
13
|
+
|
|
12
14
|
## Boundaries
|
|
13
15
|
|
|
14
16
|
- Do not edit, move, delete or reformat locked test files (`node "{{LW_HOME}}/hooks/lw.mjs" status` lists them under `lockedTests`). Do not change test config to skip or weaken them. Review re-hashes them; any change fails the review.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: loopwright-reviewer
|
|
3
|
-
description:
|
|
3
|
+
description: Reads a change against its task file and standards under a procedure file the caller names (a review verdict by default, or a list of proposed simplifications) and returns that procedure's JSON output. Never edits code.
|
|
4
4
|
tools: Read, Grep, Glob, Bash
|
|
5
5
|
---
|
|
6
6
|
You are the loopwright reviewer, a context separate from the one that wrote the code.
|
|
7
7
|
|
|
8
|
-
Read
|
|
8
|
+
Read the procedure file the caller names and follow it exactly. It defines your inputs, the procedure and the output format. With no procedure file named, the default is `{{LW_HOME}}/prompts/reviewer.md`.
|
|
9
9
|
|
|
10
10
|
Boundaries, which hold even where your tools would allow more:
|
|
11
11
|
- Do not modify any file. Bash is for reading, running tests and check commands, and the read-only `lw.mjs` commands named in the procedure.
|
|
12
|
-
-
|
|
13
|
-
- You cannot ask the user questions.
|
|
12
|
+
- Under `reviewer.md`, in the blind pass, do not read or ask for the implementer's report. Run the second pass only when the caller supplies that report.
|
|
13
|
+
- You cannot ask the user questions. Under `reviewer.md`, anything you cannot confirm but can back with proof goes in `undecided`.
|
|
14
14
|
|
|
15
|
-
Your final message is the JSON verdict object and nothing else.
|
|
15
|
+
Your final message is the output the named procedure defines (for `reviewer.md`, the JSON verdict object) and nothing else.
|
package/content/agents/tester.md
CHANGED
|
@@ -13,6 +13,8 @@ The main thread gives you the task file path. Read its acceptance criteria (`AC
|
|
|
13
13
|
|
|
14
14
|
- Read implementation files only as far as needed to import public interfaces (module paths, exported names, signatures). Do not read or test internals.
|
|
15
15
|
- Reopened task (the main thread says so and names the scope): you may edit the existing locked tests for the named ACs, then re-lock them. Leave every other locked test untouched.
|
|
16
|
+
- Pulled locked tests (the main thread lists the files from `pulledLocks`): check each still tests its acceptance criteria, edit only what the pull broke, then re-lock only those files. Leave every other locked test untouched.
|
|
17
|
+
- Approved cuts to locked tests (the main thread lists them, each approved by the user): apply only those cuts, to the files they name. Each test must still pass against the built code and check the same behavior as before. Rerun the tests, then re-lock only the files you cut; leave every other locked test untouched.
|
|
16
18
|
- Re-dispatched during Test-stage verification (the main thread names the problem, e.g. comments restating a test name): you may edit and re-lock your own tests; this is the same re-lock as a reopen, before Build.
|
|
17
19
|
- Read `{{LW_HOME}}/prompts/standards.md` and follow it in the tests you write.
|
|
18
20
|
- Write only test files (and fixtures they need). Do not create or edit implementation code, not even stubs.
|
package/content/hooks/lw.mjs
CHANGED
|
@@ -218,6 +218,166 @@ const refExists = (ref) => {
|
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Re-locks and restarts that the history flags for the user's attention, and the ones an `accept-locks` took out.
|
|
223
|
+
* Re-locking an existing lock after a build could launder an implementer's edit; first-time locks in later slices are legitimate.
|
|
224
|
+
* A reopen covers re-locks until the next Build starts, but only when the history reads
|
|
225
|
+
* await-user, resume, reopen with nothing between (the pair the skills run around the user's answer
|
|
226
|
+
* to going back); any other reopen is ignored. A faked triple is not detected.
|
|
227
|
+
* An acceptance covers only what was flagged when it ran: a later re-lock or forced restart flags again.
|
|
228
|
+
*/
|
|
229
|
+
function lockFlags(history = []) {
|
|
230
|
+
const lockedAfterBuild = [];
|
|
231
|
+
const relockedAfterReopen = [];
|
|
232
|
+
const accepted = [];
|
|
233
|
+
const seen = new Map();
|
|
234
|
+
let reopenReason = null;
|
|
235
|
+
let prev = null;
|
|
236
|
+
let prev2 = null;
|
|
237
|
+
let built = false;
|
|
238
|
+
let forcedRestartAfterBuild = false;
|
|
239
|
+
const unaccept = (match) => {
|
|
240
|
+
const i = accepted.findIndex(match);
|
|
241
|
+
if (i !== -1) accepted.splice(i, 1);
|
|
242
|
+
};
|
|
243
|
+
for (const e of history) {
|
|
244
|
+
const sanctioned = prev2 === 'await-user' && prev === 'resume';
|
|
245
|
+
prev2 = prev;
|
|
246
|
+
prev = e.event;
|
|
247
|
+
if (e.event === 'stage' && e.detail === 'build') {
|
|
248
|
+
for (const p of seen.keys()) seen.set(p, true);
|
|
249
|
+
reopenReason = null;
|
|
250
|
+
built = true;
|
|
251
|
+
}
|
|
252
|
+
if (e.event === 'reopen' && sanctioned) reopenReason = e.reason ?? '';
|
|
253
|
+
if (built && e.event === 'start' && e.detail === '--force') {
|
|
254
|
+
forcedRestartAfterBuild = true;
|
|
255
|
+
unaccept((a) => a.restart);
|
|
256
|
+
}
|
|
257
|
+
if (e.event === 'accept-locks') {
|
|
258
|
+
if (e.detail === '--restart') {
|
|
259
|
+
forcedRestartAfterBuild = false;
|
|
260
|
+
accepted.push({ restart: true, reason: e.reason });
|
|
261
|
+
} else {
|
|
262
|
+
const i = lockedAfterBuild.indexOf(e.detail);
|
|
263
|
+
if (i !== -1) lockedAfterBuild.splice(i, 1);
|
|
264
|
+
accepted.push({ path: e.detail, reason: e.reason });
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (e.event !== 'lock') continue;
|
|
268
|
+
if (seen.get(e.detail) === true) {
|
|
269
|
+
if (reopenReason !== null) {
|
|
270
|
+
if (!relockedAfterReopen.some((r) => r.path === e.detail))
|
|
271
|
+
relockedAfterReopen.push({ path: e.detail, reason: reopenReason });
|
|
272
|
+
} else {
|
|
273
|
+
unaccept((a) => a.path === e.detail);
|
|
274
|
+
if (!lockedAfterBuild.includes(e.detail)) lockedAfterBuild.push(e.detail);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
seen.set(e.detail, false);
|
|
278
|
+
}
|
|
279
|
+
return { lockedAfterBuild, relockedAfterReopen, forcedRestartAfterBuild, accepted };
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const isAncestor = (a, b) => {
|
|
283
|
+
try {
|
|
284
|
+
gitOut(['merge-base', '--is-ancestor', a, b]);
|
|
285
|
+
return true;
|
|
286
|
+
} catch {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Locked tests out of step with their lock that the pulled commits from..to touched: the ones on the upstream
|
|
293
|
+
* branch, never the task's local-only commits. A repo without an upstream branch counts every commit.
|
|
294
|
+
*/
|
|
295
|
+
function pulledLockedTests(state, from, to) {
|
|
296
|
+
const top = gitTopLevel(cwd);
|
|
297
|
+
const stale = (state.lockedTests ?? []).filter((l) => {
|
|
298
|
+
const abs = resolve(top, l.path);
|
|
299
|
+
return existsSync(abs) && sha256File(abs) !== l.sha256;
|
|
300
|
+
});
|
|
301
|
+
if (!stale.length) return undefined;
|
|
302
|
+
try {
|
|
303
|
+
// Lock paths are lower-cased on win32 (repoRelative), git prints the tracked case.
|
|
304
|
+
const fold = (p) => (process.platform === 'win32' ? p.toLowerCase() : p);
|
|
305
|
+
const lines = (args) => gitOut(args).split('\n').filter(Boolean);
|
|
306
|
+
const upstream = ['@{u}', 'origin/HEAD'].find(refExists);
|
|
307
|
+
let commits = lines(['rev-list', `${from}..${to}`]);
|
|
308
|
+
if (upstream) {
|
|
309
|
+
const onUpstream = new Set(lines(['rev-list', `${from}..${upstream}`]));
|
|
310
|
+
commits = commits.filter((c) => onUpstream.has(c));
|
|
311
|
+
}
|
|
312
|
+
const names = (args) =>
|
|
313
|
+
gitOut(['-c', 'core.quotePath=false', ...args])
|
|
314
|
+
.split('\0')
|
|
315
|
+
.filter(Boolean)
|
|
316
|
+
.map(fold);
|
|
317
|
+
// `--cc` lists a merge commit's own edits (conflict resolutions) only, never what its second parent brings in:
|
|
318
|
+
// the commits that merge brought are listed on their own. `-m` would list every file the mainline changed since
|
|
319
|
+
// the merged branch forked, from before the base too. A file the pulled commits changed and then reverted is
|
|
320
|
+
// dropped by the net diff from..to.
|
|
321
|
+
const touched = new Set(
|
|
322
|
+
commits.length ? names(['log', '--cc', '--no-walk', '--name-only', '--format=', '-z', ...commits]) : [],
|
|
323
|
+
);
|
|
324
|
+
const net = new Set(names(['diff', '--name-only', '-z', from, to]));
|
|
325
|
+
return stale.filter((l) => touched.has(fold(l.path)) && net.has(fold(l.path))).map((l) => l.path);
|
|
326
|
+
} catch (err) {
|
|
327
|
+
process.stderr.write(`loopwright: cannot diff the previous base (${err.message.split('\n')[0]}); no pulledLocks\n`);
|
|
328
|
+
return undefined;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** The answered HEAD when it sits on the way from the base to `to`: those commits stay in the review. */
|
|
333
|
+
const keptHead = (state, to) =>
|
|
334
|
+
state.answeredHead && isAncestor(state.baseCommit, state.answeredHead) && isAncestor(state.answeredHead, to)
|
|
335
|
+
? state.answeredHead
|
|
336
|
+
: undefined;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* HEAD past the base with at least one commit already on the upstream branch (else origin/HEAD), and not yet
|
|
340
|
+
* answered. Once answered, only the commits made since that answer are checked, and `keptEarlier` says the
|
|
341
|
+
* answered commits stay in the review. `localOnly` lists the short shas of the commits that exist only locally
|
|
342
|
+
* (the task's own work, so the branch holds both kinds); a merge commit holds no work of its own and never counts.
|
|
343
|
+
*/
|
|
344
|
+
function movedHead(state) {
|
|
345
|
+
try {
|
|
346
|
+
const to = gitOut(['rev-parse', 'HEAD']);
|
|
347
|
+
if (to === state.baseCommit || to === state.answeredHead) return undefined;
|
|
348
|
+
const upstream = ['@{u}', 'origin/HEAD'].find(refExists);
|
|
349
|
+
if (!upstream) return undefined;
|
|
350
|
+
const kept = keptHead(state, to);
|
|
351
|
+
const keptEarlier = Boolean(kept);
|
|
352
|
+
const range = `${kept ?? state.baseCommit}..`;
|
|
353
|
+
const lines = (args) => gitOut(args).split('\n').filter(Boolean);
|
|
354
|
+
const onUpstream = new Set(lines(['rev-list', `${range}${upstream}`]));
|
|
355
|
+
const commits = lines(['log', '--format=%H %s', `${range}HEAD`]);
|
|
356
|
+
if (!commits.some((c) => onUpstream.has(c.split(' ')[0]))) return undefined;
|
|
357
|
+
const localOnly = lines(['rev-list', '--no-merges', `${range}HEAD`])
|
|
358
|
+
.filter((c) => !onUpstream.has(c))
|
|
359
|
+
.map((c) => c.slice(0, 7));
|
|
360
|
+
return {
|
|
361
|
+
from: state.baseCommit,
|
|
362
|
+
to,
|
|
363
|
+
commits,
|
|
364
|
+
...(keptEarlier && { keptEarlier }),
|
|
365
|
+
...(localOnly.length && { localOnly }),
|
|
366
|
+
};
|
|
367
|
+
} catch {
|
|
368
|
+
return undefined;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** How many commits the task already has since its base, so a later pull is known to sit on top of them. */
|
|
373
|
+
function ownCommits(state) {
|
|
374
|
+
try {
|
|
375
|
+
return Number(gitOut(['rev-list', '--count', `${state.baseCommit}..HEAD`])) || undefined;
|
|
376
|
+
} catch {
|
|
377
|
+
return undefined;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
221
381
|
const [cmd, ...rest] = process.argv.slice(2);
|
|
222
382
|
try {
|
|
223
383
|
switch (cmd) {
|
|
@@ -239,11 +399,23 @@ try {
|
|
|
239
399
|
const { dir, id } = ctx(true);
|
|
240
400
|
const prior = readState(dir, id);
|
|
241
401
|
if (!force && prior) fail('loopwright: task already active (run lw.mjs done first, or start --force)');
|
|
402
|
+
const baseCommit = gitOut(['rev-parse', base]);
|
|
403
|
+
const baseMoved = prior?.baseCommit !== baseCommit;
|
|
404
|
+
// Locked tests out of step with their lock now that the base moves, that the commits it moves over touched:
|
|
405
|
+
// the pull's files, fixed here so a later edit of a test that matched its lock is never taken for a pull.
|
|
406
|
+
const pulledSnapshot = baseMoved
|
|
407
|
+
? prior?.baseCommit && pulledLockedTests(prior, prior.baseCommit, baseCommit)
|
|
408
|
+
: prior?.pulledSnapshot;
|
|
242
409
|
const state = {
|
|
243
410
|
version: 1,
|
|
244
411
|
task,
|
|
245
412
|
stage: 'plan',
|
|
246
|
-
baseCommit
|
|
413
|
+
baseCommit,
|
|
414
|
+
// The locked tests a pull changed, and where in the history the base moved, so a re-lock after it counts
|
|
415
|
+
// as handled; both kept across restarts that leave the base alone.
|
|
416
|
+
pulledSnapshot: pulledSnapshot?.length ? pulledSnapshot : undefined,
|
|
417
|
+
baseMovedAt: baseMoved ? (prior?.history?.length ?? 0) : prior.baseMovedAt,
|
|
418
|
+
answeredHead: prior?.answeredHead,
|
|
247
419
|
worktree: gitTopLevel(cwd),
|
|
248
420
|
branch: gitOut(['rev-parse', '--abbrev-ref', 'HEAD']),
|
|
249
421
|
// A forced restart keeps the audit trail and the lock records, so a locked test edited
|
|
@@ -322,42 +494,50 @@ try {
|
|
|
322
494
|
else if (sha256File(abs) !== l.sha256) changed.push(l.path);
|
|
323
495
|
}
|
|
324
496
|
const ok = changed.length === 0 && missing.length === 0;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (!relockedAfterReopen.some((r) => r.path === e.detail))
|
|
348
|
-
relockedAfterReopen.push({ path: e.detail, reason: reopenReason });
|
|
349
|
-
} else if (!lockedAfterBuild.includes(e.detail)) lockedAfterBuild.push(e.detail);
|
|
350
|
-
}
|
|
351
|
-
seen.set(e.detail, false);
|
|
497
|
+
const { lockedAfterBuild, relockedAfterReopen, forcedRestartAfterBuild, accepted } = lockFlags(state.history);
|
|
498
|
+
out({ ok, changed, missing, lockedAfterBuild, relockedAfterReopen, forcedRestartAfterBuild, accepted });
|
|
499
|
+
process.exit(ok ? 0 : 1);
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
case 'accept-locks': {
|
|
503
|
+
// Takes re-locks and a forced restart that a decision covers, or that the user dismissed, out of check-locks.
|
|
504
|
+
const usage = 'loopwright: usage: accept-locks --reason "<text>" [--restart] [<path>...]';
|
|
505
|
+
const reason = flag(rest, '--reason')?.trim();
|
|
506
|
+
if (!reason) fail(`loopwright: accept-locks requires --reason <text>\n${usage}`);
|
|
507
|
+
const restart = rest.includes('--restart');
|
|
508
|
+
if (restart) rest.splice(rest.indexOf('--restart'), 1);
|
|
509
|
+
if (!restart && rest.length === 0) fail(`loopwright: accept-locks needs a path or --restart\n${usage}`);
|
|
510
|
+
const { dir, id, state } = requireState();
|
|
511
|
+
const flags = lockFlags(state.history);
|
|
512
|
+
const items = [...rest.map((p) => repoRelative(cwd, p)), ...(restart ? ['--restart'] : [])];
|
|
513
|
+
const flagged = (item) =>
|
|
514
|
+
item === '--restart' ? flags.forcedRestartAfterBuild : flags.lockedAfterBuild.includes(item);
|
|
515
|
+
const accepted = items.filter(flagged);
|
|
516
|
+
for (const item of accepted) {
|
|
517
|
+
note(state, 'accept-locks', item);
|
|
518
|
+
state.history.at(-1).reason = reason;
|
|
352
519
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
520
|
+
if (accepted.length) writeState(dir, id, state);
|
|
521
|
+
out({ accepted, notFlagged: items.filter((item) => !flagged(item)) });
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
case 'keep-base': {
|
|
525
|
+
// Records the current HEAD as answered, so `brief` stops reporting headMoved until HEAD moves again.
|
|
526
|
+
// `--pulled`: some of those commits are pulled, so the locked tests they changed are recorded as after a base move.
|
|
527
|
+
const reason = flag(rest, '--reason')?.trim();
|
|
528
|
+
if (!reason) fail('loopwright: keep-base requires --reason <text>');
|
|
529
|
+
const { dir, id, state } = requireState();
|
|
530
|
+
const head = gitOut(['rev-parse', 'HEAD']);
|
|
531
|
+
if (rest.includes('--pulled')) {
|
|
532
|
+
const files = pulledLockedTests(state, keptHead(state, head) ?? state.baseCommit, head);
|
|
533
|
+
state.pulledSnapshot = files?.length ? files : undefined;
|
|
534
|
+
state.baseMovedAt = state.history.length;
|
|
358
535
|
}
|
|
359
|
-
|
|
360
|
-
|
|
536
|
+
state.answeredHead = head;
|
|
537
|
+
note(state, 'keep-base', state.answeredHead);
|
|
538
|
+
state.history.at(-1).reason = reason;
|
|
539
|
+
writeState(dir, id, state);
|
|
540
|
+
out({ answeredHead: state.answeredHead });
|
|
361
541
|
break;
|
|
362
542
|
}
|
|
363
543
|
case 'fingerprint': {
|
|
@@ -605,8 +785,12 @@ try {
|
|
|
605
785
|
const dir = loopwrightDir(cwd);
|
|
606
786
|
const state = dir && readState(dir, worktreeId(cwd));
|
|
607
787
|
const history = state?.history ?? [];
|
|
608
|
-
|
|
609
|
-
|
|
788
|
+
// A reopen counts until the next Build or Review: Review sends a pulled test back to Test and goes on to
|
|
789
|
+
// pass without a Build, and that reopen must not scope the next slice's Test.
|
|
790
|
+
const lastScoped = history.findLastIndex(
|
|
791
|
+
(e) => e.event === 'stage' && (e.detail === 'build' || e.detail === 'review'),
|
|
792
|
+
);
|
|
793
|
+
const reopen = history.findLast((e, i) => e.event === 'reopen' && i > lastScoped);
|
|
610
794
|
let cfg;
|
|
611
795
|
try {
|
|
612
796
|
cfg = readConfig();
|
|
@@ -615,6 +799,30 @@ try {
|
|
|
615
799
|
cfg = JSON.parse(readFileSync(fileURLToPath(new URL('./default-config.json', import.meta.url)), 'utf8'));
|
|
616
800
|
}
|
|
617
801
|
const { maxFixRounds, crossAgentReview, docsDir, models } = cfg;
|
|
802
|
+
const flags = lockFlags(history);
|
|
803
|
+
const flaggedLocks =
|
|
804
|
+
flags.lockedAfterBuild.length || flags.forcedRestartAfterBuild
|
|
805
|
+
? { lockedAfterBuild: flags.lockedAfterBuild, forcedRestartAfterBuild: flags.forcedRestartAfterBuild }
|
|
806
|
+
: undefined;
|
|
807
|
+
const top = state?.pulledSnapshot?.length && gitTopLevel(cwd);
|
|
808
|
+
const relocked = new Set(
|
|
809
|
+
history
|
|
810
|
+
.slice(state?.baseMovedAt ?? 0)
|
|
811
|
+
.filter((e) => e.event === 'lock')
|
|
812
|
+
.map((e) => e.detail),
|
|
813
|
+
);
|
|
814
|
+
const pulledLocks = (state?.lockedTests ?? [])
|
|
815
|
+
.filter((l) => {
|
|
816
|
+
const abs = top && resolve(top, l.path);
|
|
817
|
+
return (
|
|
818
|
+
abs &&
|
|
819
|
+
state.pulledSnapshot.includes(l.path) &&
|
|
820
|
+
!relocked.has(l.path) &&
|
|
821
|
+
existsSync(abs) &&
|
|
822
|
+
sha256File(abs) !== l.sha256
|
|
823
|
+
);
|
|
824
|
+
})
|
|
825
|
+
.map((l) => l.path);
|
|
618
826
|
out({
|
|
619
827
|
dir,
|
|
620
828
|
task: state?.task ?? null,
|
|
@@ -623,8 +831,18 @@ try {
|
|
|
623
831
|
lockedTests: state?.lockedTests,
|
|
624
832
|
verdict: state?.verdict,
|
|
625
833
|
awaitingUser: state?.awaitingUser,
|
|
834
|
+
flaggedLocks,
|
|
835
|
+
pulledLocks: pulledLocks.length ? pulledLocks : undefined,
|
|
836
|
+
headMoved: state && movedHead(state),
|
|
837
|
+
ownCommits: state ? ownCommits(state) : undefined,
|
|
626
838
|
reopened: reopen ? { target: reopen.detail, reason: reopen.reason } : null,
|
|
627
|
-
config: {
|
|
839
|
+
config: {
|
|
840
|
+
maxFixRounds,
|
|
841
|
+
crossAgentReview,
|
|
842
|
+
simplify: cfg.simplify ?? true,
|
|
843
|
+
docsDir,
|
|
844
|
+
crossAgentReviewer: models?.crossAgentReviewer,
|
|
845
|
+
},
|
|
628
846
|
effort,
|
|
629
847
|
});
|
|
630
848
|
break;
|
|
@@ -780,7 +998,7 @@ try {
|
|
|
780
998
|
}
|
|
781
999
|
default:
|
|
782
1000
|
fail(
|
|
783
|
-
'loopwright: usage: lw.mjs <dir|start|stage|reopen|lock|check-locks|fingerprint|verdict|await-user|resume|park|explore|status|config|brief|tasks|adopt|worktree|carry|effort|done>',
|
|
1001
|
+
'loopwright: usage: lw.mjs <dir|start|stage|reopen|lock|check-locks|accept-locks|keep-base|fingerprint|verdict|await-user|resume|park|explore|status|config|brief|tasks|adopt|worktree|carry|effort|done>',
|
|
784
1002
|
);
|
|
785
1003
|
}
|
|
786
1004
|
} catch (err) {
|
|
@@ -6,11 +6,12 @@ State tool: `node "{{LW_HOME}}/hooks/lw.mjs" <cmd>`, run from the task's worktre
|
|
|
6
6
|
|
|
7
7
|
## 0. Locked tests (always first)
|
|
8
8
|
|
|
9
|
-
Run `node "{{LW_HOME}}/hooks/lw.mjs" check-locks`. It prints `{ok, changed, missing, lockedAfterBuild, relockedAfterReopen, forcedRestartAfterBuild}` and exits 1 when `ok` is false.
|
|
9
|
+
Run `node "{{LW_HOME}}/hooks/lw.mjs" check-locks`. It prints `{ok, changed, missing, lockedAfterBuild, relockedAfterReopen, forcedRestartAfterBuild, accepted}` and exits 1 when `ok` is false.
|
|
10
10
|
- `ok` is false → one Blocking finding per path in `changed` and `missing` (expectation: locked acceptance tests are unchanged; proof: the check-locks output).
|
|
11
|
-
- `lockedAfterBuild` is non-empty → one Undecided finding per path (expectation: "acceptance test re-locked after Build began; user must confirm"; proof: the check-locks output).
|
|
11
|
+
- `lockedAfterBuild` is non-empty (paths not accepted) → one Undecided finding per path (expectation: "acceptance test re-locked after Build began; user must confirm"; proof: the check-locks output).
|
|
12
12
|
- `relockedAfterReopen` is non-empty → information, not a finding: the user sent the task back through `lw.mjs reopen` and the tester re-locked these paths (`check-locks` counts only a reopen directly after an `await-user` and `resume` pair, so a reopen without the user's answer shows up under `lockedAfterBuild`). These re-locks are expected; do not report them.
|
|
13
|
-
- `
|
|
13
|
+
- `accepted` is non-empty → information, not a finding: a decision in the task file or the user already accepted these re-locks (`{path, reason}`) or the forced restart (`{restart: true, reason}`). Do not report them.
|
|
14
|
+
- `forcedRestartAfterBuild` is true (a restart not accepted) → one Undecided finding (expectation: "task state was force-restarted after Build began; user must confirm locked tests"; proof: the check-locks output).
|
|
14
15
|
- The command errors (e.g. no active task) → one Blocking finding with the error text as proof.
|
|
15
16
|
|
|
16
17
|
## Inputs
|
|
@@ -35,6 +36,7 @@ Second pass: only when the caller hands you the implementer's report. Verify eac
|
|
|
35
36
|
- bugs, regressions, security vulnerabilities;
|
|
36
37
|
- architecturally bad decisions;
|
|
37
38
|
- non-simplified code paths (a much simpler path does the same; the finding must show the smaller version);
|
|
39
|
+
- duplicated code (proof: both locations), fixed by calling or extending one of them;
|
|
38
40
|
- duplicated docs: the change states a fact that another doc, comment or contract already states (proof: both locations; the fix is to remove the new copy and link, never to delete the older home);
|
|
39
41
|
- bypassed mechanism: the change branches or hardcodes what an existing mechanism (config, registry, helper) already handles (proof: the mechanism `path:line`);
|
|
40
42
|
- missing tests for new behavior;
|
|
@@ -42,6 +44,7 @@ Second pass: only when the caller hands you the implementer's report. Verify eac
|
|
|
42
44
|
- violations of the other named rules in `standards.md` (comment rule included);
|
|
43
45
|
- deviations from the standards docs or established codebase patterns.
|
|
44
46
|
Exclude lint/format-level nits; mechanical checks own them. Exception: a lint or format check failing on a changed file that is not locked is Blocking; failing on a locked test file is Undecided (the user decides, Build cannot touch it). A failing test assertion stays Blocking.
|
|
47
|
+
Do not report a candidate that a task decision explicitly keeps.
|
|
45
48
|
A proven violation of a named rule in `standards.md` is high impact (Blocking when confidence is high). Without that proof (smaller version, both locations, mechanism `path:line`, or the hunk) it is dropped. A violation inside a locked test file stays Undecided (the user decides, Build cannot touch it).
|
|
46
49
|
5. **Investigate each candidate.** Self-verify first: re-read the code, run a repro or a test. Then assign impact (high/mid/low) and confidence (high/mid/low).
|
|
47
50
|
6. **Report.**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# loopwright simplify procedure
|
|
2
|
+
|
|
3
|
+
You propose behavior-preserving cuts to one change. You do not apply them. Do not modify any file: no edits, no formatting, no `git add`/`commit`/`stash`/`checkout`. Running read-only commands, tests and check commands is allowed; never with flags that rewrite files (snapshot updates, `--fix`, `--write`).
|
|
4
|
+
|
|
5
|
+
State tool: `node "{{LW_HOME}}/hooks/lw.mjs" <cmd>`, run from the task's worktree. Use only `status`, invoked exactly as written here.
|
|
6
|
+
|
|
7
|
+
## Inputs
|
|
8
|
+
|
|
9
|
+
- the task file (the caller gives you its absolute path); read its goal, decisions (`D…`) and acceptance criteria (`AC…`),
|
|
10
|
+
- scope: the diff against the base commit (`baseCommit` in `status`): `git diff <baseCommit>` plus untracked files from `git status --porcelain`. Every changed file is in scope, prose included. Nothing outside the diff is in scope,
|
|
11
|
+
- standards: `{{LW_HOME}}/prompts/standards.md`, `AGENTS.md` and the `docs/agents/` docs it links.
|
|
12
|
+
|
|
13
|
+
## Procedure
|
|
14
|
+
|
|
15
|
+
1. Read the task file, the diff and the code around it until you know what each changed hunk is for.
|
|
16
|
+
2. Look for cuts: code the diff duplicates from existing code or from itself, wrappers and helpers with one call site that add nothing, dead or unused code, docs, tests or comments that repeat another place, speculative options nobody asked for. Use the rules in `standards.md` as the yardstick.
|
|
17
|
+
3. For each cut, check it against the task: a cut must never change public behavior, a decision or an acceptance criterion. A cut that weakens what a test checks is a trade-off, not an obvious cut.
|
|
18
|
+
4. Readability guard: never propose dense one-liners, nested ternaries, clever tricks, or merging separate concerns into one function to save lines. A cut that saves lines but makes the code harder to read is dropped.
|
|
19
|
+
5. Sort each kept cut:
|
|
20
|
+
- **obvious**: no one would object (dead code, an exact duplicate, a wrapper that only forwards). It loses nothing.
|
|
21
|
+
- **trade-off**: it saves lines but gives something up (a test case, a guard, a doc sentence, a named step).
|
|
22
|
+
- A cut inside a locked test file (`lockedTests` in `status`) is always a trade-off cut, never an obvious one.
|
|
23
|
+
6. Keep at most 8 trade-off cuts, largest net line change first; drop the rest. Obvious cuts have no cap.
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
Output exactly one JSON object with nothing before or after it: no prose, no code fence. Shape:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
{"obvious": [{"location": "src/a.ts:10-24", "change": "call parse() from b.ts instead of the copy", "lines": -12}], "tradeoffs": [{"location": "test/a.test.ts:5-40", "change": "merge the two cases that differ only in the input", "lines": -18, "basis": "both blocks at test/a.test.ts:5 and :23 differ only in the value", "loses": "a separate failure message for each input"}]}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- `obvious` and `tradeoffs` — the two lists, both always present.
|
|
34
|
+
- `location` — `path:line` or `path:start-end`.
|
|
35
|
+
- `change` — the cut in one sentence, concrete enough to apply verbatim.
|
|
36
|
+
- `lines` — the net line change as a negative integer (a cut that adds lines elsewhere counts them).
|
|
37
|
+
- `basis` — proof the cut is safe: both locations of a duplicate, the existing mechanism `path:line`, or the unused symbol. Trade-off cuts only.
|
|
38
|
+
- `loses` — what the user gives up. Trade-off cuts only.
|
|
39
|
+
|
|
40
|
+
Both lists empty → `{"obvious": [], "tradeoffs": []}`.
|
|
41
|
+
|
|
42
|
+
Never write task ids (AC, D, S shorthands) into `change`, `basis` or `loses`.
|
|
@@ -8,6 +8,7 @@ Shared by the tester, implementer and reviewer. The repo's own docs on architect
|
|
|
8
8
|
- **Fewest clear lines.** Write the smallest version that is still readable. Why: every line is read, tested and maintained.
|
|
9
9
|
- **Respect the layers.** Keep code in the layer the repo docs (`AGENTS.md`, `ARCHITECTURE.md`, `docs/`) assign it; do not reach across them. Why: crossed layers make later changes spread.
|
|
10
10
|
- **No trivial wrappers or one-off helpers.** Call the underlying function. A helper with one call site exists only if it names a step the reader would otherwise have to decode. Why: an indirection that adds nothing hides where the work happens.
|
|
11
|
+
- **No duplicated code.** Call or extend existing code instead of writing a near-copy; two blocks that differ only in a value become one. Test files are code too: share setup and cases instead of repeating them. Why: each copy is a second place to fix and they drift apart.
|
|
11
12
|
- **Delete what you replace.** Remove the code, tests and docs your change makes dead: no old path kept "just in case", no unused parameters, no unrequested compatibility shims. Why: dead code reads as live behavior.
|
|
12
13
|
- **Validate at the boundaries.** Check input where it enters (user, network, files), not again in every inner function; trust types inside. No guards for impossible states, no catch blocks that swallow errors, no fallbacks that hide bugs. Why: repeated checks disagree and bury the real one.
|
|
13
14
|
- **No speculative generality.** Build for the cases the task states, not ones that might come: no interface with one implementation, no option or parameter nobody asked for, no generic version of a one-off. A requested per-environment flag is not speculative. Why: unused options are code to maintain with no proof they fit.
|
|
@@ -16,7 +16,14 @@ The implementer subagent writes the code. This thread dispatches it and hands th
|
|
|
16
16
|
- `standard` or `large` with no `lockedTests` (or, large, the current slice is still `[todo]`) → run `/loopwright-test` first.
|
|
17
17
|
- `kind: fix` with no `lockedTests`, at any tier including small → run `/loopwright-test` first; a fix is never built without a locked repro test.
|
|
18
18
|
- `large` → the current slice is the first `S<n> [tested]` line; build only that slice. Every slice `[passed]` → this is a whole-branch fix round; no slice limit.
|
|
19
|
-
|
|
19
|
+
- `## Review log` has a `- Simplify:` line ending in `— apply pending` (an approved Simplify apply was interrupted) → run `/loopwright-review` to finish it, and stop here: skip steps 5–7 and the Steps below.
|
|
20
|
+
5. Moved branch. Skip this on a fix round (called with Review findings). `headMoved` in `brief` (new commits since the base commit, at least one already on the upstream branch, and not answered yet for this HEAD) → run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "branch moved"`, list the commits to the user and ask one question: are they pulled commits (leave them out of the review) or this task's own commits (keep them in)? After the answer run `node "{{LW_HOME}}/hooks/lw.mjs" resume` and record it as a decision `D<n> [asked]`.
|
|
21
|
+
- `headMoved.keptEarlier` → an earlier answer kept commits in the review, so the branch holds both kinds whatever the answer: list only the new commits, and a 'pulled' answer takes the keep-base path below, with the both-kinds notice.
|
|
22
|
+
- `headMoved.localOnly` → the listed short shas exist only locally, so they are the task's own work and the branch holds both kinds whatever the answer: a 'pulled' answer takes the keep-base path below, with the both-kinds notice. Never judge this from the commit subjects.
|
|
23
|
+
- Pulled → run `node "{{LW_HOME}}/hooks/lw.mjs" start <task> --force --base HEAD && node "{{LW_HOME}}/hooks/lw.mjs" stage build` as one call, update `base commit` in the task file header to the new HEAD, then run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --restart --reason "<the decision in words>"`.
|
|
24
|
+
- This task's own commits, or a branch holding both kinds → run `node "{{LW_HOME}}/hooks/lw.mjs" keep-base --reason "<the decision in words>"`; the base stays. Both kinds: add `--pulled` to that command, so the locked tests the new commits changed show in `pulledLocks` (step 7), and tell the user the pulled commits stay in the review, because the base cannot move past the task's own commits.
|
|
25
|
+
6. Upstream check. Skip this check on a fix round (called with Review findings). Otherwise run `GIT_TERMINAL_PROMPT=0 git fetch --quiet` (never prompts for credentials; failure, e.g. offline or no auth → skip). List `git log --oneline HEAD..@{u}`; with no upstream, use `HEAD..origin/HEAD`; with neither, skip. For `large`, check before each slice's first Build. If the new commits touch the task's files or feature, or a sibling repo the task touches, run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "upstream changed"`, show them to the user and ask whether to pull first or stop (someone may already have done this work) before spawning the implementer. Before asking, run `brief` and note whether `ownCommits` is present (the task already has commits since its base, answered as its own or only local). After the answer, run `node "{{LW_HOME}}/hooks/lw.mjs" resume` and record it as a decision `D<n> [asked]`. If the user pulled and `ownCommits` was present, the base stays: run `node "{{LW_HOME}}/hooks/lw.mjs" keep-base --pulled --reason "<the pull decision in words>"` instead of the restart below, tell the user the pulled commits stay in the review (the base cannot move past the task's own commits), and go to step 7. If it pulled and `ownCommits` was absent, rebase the review scope so pulled commits are not judged as this task's change: run `node "{{LW_HOME}}/hooks/lw.mjs" start <task> --force --base HEAD && node "{{LW_HOME}}/hooks/lw.mjs" stage build` as one call (`start` keeps locks and history and resets the stage to plan; `stage build` sets it back), and update `base commit` in the task file header to the new HEAD, then run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --restart --reason "<the pull decision in words>"` (the pull is the approved restart, so it is not raised again in Review). Otherwise continue.
|
|
26
|
+
7. After a pull (step 5 or 6), run `brief` again, as in step 2. `pulledLocks` present (a pulled commit changed those locked tests) → before the implementer runs, send only the listed files to Test: `node "{{LW_HOME}}/hooks/lw.mjs" reopen test "<the pull decision in words>"` when Build has begun, `node "{{LW_HOME}}/hooks/lw.mjs" stage test` otherwise, then run `/loopwright-test` for those files. After the tester re-locked them, run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --reason "<the pull decision in words>" <path>…` with the `pulledLocks` paths, so the re-locks are accepted under the pull decision, and continue with Steps.
|
|
20
27
|
|
|
21
28
|
## Steps
|
|
22
29
|
|
|
@@ -30,7 +37,7 @@ The implementer subagent writes the code. This thread dispatches it and hands th
|
|
|
30
37
|
3. Keep the implementer report verbatim in this conversation; a two-pass review needs it.
|
|
31
38
|
Fix task: write the report's `Root cause:` line to `## Root cause` in the task file. A root cause that differs from the plan's hypothesis is a `Deviation`, handled in step 4.
|
|
32
39
|
4. `Deviations` not "none" → run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "deviations in build"` (so the stop gate lets you end the turn), then show each to the user before Review, one at a time (Claude: `AskUserQuestion`; Codex: numbered text, then end the turn). After the answers, run `node "{{LW_HOME}}/hooks/lw.mjs" resume`. The user either accepts it (write a new decision `D<n> [asked]` to the task file), wants it fixed (run `node "{{LW_HOME}}/hooks/lw.mjs" stage build` first, so a `reopen` the implementer runs on its own does not directly follow the `resume` and is not counted as the user's choice; then spawn the `loopwright-implementer` subagent and wait for its result again, with the deviation as the finding), or wants to go back: offer that when the deviation needs a changed decision or locked test. Going back: directly after `resume`, run `node "{{LW_HOME}}/hooks/lw.mjs" reopen <plan|test> "<reason>"` (it sets the header `stage:` line, and `plan: draft` for plan; if it prints `"header": false`, set those lines by hand), record the decision, and continue with `/loopwright-plan` or `/loopwright-test` as the target says.
|
|
33
|
-
5. Go straight to `/loopwright-review
|
|
40
|
+
5. Go straight to `/loopwright-review`, which runs Simplify before its passes. The stop gate blocks ending the turn in Build without a passing review.
|
|
34
41
|
|
|
35
42
|
## Rules
|
|
36
43
|
|
|
@@ -37,10 +37,17 @@ Never write task ids (AC, D, S shorthands) into tests, code, comments, commit me
|
|
|
37
37
|
|
|
38
38
|
Draft both and show them to the user:
|
|
39
39
|
- Commit: imperative subject ≤ 72 chars; body says why, the key decisions, and the rejected options with the reason.
|
|
40
|
-
- PR: summary of intent; decisions and rejected options; notable assumptions the reviewer should know; how it was verified (check commands, acceptance tests, review rounds from the log). Do not list the diff file by file. Run `node "{{LW_HOME}}/hooks/lw.mjs" check-locks`; when `relockedAfterReopen` is non-empty, add a section listing each locked test changed after a reopen with its reason.
|
|
40
|
+
- PR: summary of intent; decisions and rejected options; notable assumptions the reviewer should know; how it was verified (check commands, acceptance tests, review rounds from the log). Do not list the diff file by file. Run `node "{{LW_HOME}}/hooks/lw.mjs" check-locks`; when `relockedAfterReopen` is non-empty, add a section listing each locked test changed after a reopen with its reason; when `accepted` is non-empty, list each accepted re-lock or restart with its reason in that section too.
|
|
41
41
|
- A `## Follow-ups` section for every kind of task, listing the parked stubs by title and any follow-ups in the task file (still no task paths or ids).
|
|
42
42
|
- Fix tasks (`kind: fix`): the PR also states the root cause in one line (from `## Root cause`), the repro test name(s) with "failed before, passes after", and the follow-ups from `## Follow-ups`.
|
|
43
43
|
|
|
44
|
+
## Going back
|
|
45
|
+
|
|
46
|
+
When the user says at any question above that something needs fixing, and before Close, offer to go back; do not ask it on every run. Run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "go back from done"` before asking one question: back to Test, back to Plan, or stay in Done. Recommend Test when only a test or the code changes, Plan when a decision, acceptance criterion or the scope changes.
|
|
47
|
+
- Stay in Done → run `node "{{LW_HOME}}/hooks/lw.mjs" resume` and continue.
|
|
48
|
+
- Plan or Test → run `node "{{LW_HOME}}/hooks/lw.mjs" resume`, append `- Scope change: <reason>` to the review log (the next review starts at round 1 and Simplify runs again), and record the go-back as `D<n> [asked]` with the user's reason. Then run `node "{{LW_HOME}}/hooks/lw.mjs" reopen <plan|test> "<reason>"` (it sets the header `stage:` line, and `plan: draft` for plan; if it prints `"header": false`, set those lines by hand), directly after `resume` with no other `lw.mjs` call between, and only after the user chooses it. Then continue with `/loopwright-plan` or `/loopwright-test`.
|
|
49
|
+
- Applied AGENTS.md/docs edits and carried stubs are kept, not reverted; tell the user they enter the next review's diff.
|
|
50
|
+
|
|
44
51
|
## 4. Close
|
|
45
52
|
|
|
46
53
|
1. Set `status: done` in the task file header.
|
|
@@ -48,7 +48,7 @@ Follow each stage skill in turn (Claude Code `/loopwright-<stage>`, Codex `$loop
|
|
|
48
48
|
- standard (and any fix): `loopwright-plan` → `loopwright-test` → `loopwright-build` → `loopwright-review` → `loopwright-done`
|
|
49
49
|
- large: `loopwright-plan` → for each slice in order: `loopwright-test` → `loopwright-build` → `loopwright-review` → then one whole-branch `loopwright-review` → `loopwright-done`
|
|
50
50
|
- A fix (`kind: fix` in the task file header; set by `/loopwright-fix`, or by Plan after the user agrees to run a bug-like goal as a fix) runs `loopwright-test` at every tier: a small fix is never built without a locked repro test. Large keeps its slice loop.
|
|
51
|
-
- Going back is the user's choice only: at a deviation,
|
|
51
|
+
- Going back is the user's choice only: at a deviation, an undecided review finding, or a fix the user raises at Done, run `node "{{LW_HOME}}/hooks/lw.mjs" reopen <plan|test> "<reason>"` (plan or test; accepted only after Build began; it sets the header `stage:` line, and `plan: draft` for plan; if it prints `"header": false`, set those lines by hand), then follow the stage skill it names. Locked tests may then be edited by the tester in Test and are re-locked.
|
|
52
52
|
- A failed review returns to `loopwright-build` and then `loopwright-review`, up to the task's fix-round cap.
|
|
53
53
|
|
|
54
54
|
A "fresh context" answer (at the plan confirmation, or at a slice boundary) ends the turn after the stage is advanced; the next session resumes from `status` and the task file, as in Resume.
|
|
@@ -64,8 +64,10 @@ When a stage says to spawn the `loopwright-<role>` subagent, spawn the subagent
|
|
|
64
64
|
- the goal restatement and the effort profile (one prompt) before the scout, each high-impact question, the "run this as a fix?" question for a bug-like goal, the low-impact batch, the tier/settings proposal, and the final plan confirmation;
|
|
65
65
|
- the slice-boundary question after a large-tier slice review passes while a `[todo]` slice remains (continue here or in a fresh context);
|
|
66
66
|
- tester `Uncovered`/`Needs` items and implementer `Deviations`;
|
|
67
|
+
- the moved-branch question at the start of Build and Review, when the branch has new commits that are already on the upstream branch (pulled commits, or this task's own);
|
|
67
68
|
- fixes: the no-repro gate (no locked repro test: provide evidence, find the faulty unit, or stop; never continue without one) and, after the final passing review (whole-branch for large), the sibling gate (include siblings in this fix or list them as follow-ups);
|
|
68
|
-
- each undecided review finding, and the fix-round cap being reached;
|
|
69
|
+
- the Simplify question at the start of Review (which proposed cuts to apply; not asked when there is nothing to cut), each undecided review finding, and the fix-round cap being reached;
|
|
70
|
+
- going back from Done: when the user says at a Done question that something needs fixing, the question back to Plan, back to Test, or stay in Done;
|
|
69
71
|
- each AGENTS.md / docs change, and the commit message and PR draft.
|
|
70
72
|
|
|
71
|
-
In Test (no-repro gate), Build and
|
|
73
|
+
In Test (no-repro gate), Build, Review and Done (going back), run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "<reason>"` before asking and `resume` after the answer, as those skills say; otherwise the stop gate pushes you past the gate. Never answer a gate yourself or treat silence as approval. Do not commit at any point.
|
|
@@ -9,17 +9,47 @@ Reviewers judge in their own context. This thread dispatches them, merges their
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
11
11
|
1. Run every loopwright command from the worktree root: `cd "$(git rev-parse --show-toplevel)"`.
|
|
12
|
-
2. `node "{{LW_HOME}}/hooks/lw.mjs" brief reviewer` → `dir` (`<lw>`), `task` (relative to `<lw>`), `baseCommit`, `config` (`crossAgentReview`, `crossAgentReviewer` = `models.crossAgentReviewer`; missing → `off`), `effort`. `dir` `null` inside a git repo → no task has started here yet; `lw.mjs start` creates `.loopwright/` with the first task, so continue and `task: null` reports "no active task". Not a git repo → tell the user loopwright must run inside a git repo, stop.
|
|
12
|
+
2. `node "{{LW_HOME}}/hooks/lw.mjs" brief reviewer` → `dir` (`<lw>`), `task` (relative to `<lw>`), `baseCommit`, `config` (`crossAgentReview`, `crossAgentReviewer` = `models.crossAgentReviewer`; missing → `off`; `simplify`), `effort`. `dir` `null` inside a git repo → no task has started here yet; `lw.mjs start` creates `.loopwright/` with the first task, so continue and `task: null` reports "no active task". Not a git repo → tell the user loopwright must run inside a git repo, stop.
|
|
13
13
|
3. `task: null` → "no active task": point the user to `/loopwright-flow`, stop.
|
|
14
14
|
4. Read the task file header (`tier`, `two-pass`, `fix-round cap`).
|
|
15
15
|
5. Scope: small/standard → the task. Large → the first `S<n> [tested]` slice, or `whole` once every slice is `[passed]`.
|
|
16
16
|
6. Round `n` = number of `- R` lines in `## Review log` for this scope after the last `- Scope change:` line (all of them if there is none) + 1.
|
|
17
|
+
7. Moved branch. `headMoved` in `brief` (new commits since the base commit, at least one already on the upstream branch, and not answered yet for this HEAD) → run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "branch moved"`, list the commits to the user and ask one question: are they pulled commits (leave them out of the review) or this task's own commits (keep them in)? After the answer run `node "{{LW_HOME}}/hooks/lw.mjs" resume` and record it as a decision `D<n> [asked]`.
|
|
18
|
+
- `headMoved.keptEarlier` → an earlier answer kept commits in the review, so the branch holds both kinds whatever the answer: list only the new commits, and a 'pulled' answer takes the keep-base path below, with the both-kinds notice.
|
|
19
|
+
- `headMoved.localOnly` → the listed short shas exist only locally, so they are the task's own work and the branch holds both kinds whatever the answer: a 'pulled' answer takes the keep-base path below, with the both-kinds notice. Never judge this from the commit subjects.
|
|
20
|
+
- Pulled → run `node "{{LW_HOME}}/hooks/lw.mjs" start <task> --force --base HEAD && node "{{LW_HOME}}/hooks/lw.mjs" stage build` as one call (Passes step 1 sets the stage to review), update `base commit` in the task file header to the new HEAD, run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --restart --reason "<the decision in words>"`, then run `brief reviewer` again (the base commit changed).
|
|
21
|
+
- This task's own commits, or a branch holding both kinds → run `node "{{LW_HOME}}/hooks/lw.mjs" keep-base --reason "<the decision in words>"`; the base stays. Both kinds: add `--pulled` to that command, so the locked tests the new commits changed show in `pulledLocks` (run `brief reviewer` again, then step 8), and tell the user the pulled commits stay in the review, because the base cannot move past the task's own commits.
|
|
22
|
+
8. `pulledLocks` in `brief` (a pulled commit changed those locked tests) → before the first reviewer is spawned, send only the listed files to Test: `node "{{LW_HOME}}/hooks/lw.mjs" reopen test "<the pull decision in words>"` when Build has begun, `node "{{LW_HOME}}/hooks/lw.mjs" stage test` otherwise, then run `/loopwright-test` for those files. After the tester re-locked them, run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --reason "<the pull decision in words>" <path>…` with the `pulledLocks` paths, so the re-locks are accepted under the pull decision, and continue with step 9 and Simplify.
|
|
23
|
+
9. `flaggedLocks` in `brief` (present only while a re-lock or forced restart is flagged and not accepted) → before the first reviewer is spawned, compare each item with the task file's decisions. A decision covers an item when it names the test file, the return to Test, or the pull. Covered → run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --reason "<that decision in words>" [--restart] [<path>…]` without asking the user (paths for `lockedAfterBuild`, `--restart` for `forcedRestartAfterBuild`). No decision covers an item → leave it to the reviewer, unchanged.
|
|
24
|
+
|
|
25
|
+
## Simplify
|
|
26
|
+
|
|
27
|
+
A read-only reviewer proposes cuts to the diff, you ask the user which to apply, and the existing roles apply only the approved ones. It never blocks Review.
|
|
28
|
+
|
|
29
|
+
Skip this section, silently and with no log line, when any of these holds: `simplify` is `false` in `brief`'s `config`; the task is a small-tier feature; this is not round 1 of the final review scope (the task for standard, `whole` for large); a `- Simplify:` line follows the last `- Scope change:` line in `## Review log` (so it runs again after `- Scope change: siblings included`). A small-tier fix runs it.
|
|
30
|
+
|
|
31
|
+
A `- Simplify:` line ending in `— apply pending` is not a skip: an earlier run was interrupted after the user approved cuts, so skip the question, resuming at the Apply (step 5), taking the approved cuts only from this run's `Simplify:` decisions in `## Decisions` (the last ones written, above the pending `- Simplify:` line), never from a `kept as written` line or an earlier run's decisions.
|
|
32
|
+
|
|
33
|
+
1. **Propose.** Now spawn the `loopwright-reviewer` subagent and wait for its result. Give it only: the absolute task file path, the base commit, and "Follow `{{LW_HOME}}/prompts/simplifier.md`." Large tier: add "Scope: whole-branch review of all slices". On Claude Code pass `effort` = the `effort` from `brief`, as in Passes step 2. The result is one JSON object with `obvious` and `tradeoffs` lists. Invalid JSON → dispatch it once more asking for only the JSON; still invalid → append `- Simplify: skipped — invalid output` to `## Review log` and go to Passes.
|
|
34
|
+
2. Both lists empty → append `- Simplify: nothing to cut` and go to Passes with no question.
|
|
35
|
+
3. **Ask.** Run `node "{{LW_HOME}}/hooks/lw.mjs" await-user "simplify"`, then ask everything in one prompt (Claude: `AskUserQuestion`, `multiSelect` for trade-offs; Codex and Junie: numbered text, the user replies with numbers):
|
|
36
|
+
- `obvious` non-empty → one question listing each cut with its `lines`: apply all or skip all.
|
|
37
|
+
- one trade-off cut → one question with its `change`, `lines` and `loses`: apply or skip.
|
|
38
|
+
- 2–8 trade-off cuts → multi-select questions of up to 4 options each, split evenly into groups of 2 to 4 (an option is a cut: `change`, `lines`, `loses`); a selected option is approved.
|
|
39
|
+
After the answer run `node "{{LW_HOME}}/hooks/lw.mjs" resume`.
|
|
40
|
+
4. **Record**, before applying anything. Each approved trade-off cut becomes a decision `D<n> [asked] Simplify: <location> — <change>; <lines> lines; gives up: <loses>`, approved obvious cuts (an apply-all answer) one decision line `D<n> [asked] Simplify: apply obvious: <location> — <change>; …`, and all declined cuts, trade-off cuts and the obvious cuts of a skip-all answer, one decision line `D<n> [asked] Simplify: kept as written: <location> — <change>; …` (each cut with its `change`, so it stays identifiable after applying other cuts moves line numbers), so Review does not report them. Then append `- Simplify: <o> obvious applied|skipped, <t> trade-off applied, <d> declined` to `## Review log`, ending it with ` — apply pending` when any cut is approved; write this line before applying, so a resume mid-apply does not ask again.
|
|
41
|
+
5. **Apply** each branch that has approved cuts; nothing approved → go to the Passes.
|
|
42
|
+
- Approved cuts in locked test files first: `node "{{LW_HOME}}/hooks/lw.mjs" stage test`, then spawn the `loopwright-tester` subagent and wait for its result (on Claude Code pass `effort` = the output of `node "{{LW_HOME}}/hooks/lw.mjs" effort tester`; if the spawn rejects `effort`, spawn without it), with the task file path and the approved cuts verbatim for those files only. It applies them, reruns the tests and re-locks only those files. Then run `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --reason "<the decision in words>" <path>…` with those paths, so Review does not flag the re-lock.
|
|
43
|
+
- Approved cuts in other files (the approved obvious cuts and the rest): `node "{{LW_HOME}}/hooks/lw.mjs" stage build`, then spawn the `loopwright-implementer` subagent and wait for its result, as in Build step 2 but with `effort` = the output of `node "{{LW_HOME}}/hooks/lw.mjs" effort implementer`, not the reviewer's. Its prompt contains the task file path and "Approved simplifications:" with the approved cuts verbatim (`location`, `change`); never your own summary. Keep its report verbatim. `Deviations` not "none" → handle them as in Build step 4; if that sends the task back to Plan or Test, remove the ` — apply pending` ending from the `- Simplify:` line before running `reopen`, so Test does not skip the tester.
|
|
44
|
+
- `two-pass: on` → the second pass gets both implementer reports, Build's and this one.
|
|
45
|
+
- After the last branch, remove the ` — apply pending` ending from the `- Simplify:` line. On a resume, skip an approved cut that is already applied.
|
|
46
|
+
6. Go on with the Passes.
|
|
17
47
|
|
|
18
48
|
## Passes
|
|
19
49
|
|
|
20
50
|
1. `node "{{LW_HOME}}/hooks/lw.mjs" stage review` (it updates the task file header `stage:` line; if it prints `"header": false`, set that line by hand).
|
|
21
51
|
2. **Blind pass.** Now spawn the `loopwright-reviewer` subagent and wait for its result. Give it only: the absolute task file path, the base commit, and "Follow `{{LW_HOME}}/prompts/reviewer.md`. Blind pass." Large tier: add "Scope: slice S<n> (its ACs; earlier slices passed)" or "Scope: whole-branch review of all slices". Never include the implementer report, chat history or your opinion. On Claude Code pass `effort` = the `effort` from `brief` on the spawn; if `brief` has no `effort` (it warns on stderr) or the spawn rejects `effort`, spawn without it (the agent file's effort applies). Use the same effort for the second pass.
|
|
22
|
-
3. **Second pass** (only if `two-pass: on`). Now spawn the `loopwright-reviewer` subagent and wait for its result, with the task file path, the base commit, "Follow `{{LW_HOME}}/prompts/reviewer.md`. Second pass.", and then "Verify the claims in this implementer report:" with the report verbatim. Report no longer available → skip and note it in the log line.
|
|
52
|
+
3. **Second pass** (only if `two-pass: on`). Now spawn the `loopwright-reviewer` subagent and wait for its result, with the task file path, the base commit, "Follow `{{LW_HOME}}/prompts/reviewer.md`. Second pass.", and then "Verify the claims in this implementer report:" with the report verbatim (Simplify's apply report too, if it ran). Report no longer available → skip and note it in the log line.
|
|
23
53
|
4. **Cross-agent pass** (only if `crossAgentReview` is not `off`). `command -v <claude|codex>` fails → skip, note it. Otherwise, from the worktree root, set `PROMPT="Follow {{LW_HOME}}/prompts/reviewer.md. Task file: <abs path>. Base commit: <sha>. Blind pass."` and run (`LOOPWRIGHT_HOOKS=off` keeps loopwright's own hooks, such as the stop gate, out of the headless reviewer session):
|
|
24
54
|
- claude (omit `--model` when the model is `inherit`; add one `"Bash(<cmd>:*)"` per check command in the task header; the `lw.mjs` entries allow only the read-only `status`, `check-locks` and `fingerprint`, in the quoted form the reviewer prompt uses and unquoted; the prompt must come after `--` because the tool flags take several values; `<effort>` is the `effort` from `brief`; omit `--effort` if it is missing):
|
|
25
55
|
`LOOPWRIGHT_HOOKS=off claude -p --model <crossAgentReviewer.claude> --effort <effort> --output-format json --json-schema "$(cat "{{LW_HOME}}/schemas/verdict.json")" --allowedTools "Read" "Grep" "Glob" "Bash(git diff:*)" "Bash(git status:*)" "Bash(git log:*)" 'Bash(node "{{LW_HOME}}/hooks/lw.mjs" status)' 'Bash(node "{{LW_HOME}}/hooks/lw.mjs" check-locks)' 'Bash(node "{{LW_HOME}}/hooks/lw.mjs" fingerprint)' "Bash(node {{LW_HOME}}/hooks/lw.mjs status)" "Bash(node {{LW_HOME}}/hooks/lw.mjs check-locks)" "Bash(node {{LW_HOME}}/hooks/lw.mjs fingerprint)" "Bash(<check command>:*)" --disallowedTools "Edit" "Write" "MultiEdit" "NotebookEdit" -- "$PROMPT"`
|
|
@@ -35,7 +65,7 @@ Human gates: before you ask the user anything in this stage (an undecided findin
|
|
|
35
65
|
Merge all passes: union of `blocking`, union of `undecided` (drop exact duplicates by location and expectation), sum of `droppedCount`. Decide from the arrays, not from the `pass` fields.
|
|
36
66
|
|
|
37
67
|
- **Blocking** present → `node "{{LW_HOME}}/hooks/lw.mjs" verdict fail --round <n>`. Fix rounds used = n − 1. If that reaches or exceeds the `fix-round cap`, stop: show every open finding and let the user decide (raise the cap, fix by hand, or accept). Otherwise show the findings briefly and run `/loopwright-build` with the Blocking findings verbatim; then review again (round n + 1). Undecided findings of this round are only counted; the next round re-checks them.
|
|
38
|
-
- Only **Undecided** → present each to the user, one at a time (Claude: `AskUserQuestion`; Codex: numbered text), with its location, expectation and proof; options: fix or dismiss. Record each answer under the round's log line: ` - U<k> <location>: fix|dismissed — <user's reason>`. Any "fix" → `verdict fail --round <n>` and Build with those findings, same cap rule. All dismissed → pass.
|
|
68
|
+
- Only **Undecided** → present each to the user, one at a time (Claude: `AskUserQuestion`; Codex: numbered text), with its location, expectation and proof; options: fix or dismiss. Record each answer under the round's log line: ` - U<k> <location>: fix|dismissed — <user's reason>`. Any "fix" → `verdict fail --round <n>` and Build with those findings, same cap rule. A dismissed re-lock or restart finding also runs `node "{{LW_HOME}}/hooks/lw.mjs" accept-locks --reason "<user's reason>" [--restart] [<path>…]`, so it is not asked again for that re-lock or restart. Every other Undecided finding is asked as above, each round. All dismissed → pass.
|
|
39
69
|
- An undecided finding the user wants resolved by changing the plan or a locked test (not just the code) → offer to go back: after `verdict fail --round <n>`, `await-user` and the answer's `resume`, run `node "{{LW_HOME}}/hooks/lw.mjs" reopen <plan|test> "<reason>"` with the user's reason (it sets the header `stage:` line, and `plan: draft` for plan; if it prints `"header": false`, set those lines by hand), then continue with `/loopwright-plan` or `/loopwright-test`. Run it only after the user chooses it.
|
|
40
70
|
- Nothing open → `node "{{LW_HOME}}/hooks/lw.mjs" verdict pass --round <n>`.
|
|
41
71
|
- Fix tasks, sibling gate: asked once, at the final pass (the task review for small/standard, the whole-branch review for large), never after a slice review. A passing slice review only records its merged `siblings` (union from all passes, dropping exact duplicates by `path` and `line`) as ` - Sibling <path>:<line> — <why>` lines under its log line, then the slice loop goes on.
|
|
@@ -9,18 +9,20 @@ The tester writes acceptance tests from the confirmed ACs and locks them. This t
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
11
11
|
1. Run every loopwright command from the worktree root: `cd "$(git rev-parse --show-toplevel)"`.
|
|
12
|
-
2. `node "{{LW_HOME}}/hooks/lw.mjs" brief tester` → `dir` (`<lw>`), `task` (path relative to `<lw>`), `stage`, `lockedTests`, `reopened`, `effort`. `dir` `null` inside a git repo → no task has started here yet; `lw.mjs start` creates `.loopwright/` with the first task, so continue and `task: null` reports "no active task". Not a git repo → tell the user loopwright must run inside a git repo, stop.
|
|
12
|
+
2. `node "{{LW_HOME}}/hooks/lw.mjs" brief tester` → `dir` (`<lw>`), `task` (path relative to `<lw>`), `stage`, `lockedTests`, `reopened`, `pulledLocks`, `effort`. `dir` `null` inside a git repo → no task has started here yet; `lw.mjs start` creates `.loopwright/` with the first task, so continue and `task: null` reports "no active task". Not a git repo → tell the user loopwright must run inside a git repo, stop.
|
|
13
13
|
3. `task: null` → "no active task": stop and point the user to `/loopwright-plan` or `/loopwright-flow`.
|
|
14
14
|
4. Read the task file header.
|
|
15
15
|
- `tier: small` and `kind` feature (or no `kind`) → there is no Test stage; say so and go to `/loopwright-build`. `kind: fix` at tier small → Test runs: a fix is never built without a locked repro test.
|
|
16
16
|
- Header not `plan: confirmed` (or no ACs, or ACs without an interface) → stop; point the user to `/loopwright-plan`.
|
|
17
|
+
- `pulledLocks` present (a pull the user approved changed locked tests) → the scope is the files in `pulledLocks`, not the ACs below: the tester checks each listed file still tests its acceptance criteria, edits only what the pull broke, and re-locks it; every other locked test stays untouched.
|
|
17
18
|
- Reopened task (`reopened` is not `null`; its `reason` says why) → the scope is the ACs the reason and the task file's added or changed ACs name, in whichever slices hold them (a `[tested]` or `[passed]` slice included), not the first `[todo]` slice. Existing locked tests for those ACs may be edited and re-locked.
|
|
18
19
|
- `tier: large`, not reopened → the current slice is the first `S<n> [todo]` line; test only its ACs.
|
|
20
|
+
- `## Review log` has a `- Simplify:` line ending in `— apply pending` (an approved Simplify apply was interrupted) → run `/loopwright-review` to finish it, and stop here: do not spawn the tester.
|
|
19
21
|
|
|
20
22
|
## Steps
|
|
21
23
|
|
|
22
24
|
1. `node "{{LW_HOME}}/hooks/lw.mjs" stage test` (it updates the task file header `stage:` line; if it prints `"header": false`, set that line by hand).
|
|
23
|
-
2. Now spawn the `loopwright-tester` subagent and wait for its result. Give it only the absolute task file path (`<lw>/<task>`) and, for large tier, "Write tests only for slice S<n>: AC…". Reopened: "Reopened task: the reason is … Write or edit tests only for AC…; existing locked tests for them may be edited and re-locked." No chat history, no implementation hints. On Claude Code pass `effort` = the `effort` from `brief` on the spawn; if `brief` has no `effort` (it warns on stderr) or the spawn rejects `effort`, spawn without it (the agent file's effort applies).
|
|
25
|
+
2. Now spawn the `loopwright-tester` subagent and wait for its result. Give it only the absolute task file path (`<lw>/<task>`) and, for large tier, "Write tests only for slice S<n>: AC…". `pulledLocks`: "A pull changed these locked tests: <paths>. Check each still tests its acceptance criteria, edit only what the pull broke, and re-lock them; leave every other locked test untouched." Reopened: "Reopened task: the reason is … Write or edit tests only for AC…; existing locked tests for them may be edited and re-locked." No chat history, no implementation hints. On Claude Code pass `effort` = the `effort` from `brief` on the spawn; if `brief` has no `effort` (it warns on stderr) or the spawn rejects `effort`, spawn without it (the agent file's effort applies).
|
|
24
26
|
Fix tasks: also say the task is a fix whose `## Bug report` it must read, and name any existing test the scout or the user found already failing with the reported symptom.
|
|
25
27
|
3. Verify the report:
|
|
26
28
|
- `node "{{LW_HOME}}/hooks/lw.mjs" brief tester` → `lockedTests` must contain every test file and fixture the report lists. A reported file missing from the locks → run `node "{{LW_HOME}}/hooks/lw.mjs" lock <file>` yourself.
|
|
@@ -33,11 +35,11 @@ The tester writes acceptance tests from the confirmed ACs and locks them. This t
|
|
|
33
35
|
- (c) Stop the task: set `status: stopped` in the task file header and run `node "{{LW_HOME}}/hooks/lw.mjs" done` (the task file stays).
|
|
34
36
|
If (a) and (b) both fail, the task stops the same way, with what was tried recorded in the task file and an honest next step for the user (for example a normal `/loopwright-flow` task to add logging around the suspected code). No repro, no fix: there is no option to continue without a repro, and Build never starts.
|
|
35
37
|
- `Uncovered` or `Needs` not empty → show those items to the user, one at a time. The answer may change an AC or a decision: write it to the task file (`[asked]`), then dispatch the tester again.
|
|
36
|
-
4. Write the test file next to each AC line (`— test: <file>`). Large tier: change the slice (reopened: every slice in scope) to `S<n> [tested]`.
|
|
38
|
+
4. Write the test file next to each AC line (`— test: <file>`). `pulledLocks`: leave the slice markers alone. Large tier otherwise: change the slice (reopened: every slice in scope) to `S<n> [tested]`.
|
|
37
39
|
5. Tell the user in a few lines: test files, ACs covered, locked paths. Then the next stage is `/loopwright-build`.
|
|
38
40
|
|
|
39
41
|
## Rules
|
|
40
42
|
|
|
41
43
|
- Never write task ids (AC, D, S shorthands) into tests, code, comments, commit messages or PR drafts.
|
|
42
|
-
- Lock only in this stage, and only the tests for this stage's scope (the task, or the current slice). Never re-lock an existing locked test, except after a reopen (the user chose to go back), where the tester may edit and re-lock the tests in the reopened scope, or when this stage's verification re-dispatches the tester before Build. Outside a reopen, if one is wrong, tell the user and let them decide.
|
|
44
|
+
- Lock only in this stage, and only the tests for this stage's scope (the task, or the current slice). Never re-lock an existing locked test, except after a reopen (the user chose to go back), where the tester may edit and re-lock the tests in the reopened scope, or after a pull the user approved, where it may re-lock the files in `pulledLocks` and no others, or when this stage's verification re-dispatches the tester before Build. Outside a reopen, if one is wrong, tell the user and let them decide.
|
|
43
45
|
- Do not read the implementation to judge the tests; the ACs are the contract.
|
package/dist/cli.js
CHANGED