@naswerks/engineering-loop 0.7.1 → 0.9.0

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.
Files changed (37) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +199 -0
  4. package/README.md +12 -7
  5. package/bin/verify-staged.mjs +136 -23
  6. package/bin/witness-acts.mjs +64 -0
  7. package/bin/witness-bodycheck.mjs +78 -0
  8. package/bin/witness-edits.mjs +60 -0
  9. package/bin/witness-extract-cmd.mjs +57 -0
  10. package/bin/witness-extract-seed.mjs +65 -0
  11. package/bin/witness-file-ledger.mjs +57 -0
  12. package/bin/witness-gaps.mjs +57 -0
  13. package/bin/witness-latency.mjs +55 -0
  14. package/bin/witness-lib.mjs +124 -0
  15. package/bin/witness-plane-window.mjs +57 -0
  16. package/bin/witness-procs.mjs +71 -0
  17. package/bin/witness-spawn-task.mjs +61 -0
  18. package/bin/witness-tx.mjs +60 -0
  19. package/bin/witness-watch.mjs +405 -0
  20. package/bin/witness-writes.mjs +64 -0
  21. package/package.json +1 -1
  22. package/references/docs-workflow.md +44 -24
  23. package/references/engineering-loop.md +42 -24
  24. package/skills/docs-audit-full/SKILL.md +2 -1
  25. package/skills/docs-process/SKILL.md +13 -7
  26. package/skills/docs-write/SKILL.md +1 -1
  27. package/skills/init/scripts/doctor.mjs +43 -5
  28. package/skills/init/scripts/owned.mjs +10 -0
  29. package/skills/spec-build/SKILL.md +12 -4
  30. package/skills/spec-coordinator/SKILL.md +149 -80
  31. package/skills/spec-ignite/SKILL.md +25 -21
  32. package/skills/spec-pipeline/SKILL.md +151 -82
  33. package/skills/spec-retro/SKILL.md +14 -9
  34. package/skills/spec-review/SKILL.md +32 -14
  35. package/skills/spec-seat/SKILL.md +107 -48
  36. package/skills/spec-witness/SKILL.md +267 -212
  37. package/templates/docs/readme-research.md +2 -2
@@ -29,21 +29,27 @@ quietly — say so in your PLAN TLDR and let the coordinator rule.
29
29
  and holds the close — a different contract, and `spec-coordinator` carries it whole.
30
30
 
31
31
  **Why this file exists:** a base contract that every seat kind shared, with the build job mixed in, sent
32
- the review row into the umbrella its own charter excluded and offered the docs-process row a `docs-write`
33
- it must never run. One base class, three wrong instructions. The contract and the job are therefore two
34
- files.
32
+ the review row into the coordinator's settled framing its own charter excluded and offered the docs-process
33
+ row a `docs-write` it must never run. One base class, three wrong instructions. The contract and the job are
34
+ therefore two files.
35
35
 
36
36
  **Find the format first.** This repository writes its formats (the doc header and status words, where an effort is filed, its rails) in the sections `rg -n '^#+ .*\(repository-owned\)' docs/_meta/` lists; read the one a step names before that step writes. This skill names the section, never the format.
37
37
 
38
38
  ## What you hold (and what you never touch)
39
39
 
40
40
  - **Yours:** your one assignment; the recon; the plan; the work; your artifacts; your own explicit-path
