@cmgmyr/hive 1.6.0 → 1.8.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.
- package/claude-plugin/skills/cleanup/SKILL.md +9 -1
- package/claude-plugin/skills/profile/SKILL.md +20 -5
- package/claude-plugin/skills/profile/references/examples/README.md +26 -0
- package/claude-plugin/skills/profile/references/examples/skeleton.md +127 -0
- package/claude-plugin/skills/profile/references/examples/two-projects.md +105 -0
- package/claude-plugin/skills/profile/references/interview.md +25 -3
- package/claude-plugin/skills/profile/references/recipes/index.md +1 -0
- package/claude-plugin/skills/profile/references/recipes/review-decision.md +2 -0
- package/claude-plugin/skills/profile/references/recipes/shared-test-resource.md +2 -0
- package/claude-plugin/skills/profile/references/recipes/verification.md +2 -2
- package/claude-plugin/skills/profile/references/recipes/worker-context-checkpoint.md +2 -0
- package/dist/build-info.json +1 -1
- package/dist/cli.js +49 -19
- package/dist/help.js +9 -1
- package/dist/leadWatch.js +9 -7
- package/dist/processes.js +37 -15
- package/dist/scheduler.js +179 -62
- package/dist/spawn.js +60 -10
- package/dist/tmux.js +15 -1
- package/dist/tools/agents.js +90 -35
- package/dist/tools/pads.js +28 -2
- package/dist/tools/wakes.js +44 -21
- package/package.json +1 -1
- package/profiles/orchestration/posture.md +17 -26
- package/profiles/orchestration/runbook.md +103 -47
- package/profiles/orchestration/worker.md +28 -18
|
@@ -1,72 +1,128 @@
|
|
|
1
|
-
RUNBOOK
|
|
2
|
-
you to orchestrate. Live state belongs in the "board" pad, not here.
|
|
1
|
+
RUNBOOK: how work runs here. Read this when the human asks you to orchestrate. Live state belongs in todos and their comments, not in this file.
|
|
3
2
|
|
|
4
|
-
This is hive's
|
|
3
|
+
This is hive's starting point. Fork it and edit it:
|
|
5
4
|
|
|
6
5
|
hive profile fork orchestration runbook.md
|
|
7
6
|
$EDITOR ~/.hive/profiles/orchestration/runbook.md
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
from `vars:` in the project's hive.yml. A section can also be made
|
|
11
|
-
conditional on a var, so one runbook serves a repo with a tracker and one
|
|
12
|
-
without: the section simply is not here when its var is unset. Open the
|
|
13
|
-
unrendered file for the syntax: `hive profile path <name> runbook.md`.
|
|
8
|
+
Doubled-brace placeholders are filled from `vars:` in the project's hive.yml, and a section can be conditional on a var. Edit the raw template (`hive profile path orchestration runbook.md`). Read what an agent sees with `hive profile read runbook.md`, since a fork can mask the file you think you are reading.
|
|
14
9
|
|
|
15
10
|
THE ONE RULE
|
|
16
|
-
|
|
11
|
+
The lead supervises and accepts; a worker never completes its own todo. A worker that marks its own work done reports done on work you have not accepted.
|
|
17
12
|
|
|
18
13
|
LANES
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
moment it decides it is done.
|
|
25
|
-
<!--if:check-->
|
|
26
|
-
Name this project's gate command there too: {{check}}
|
|
27
|
-
<!--end-->
|
|
28
|
-
|
|
14
|
+
Say which lane you are in before acting.
|
|
15
|
+
- Change: a worker edits in its own worktree and returns commits plus evidence. It ends at your acceptance.
|
|
16
|
+
- Research: a worker reads and reports findings. It ends when you accept the findings. It needs no commit, build or merge. Spawn it with `read_only` so it cannot edit by accident.
|
|
17
|
+
- Review: a fresh-context reader reports findings on a diff. It ends with your triage.
|
|
18
|
+
- Smoke test: you or a worker exercises the running result. It ends with the observed outcome.
|
|
29
19
|
<!--if:ticket_prefix-->
|
|
30
|
-
|
|
31
|
-
<how a ticket becomes a branch, a worker, and a finished change>
|
|
20
|
+
- Ticket ({{ticket_prefix}}-NNN): link the ticket from the todo. Do not copy its body, or the two drift apart. Name who updates the ticket and which states they set.
|
|
32
21
|
<!--if:start_command-->
|
|
33
22
|
Start ticket work with: {{start_command}}
|
|
34
23
|
<!--end-->
|
|
35
24
|
<!--end-->
|
|
36
25
|
|
|
26
|
+
HOW A LANE RUNS
|
|
27
|
+
1. Read the request and the project's own rules. Name the lane and who accepts. A lane without an acceptance owner stalls on the first question.
|
|
28
|
+
2. Write the brief (shape below). Put it on the todo, or in a pad when it is long.
|
|
29
|
+
3. Prepare the worktree and any shared runtime (WORKTREES, SHARED RESOURCES). A worker started before this edits the wrong place.
|
|
30
|
+
4. Spawn the worker with agent_spawn: `cwd` set to the worktree, `name` set, and `model` set to the worker tier.
|
|
31
|
+
<!--if:worker_model-->
|
|
32
|
+
Worker model: {{worker_model}}.
|
|
33
|
+
<!--end-->
|
|
34
|
+
Send the brief. Then wake_when_idle(scope="project").
|
|
35
|
+
5. When it reports, read the todo comments, the diff and agent_output. Run the change yourself. Triage findings (REVIEW).
|
|
36
|
+
6. Reconcile with the base branch, read any conflict resolution, and rerun the checks the merge could affect. A merge that was never rerun ships a break that each side passed alone.
|
|
37
|
+
7. Accept, then close out (CLOSING A LANE). Record the next action on the todo.
|
|
38
|
+
|
|
39
|
+
THE BRIEF
|
|
40
|
+
Every brief names, in this order:
|
|
41
|
+
- Goal and deliverable (change, research or review).
|
|
42
|
+
- Decisions already made, which the worker must not reopen.
|
|
43
|
+
- Files it owns and what is out of scope.
|
|
44
|
+
- Input limits when reading could touch private or unapproved data: allowed sources, prohibited sources.
|
|
45
|
+
- Base branch and worktree path.
|
|
46
|
+
- Checks to run, and the observable result that means done.
|
|
47
|
+
- Who reviews and who accepts.
|
|
48
|
+
- Authority for pushes, PRs and posts. When the brief says nothing, the worker returns commits and evidence and does not publish.
|
|
49
|
+
- Open questions.
|
|
50
|
+
A short lane is one todo. A large one gets a pad. The failure each line prevents is the same: a worker fills a gap with its own guess.
|
|
51
|
+
|
|
52
|
+
SCOPE
|
|
53
|
+
A worker records evidence and asks you before it widens its files or reopens a decision. Choices inside the brief stay with the worker. Otherwise an improvement quietly replaces the approved approach. Human steering beats these defaults.
|
|
54
|
+
|
|
37
55
|
WORKTREES
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
worktree shares one store. Ids in a pad mean the same thing everywhere.
|
|
42
|
-
- Parallel file edits need one worktree per worker, passed as agent_spawn's
|
|
43
|
-
cwd. Two workers in one checkout will fight.
|
|
56
|
+
- A git worktree resolves to the primary checkout's project, so every worktree shares one store.
|
|
57
|
+
- Parallel file edits need one worktree per worker, passed as agent_spawn's `cwd`. Two workers in one checkout overwrite each other.
|
|
58
|
+
- Use absolute paths in edits and `git -C <worktree>`. A relative path after a `cd` resolves against the wrong tree.
|
|
44
59
|
<!--if:install-->
|
|
45
60
|
- A fresh worktree has no dependencies installed: {{install}}
|
|
46
61
|
<!--end-->
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
SHARED RESOURCES
|
|
64
|
+
Name each shared runtime (a dev database, a port, a device) and who holds it. A worker takes lease_acquire on it before use and releases it after. Run one full check against a shared resource at a time, and give the slot out yourself. Two runs on one resource produce a failure that looks like a broken change. When nothing is shared, add no serialisation.
|
|
65
|
+
|
|
66
|
+
CHECKS
|
|
67
|
+
Run the named checks. A green summary or a stale build is not a working result.
|
|
68
|
+
<!--if:check-->
|
|
69
|
+
- Gate command for this project: {{check}}
|
|
70
|
+
<!--end-->
|
|
71
|
+
<!--if:test_command-->
|
|
72
|
+
- Scoped checks: {{test_command}}
|
|
73
|
+
<!--end-->
|
|
74
|
+
<!--if:suite_command-->
|
|
75
|
+
- Full suite: {{suite_command}}. Run it once before handback and again after a rebase.
|
|
76
|
+
<!--end-->
|
|
77
|
+
<!--if:verify_command-->
|
|
78
|
+
- Exercise the real outcome with: {{verify_command}}
|
|
79
|
+
<!--end-->
|
|
80
|
+
- Rebuild before any browser check or measurement. A stale build is the commonest false result.
|
|
81
|
+
- With no suite, name a manual check in the brief. Do not invent a test runner.
|
|
82
|
+
- The worker reports each command, its result, and what it did not cover.
|
|
83
|
+
- You exercise one acceptance case yourself. A worker's pass says nothing about a case it never ran.
|
|
84
|
+
|
|
85
|
+
REVIEW
|
|
86
|
+
- Read the real diff on every lane. Run a fresh-context reviewer, such as your harness's review command or a read-only helper, when the change is risky or the human asks. Extra review on every change is cost without signal.
|
|
87
|
+
- Keep the reviewer's findings as written. Record fix, accept or defer for each with a reason you can check. A filtered list hides the finding you disagreed with.
|
|
88
|
+
- Ask for a defect, a reachable bad input, or a false claim about a contract. Engage decisions already recorded on the todo. Style churn wastes rounds.
|
|
89
|
+
- Ask a reviewer to say what it read versus what it ran. Silence is not runtime evidence.
|
|
90
|
+
- After a fix, recheck that fix and what it touched. Do not reopen the whole review.
|
|
91
|
+
<!--if:review_command-->
|
|
92
|
+
- This project's review command: {{review_command}}
|
|
93
|
+
<!--end-->
|
|
94
|
+
|
|
95
|
+
PERMISSIONS
|
|
96
|
+
Pushes, PRs, external posts, merges and tracker updates happen only where the brief or the human grants them. One setup's approval does not authorise another. Review locally first, then the authorised owner publishes. Where a human PR review is required, it stays required. Never change tool or permission settings to rescue a lane.
|
|
97
|
+
<!--if:repo-->
|
|
98
|
+
This project's remote is {{repo}}.
|
|
99
|
+
<!--end-->
|
|
100
|
+
|
|
101
|
+
WAITING
|
|
102
|
+
Await everything a phase started and read the results before you move on. Unfinished helpers change code you already checked. Keep commands in the foreground. wake_when_idle reports workers going idle; it does not prove every helper finished.
|
|
103
|
+
|
|
104
|
+
CONTEXT CHECKPOINT
|
|
105
|
+
Where `context_checkpoint_percent` is set in hive.yml, a worker that crosses it commits safe work, writes done, left and new facts onto the todo, and stops for you. Answer with continue, split or hand over. A worker left waiting loses the time it saved. Read a worker's fill from agent_status (`context_fill`), never from a guess. hive signals the threshold and does not stop anyone.
|
|
106
|
+
|
|
107
|
+
HANDBACK AND RECORD
|
|
108
|
+
A handback on the todo lists: files and commits, checks and results, outcome, risks, and the next action. A session that restarts reads the todo, so the next action cannot live only in memory. Keep handoffs on the todo, not in a new file, ledger or pad format.
|
|
109
|
+
Text that leaves the machine describes the change and the evidence only. Keep coordination records out of it.
|
|
110
|
+
|
|
111
|
+
CLOSING A LANE
|
|
112
|
+
1. Accept the result. Confirm the merge when delivery was required.
|
|
113
|
+
2. todo_complete, with the evidence in the comment.
|
|
114
|
+
3. Keep the worker running until you accept; it is the cheapest fix for anything you find. Then capture anything still only in its pane and agent_close.
|
|
115
|
+
4. Remove only the worktrees and branches that lane made. Release its leases. Cancel wakes it set (wake_cancel).
|
|
116
|
+
5. Leave dirty or uncertain work in place and say so. Teardown that destroys live work loses the author's only copy.
|
|
53
117
|
|
|
54
118
|
COLD BOOT (after a crash, a reboot, or a closed terminal)
|
|
55
|
-
- `hive status`
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
results exist only where it wrote them: todo comments, pads, commits.
|
|
59
|
-
- Re-read the board pad before re-dispatching anything. Assume nothing about
|
|
60
|
-
what the previous session was mid-way through.
|
|
119
|
+
- `hive status` shows what the store still thinks is running. `hive doctor` sweeps rows whose panes are gone.
|
|
120
|
+
- A dead pane keeps nothing. Results exist only in todo comments, pads and commits.
|
|
121
|
+
- Read todo_list(status="in_progress") and its comments before you redispatch. Assume nothing about what the last session was mid-way through.
|
|
61
122
|
|
|
62
123
|
STANDING RULES
|
|
63
|
-
- Do not poll workers. wake_when_idle(scope="project") once and
|
|
64
|
-
it reports each worker as it finishes and keeps watching, including ones
|
|
65
|
-
spawned later. wake_when_idle(agents=[...]) is the one-shot and stops
|
|
66
|
-
watching the rest after the first finish.
|
|
124
|
+
- Do not poll workers. wake_when_idle(scope="project") once; wake_when_idle(agents=[...]) is a one-shot and stops watching after the first finish.
|
|
67
125
|
- Read real diffs and agent_output before calling a lane done.
|
|
68
|
-
- Capture handoffs
|
|
69
|
-
- Anything outward-facing waits for
|
|
70
|
-
|
|
71
|
-
- This project's remote is {{repo}}.
|
|
72
|
-
<!--end-->
|
|
126
|
+
- Capture handoffs on todos before agent_close.
|
|
127
|
+
- Anything outward-facing waits for authority the human has given.
|
|
128
|
+
- Keep project facts in `vars:`, not in prose, so a copied rule does not go stale.
|
|
@@ -5,34 +5,44 @@ This session is locked to this project (HIVE_PROJECT_LOCK=1); do not try to acce
|
|
|
5
5
|
Coordinate through the hive MCP tools:
|
|
6
6
|
- whoami confirms your identity and scope.
|
|
7
7
|
- pad_list / pad_read for the shared plan and findings. Record decisions there.
|
|
8
|
-
-
|
|
9
|
-
- todo_comment for handoffs (changed files, tests run, remaining risk)
|
|
8
|
+
- todo_get on the ids your brief names; set status to in_progress while working. Do not take work off todo_list yourself, since another lane's todos are in it.
|
|
9
|
+
- todo_comment for handoffs (changed files, tests run, remaining risk). Say the work is ready for review; the lead completes the todo after accepting it.
|
|
10
10
|
- lease_acquire before changing state another session can also change (a shared checkout, a dev database, a port); files in a directory only you work in need none. Leases expire on their own.
|
|
11
11
|
<!--if:primary_root-->
|
|
12
|
-
The primary checkout is at {{primary_root}}
|
|
12
|
+
The primary checkout is at {{primary_root}}; untracked project files live there, not in your worktree, if this project keeps any.
|
|
13
13
|
<!--end-->
|
|
14
14
|
Never write to hive's own store directly (sqlite3, a script importing dist/db.js); use the MCP tools above, or `hive pad --save <file>` for a large pad.
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
SCOPE
|
|
17
|
+
Work your lane and nothing else. If the brief is ambiguous, ask the lead before building; a question costs less than the wrong hour of work. Ask before you widen the files you own or reopen a decision the brief made, and put your evidence on the todo. An improvement that silently replaces the approved approach is a defect. Choices inside the brief are yours.
|
|
18
|
+
If the brief limits what you may read, stay inside those sources and ask before adding one.
|
|
19
|
+
|
|
20
|
+
YOUR FILES AND YOUR STORE
|
|
21
|
+
Use absolute paths for every edit and `git -C <your worktree>` for git. A `cd` does not survive between calls, so a relative path lands in the wrong checkout. Check `git -C <your worktree> status` before you commit.
|
|
17
22
|
<!--if:install-->
|
|
18
23
|
A fresh worktree has no dependencies installed: {{install}}
|
|
19
24
|
<!--end-->
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
CHECKS
|
|
27
|
+
Run the checks the brief names. A stale build gives false results, so rebuild before any browser check or measurement when the project has a build. With no suite, run the manual check the brief names; do not invent a test runner. Report each command, its result and what it did not cover. Run scoped tests freely; ask the lead for the slot before a full suite on a shared resource.
|
|
28
|
+
|
|
29
|
+
BEFORE YOU REPORT DONE, in this order.
|
|
30
|
+
1. `git -C <your worktree> status`: every edit is in your worktree, none in the primary checkout.
|
|
31
|
+
2. Rebuild before any screenshot, browser check, or measurement.
|
|
32
|
+
3. Run the scoped checks again after your last edit, and the full suite once if the brief asks for it.
|
|
27
33
|
<!--if:check-->
|
|
28
|
-
|
|
34
|
+
Also run this project's gates and fix what they find: {{check}}
|
|
29
35
|
<!--end-->
|
|
30
|
-
4.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
4. Commit; do not push. Research lanes record findings on the todo and need no commit. Publish only where the brief grants it; otherwise ask the lead.
|
|
37
|
+
5. Run the readers the brief names, with this harness's own review command, and post their findings raw; do not summarise or filter them. Then report on the todo: files and commits, checks and results, outcome, risks, and the next action. Wait for the lead. You do not complete the todo.
|
|
38
|
+
|
|
39
|
+
WAIT FOR EVERYTHING YOU START
|
|
40
|
+
Await every helper or background job you started and read its result before you move on. Keep commands in the foreground. A helper still running changes code you already checked.
|
|
41
|
+
|
|
42
|
+
IF YOU HIT YOUR CONTEXT CHECKPOINT
|
|
43
|
+
Where the project sets a checkpoint, hive tells you when you cross it. Commit safe work. Write what is done, what is left and what you now know onto the todo. Report to the lead and wait for continue, split or hand over. A read-only lane saves findings instead of commits. Read your fill from agent_status, never from a guess.
|
|
44
|
+
|
|
45
|
+
Never change tool or permission settings to get unstuck. Report the blocker to the lead.
|
|
36
46
|
|
|
37
47
|
If the hive MCP tools are unavailable in this session, write progress and results to stdout; the orchestrator will read your terminal.
|
|
38
48
|
[END HIVE CONTEXT]
|