@mu-crew/mu 3.13.2 → 4.0.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 (119) hide show
  1. package/AGENTS.md +73 -35
  2. package/README.md +71 -57
  3. package/dist/chunk-5HECDBK3.js +4482 -0
  4. package/dist/chunk-5HECDBK3.js.map +1 -0
  5. package/dist/chunk-AW2NONYU.js +301 -0
  6. package/dist/chunk-AW2NONYU.js.map +1 -0
  7. package/dist/chunk-GQNHIPJN.js +4060 -0
  8. package/dist/chunk-GQNHIPJN.js.map +1 -0
  9. package/dist/{chunk-3BARPJLY.js → chunk-PZ5GOCWH.js} +16 -2
  10. package/dist/chunk-PZ5GOCWH.js.map +1 -0
  11. package/dist/chunk-S424D5EP.js +13766 -0
  12. package/dist/chunk-S424D5EP.js.map +1 -0
  13. package/dist/{cli-CKOMHBXV.js → cli-GB2CAVVW.js} +6776 -4350
  14. package/dist/cli-GB2CAVVW.js.map +1 -0
  15. package/dist/cli.js +2 -3
  16. package/dist/cli.js.map +1 -1
  17. package/dist/errors-KHOYKD7D.js +65 -0
  18. package/dist/extension/mu-pi.js +1617 -836
  19. package/dist/extension/mu-pi.js.map +1 -1
  20. package/dist/index.d.ts +4015 -2561
  21. package/dist/index.js +614 -297
  22. package/dist/index.js.map +1 -1
  23. package/dist/tui-ALPHYTA2.js +1773 -0
  24. package/dist/tui-ALPHYTA2.js.map +1 -0
  25. package/docs/ARCHITECTURE.md +117 -66
  26. package/docs/VOCABULARY.md +112 -49
  27. package/docs/guide/README.md +3 -3
  28. package/docs/guide/backends.md +8 -4
  29. package/docs/guide/cleanup.md +61 -33
  30. package/docs/guide/delegate.md +141 -66
  31. package/docs/guide/dispatch.md +148 -53
  32. package/docs/guide/getting-started.md +37 -44
  33. package/docs/guide/other-agent-clis.md +102 -0
  34. package/docs/guide/recovery.md +31 -50
  35. package/docs/guide/remote.md +115 -45
  36. package/docs/guide/sql.md +104 -24
  37. package/docs/guide/stop-a-worker.md +30 -37
  38. package/docs/guide/sync.md +11 -3
  39. package/docs/guide/upgrade.md +93 -43
  40. package/docs/reference/env.md +23 -32
  41. package/docs/reference/naming.md +12 -7
  42. package/docs/reference/surface-contract.md +153 -0
  43. package/package.json +33 -11
  44. package/prompts/mu-debug.md +3 -1
  45. package/prompts/mu-refute.md +2 -1
  46. package/prompts/mu-research.md +3 -1
  47. package/prompts/mu-review.md +2 -1
  48. package/prompts/mu-rules-audit.md +5 -4
  49. package/prompts/mu-sweep.md +2 -1
  50. package/prompts/mu-tournament.md +4 -2
  51. package/prompts/mu-until.md +3 -1
  52. package/prompts/ultrathink.md +1 -1
  53. package/skills/mu/SKILL.md +60 -291
  54. package/skills/mu/recipes/adversarial-review.md +12 -103
  55. package/skills/mu/recipes/brief.md +14 -61
  56. package/skills/mu/recipes/course-correct.md +23 -0
  57. package/skills/mu/recipes/findings.md +17 -111
  58. package/skills/mu/recipes/models.md +17 -92
  59. package/skills/mu/recipes/move.md +14 -0
  60. package/skills/mu/recipes/orchestrator-loop.md +20 -119
  61. package/skills/mu/recipes/recovery.md +8 -29
  62. package/skills/mu/recipes/remote-workers.md +16 -318
  63. package/skills/mu/recipes/tasks-or-calls.md +15 -78
  64. package/skills/mu/recipes/test-health.md +19 -69
  65. package/skills/mu/recipes/worker.md +17 -24
  66. package/dist/chunk-45KQLMEL.js +0 -2908
  67. package/dist/chunk-45KQLMEL.js.map +0 -1
  68. package/dist/chunk-G434JKV2.js +0 -641
  69. package/dist/chunk-G434JKV2.js.map +0 -1
  70. package/dist/chunk-KUGUFBWH.js +0 -12527
  71. package/dist/chunk-KUGUFBWH.js.map +0 -1
  72. package/dist/chunk-QITLNZEM.js +0 -87
  73. package/dist/chunk-QITLNZEM.js.map +0 -1
  74. package/dist/chunk-VIEYQMQA.js +0 -393
  75. package/dist/chunk-VIEYQMQA.js.map +0 -1
  76. package/dist/chunk-WI6AWCMK.js +0 -19
  77. package/dist/chunk-WI6AWCMK.js.map +0 -1
  78. package/dist/cli-CKOMHBXV.js.map +0 -1
  79. package/dist/devtools-LS4ZEPWM.js +0 -3772
  80. package/dist/devtools-LS4ZEPWM.js.map +0 -1
  81. package/dist/tui-LFJ5P4Y2.js +0 -40956
  82. package/dist/tui-LFJ5P4Y2.js.map +0 -1
  83. package/dist/tui-sync-worker.js +0 -17
  84. package/dist/tui-sync-worker.js.map +0 -1
  85. package/dist/yank-XDOONQSL.js +0 -13
  86. package/dist/yank-XDOONQSL.js.map +0 -1
  87. package/docs/ROADMAP.md +0 -123
  88. package/docs/VISION.md +0 -298
  89. package/docs/architecture/control-socket.md +0 -142
  90. package/docs/architecture/dag.md +0 -117
  91. package/docs/architecture/mux.md +0 -167
  92. package/docs/architecture/ops-log.md +0 -160
  93. package/docs/architecture/sdk.md +0 -187
  94. package/docs/architecture/sync.md +0 -159
  95. package/docs/architecture/tui.md +0 -165
  96. package/docs/guide/tui.md +0 -98
  97. package/docs/history/CHANGELOG-pre-3.md +0 -4866
  98. package/docs/img/tui-dashboard.png +0 -0
  99. package/docs/specs/2026-09-28-agent-state-from-murmur.md +0 -333
  100. package/docs/specs/2026-09-29-task-substates.md +0 -247
  101. package/docs/specs/2026-10-03-keep-driving-nudge.md +0 -163
  102. package/docs/specs/2026-10-21-fast-and-slow-gates.md +0 -229
  103. package/skills/mu/recipes/backlog-triage.md +0 -45
  104. package/skills/mu/recipes/codemode-driver.md +0 -118
  105. package/skills/mu/recipes/deep-research.md +0 -69
  106. package/skills/mu/recipes/drift-audit.md +0 -75
  107. package/skills/mu/recipes/fan-out.md +0 -42
  108. package/skills/mu/recipes/hypothesis-panel.md +0 -48
  109. package/skills/mu/recipes/long-run.md +0 -32
  110. package/skills/mu/recipes/loop-until-done.md +0 -45
  111. package/skills/mu/recipes/plan.md +0 -67
  112. package/skills/mu/recipes/refute.md +0 -55
  113. package/skills/mu/recipes/review-panel.md +0 -65
  114. package/skills/mu/recipes/rules-audit.md +0 -89
  115. package/skills/mu/recipes/tournament.md +0 -44
  116. package/skills/mu/recipes/ultrathink.md +0 -86
  117. package/skills/mu/recipes/watcher.md +0 -28
  118. package/skills/mu/recipes/waves.md +0 -21
  119. /package/dist/{chunk-3BARPJLY.js.map → errors-KHOYKD7D.js.map} +0 -0
