fix(guards): a step whose test is seen green may stop while it waits for its controller

voyage-lekerepo trial (2026-10-06) point 7, operator decision 2026-10-08
(«grønt merke på låsen»): the stop guard blocked Stop three times while the
executor waited for the controller, with the step's test already green.

- test-lock.mjs green --cmd "<Verify>" runs the step's test command (same
  allowlist + denylist as done-line) and records green_at only on exit 0;
  pending clears it; a new lock starts without it.
- stop-test-lock lets a green-marked lock stop; the write guard still
  refuses the locked test files.
- trekexecute: D1 marks green after a PASS; each fix round marks pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-10-08 06:59:14 +02:00
commit 393b8e5a0a
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
5 changed files with 163 additions and 10 deletions

View file

@ -38,6 +38,10 @@ let lock = readLock(input?.cwd || process.cwd());
if (lock.state !== 'locked' || lock.lock.session !== input?.session_id) lock = lockForSession(input?.session_id);
if (lock.state !== 'locked') process.exit(0);
if (!lock.lock.session || lock.lock.session !== input?.session_id) process.exit(0);
// The step's test has been seen passing by a command (`test-lock.mjs green`):
// the session may stop -- e.g. to wait for its controller -- while the write
// guard keeps the test files locked (operator decision 2026-10-08).
if (lock.lock.green_at) process.exit(0);
const files = lock.lock.files.join(', ');
process.stdout.write(JSON.stringify({