41
- commit (on call).
42
- - **Never yours:** `project-status.md` (coordinator-owned tracker — READ-ONLY), memory files, other slices'
43
- files (cross-slice changes need explicit coordinator approval and get recorded as a departure), the
44
- umbrella's declared out-of-scope areas, `docs-write` **on your own initiative** (it arrives as part of
45
- the coordinator's close-out call — and for a docs-process seat it never arrives at all, because you are
46
- that skill's consumer), any commit/push without the relayed coordinator call.
41
+ commits and your branch pushes once your plan is approved.
42
+ - **Never yours:** `project-status.md` (coordinator-owned tracker — READ-ONLY), `live-checks.md` (the
43
+ owner's — its rows are the ones the owner dictates), memory files, other slices' files (cross-slice changes
44
+ need explicit coordinator approval and get recorded as a departure), what the brief's § What this effort
45
+ does NOT do names, `docs-write` **on your own initiative** (it arrives as part of your close-out — the
46
+ relay's run-to-done order hand-cranked, the coordinator's close-out call hosted — and for a docs-process
47
+ seat it never arrives at all, because you are that skill's consumer), any commit or push before your plan
48
+ is approved, and any push to the base branch.
49
+
50
+ **Your charter is the brief.** `00-ignition-brief.md` is the coordinator's spec and the charter every seat
51
+ reads: its sections down to § Platform state bind you, and the owner's rulings in it are settled. Your own
52
+ spec is one numbered file in the same folder.
47
53
 
48
54
  ## Step 0 — orient NOW (before asking anything; no role or assignment needed)
49
55
 
@@ -101,11 +107,19 @@ FINAL TLDR — **append, never overwrite**) are FILES, not just chat text.
101
107
  **ONE CEREMONY IN BOTH MODES: you write your file, then you poke; your coordinator appends its ruling to the
102
108
  SAME file, then pokes you. Nobody pastes a document into a message.**
103
109
 
104
- - **Hand-cranked:** create them under `docs/research/{topic}/sessions/{slug}/` at plan time and end your
105
- turn announcing the path. The coordinator reads `tldr.md` with normal file tools and APPENDS its ruling
106
- under `## COORDINATOR RULING`, so read the answer in your own file and proceed. The full plan is PULL — it is
107
- read only on a read-full-plan verdict; never paste it into chat. (If your harness has a plan-approval
108
- mode that forbids writes: give the chat summary, get the human's approve, THEN post and stop.)
110
+ - **Hand-cranked — THE RELAY.** Post your PLAN TLDR and numbered questions **in the chat**, as plain text,
111
+ before any plan-approval presentation. The human relays them, and your coordinator's notes come back in
112
+ ONE message: the verdict, the answers, the riders, and the standing run-to-done order. Fold them in and
113
+ present your plan; the human approves it. Then create `plan.md` and `tldr.md` under
114
+ `docs/research/{topic}/sessions/{slug}/`, with the notes transcribed VERBATIM in `tldr.md` under
115
+ `## COORDINATOR RULING (plan — {verdict})`, and **RUN TO DONE WITHOUT A STOP**: build, suites,
116
+ `docs-write`, commits with `verify-staged`, your branch pushes (never the base branch; no merge, tag or
117
+ publish), and your FINAL TLDR in the chat. **The only stops:** a destructive act outside the effort's
118
+ branches, a credential exposure, a host restart, a `verify-staged` failure. A red you cannot fix takes
119
+ your spec's escape hatch, and you still close out. A mid-build question goes under
120
+ `## MID-BUILD QUESTION` in your `tldr.md`, and its ruling is appended there. After your last push your
121
+ coordinator reviews the FINAL against the tree and writes `## COORDINATOR ACCEPT (final — {slug})` into
122
+ your `tldr.md` itself. The full plan is PULL — never paste it into chat.
109
123
  - **Hosted (a seat inside a pipeline):** the same two files are yours to edit with normal file tools. **Write,
110
124
  then poke:** the first time, call `post_tldr` with `path` — the file's path inside your workspace, relative
111
125
  to its root — and the control plane reads the file from your runner; after that, call `post_tldr` with
@@ -126,6 +140,11 @@ SAME file, then pokes you. Nobody pastes a document into a message.**
126
140
 
127
141
  Either way, `tldr.md` read top-to-bottom is the session's whole conversation in message-flow order.
128
142
 
143
+ **Write the board with your file tools — Edit or Write — never through a shell heredoc.** A heredoc board
144
+ post has failed both ways a shell can fail it: on quoting ("unexpected EOF") and on length (the command
145
+ line is too long to spawn), and a heredoc collapses backslashes even when it runs. The file tools have
146
+ none of the three failures.
147
+
129
148
  **Greppable turn anchors:** every append gets a stable heading carrying actor + identity —
130
149
  `## [{seat}·{slug} · run {id}] {phase}` when your seat has a run identity, `## [{seat}·{slug}] {phase}`
131
150
  hand-cranked. The coordinator's voice is always `## COORDINATOR RULING …` / `## COORDINATOR NOTE …`. The
@@ -259,19 +278,19 @@ Ask what the park is protecting:
259
278
  - **A park on your own legitimate in-worktree work** — **re-request it** (no self-imposed cap, no
260
279
  workaround, no silent giving-up) AND disclose ("blocked on X, re-requested N times"). A parked call is
261
280
  the platform's turn, not your failure; routing around it hides the defect the park is surfacing.
262
- - **A park on a boundary command** (push to the base branch, force-push, branch delete — or a command
263
- whose *text* merely tripped the scanner) — **never re-request; reshape the command.**
264
- **A search is data only in one shape:** a quoted literal pattern given to a read-only search tool (`rg`,
265
- `grep`, `git grep`, `Select-String`, `findstr`), with no `$`, no backtick, no interpreter and no `xargs`
266
- in the pipeline. Any other command carrying boundary words parks — search for the symbol, not the verb.
267
- **THE SCANNER MATCHES TEXT, NOT PARSED VERBS, AND THIS IS THE MOST-PAID FENCE IN THE CEREMONY.** It
268
- fires on read-only commands a careful seat runs to PROVE its work: an `echo` label reading
269
- `=== remote tip ===` on a `git status`/`git log` block, or `git branch -r --contains <sha>` — a branch
270
- **listing** — tripping the *"branch deletion is human-only"* backstop. **So the discipline belongs in
271
- the prose you write around a command, not only in the command:** no git-verb vocabulary (push, remote,
272
- force, reset, branch delete) in any `echo`, comment, `--description` or section label. For upstream
273
- verification use `git log origin/<branch>..HEAD | wc -l` and `git status -sb`, which carry no colliding
274
- noun.
281
+ - **A park on a boundary command** (push to the base branch, force-push, branch delete — or a command the
282
+ gate read as one) — **never re-request; reshape the command.**
283
+ **THE GATE READS THE COMMAND THE SHELL WOULD RUN, NOT ITS WORDS.** What parks is the operation — a
284
+ publish, a remote change, a branch deletion, a merge — at any depth: wrapped, chained, or named inside
285
+ another program's words. An `echo` label naming a git verb, a branch listing and a quoted search pattern
286
+ are data to it. **They stop being data when something on the line could run them:** a shell or an
287
+ interpreter anywhere on the line, or a `$`, a backtick or an `xargs` in the pipeline. So keep a proof
288
+ command plain — one program, quoted literals — and give a search to a read-only search tool (`rg`,
289
+ `grep`, `git grep`, `Select-String`, `findstr`).
290
+ **RESHAPE MEANS A DIFFERENT COMMAND, NEVER A DISGUISED ONE — NEVER ROUTE AROUND A REFUSAL.** Rewriting a
291
+ path with a glob or a quote so a word is no longer seen (a `?` in place of one letter of a folder name)
292
+ is a disguise, and the same disguise passes a real boundary command. When the only way through is to
293
+ hide the word, the park is a false one: disclose it, with the verbatim command and park text, and ask.
275
294
  - **A POLICY WALL is none of the three.** If the refusal says `walled-by-policy`, **an approval cannot
276
295
  grant it** and re-requesting is walking through a known fail-open. The two routes are **reshape the work**
277
296
  (do it by a path the policy allows — often: hand the text to a seat whose scope covers it) or
@@ -301,8 +320,11 @@ Plain text, BEFORE any plan-approval presentation:
301
320
 
302
321
  ```
303
322
  PLAN TLDR ({your assignment}), recon done against HEAD {sha}, anchors {verified fresh / drift: …}:
304
- BELIEFS: HEAD {sha}; dirty files I see: {list, whose}; tool versions: {the harness, the runtimes};
305
- baseline suites: {per lane, as patterns/testing.md names them: N (+known pre-existing reds)}.
323
+ BELIEFS: HEAD {sha}; dirty files I see: {list, whose}; tool versions: {the harness, the runtimes, and the
324
+ model and effort this session is running on}; baseline suites: {cited from the brief's § Baselines, per
325
+ lane: N (+known pre-existing reds); a lane it does not name, measured before you edit}.
326
+ {when your row names a further repository, one line each:}
327
+ ALSO WRITING {repository}: commit {sha} on {branch}; dirty files there: {list, whose}.
306
328
  CONTROLS: for each probe or pin I will build — its positive control, and what would make it FAIL.
307
329
  {one line each: "probe X — control: {the case that must go red}; fails when: {…}"}
308
330
  {5-10 lines: what you will do, anchored to real files; the surfaces you will touch; departures flagged.}
@@ -318,7 +340,18 @@ coordinator with your question text and what the re-raise keys on (the two-headi
318
340
  **BELIEFS sha — ONE line.** The build-go HEAD check scans for `HEAD` + a 40-hex token **on the same line**
319
341
  (fenced or quoted is fine); a markdown break between them reads as a malformed sha and **refuses the
320
342
  flip** (fail-closed by design). Paste the verbatim `git rev-parse HEAD` output, never hand-transcribe, no
321
- wrapping. The checker reads `plan.md` AND `tldr.md`; the line in either satisfies it.
343
+ wrapping. **Put the BELIEFS line near the top of BOTH `plan.md` and `tldr.md`. When your HEAD moves,
344
+ restate it by appending a new `BELIEFS:` line, never by editing the old one:** the check reads the newest
345
+ line that carries `BELIEFS`, and with none it takes the first `HEAD <sha>` it meets, so quoted command
346
+ output carrying another sha is then read as your belief.
347
+
348
+ **A further repository's commit goes on its own `ALSO WRITING` line, beneath the BELIEFS line and never
349
+ beside the word `HEAD`:** the BELIEFS line carries one sha, this repository's, and your coordinator diffs
350
+ the other line against that repository's branch.
351
+
352
+ **The model and effort in that line are the ones you can read, never the brief's copied back.** The brief's
353
+ `## Birth` names the pair every seat starts on, and a seat that finds itself on another says so here, before
354
+ its plan. Write *not visible from here* for a part your session cannot see.
322
355
 
323
356
  **Cite symbols, not line numbers.** In anything that outlives a commit — a TLDR, a working doc, a handover
324
357
  — **name the symbol and use the line as a hint.** A line number is a comment, not an address; an anchor
@@ -397,15 +430,34 @@ doorbell with no follow-through**; if you receive one bare, retry anyway and say
397
430
  disqualifier is **anything else on the line**, and a leading `cd` — harmless on every OTHER git call you
398
431
  make — disqualifies a push (the FORM check reads the whole command string). Qualifying forms, exactly:
399
432
  first `git push -u origin <your-branch>`, later `git push origin <your-branch>` (`--set-upstream` also
400
- qualifies). A push without a refspec parks by design.
433
+ qualifies). A push without a refspec parks by design. This is your push in THIS repository; a further
434
+ repository's push has its own form, below.
401
435
  - **EVERY GIT COMMAND GOES ALONE — no shell metacharacters.** The FORM check reads the whole command
402
436
  string, so chaining, redirects or substitution disqualify it: `git add … && git commit … && git push …`
403
- parks where the same three commands, sent one at a time, flow unattended. Keep the word "push" out of
404
- echo text — the deny layer matches text, not parsed verbs.
437
+ parks where the same three commands, sent one at a time, flow unattended.
405
438
  - Prefer native read/glob/grep tools for reads; a shell read flows with its row like any other
406
439
  non-boundary call. On a periscope 1.4.0 runner they reach anything outside your workspace except
407
440
  credential material; on an older runner Read is jailed to your workspace, so read a file outside it —
408
441
  the runner's installed package, say — with a shell command.
442
+ - **WHEN YOUR ROW NAMES A FURTHER REPOSITORY, YOU WORK IN TWO TREES, AND EACH KEEPS ITS OWN RULES.** Most
443
+ rows name none, and nothing in this bullet applies to them.
444
+ - **Your home is this repository:** your spec, board, plan and working doc stay here, and nothing of
445
+ the pipeline's record is ever written in the other repository.
446
+ - **The other repository takes your code, in your own tree of it — never its owner's checkout.**
447
+ Hosted, your seed names the environment variable holding that tree's path: read it, never build the
448
+ path. Hand-cranked, your prompt names the path. Read the branch in the tree itself; it need not carry
449
+ this repository's branch name.
450
+ - **This section applies once per repository:** an explicit staging list and its `verify-staged`
451
+ receipt, run inside that tree; its own commit; and before its push, the whole of ITS gate — the suite
452
+ and checks its own contributing rules name, which this repository's lanes never run.
453
+ - **Its commit and pull-request text follow ITS rules:** no effort ids, no board or seat words. Where it
454
+ checks pull requests, open a DRAFT one at your first push and read its checks after every push.
455
+ - **Push from inside that tree — `cd "$TREE" && git push origin <branch>`, and nothing else on the
456
+ line,** with the variable your seed names in `$TREE`'s place (hand-cranked, the path your prompt
457
+ names). It is the one push that takes a leading `cd`. Keep the variable out of the push itself:
458
+ `git -C "$TREE" push` cannot be read, and waits for a person. Your push may wait for one anyway: wait,
459
+ never reshape it, and report a refusal.
460
+ - **You never merge, tag or publish there.** A release is a person's act, at the pipeline's `step`.
409
461
  - **Codegen only through the command `patterns/codegen.md` § Running codegen names** (when the repo has
410
462
  one) — never hand-write a generated folder.
