@brainervirus/workit-cursor 7.6.0 → 8.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.
@@ -0,0 +1,117 @@
1
+ # Running a fanout
2
+
3
+ How the lead picks models, keeps workers flowing, retries, races, verifies
4
+ and fans in. Workit records and checks; the host's own subagents run the work.
5
+
6
+ ## TIER to model
7
+
8
+ TIER is a field of each slice and of its brief. Map it where the host lets you
9
+ pick a model per spawn; nothing in the workspace config routes it.
10
+
11
+ | TIER | Claude Code (`model` on the Agent call) | Hosts without a per-spawn model |
12
+ | --- | --- | --- |
13
+ | scouting (read-only search, not a slice) | `haiku` | host default |
14
+ | mundane | `sonnet` | host default |
15
+ | standard | omit it (inherits yours) | host default |
16
+ | hard | omit it (inherits yours); consider a race | host default |
17
+
18
+ OpenCode takes a subagent's model from its agent config: pick a configured
19
+ agent whose model fits the TIER, else the default. Codex, Cursor and Pi run
20
+ every worker on the host's model, so TIER only sizes the timebox and decides
21
+ whether to race.
22
+
23
+ ## Rolling window
24
+
25
+ Keep 4-6 workers in flight on Claude Code; elsewhere as many as the host runs
26
+ in the background, never more than 6. Do not wait for a whole wave: when one
27
+ worker finishes (its notification, or a new head or PR in `workit fanout
28
+ status`), verify it, then spawn the next slice from `spawnable` in the same
29
+ status output. A slice whose dependencies landed, or a stacked child whose
30
+ parent is verified, appears there by itself.
31
+
32
+ ## Retry, then escalate
33
+
34
+ A slice is retried when it is STUCK, its worker exits without meeting
35
+ ACCEPTANCE, or its verdict fails. Stop the worker and observe that it exited.
36
+ Release its worktree: `workit fanout worktree release <slice>` (native
37
+ worktrees: record `git -C <wt> status --short` first). Then spawn one fresh
38
+ worker with `workit fanout brief <slice> --mode resume`: same branch, and the
39
+ brief points at its head and its ledger rows (last report, verdicts,
40
+ rulings). If the retry fails too, escalate instead of a third worker:
41
+ re-slice it smaller (`workit fanout plan` again), take it over yourself, or
42
+ report the gap to the user.
43
+
44
+ ## Race a hard slice
45
+
46
+ When a hard slice has an uncertain approach and a cheap VERIFY, run 2-3
47
+ attempts at once instead of retrying in series. `workit fanout brief <slice>
48
+ --attempt <n>` gives each attempt its own branch (`<branch>-try<n>`), session
49
+ and scratch dir. Each attempt needs its own worktree: Claude Code's
50
+ `implementer` isolates natively; on other hosts `fanout worktree create` makes
51
+ only the slice's own worktree, so run the attempts one after another there.
52
+ Verify every attempt, keep the one with the best verdict (accepted first,
53
+ then the fewest changed files, then the earliest), point the slice branch at
54
+ it (`git branch <branch> <winner>`), have the verifier record the verdict on
55
+ `<branch>` (same head), and delete the losing attempt branches.
56
+
57
+ ## Verification
58
+
59
+ Follow the workspace `verification` setting (`workit grant show`); the
60
+ worker never records a verdict on its own work.
61
+
62
+ - `self` (the default): a verifier that wrote none of the slices records the
63
+ verdicts. A lead that authored none of the slices may record them in its
64
+ own session.
65
+ - `independent`, and any slice at high risk: a separate verifier session
66
+ records them, never the lead's own; at high risk one verifier per slice,
67
+ plus a review panel (below). This is doctrine, not enforced: the ledger
68
+ only tells a branch's authors from everyone else, and a lead that wrote
69
+ none of it counts as independent.
70
+
71
+ Which session id a verdict carries, per host:
72
+
73
+ - Claude Code: subagents inherit your `WORKIT_SESSION_ID`, so the
74
+ SubagentStart hook names each `verifier` and `reviewer` its own session
75
+ (`<lead>:<agent id>`), passed as `--session`; that one wins over any
76
+ `<lead>-v<n>` in a brief. An `implementer` uses the session its brief
77
+ exports for its workit commands.
78
+ - Other hosts: the session the brief sets wins: `export
79
+ WORKIT_SESSION_ID=<lead>-w-<slice>` from `workit fanout brief` for a
80
+ worker, `<lead>-v<n>` (or `--as verifier`) for a verifier you start.
81
+
82
+ A batch verifier takes several slices on one surface in one session: for
83
+ each branch it checks out the head, runs that slice's VERIFY, and records its
84
+ own `workit ledger verdict <result> --branch <b> --how "<evidence>"`. Every
85
+ verdict is keyed to that branch's head SHA; a slice whose head moves after
86
+ it needs a new one. Batch at most what fits one context, about 4 slices.
87
+
88
+ ## Review panel (high risk only)
89
+
90
+ At risk=high only, 2-3 fresh reviewers (read the `workit-review` skill's SKILL.md and follow it), each on a model
91
+ other than the author's (Claude Code: a different `model`), each records
92
+ `workit ledger verdict <result> --kind review --branch <b> --how "<findings>"`.
93
+ Land only when every panel verdict passes. Below high risk a panel costs
94
+ more than it finds.
95
+
96
+ ## Integration-branch fan-in (one PR)
97
+
98
+ Only when the user wants one PR for the whole fanout:
99
+
100
+ 1. Cut the integration branch (`workit git branch <integration> --base
101
+ <trunk>`) and plan with `"fanIn": "integration"` and `--trunk
102
+ <integration>`. Planning refuses integration mode on origin's default
103
+ branch.
104
+ 2. Every brief then tells the worker to merge the integration tip into its
105
+ branch before reporting (the fast-forward rule). That merge is the only
106
+ one a worker makes, and only in this mode.
107
+ 3. Land each verified slice with `git merge --ff-only <slice-branch>` in the
108
+ integration checkout. Not a fast-forward (the tip moved since the worker
109
+ merged)? Resume the worker to merge again; never a merge commit of your own.
110
+ 4. `workit fanout check` gates against the integration branch; a slice whose
111
+ tip is on it reads as landed. When all have landed, ship the integration
112
+ branch as one PR (read the `workit-ship` skill's SKILL.md and follow it).
113
+
114
+ ## Stacks
115
+
116
+ For stacked slices (`dependsOn` one parent): `workit stack plan <bottom> …
117
+ <top>` once, then `workit stack sync` and `workit stack land`.
@@ -51,8 +51,8 @@ the base keeps moving, or after 3 failed fix attempts on the same check.
51
51
  flake|infra` per head. Real: reproduce with `workit check`, fix the root
52
52
  cause, batch fixes into one push.
53
53
  6. **Verified.** After the last push a non-author records a verdict
54
- (read the `workit-review` skill's SKILL.md and follow it). Land only when granted: `workit stack land` (the
55
- contiguous verified run from the root) or `workit pr merge`.
54
+ (read the `workit-review` skill's SKILL.md and follow it). Land only when granted: `workit stack land` (verified run
55
+ from the root) or `workit pr merge`; `--unverified --reason` only if user-asked.
56
56
  7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
57
57
  verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
58
58
  line of the final or stop report; never pause the babysit loop for it.