@@ -1,75 +0,0 @@
1
- # Drift audit
2
-
3
- Use during a long run to catch a crew drifting from what you decided:
4
- an instruction that never reached its worker, a batch run on stale
5
- inputs, work continuing on a closed task. One read-only
6
- [delegate call](tasks-or-calls.md#delegate-call); it edits nothing.
7
-
8
- ## When
9
-
10
- - every few hours of a long run;
11
- - after each batch report of a chained task (sweep, campaign, soak);
12
- - after a context compaction or a resume;
13
- - before you declare a stop rule met.
14
-
15
- ## Run
16
-
17
- Issue one delegate call with `record: { task: "<ws>/<umbrella>" }` and
18
- this brief, with `<ws>` filled in:
19
-
20
- ```text
21
- Read-only drift audit of mu workstream <ws>. Change nothing. Sources:
22
- mu state -w <ws>; mu task list -w <ws> --json; mu task notes <id> -w <ws>;
23
- mu sql (ops, tasks, task_notes, agents); git log in the repo and in each
24
- owner's workspace. Never judge by a capped mu log -n window: the claim
25
- or close you compare against is often older than it.
26
- 1. Unsent notes: notes on IN_PROGRESS tasks, by someone other than the
27
- owner, after the owner's last task.claim or agent.send op:
28
- mu sql "select t.local_id task, a.name owner, n.created_at, substr(n.content,1,80) note from tasks t join workstreams w on w.id=t.workstream_id join agents a on a.id=t.owner_id join task_notes n on n.task_id=t.id where w.name='<ws>' and t.status='IN_PROGRESS' and coalesce(n.author,'')<>a.name and n.created_at > max(coalesce((select max(o.created_at) from ops o where o.intent='task.claim' and o.key='<ws>/'||t.local_id),''), coalesce((select max(o.created_at) from ops o where o.intent='agent.send' and o.key='<ws>' and o.payload like 'agent send '||a.name||' (%'),'')) order by n.created_at"
29
- Quote each task's last claim (seq, time). For each instruction it
30
- lists: did the owner act on it (later commits, notes, pane)? Also read
31
- mu sql "select seq, created_at, payload from ops where intent='agent.send' and key='<ws>'"
32
- and flag mode=plain or mode=steer with state=busy since=<t> long
33
- before the send: it queued behind a long turn and may not have landed.
34
- 2. Stale pins: for each build/binary sha or oracle commit named in an
35
- IN_PROGRESS note, and each merged fix its task's findings depend on:
36
- git merge-base --is-ancestor <fix> <pinned>. Exit 1 = pin is stale.
37
- 3. Closed-task notes: notes added after the task's last task.close op,
38
- minus those the close verb writes in its own transaction
39
- (`--evidence`, `--why`: timestamp within 50ms of the close op); any
40
- other note counts, whatever its prefix. Report each of the top 5 by
41
- count as its own finding with its count,
42
- even when the notes look routine. A late note that reports the
43
- closed bug again usually ran on a build without the closing fix:
44
- check its sha with git merge-base --is-ancestor <fix> <sha>.
45
- mu sql "select t.local_id name, count(*) late from tasks t join workstreams w on w.id=t.workstream_id join task_notes n on n.task_id=t.id join (select key, max(created_at) at from ops where intent='task.close' and entity='task' group by key) c on c.key='<ws>/'||t.local_id where w.name='<ws>' and t.status='CLOSED' and (julianday(n.created_at)-julianday(c.at))*86400 > 0.05 group by t.local_id order by late desc"
46
- 4. Thin decisions: an ACCEPT/REJECTED/CLOSE/SUPERSEDED note under 40
47
- chars; a refuter tally with no REFUTER or VERDICT note; a review the
48
- orchestrator closed with no FILES/COMMANDS note and no commit.
49
- 5. Silent tasks: IN_PROGRESS with no note or commit for longer than
50
- the cadence its notes state (default 2h).
51
- 6. Missing work: a task or finding a note or log line says will be
52
- filed that does not exist.
53
- 7. Unrefuted briefs: IN_PROGRESS tasks with no note line starting
54
- REFUTER , VERDICT: or REFUTE-EXEMPT:.
55
- End with exactly this, one EVIDENCE line per finding (none when clean):
56
- VERDICT: <ws> DRIFT-AUDIT CLEAN | FINDINGS <n>
57
- EVIDENCE: FINDING <high|med|low> <file:line|task> <what> (check <1-7>)
58
- ```
59
-
60
- `record` keeps only the VERDICT line and the `EVIDENCE:` lines after
61
- it, so each finding must be an `EVIDENCE: FINDING` line. The note
62
- lands headed `REFUTER`, which the refute nudge and decision warnings
63
- read as a recorded verdict; on an umbrella that is harmless.
64
-
65
- ## Act
66
-
67
- Each finding becomes one of:
68
-
69
- - an `OPEN/triage` task blocking the umbrella ([findings § Record](findings.md#record));
70
- - a send to the worker it names, per
71
- [orchestrator-loop § Sending](orchestrator-loop.md#sending)
72
- (`--interrupt` when its current work is wasted, as with a stale pin).
73
-
74
- Done when the verdict is recorded on the umbrella and every finding
75
- is a task or a delivered send.
@@ -1,42 +0,0 @@
1
- # Fan-out
2
-
3
- Use when the same treatment applies to many units: files, call sites,
4
- failing tests, findings, modules. One context holding 50 units drops
5
- some and calls the job done; one task per unit cannot.
6
-
7
- ## Steps
8
-
9
- 1. **Enumerate first.** A scout (a [delegate call](tasks-or-calls.md#delegate-call)) lists the units and
10
- writes them to the umbrella's note, one per line. The list is done
11
- when it matches a command the scout ran (`rg -l`, a test listing),
12
- not when it looks complete. Record the command and the count. The
13
- scout runs cheap; the units run mid, or strong when each is a
14
- judgement call ([models](models.md#roles)).
15
- 2. **One task per unit**, blocked into an umbrella:
16
-
17
- ```bash
18
- mu task add sweep -w <ws> -t "Sweep: <goal>" -i 60 -e 1 --note 'UNITS: 37 (rg -l ... | wc -l)'
19
- mu task add sweep_auth_ts -w <ws> -t "Sweep src/auth.ts" -i 50 -e 0.2
20
- mu task block sweep -w <ws> --by sweep_auth_ts
21
- ```
22
-
23
- Put the shared [brief](brief.md) and acceptance criteria on the
24
- umbrella; each unit task's note holds only what differs. A sweep that
25
- only checks (no commits) makes each unit a delegate call instead
26
- ([tasks-or-calls](tasks-or-calls.md)).
27
- 3. **Cap concurrency** ([orchestrator-loop § Concurrency](orchestrator-loop.md#concurrency)).
28
- One agent per ready unit, up to the ceiling. Tell workers to avoid
29
- repo-wide commands so more can run.
30
- 4. **Pipeline.** Dispatch, wait `--first`, merge
31
- ([orchestrator-loop § Merging](orchestrator-loop.md#merging)), dispatch
32
- the next unit to the freed worker with `--fresh`. With `codemode`, a
33
- [driver](codemode-driver.md) can dispatch each batch. Units that touch the same files
34
- are chained with `block` (see [waves](waves.md)).
35
- 5. **Review per unit** when a wrong unit is costly: add a review task
36
- per unit ([adversarial-review](adversarial-review.md)).
37
- 6. **Synthesize** when the output is a report, not commits: one
38
- delegate call reads the unit notes (not transcripts) and writes one
39
- result into the umbrella's note.
40
-
41
- Done when `mu task close sweep --if-ready` closes the umbrella: every
42
- unit is closed, and the closed count matches the step 1 count.
@@ -1,48 +0,0 @@
1
- # Hypothesis panel
2
-
3
- Use for root-cause work: a flaky test, an intermittent bug, a metric
4
- that moved. One agent that forms a theory then tests its own theory
5
- finds evidence for it. Separate agents, each given different evidence,
6
- form independent theories; separate agents then try to kill them.
7
-
8
- ## Steps
9
-
10
- 1. **Write the symptom** on the umbrella: what happens, how often, the
11
- repro command, and what would count as fixed.
12
- 2. **One reader per evidence source** (a [delegate call](tasks-or-calls.md#delegate-call), strong tier:
13
- root cause is judgement, [models](models.md#roles)): logs, the
14
- code path, recent commits, data, environment. Each sees only its
15
- source, so the theories do not anchor on each other. Record each
16
- theory as an `OPEN/triage` task blocking the umbrella, decided like
17
- a finding ([findings § Triage](findings.md#triage)):
18
-
19
- ```bash
20
- mu task add -w <ws> --triage -t "h: <cause>" -i 60 -e 0.5 \
21
- --note 'PREDICTS: <an observation true if this is the cause, false otherwise>'
22
- ```
23
-
24
- 3. **Test each hypothesis.** An experiment that changes code (force the
25
- race, revert the commit) needs a workspace: `mu task accept` the
26
- hypothesis and dispatch it as a task. One that only reads (feed the
27
- data, grep the logs) is a delegate call with `record` on the
28
- hypothesis ([tasks-or-calls § Delegate call](tasks-or-calls.md#delegate-call)).
29
- A killed hypothesis closes `--as rejected --why "<the observation
30
- that contradicts PREDICTS>"`; a survivor gets a `SURVIVED: <evidence>`
31
- note. Prose reasons: [brief § Quoting](brief.md#quoting).
32
- 4. **If one survives**, add a fix task for it, then a review task
33
- ([adversarial-review](adversarial-review.md)). The fix is accepted
34
- only if the step 1 repro stops reproducing.
35
- 5. **If none survives**, start another round
36
- ([loop-until-done](loop-until-done.md)): the new hypothesis tasks get
37
- the killed hypotheses and their evidence as input.
38
-
39
- Done when the fix's review task is `CLOSED/done` (ACCEPT) and the
40
- repro from step 1 no longer
41
- reproduces at the rate step 1 recorded.
42
-
43
- ## Traps
44
-
45
- - **Two survivors** usually means the experiments were too weak. Design
46
- one experiment that separates them before you fix either.
47
- - **Flaky repros need counts** ([long-run](long-run.md) step 1). "Passed once" proves nothing for a 1 in
48
- 50 failure. Put the run count in step 1.
@@ -1,32 +0,0 @@
1
- # Long runs
2
-
3
- Use when a task or proof runs for hours, crosses context compaction,
4
- or may hit flakes.
5
-
6
- 1. **Define done first.** Before dispatch, write the completion criterion
7
- into the task note: the checks, how many runs must agree, the
8
- allowed variance. A worker that finds the bar in the note stops at
9
- the bar, not at the first green. For chained batches (sweeps,
10
- campaigns, soaks) it also names the **inputs** each batch runs on
11
- (build sha, oracle commit, config) and when to refresh them
12
- ("rebuild from main before each batch"); each batch report states
13
- the inputs it used, and the stop rule counts only batches on
14
- current inputs.
15
- 2. **Split into independent units** ([fan-out](fan-out.md)). Shard a long proof into tasks
16
- that run in parallel, so one flake restarts only its unit. Each unit
17
- carries its own criterion.
18
- 3. **Keep state in the DB.** Progress lives in task notes, not in the
19
- orchestrator's context. After a compaction, `mu state` and
20
- `mu task notes <id>` are the whole picture. Append
21
- `DEAD-END: <approach> — <why it failed>` to the umbrella so a resumed
22
- orchestrator does not retry it.
23
- 4. **Bound each tool call** to minutes: batches of ≤10 minutes,
24
- `mu task wait --timeout` re-issued, no open-ended `sleep` loops.
25
- A `--steer` lands only when the running tool returns.
26
- 5. **Accept evidence, not close notes**
27
- ([orchestrator-loop § Merging](orchestrator-loop.md#merging)), and
28
- run a [drift-audit](drift-audit.md) after each batch report and
29
- every few hours.
30
-
31
- Done when every unit is `CLOSED/done` and the criterion from step 1
32
- holds on the merged tree.
@@ -1,45 +0,0 @@
1
- # Loop until done
2
-
3
- Use when the amount of work is unknown: fix type errors until clean,
4
- find flaky tests until none are new, search until nothing new turns up.
5
- A fixed number of passes stops too early or runs too long; a stop rule
6
- written down first does neither.
7
-
8
- ## Steps
9
-
10
- 1. **Write the stop rule** on the umbrella before the first round. It
11
- names a command and a condition, plus a no-progress rule:
12
-
13
- ```text
14
- STOP: `npx tsc --noEmit` exits 0
15
- NO-PROGRESS: two rounds in a row reduce the error count by zero
16
- ```
17
-
18
- 2. **Each round is a task** that blocks the umbrella and is blocked by
19
- the previous round:
20
- `round_1`, `round_2`, .... Add the next round only when the current
21
- one closes; never pre-create rounds. Dispatch each per
22
- [orchestrator-loop](orchestrator-loop.md); multi-hour loops follow
23
- [long-run](long-run.md).
24
- 3. **Each round ends with its measurement** in the note:
25
- `MEASURE: 14 errors (was 31)`, or `NEW: 0 flaky tests`.
26
- 4. **After each round, check the rule** yourself, from the measurement
27
- command, not from the worker's note.
28
- - Rule met: first one delegate call refutes the umbrella's criteria
29
- on the merged tree (record on the umbrella). Then
30
- `mu task close <umbrella> --if-ready --evidence "<stop
31
- command + result>"` (each round blocks the umbrella).
32
- - No progress: stop the loop and decide. Change the approach, split
33
- the work, or park the umbrella with
34
- `mu task park <umbrella> --why "<what is stuck>"` and tell the human.
35
- Prose reasons: [brief § Quoting](brief.md#quoting).
36
- - Otherwise: add the next round and dispatch it.
37
-
38
- Done when the stop rule holds on the merged tree, run by you.
39
-
40
- ## Traps
41
-
42
- - **A round that only reports is not progress.** Each round must change
43
- something (fix, new search slice) or produce a new measurement.
44
- - **Moving goalposts.** Edit the stop rule only with a note saying why;
45
- the old rule stays in the history.
@@ -1,67 +0,0 @@
1
- # Planning a DAG
2
-
3
- Use when you turn a spec or a clear set of requirements into tasks.
4
- The DAG is the plan: each task's note carries its full content, and
5
- `mu state` is the progress tracker. Write a markdown plan only when the
6
- human asks for a file.
7
-
8
- ## Steps
9
-
10
- 1. **Map files and gates.** List what gets created or changed and each
11
- file's responsibility. For a new project, define repo `## Gates` first
12
- ([test-health](test-health.md#gate-contract)); point plan notes there.
13
- Existing gates remain until their replacement is approved.
14
- 2. **Size the tasks.** A task is the smallest unit that carries its own
15
- verification and is worth a review. Split only where a reviewer
16
- could reject one task and accept its neighbour. Fold setup, config,
17
- and docs into the task whose deliverable needs them.
18
- 3. **Write the root task.** `task_0` holds the goal, the architecture
19
- in two or three sentences, and the global constraints copied
20
- verbatim from the spec. Every other task is blocked by it; close it
21
- at once. It carries notes, not work.
22
- 4. **Write each task's note** as a [brief](brief.md): its Shape, plus
23
- INTERFACES and STEPS:
24
-
25
- ```text
26
- GOAL: one sentence
27
- DONE WHEN: checkable, exhaustive criterion
28
- FILES: Create/Modify/Test with exact paths (line ranges if known)
29
- INTERFACES: Consumes: <exact signatures from earlier tasks>
30
- Produces: <exact names and types later tasks use>
31
- STEPS: one action each; code steps carry the code
32
- VERIFY: <exact command and expected result>
33
- ```
34
-
35
- The worker sees only its own task. INTERFACES is how it learns the
36
- names its neighbours use.
37
- 5. **No placeholders.** "TBD", "add error handling", "similar to
38
- task 3", "write tests for the above": each is a missing decision the
39
- worker will make alone. Write the actual content; tasks are read out
40
- of order.
41
- 6. **Add edges for dependencies only.** `mu task block A --by B` when A
42
- consumes what B produces. Plan order is not a dependency: an extra
43
- edge serialises tasks that could run in parallel. The exception:
44
- tasks that edit the same files are chained ([waves](waves.md)).
45
- 7. **Self-review before dispatch.** Map each spec requirement to its
46
- task, grep the notes for placeholders, match INTERFACES names across
47
- tasks, and read the graph back (`mu task tree task_0 -w <ws> --down`).
48
- Then refute each brief that makes claims ([call](tasks-or-calls.md#delegate-call),
49
- all in one turn, at your tier from another family: [models](models.md#checkers)): "What in this brief is false about the code,
50
- ambiguous, or would make a correct worker fail review? Cite
51
- file:line." Rewrite each REFUTED brief. Five of six briefs refuted in one run had
52
- such a defect, e.g. a fallback test old extensions made unpassable.
53
-
54
- Done when every spec requirement maps to a task, no note holds a
55
- placeholder, every claim-making brief has a verdict, and `mu state`
56
- lists the tasks you meant to run in parallel as Ready together. Then dispatch per [orchestrator-loop](orchestrator-loop.md).
57
-
58
- ## Notes
59
-
60
- - `impact` comes from what breaks without the task; `effort_days` from
61
- its step count. Guess honestly rather than defaulting to 50 and 1.
62
- - Review gates follow [adversarial-review](adversarial-review.md): a
63
- review task blocked by the work.
64
- - End each phase/milestone with a [test-health task](test-health.md#upkeep-loop);
65
- connect real dependencies, not a barrier across independent workers.
66
- - When reality disagrees with the plan, append a note saying so. Do not
67
- rewrite earlier notes.
@@ -1,55 +0,0 @@
1
- # Find, refute, synthesize
2
-
3
- Use for audits, bug sweeps, and fact-checks: anything that produces
4
- findings. Finders over-report; a separate agent told to kill each
5
- finding filters what survives. Where findings live and how triage works
6
- is [findings](findings.md); this recipe is the search around it. Builds
7
- on [fan-out](fan-out.md).
8
-
9
- **Mode:** workstream by default (an audit feeds fixes). For a quick
10
- fact-check nobody will track, use delegate mode from
11
- [findings](findings.md) and skip the tasks.
12
-
13
- ## Steps
14
-
15
- 1. **Pin the scope** on an umbrella task: what is searched, and what
16
- counts as a finding.
17
- 2. **Split the search** into slices (security, data integrity, one
18
- module each). One finder task per slice. Finders read; they do not
19
- fix.
20
- 3. **Finders record findings** as `OPEN/triage` tasks blocking the
21
- umbrella, one per finding, severity first in the title, file:line and
22
- evidence in the note ([findings § Record](findings.md#record)). A
23
- finder with more than 5 writes `FINDING:` lines in its own note
24
- instead, and [findings § Triage](findings.md#triage) turns them into
25
- tasks.
26
- 4. **Refute each finding** with a
27
- [delegate call](tasks-or-calls.md#delegate-call), not a task. The
28
- refuter gets the finding and the code, not the finder's reasoning,
29
- and tries to prove it false: run it, find the guard, read the caller.
30
- Pass `record` so its verdict lands on the finding, and apply the
31
- skip and three-refuter rules, as in
32
- [findings § Triage](findings.md#triage).
33
- Many findings: issue the calls in batches under the cap ([orchestrator-loop § Concurrency](orchestrator-loop.md#concurrency)); to
34
- get the verdicts back as one table, see
35
- [codemode-driver § Delegate calls](codemode-driver.md#delegate-calls).
36
- 5. **Report** from the graph: accepted findings are the result, ranked
37
- by impact; `mu task list --substate rejected` is what was refuted.
38
- A synthesis task is needed only when the human wants prose.
39
-
40
- Done when no finding is left in triage without an `UNVERIFIED` note,
41
- and the accepted findings are fixed or handed off. The umbrella closes
42
- with `--if-ready` once no finding is open; while an `UNVERIFIED` finding
43
- remains it stays open and the human gets the list.
44
-
45
- ## Traps
46
-
47
- - **UNVERIFIED is not REFUTED.** A refuter that hit a rate limit or
48
- could not run the code disproved nothing. The finding stays in triage
49
- with an `UNVERIFIED:` note, reported apart.
50
- - **Cheap finders, strong refuters.** Finders can run cheap when a
51
- missed finding is affordable: refuters test what was reported, not
52
- what was missed. Refuters run at the finder's tier or higher, and no
53
- lower than mid, from another family ([models](models.md#checkers)).
54
- - **No findings is a result.** A slice that finds nothing closes with
55
- that in its note; do not re-run it until it finds something.
@@ -1,65 +0,0 @@
1
- # Review panel
2
-
3
- Use to review one diff, branch, or PR from several angles before it
4
- ships: correctness, security, simplicity, tests, the repo's own rules.
5
- One reviewer looking at everything finds the obvious; one reviewer per
6
- angle, each in a fresh context, finds more. Findings are refuted before
7
- anyone acts on them.
8
-
9
- This is a sweep over one change. To gate each unit of a larger job,
10
- use [adversarial-review](adversarial-review.md) instead.
11
-
12
- **Mode:** delegates by default: reviewing a PR, a doc, or a draft needs
13
- an answer, not a permanent record. Switch to workstream mode when the
14
- panel's findings will be fixed by agents. Both modes are in
15
- [findings](findings.md).
16
-
17
- ## Steps
18
-
19
- 1. **Pin the target**: `git diff main...HEAD`, a PR number, or a commit
20
- range. Put it in every reviewer's brief (delegate mode) or on an
21
- umbrella task (workstream mode), so every reviewer reads the same
22
- range.
23
- 2. **One reviewer per angle**: a delegate in delegate mode, a task in
24
- workstream mode. Pick the angles that apply:
25
-
26
- | Angle | Looks for |
27
- | --- | --- |
28
- | correctness | logic errors, edge cases, error paths, races |
29
- | security | injection, auth and permission checks, secrets, unsafe input |
30
- | simplicity | duplication, dead code, needless abstraction, an existing helper not reused |
31
- | tests | risky coverage gaps, ineffective tests, level/duplication/wait/cost findings ([test-health](test-health.md#adding-or-changing-tests)) |
32
- | rules | the repo's written rules (see [rules-audit](rules-audit.md)) |
33
-
34
- Each reviewer gets the range, its angle, and the [brief](brief.md)
35
- rules and available gate records ([test-health](test-health.md#gate-contract));
36
- coordinate targeted checks across angles. It edits nothing. A clean result (`FINDINGS: none` plus the
37
- commands it ran) is a valid result.
38
- 3. **Record findings** by mode:
39
- - delegate: each reviewer ends its answer with `FINDING:` lines;
40
- - workstream: each finding is an `OPEN/triage` task blocking the
41
- umbrella ([findings § Record](findings.md#record)).
42
- 4. **Merge and refute.** Merge duplicates across angles, then refute
43
- with [delegate calls](tasks-or-calls.md#delegate-call) in both modes,
44
- following the skip and three-refuter rules in
45
- [findings § Triage](findings.md#triage).
46
- 5. **Act:**
47
- - delegate mode: post the comments or edit the doc from the merged
48
- list, citing file:line and evidence;
49
- - workstream mode: accept the confirmed findings, dispatch the
50
- fixes, each with its own review
51
- ([adversarial-review](adversarial-review.md)).
52
-
53
- Done when every finding is acted on (delegate mode) or decided in
54
- triage and the umbrella closes with `--if-ready` (workstream mode).
55
-
56
- ## Traps
57
-
58
- - **Reviewers padding the list.** A panel that always finds ten things
59
- is guessing.
60
- - **Vary families across angles, not tiers.** Every reviewer is at the
61
- author's tier or higher ([models](models.md#checkers)); one model's
62
- blind spot repeated five times is still one blind spot. Pass `model`
63
- to `mu_delegate`.
64
- - **The panel is not the slow gate.** Merge verification still runs on the
65
- merged tree ([orchestrator-loop](orchestrator-loop.md#merging)).
@@ -1,89 +0,0 @@
1
- # Rules audit
2
-
3
- Use when the repo's written rules (`AGENTS.md`, contributing guides,
4
- style docs) are not being followed, or when the same correction keeps
5
- coming up in review and is not written down. One agent checking a diff
6
- against twenty rules skips some; one checker per rule does not.
7
-
8
- Two modes. **Check** asks "does this change follow our rules?".
9
- **Mine** asks "which rules are we missing?".
10
-
11
- Check on someone's PR runs as delegates; check before merging your own
12
- work, and mine always, run in a workstream. Violations and candidate
13
- rules are findings: [findings](findings.md) says where they live.
14
-
15
- ## Check: a change against the rules
16
-
17
- 1. **List the rules.** A scout (a delegate call) extracts every
18
- checkable rule from the rule files, one per line with its source,
19
- into every checker's brief (delegate mode) or the umbrella's note
20
- (workstream mode):
21
-
22
- ```text
23
- RULE: r7 AGENTS.md:52 "Throw typed error classes, not bare Error"
24
- ```
25
-
26
- Skip rules no diff can show (team habits, meeting norms). Record the
27
- count.
28
- 2. **Pin the target**: the diff, branch, or PR, as in
29
- [review-panel](review-panel.md) step 1.
30
- 3. **One checker per rule**, as a [delegate call](tasks-or-calls.md#delegate-call)
31
- The checker gets one rule and the diff. Delegate mode: end the answer
32
- with `FINDING: … r7 …` lines. Workstream mode: one triage task per
33
- violation ([findings § Record](findings.md#record); title
34
- `<severity>: r7 <what>`). With no violation it reports `r7: no violations` with what it
35
- looked at. One rule per checker keeps it from skimming; batch under
36
- the cap ([orchestrator-loop § Concurrency](orchestrator-loop.md#concurrency)).
37
- 4. **A skeptic pass** over the findings, also a delegate call: one fresh agent reads each flagged
38
- line and the rule, and drops false positives (the rule does not
39
- apply here, the code already complies, the rule has a stated
40
- exception). In workstream mode, a dropped finding is
41
- `close --as rejected --why "<why the rule does not bite here>"`; a
42
- confirmed one is accepted with `--evidence` naming the flagged line
43
- ([findings § Triage](findings.md#triage) step 3; quoting:
44
- [brief § Quoting](brief.md#quoting)).
45
- 5. **Report or fix** confirmed violations, as in review-panel step 5.
46
-
47
- Done when every rule from step 1 has a checker result, and every finding
48
- is decided.
49
-
50
- ## Mine: rules you keep stating but never wrote
51
-
52
- 1. **Collect corrections.** Sources, any that exist: review comments
53
- on merged PRs, `REJECT` notes from [adversarial-review](adversarial-review.md)
54
- tasks, and past agent sessions (with a session archive such as
55
- [museum](https://github.com/mu-crew/museum), search for user turns
56
- that correct the agent: "no, use", "don't", "we always"). One reader
57
- (a delegate call) per source batch returns each correction as one
58
- line:
59
-
60
- ```text
61
- CORRECTION: k12 <source ref> "use the shared retry helper instead of a hand-rolled loop"
62
- ```
63
-
64
- 2. **Cluster** the corrections in one delegate call: the same lesson in
65
- different words is one cluster. Keep clusters with at least two
66
- corrections from different occasions; a one-off is not a rule.
67
- 3. **One `OPEN/triage` task per candidate rule**, the rule as the
68
- title and its cluster of corrections in the note.
69
- 4. **Refute each candidate** with a
70
- [delegate call](tasks-or-calls.md#delegate-call) that passes
71
- `record`: would it have prevented the real mistakes in its cluster?
72
- Does it contradict an existing rule? Is it already enforced by a
73
- linter or test (then it needs no prose)? Dropped candidates close
74
- `--as rejected --why` naming the deciding answer.
75
- 5. **Propose, don't commit.** The candidates left in triage are the
76
- proposal: write them as a diff to the rule file in the umbrella's
77
- note, worded per [brief](brief.md) (positive, specific, with the
78
- reason). A rule change is a human decision: the human accepts or
79
- rejects each candidate task.
80
-
81
- Done when every cluster has a verdict and the proposal lists each kept
82
- rule with the corrections behind it.
83
-
84
- ## Traps
85
-
86
- - **A rule a tool can check belongs in the tool.** If a linter, type,
87
- or test can catch it, propose that instead of prose.
88
- - **Mined rules overfit.** Two corrections in one week about one file
89
- may be about that file, not a rule. The refute step asks.
@@ -1,44 +0,0 @@
1
- # Tournament
2
-
3
- Use when several answers are possible and the best is a judgement
4
- call: a design, a name, an API shape, competing fixes, a ranking. Agents
5
- compete on the same task; judges compare pairs. Comparing two is more
6
- reliable than scoring one.
7
-
8
- ## Steps
9
-
10
- 1. **Write the rubric first**, on the umbrella: what good looks like,
11
- in a few ranked criteria. Judges apply it; they do not invent one.
12
- 2. **Generate.** N attempts with the same brief and a different
13
- approach or model each. Code attempts are tasks, each in its own
14
- workspace. Ideas (names, plans) are delegate calls; one call can
15
- generate many candidates.
16
- 3. **Filter** (when there are many candidates): one delegate call drops
17
- the ones that fail a hard rubric criterion and merges duplicates. What is left
18
- enters the bracket.
19
- 4. **Judge in pairs.** One [delegate call](tasks-or-calls.md#delegate-call) per comparison, a fresh agent
20
- each, so no judge holds the whole field
21
- ([tasks-or-calls](tasks-or-calls.md)). The judge sees the two
22
- candidates and the rubric and ends with `WINNER: <a|b> <reason>`.
23
- A judge decides a pair, not a task: no `record`. Record each round
24
- (pair, winner, reason) in the umbrella's note; winners meet in the
25
- next round. A round wider than the cap runs in batches
26
- ([orchestrator-loop § Concurrency](orchestrator-loop.md#concurrency)).
27
- 5. **Confirm the winner** with a final check against the rubric, then
28
- merge it. Free the losing workspaces.
29
-
30
- Done when one candidate has won every comparison it entered and the
31
- final check passed.
32
-
33
- ## Traps
34
-
35
- - **Position bias.** Judges favour the first candidate shown. For close
36
- calls, judge the pair twice with the order swapped; a split decision
37
- goes to a third judge.
38
- - **Same model, same taste.** Vary the attempts across families at the
39
- same tier, and judge with a model that made no attempt, at that tier
40
- or above ([models](models.md#checkers)). A close final goes to a
41
- frontier judge, or with none available, the strongest model from a
42
- family that made no attempt.
43
- - **Ranking many items** (tickets by severity): bucket them in parallel,
44
- then run pairwise comparisons only within and across bucket edges.
@@ -1,86 +0,0 @@
1
- # Ultrathink
2
-
3
- Use when a task is too large or too risky for one context: a migration
4
- across many files, a repo-wide audit, a hard bug, a design with real
5
- alternatives, any long autonomous run where you will not read every
6
- line. Ultrathink composes the other recipes. Every unit, gate, finding
7
- and round is a task in the DAG, so the run is as visible as the code it
8
- produces; the checks on them are delegate calls whose verdicts land on
9
- those tasks.
10
-
11
- It costs many agents and many tokens. For a change one agent can hold
12
- and check, skip it.
13
-
14
- ## Steps
15
-
16
- 1. **Define done.** Write the goal and the stop rule on an umbrella task:
17
- the command that must pass, the report that must exist, the criteria
18
- a reviewer will apply. Ask the human now for anything only they can
19
- decide (scope, budget, external actions); after this step, keep
20
- driving.
21
- 2. **Understand before you change.** If the shape of the work is not
22
- known, run a scout ([delegate call](tasks-or-calls.md#delegate-call))
23
- or a [fan-out](fan-out.md) of readers first. Their
24
- output is the unit list and the facts the plan needs, in notes.
25
- 3. **Pick the shape** for the main phase:
26
-
27
- | The work is | Recipe |
28
- | --- | --- |
29
- | the same change over many units | [fan-out](fan-out.md) |
30
- | finding problems or checking claims | [refute](refute.md) |
31
- | a cause to find | [hypothesis-panel](hypothesis-panel.md) |
32
- | a choice between real alternatives | [tournament](tournament.md) |
33
- | an unknown amount, until a check passes | [loop-until-done](loop-until-done.md) |
34
- | a backlog of external items | [backlog-triage](backlog-triage.md) |
35
- | a question across many sources | [deep-research](deep-research.md) |
36
- | one change to review from every angle | [review-panel](review-panel.md) |
37
- | a change against the repo's written rules | [rules-audit](rules-audit.md) |
38
-
39
- Phases chain: an audit (refute) feeds a fix sweep (fan-out); a
40
- tournament picks the design a fan-out then implements.
41
- 4. **Plan the whole phase as tasks** before spawning: every unit,
42
- blocked into the umbrella, each note written as a
43
- [brief](brief.md) ([plan](plan.md) for a spec-driven build). Rounds
44
- of a loop are the one exception: add each when the last closes.
45
- 5. **Review every unit that ships.** Each commit-producing task gets a
46
- review task ([adversarial-review](adversarial-review.md)) on a
47
- [comparable model](models.md#checkers). Every finding is a triage task,
48
- refuted before it is accepted ([findings](findings.md)).
49
- 6. **Run the loop** ([orchestrator-loop](orchestrator-loop.md)): pipeline
50
- merges, verify each merge, keep workers busy
51
- ([waves](waves.md) when they share files). Long runs follow
52
- [long-run](long-run.md). With codemode, a
53
- [driver](codemode-driver.md) can dispatch a wave.
54
- 7. **Close against the stop rule**, checked by you on the merged tree,
55
- not by any worker's note. Units can each pass review while the goal
56
- fails whole: one [delegate](refute.md) call refutes the umbrella's
57
- criteria on the merged tree (record on the umbrella). Then
58
- `mu task close <umbrella> --if-ready --evidence '...'`.
59
-
60
- Done when the umbrella is closed, its stop rule holds on the merged
61
- tree, every shipped unit's latest review task is `CLOSED/done`
62
- (ACCEPT), and
63
- `mu task list --substate triage` is empty.
64
-
65
- ## Budget
66
-
67
- - Agree a ceiling in step 1 and write it on the umbrella
68
- ([orchestrator-loop § Concurrency](orchestrator-loop.md#concurrency)).
69
- - Checks are calls, not tasks ([tasks-or-calls](tasks-or-calls.md)): a
70
- 50-unit run should add about 50 units, 50 gates and the findings that
71
- survive, not a task per refuter and judge.
72
- - The run gets its own workstream, `<project>-ut-<topic>`, torn down
73
- when the umbrella closes ([recovery](recovery.md) before teardown).
74
- - Tiers per phase ([models](models.md#roles)): cheap scouts and finds,
75
- mid builds, strong plans and synthesizes; each checker at the tier of
76
- whoever wrote what it checks, or higher, another family. Calibrate the
77
- tier split on the slice, not only the cost.
78
- - Calibrate on a slice: run the phase on a few units, check the result
79
- and the cost, then fan out the rest.
80
-
81
- ## What the human sees
82
-
83
- `mu state` shows every unit, its reviewer, and what is still running.
84
- `mu task notes <id>` shows why any unit was accepted or rejected. A
85
- rejected unit stays in the DAG next to its fix. Nothing about the run
86
- lives only in your context.