411
463
  - **Never improvise a qualifying path in.** If a push parks and the remedy you can think of is touching a
@@ -417,7 +469,8 @@ doorbell with no follow-through**; if you receive one bare, retry anyway and say
417
469
  Plain text — **this is the contract**, whatever your job:
418
470
 
419
471
  ```
420
- FINAL TLDR — {your assignment}. Built on HEAD {sha}, nothing committed (awaiting the relayed call).
472
+ FINAL TLDR — {your assignment}. Built on HEAD {sha}; {hand-cranked: committed and pushed — the hashes and
473
+ branches} {hosted: nothing committed (awaiting the acceptance's commit call)}.
421
474
  (a) SHIPPED + VERIFICATION — per item: what + where + the receipt inline.
422
475
  (b) VERBATIM RUNNER SUMMARIES — exact blocks, never prose, WITH the invocation command per block;
423
476
  deltas vs baseline; any red run DISCLOSED with its rerun. A suite number quoted anywhere
@@ -428,21 +481,26 @@ FINAL TLDR — {your assignment}. Built on HEAD {sha}, nothing committed (awaiti
428
481
  `docs/research/{topic}/project-status.md` § `## Deferred findings log`. Number them
429
482
  LOCALLY to your tldr; the effort has ONE id sequence and the coordinator allocates from it.
430
483
  Each line carries its receipt (file:line) so it can be transcribed without re-deriving.
431
- (e) LIVE CHECKLIST ENTRIES — click + what PASS looks like, runnable cold, VERBATIM here. The
432
- COORDINATOR aggregates these into the effort's `live-checks.md` — never write that file
433
- unprompted: two writers on the file the review grades from is a divergence waiting to happen.
434
- Touch it only when the coordinator's call names it.
435
- (f) EXPLICIT STAGING LIST — the exact list `verify-staged` will be run over; a path not on
436
- this list is a path nobody will notice missing — + "commit HELD awaiting the relayed call" +
437
- which dirty files are NOT mine. SESSION ID + NAME.
484
+ (e) WHAT THE OWNER COULD TRY — in the chat, never a file: a few clicks, each with what passing
485
+ looks like, runnable cold. Live checks are the owner's; a row reaches `live-checks.md` only
486
+ when the owner dictates it, and you never write one.
487
+ (f) EXPLICIT STAGING LIST — the exact list `verify-staged` was (hand-cranked) or will be (hosted)
488
+ run over; a path not on this list is a path nobody will notice missing — + the STAGING
489
+ VERIFIED receipt, or hosted "commit HELD awaiting the commit call" + which dirty files are NOT
490
+ mine. A seat that wrote a further repository gives a list and a receipt PER REPOSITORY, each
491
+ under its repository's name, and in (b) each repository's summaries under its own name.
492
+ SESSION ID + NAME.
438
493
  ```
439
494
 
440
495
  ## Close-out — the order is law
441
496
 
442
- The call arrives (FINAL TLDR ACCEPTED, maybe fix-first, `docs-write` with a carry list **if your job
443
- produces a working doc**, COMMIT CALL with the message). Execute it exactly.
497
+ **Hand-cranked, the relay's run-to-done order IS the call:** run `docs-write` **if your job produces a
498
+ working doc**, commit with `verify-staged`, push your branch, and post the FINAL TLDR in the chat; your
499
+ coordinator reviews it against the tree and writes its acceptance into your `tldr.md` afterwards.
500
+ **Hosted, the call arrives** (FINAL TLDR ACCEPTED, maybe fix-first, `docs-write` with a carry list **if
501
+ your job produces a working doc**, COMMIT CALL with the message). Execute it exactly.
444
502
 
445
- **Between the coordinator's FINAL acceptance and your push, do not post NEW CONTENT** — a re-posted report
503
+ **Hosted, between the coordinator's FINAL acceptance and your push, do not post NEW CONTENT** — a re-posted report
446
504
  makes the acceptance stale by design. Append your close-out receipt AFTER the push under this heading:
447
505
 
448
506
  ```
@@ -502,11 +560,12 @@ human driving the table files a defect against correct behaviour. Fixes invalida
502
560
  what sweeps them.
503
561
 
504
562
  **AND THE OWNERSHIP SPLIT IS PART OF THE RULE — without it the step is a dead end.** You may not write
505
- `project-status.md` (coordinator-owned) or anything under `sessions/**` (testimony, byte-untouched). So:
563
+ `project-status.md` (coordinator-owned), a row of `live-checks.md` (the owner's) or anything under
564
+ `sessions/**` (testimony, byte-untouched). So:
506
565
 
507
- - **`live-checks.md`** — correct it directly if your change made a row's stated behaviour wrong.
508
- - **the tracker and `sessions/**`** — **REPORT the correction in your FINAL TLDR, quoting the line and what
509
- it should say.** Your coordinator transcribes it.
566
+ - **your own working doc, code and comments** — correct them in the same commit.
567
+ - **the tracker, a dictated `live-checks.md` row and `sessions/**`** — **REPORT the correction in your FINAL
568
+ TLDR, quoting the line and what it should say.** Your coordinator applies it.
510
569
 
511
570
  A partial the seat cannot execute is not an escape hatch, it is a dead end handed to it. Say which
512
571
  corrections are yours and which you are handing back.