hive-lite 0.1.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/README.md +443 -0
- package/bin/hive.js +6 -0
- package/docs/cli-semantics.md +386 -0
- package/docs/skills/hive-lite-finish/SKILL.md +282 -0
- package/docs/skills/hive-lite-finish/agents/openai.yaml +4 -0
- package/docs/skills/hive-lite-finish/references/safety.md +95 -0
- package/docs/skills/hive-lite-finish/references/verdicts.md +123 -0
- package/docs/skills/hive-lite-map-maintainer/SKILL.md +203 -0
- package/docs/skills/hive-lite-map-maintainer/agents/openai.yaml +7 -0
- package/docs/skills/hive-lite-map-maintainer/references/lifecycle.md +114 -0
- package/docs/skills/hive-lite-map-maintainer/references/repair-rules.md +201 -0
- package/docs/skills/hive-lite-start-prompt/SKILL.md +283 -0
- package/docs/skills/hive-lite-start-prompt/agents/openai.yaml +4 -0
- package/docs/skills/hive-lite-start-prompt/references/input-calibration.md +82 -0
- package/docs/skills/hive-lite-start-prompt/references/preflight.md +116 -0
- package/package.json +40 -0
- package/src/cli.js +910 -0
- package/src/lib/change.js +642 -0
- package/src/lib/context.js +1104 -0
- package/src/lib/evidence.js +230 -0
- package/src/lib/fsx.js +54 -0
- package/src/lib/git.js +128 -0
- package/src/lib/glob.js +47 -0
- package/src/lib/health.js +1012 -0
- package/src/lib/id.js +13 -0
- package/src/lib/map.js +713 -0
- package/src/lib/next.js +341 -0
- package/src/lib/risk.js +122 -0
- package/src/lib/roles.js +109 -0
- package/src/lib/scope.js +168 -0
- package/src/lib/skills.js +349 -0
- package/src/lib/status.js +344 -0
- package/src/lib/yaml.js +223 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# Hive Lite CLI Semantics
|
|
2
|
+
|
|
3
|
+
This document explains the important CLI states and what an operator or skill should do next.
|
|
4
|
+
|
|
5
|
+
Use human-readable output when a person is reading the terminal. Use `--json` when a skill, agent, script, or future companion UI needs stable fields.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
node bin/hive.js next
|
|
9
|
+
node bin/hive.js next --json
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## `--json`
|
|
13
|
+
|
|
14
|
+
`--json` switches a command from human text to structured JSON.
|
|
15
|
+
|
|
16
|
+
Use text output for humans:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
node bin/hive.js next
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use JSON for skills and agents:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
node bin/hive.js next --json
|
|
26
|
+
node bin/hive.js next --agent codex --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Human output explains the result. JSON output is a stable contract with fields such as `phaseGuess`, `summaryForHuman`, `primaryAction`, `verdict`, `mode`, and `recommendedActions`.
|
|
30
|
+
|
|
31
|
+
## `next`
|
|
32
|
+
|
|
33
|
+
`next` is Hive Lite's "what should happen now?" command. It does not edit files, run agents, validate, accept, commit, stash, or initialize git. It only reads local facts and recommends an operator step.
|
|
34
|
+
|
|
35
|
+
It reads:
|
|
36
|
+
|
|
37
|
+
- git repo presence
|
|
38
|
+
- worktree state
|
|
39
|
+
- latest Hive Change Record
|
|
40
|
+
- Project Map health
|
|
41
|
+
- actionable recent split notes
|
|
42
|
+
- pending map delta candidates
|
|
43
|
+
|
|
44
|
+
By default, `status --json` and `next --json` filter split notes to reduce exploratory clutter. They show active unfinished split notes that already have accepted phase progress. If no active split exists, they show only the newest unstarted split note. `splitNoteSummary` reports how many split notes were hidden by this default policy. Use `status --all --json` to inspect every runtime split note.
|
|
45
|
+
`splitNoteSummary.primaryRecentSplitNote` identifies the split note selected as primary from the visible notes. `splitNoteSummary.otherActiveSplitNotes` lists older active-progress split notes so an operator can tell whether additional historical split work exists.
|
|
46
|
+
|
|
47
|
+
Hive Lite cannot detect the currently running agent CLI. If the caller provides `--agent <codex|claude|gemini|all>` or `--path <skills-dir>`, `next` treats the recommended Hive Lite operator skill as a precondition. When the selected target is missing that skill or has a stale copy, `phaseGuess` becomes `skill_preflight` and `primaryAction.kind` becomes `install_operator_skill`.
|
|
48
|
+
|
|
49
|
+
### `phaseGuess`
|
|
50
|
+
|
|
51
|
+
| Value | Meaning | What To Do |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `repo_setup_required` | Current directory is not inside a git repo. | Stop. Switch to the correct repo root, or manually initialize git and create an initial commit before using Hive Lite. |
|
|
54
|
+
| `skill_preflight` | The selected agent target is missing the operator skill needed for the next Hive Lite step. | Run the recommended `skills install` or `skills sync`, then rerun `next`. |
|
|
55
|
+
| `preflight` | Worktree has unmanaged dirty changes. | Stop before starting new work. Commit, stash, use a separate worktree, or stop. |
|
|
56
|
+
| `finish` | A Hive change is in progress, or was accepted without commit. | Use `$hive-lite-finish` to check, validate, record evidence, accept, or commit. |
|
|
57
|
+
| `map` | Project Map is missing, invalid, critical, or needs attention. | Use `$hive-lite-map-maintainer` to bootstrap, refresh, or repair the map. |
|
|
58
|
+
| `split_continue` | A previous large intent has a split note with a ready remaining phase. | Ask the human whether to continue the suggested phase through `$hive-lite-start-prompt`. |
|
|
59
|
+
| `start` | Worktree and map are ready for a new bounded requirement. | Use `$hive-lite-start-prompt` with the user's next requirement. |
|
|
60
|
+
|
|
61
|
+
### Example Human Output
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
Hive Lite Next
|
|
65
|
+
|
|
66
|
+
Current State:
|
|
67
|
+
Worktree: dirty
|
|
68
|
+
Hive State: in_progress
|
|
69
|
+
|
|
70
|
+
Phase Guess: finish
|
|
71
|
+
|
|
72
|
+
Recommended Next Action:
|
|
73
|
+
Use hive-lite-finish
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Example JSON Shape
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"phaseGuess": "finish",
|
|
81
|
+
"summaryForHuman": "当前有一个 Hive change 还在进行中,建议先用 hive-lite-finish 收尾。",
|
|
82
|
+
"primaryAction": {
|
|
83
|
+
"kind": "run_finish_skill",
|
|
84
|
+
"label": "Use hive-lite-finish",
|
|
85
|
+
"prompt": "$hive-lite-finish\nClose Hive Lite change chg_xxx."
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## `status`
|
|
91
|
+
|
|
92
|
+
`status` classifies the repository boundary. It is the preflight check before starting a requirement.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
node bin/hive.js status
|
|
96
|
+
node bin/hive.js status --json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### `hive.state`
|
|
100
|
+
|
|
101
|
+
| Value | Meaning | What To Do |
|
|
102
|
+
| --- | --- | --- |
|
|
103
|
+
| `repo_setup_required` | Not inside a git worktree. | Stop. Do not auto-run `git init`. |
|
|
104
|
+
| `clean` | Worktree is clean. | It is safe to start `find`. |
|
|
105
|
+
| `unmanaged_dirty` | Dirty files are not tied to a Hive Change Record. | Stop and ask the human to commit, stash, use a worktree, or stop. |
|
|
106
|
+
| `in_progress` | Dirty files belong to an unfinished Hive Change Record. | Continue finish flow: `check`, `validate`, manual evidence, or `accept`. |
|
|
107
|
+
| `accepted_uncommitted` | Latest Hive Change Record was accepted, but no commit was created. | Commit the accepted change or isolate the work before starting another requirement. |
|
|
108
|
+
|
|
109
|
+
## `find`
|
|
110
|
+
|
|
111
|
+
`find` turns a user intent into a Context Packet.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
node bin/hive.js find "Dashboard Action Inbox content should align left" --explain
|
|
115
|
+
node bin/hive.js find "Dashboard Action Inbox content should align left" --json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `mode`
|
|
119
|
+
|
|
120
|
+
| Value | Meaning | What To Do |
|
|
121
|
+
| --- | --- | --- |
|
|
122
|
+
| `edit_context` | Hive found one bounded area and narrow writable scope. | Give the Context Packet to a coding agent. |
|
|
123
|
+
| `discovery_context` | Hive found useful context, but not a safe edit permit. | Repair the map or use for investigation only. |
|
|
124
|
+
| `needs_map` | Hive could not confidently route the intent. | Use `$hive-lite-map-maintainer` or `map prompt --from-find ctx_xxx`. |
|
|
125
|
+
| `needs_decomposition` | The intent is too broad for one Context Packet / Change Record. | Do not generate a coding prompt. Present phase seeds and ask the human which phase to start. |
|
|
126
|
+
|
|
127
|
+
### Important Fields
|
|
128
|
+
|
|
129
|
+
- `id`: Context Packet id, such as `ctx_xxx`
|
|
130
|
+
- `mode`: whether the packet is editable, discovery-only, map-needing, or too broad
|
|
131
|
+
- `area.id`: selected Project Map area
|
|
132
|
+
- `writableScope`: direct writable files
|
|
133
|
+
- `reviewGated`: conditional or broad fallback scope that requires review
|
|
134
|
+
- `splitNote`: split artifact path when mode is `needs_decomposition`
|
|
135
|
+
- `candidatePhaseSeeds`: phase seeds for large intents
|
|
136
|
+
|
|
137
|
+
When continuing a split phase, pass the recorded split and phase ids plus the phase primary area:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
node bin/hive.js find "<phase.findIntent>" --from-split split_xxx --phase phase_xxx --area area.id --json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`--from-split` + `--phase` constrains routing to the selected phase's primary area when the split note is available.
|
|
144
|
+
If the split note or phase cannot be found, the result is not an edit permit and `phaseDependencyStatus.canStartNormally` is `false`.
|
|
145
|
+
If `--area` disagrees with the recorded phase area, Hive Lite routes to the recorded phase area and reports a warning.
|
|
146
|
+
Split-note markdown renders the current Hive Lite CLI invocation first, such as `node /path/to/bin/hive.js ...` when run from a source checkout, and includes `hive-lite ...` as a fallback for environments where the package alias is installed.
|
|
147
|
+
|
|
148
|
+
## `skills`
|
|
149
|
+
|
|
150
|
+
`skills` installs and checks the Hive Lite operator skills that teach agent CLIs how to drive Hive Lite.
|
|
151
|
+
|
|
152
|
+
Hive Lite does not detect which agent CLI is installed or currently running. `skills doctor` only checks the selected skills directories: all known target paths by default, explicit target paths with `--agent`, or a custom directory with `--path`.
|
|
153
|
+
|
|
154
|
+
`--agent codex`, `--agent claude`, and `--agent gemini` are global user-skill targets. They write to and check `~/.codex/skills`, `~/.claude/skills`, and `~/.gemini/skills` respectively; they do not populate repo-local agent skill directories. Use `--path <dir>` only for an intentional custom repo-local copy.
|
|
155
|
+
|
|
156
|
+
Bundled skills:
|
|
157
|
+
|
|
158
|
+
- `hive-lite-start-prompt`
|
|
159
|
+
- `hive-lite-finish`
|
|
160
|
+
- `hive-lite-map-maintainer`
|
|
161
|
+
|
|
162
|
+
### Targets
|
|
163
|
+
|
|
164
|
+
| Target | Path | Scope |
|
|
165
|
+
| --- | --- | --- |
|
|
166
|
+
| `codex` | `~/.codex/skills` | global user |
|
|
167
|
+
| `claude` | `~/.claude/skills` | global user |
|
|
168
|
+
| `gemini` | `~/.gemini/skills` | global user |
|
|
169
|
+
| `all` | `codex`, `claude`, and `gemini` |
|
|
170
|
+
| `--path <dir>` | custom skills directory | custom |
|
|
171
|
+
|
|
172
|
+
### Commands
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
node bin/hive.js skills doctor
|
|
176
|
+
node bin/hive.js skills doctor --agent codex
|
|
177
|
+
node bin/hive.js skills doctor --path ~/.codex/skills --json
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
`doctor` reports each bundled skill as:
|
|
181
|
+
|
|
182
|
+
| Status | Meaning | What To Do |
|
|
183
|
+
| --- | --- | --- |
|
|
184
|
+
| `current` | Installed copy matches bundled copy. | Nothing needed. |
|
|
185
|
+
| `missing` | Skill is not installed at the target path. | Run `skills install`. |
|
|
186
|
+
| `stale` | Skill exists but differs from the bundled copy. | Run `skills sync` or `skills install --force` if you want to overwrite. |
|
|
187
|
+
|
|
188
|
+
Install missing skills:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
node bin/hive.js skills install --agent codex
|
|
192
|
+
node bin/hive.js skills install --agent claude
|
|
193
|
+
node bin/hive.js skills install --agent gemini
|
|
194
|
+
node bin/hive.js skills install --agent all
|
|
195
|
+
node bin/hive.js skills install --path /custom/skills/dir
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`install` does not overwrite stale skills by default. This protects local edits.
|
|
199
|
+
|
|
200
|
+
Overwrite stale skills with bundled copies:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
node bin/hive.js skills sync --agent codex
|
|
204
|
+
node bin/hive.js skills sync --agent all
|
|
205
|
+
node bin/hive.js skills sync --path /custom/skills/dir
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Safety:
|
|
209
|
+
|
|
210
|
+
- These commands copy only `docs/skills/hive-lite-*` directories.
|
|
211
|
+
- They do not run agents.
|
|
212
|
+
- They do not modify product code.
|
|
213
|
+
- They do not edit secrets or agent runtime config.
|
|
214
|
+
- `sync` may overwrite local edits inside the target Hive Lite skill directories.
|
|
215
|
+
|
|
216
|
+
## `check`
|
|
217
|
+
|
|
218
|
+
`check` captures the current dirty diff as a Change Record and evaluates scope, risk, validation status, and evidence policy.
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
node bin/hive.js check --context ctx_xxx
|
|
222
|
+
node bin/hive.js check --context ctx_xxx --json
|
|
223
|
+
node bin/hive.js check chg_xxx
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Scope Status
|
|
227
|
+
|
|
228
|
+
| Value | Meaning | What To Do |
|
|
229
|
+
| --- | --- | --- |
|
|
230
|
+
| `clean` | Changed files are inside direct writable scope. | Continue to validation/evidence. |
|
|
231
|
+
| `needs_review` | Changed files touched conditional or broad fallback scope. | Require a review reason before accept. |
|
|
232
|
+
| `violation` | Changed files touched forbidden or outside allowed scope. | Stop. Fix the diff or repair the map; do not accept. |
|
|
233
|
+
|
|
234
|
+
### Evidence Verdict
|
|
235
|
+
|
|
236
|
+
| Value | Meaning | What To Do |
|
|
237
|
+
| --- | --- | --- |
|
|
238
|
+
| `acceptable` | Required evidence is sufficient. | Ask human whether to accept and commit. |
|
|
239
|
+
| `needs_validation` | Required command validation has not run. | Run `validate`. |
|
|
240
|
+
| `needs_manual_verification` | A directly visible change needs a human evidence note. | Ask the human to verify, then record manual evidence. |
|
|
241
|
+
| `needs_review_reason` | Hive needs an explicit human review reason. | Ask for or draft a review reason and wait for confirmation. |
|
|
242
|
+
| `evidence_insufficient` | Evidence is weak for this kind of change. | Prefer focused evidence; otherwise require review reason or explicit risk acceptance. |
|
|
243
|
+
| `blocked` | Scope violation, failed validation, or another blocker. | Stop. Do not accept. |
|
|
244
|
+
|
|
245
|
+
## `validate`
|
|
246
|
+
|
|
247
|
+
`validate` records evidence on a Change Record.
|
|
248
|
+
|
|
249
|
+
Run configured validation:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
node bin/hive.js validate chg_xxx
|
|
253
|
+
node bin/hive.js validate chg_xxx --profile dashboard-build
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Run a custom validation command:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
node bin/hive.js validate chg_xxx --cmd "npm test"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Record manual evidence:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
node bin/hive.js validate chg_xxx \
|
|
266
|
+
--manual manual-verification \
|
|
267
|
+
--result passed \
|
|
268
|
+
--note "Opened the UI and confirmed the requested behavior."
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Manual `--result` values:
|
|
272
|
+
|
|
273
|
+
| Value | Meaning |
|
|
274
|
+
| --- | --- |
|
|
275
|
+
| `passed` | Human verified the behavior. |
|
|
276
|
+
| `failed` | Human checked and found a problem. |
|
|
277
|
+
| `not_applicable` | The manual profile does not apply to this change. |
|
|
278
|
+
|
|
279
|
+
Manual evidence must come from the human. An agent summary is not manual evidence.
|
|
280
|
+
|
|
281
|
+
Failed manual evidence is optional. If the human says the implementation is wrong, the default flow is:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
do not accept
|
|
285
|
+
give the same Context Packet plus the failure observation back to the coding agent
|
|
286
|
+
agent repairs within the same boundaries
|
|
287
|
+
rerun check --context ctx_xxx
|
|
288
|
+
rerun validation/manual verification
|
|
289
|
+
accept only after evidence is sufficient
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Record `--result failed` only when the human wants the failed attempt captured as evidence. If failed evidence is recorded, the current Change Record is blocked; the repair attempt should produce a fresh Change Record with `check --context ctx_xxx`.
|
|
293
|
+
|
|
294
|
+
## `accept`
|
|
295
|
+
|
|
296
|
+
`accept` records the human decision.
|
|
297
|
+
|
|
298
|
+
Normal accept:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
node bin/hive.js accept chg_xxx
|
|
302
|
+
node bin/hive.js accept chg_xxx --commit -m "Update Action Inbox layout"
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Reviewed accept:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
node bin/hive.js accept chg_xxx \
|
|
309
|
+
--reviewed \
|
|
310
|
+
--reason "Reviewed grouping logic; validation passed and the change is isolated."
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Explicit risk acceptance:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
node bin/hive.js accept chg_xxx \
|
|
317
|
+
--accept-risk \
|
|
318
|
+
--reason "No focused test exists yet; accepting a low-risk isolated change after review."
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Rules:
|
|
322
|
+
|
|
323
|
+
- `blocked` cannot be accepted in the MVP.
|
|
324
|
+
- `needs_validation` should validate first.
|
|
325
|
+
- `needs_manual_verification` should record manual evidence first.
|
|
326
|
+
- `needs_review_reason` and `evidence_insufficient` require a human reason or explicit risk acceptance.
|
|
327
|
+
- `--commit` creates the git boundary for the accepted change.
|
|
328
|
+
|
|
329
|
+
## `map verify`
|
|
330
|
+
|
|
331
|
+
`map verify` checks whether the Project Map files exist, parse, and reference valid validation profiles and entrypoint shapes.
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
node bin/hive.js map verify
|
|
335
|
+
node bin/hive.js map verify --json
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
JSON output includes `status`, `mapDir`, `problems`, `errors`, and `warnings`. `errors` is an alias of `problems` for agent workflows that expect an errors field.
|
|
339
|
+
|
|
340
|
+
## `map health`
|
|
341
|
+
|
|
342
|
+
`map health` checks whether the Project Map can support safe `find` and useful `check` evidence policy.
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
node bin/hive.js map health
|
|
346
|
+
node bin/hive.js map health --area dashboard.action_inbox
|
|
347
|
+
node bin/hive.js map health --json
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Status
|
|
351
|
+
|
|
352
|
+
| Value | Meaning | What To Do |
|
|
353
|
+
| --- | --- | --- |
|
|
354
|
+
| `healthy` | No critical/warning findings. | Map can support edit-ready areas. |
|
|
355
|
+
| `needs_attention` | Map has warnings. | Refresh or repair if relevant to the next requirement. |
|
|
356
|
+
| `unsafe_for_edit_context` | Map has critical findings. | Repair map before relying on edit context. |
|
|
357
|
+
| `invalid_map` | Map YAML/schema is missing or invalid. | Fix map files before using Hive Lite. |
|
|
358
|
+
|
|
359
|
+
## `map prompt`
|
|
360
|
+
|
|
361
|
+
`map prompt` generates a prompt for a map-maintainer agent. It does not call an LLM and does not edit files itself.
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
node bin/hive.js map prompt --focus "Dashboard surfaces" --max-areas 8
|
|
365
|
+
node bin/hive.js map prompt --from-find ctx_xxx
|
|
366
|
+
node bin/hive.js map prompt --from-find ctx_xxx --json
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Use cases:
|
|
370
|
+
|
|
371
|
+
- bootstrap a first Project Map
|
|
372
|
+
- refresh stale areas
|
|
373
|
+
- repair one intent after `find` returns `needs_map` or `discovery_context`
|
|
374
|
+
- add roles / verification policy so `check` can judge evidence better
|
|
375
|
+
|
|
376
|
+
## `map delta`
|
|
377
|
+
|
|
378
|
+
Accepted changes may produce Map Delta Candidates. A delta is a suggestion, not automatic durable knowledge.
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
node bin/hive.js map delta list
|
|
382
|
+
node bin/hive.js map delta apply delta_xxx
|
|
383
|
+
node bin/hive.js map delta reject delta_xxx --reason "One-off change; not durable map knowledge."
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Apply only when the lesson is durable and useful for future `find` / `check` behavior.
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hive-lite-finish
|
|
3
|
+
description: Use this skill after a coding agent says a Hive Lite-scoped change is implemented and the user wants help closing it. It runs Hive Lite check/validate, interprets Evidence Policy, asks the human for manual verification or review reasons when required, and only accepts/commits after explicit confirmation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hive Lite Finish
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Drive the finish side of a Hive Lite change after code has been edited:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
check -> validate -> human verification or review reason -> accept
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Hive Lite is the factual evidence layer. This skill is the operator layer. The human remains responsible for manual verification, risk acceptance, review reasons, and commit confirmation.
|
|
17
|
+
|
|
18
|
+
## References
|
|
19
|
+
|
|
20
|
+
- Read [safety.md](references/safety.md) before mutating git state, recording manual evidence, accepting risk, or committing.
|
|
21
|
+
- Read [verdicts.md](references/verdicts.md) when interpreting `evidencePolicy.verdict`.
|
|
22
|
+
|
|
23
|
+
## Skill Handoffs
|
|
24
|
+
|
|
25
|
+
Do not assume this skill can invoke `$hive-lite-start-prompt` or `$hive-lite-map-maintainer` automatically. If another skill is needed, output an explicit prompt for the user to run and stop.
|
|
26
|
+
|
|
27
|
+
- Next phase after split accept: output a `$hive-lite-start-prompt` handoff.
|
|
28
|
+
- Map repair or refresh needed during finish: output a `$hive-lite-map-maintainer` handoff; do not edit map files here.
|
|
29
|
+
|
|
30
|
+
If the target handoff skill is unavailable in the active agent CLI, tell the user to install or sync Hive Lite skills for their agent first. Hive Lite cannot detect the running agent by itself; use the user's agent target such as `codex`, `claude`, or `gemini`:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
hive-lite skills doctor --agent <codex|claude|gemini>
|
|
34
|
+
hive-lite skills install --agent <codex|claude|gemini>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Boundaries
|
|
38
|
+
|
|
39
|
+
- Do not edit application code.
|
|
40
|
+
- Do not repair Project Map files in this skill; hand off to `$hive-lite-map-maintainer` if map work is required.
|
|
41
|
+
- Do not claim manual UI/product verification yourself.
|
|
42
|
+
- Do not automatically accept risk, commit, stash, reset, clean, push, merge, or deploy.
|
|
43
|
+
- Do not ignore scope violations or failed required validation.
|
|
44
|
+
- Agent summaries are not evidence. Evidence must come from Hive Lite diff/scope, validation logs, manual validation notes, review reasons, or accept records.
|
|
45
|
+
|
|
46
|
+
## Find The CLI
|
|
47
|
+
|
|
48
|
+
Run Hive Lite from the target repo root. Prefer the package command:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
hive-lite <args>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If `hive-lite` is not available, try an explicit path already given by the user or conversation context, such as `node /path/to/hive-lite/bin/hive.js <args>`. Ask for the CLI path if it is not obvious.
|
|
55
|
+
|
|
56
|
+
In command examples below, replace `hive-lite` with the resolved command.
|
|
57
|
+
|
|
58
|
+
## Workflow
|
|
59
|
+
|
|
60
|
+
### 1. Identify The Change
|
|
61
|
+
|
|
62
|
+
Run `hive-lite status --json` first. If it reports `hive.state = repo_setup_required`, stop immediately. Do not run check/validate/accept and do not initialize git automatically. Tell the user to switch to the correct git repo root, or manually initialize git and create an initial commit before using Hive Lite.
|
|
63
|
+
|
|
64
|
+
Find one of:
|
|
65
|
+
|
|
66
|
+
- context id from the coding agent output, such as `ctx_xxx`,
|
|
67
|
+
- change id from the user, such as `chg_xxx`,
|
|
68
|
+
- latest in-progress change from `hive-lite status --json`.
|
|
69
|
+
|
|
70
|
+
If neither context id nor change id is known, ask the user for the context/check command rather than guessing.
|
|
71
|
+
|
|
72
|
+
### 2. Run Check
|
|
73
|
+
|
|
74
|
+
If a context id is known, run:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
hive-lite check --context <ctx_id> --json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If a change id is known, run:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
hive-lite check <chg_id> --json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Read JSON fields directly. Key fields:
|
|
87
|
+
|
|
88
|
+
- `id`
|
|
89
|
+
- `scope.status`
|
|
90
|
+
- `scope.reviewDetails`
|
|
91
|
+
- `validation.status`
|
|
92
|
+
- `validation.plan`
|
|
93
|
+
- `risk.level`
|
|
94
|
+
- `risk.blockingReasons`
|
|
95
|
+
- `risk.reviewReasons`
|
|
96
|
+
- `evidencePolicy.verdict`
|
|
97
|
+
- `evidencePolicy.class`
|
|
98
|
+
- `evidencePolicy.missing`
|
|
99
|
+
- `evidencePolicy.nextActions`
|
|
100
|
+
|
|
101
|
+
Summarize for the human in plain language:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
I checked the change.
|
|
105
|
+
- Scope: clean / needs review / violation
|
|
106
|
+
- Risk: low / medium / high
|
|
107
|
+
- Current evidence verdict: <human explanation>
|
|
108
|
+
- Next step: <what I can do or what I need from you>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 3. Follow The Verdict
|
|
112
|
+
|
|
113
|
+
Read [verdicts.md](references/verdicts.md). Use `evidencePolicy.verdict` as the main decision source.
|
|
114
|
+
|
|
115
|
+
Safe default:
|
|
116
|
+
|
|
117
|
+
- `blocked`: stop.
|
|
118
|
+
- `needs_validation`: run safe automatic validation, or ask first if the command looks unsafe.
|
|
119
|
+
- `needs_manual_verification`: ask the human to verify; do not record manual evidence until they confirm.
|
|
120
|
+
- `needs_review_reason` or `evidence_insufficient`: explain options and ask for a review reason, focused test, or risk acceptance.
|
|
121
|
+
- `acceptable`: ask whether to accept and commit.
|
|
122
|
+
|
|
123
|
+
After running validation or recording manual evidence, run `hive-lite check <chg_id> --json` again before deciding the next step.
|
|
124
|
+
|
|
125
|
+
If `accept` later returns `postAcceptHint.kind = split_remaining_phases`, explain ready and waiting phases to the human and recommend `postAcceptHint.suggestedNextPhase` when present.
|
|
126
|
+
|
|
127
|
+
Do not assume this skill can invoke `$hive-lite-start-prompt` automatically. Instead, output a clear handoff prompt and stop:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
To continue the next phase, run:
|
|
131
|
+
|
|
132
|
+
$hive-lite-start-prompt
|
|
133
|
+
Continue split <split_id> with phase <phase_id>.
|
|
134
|
+
Use this find intent:
|
|
135
|
+
"<findIntent>"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
If the user explicitly asks you to continue in the same session, you may run the phase-specific `hive-lite find ... --from-split ... --phase ... --area <primaryAreaId> --json` command and summarize the result, but do not duplicate the full start-skill workflow unless the active agent environment has actually loaded `$hive-lite-start-prompt`.
|
|
139
|
+
|
|
140
|
+
### 4. Automatic Validation
|
|
141
|
+
|
|
142
|
+
If validation is needed, inspect `validation.plan`.
|
|
143
|
+
|
|
144
|
+
You may run a command validation automatically only when it appears safe. Read [safety.md](references/safety.md). If unsure, ask first.
|
|
145
|
+
|
|
146
|
+
Run:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
hive-lite validate <chg_id> --json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
or, for a selected profile:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
hive-lite validate <chg_id> --profile <profile> --json
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Then rerun:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
hive-lite check <chg_id> --json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 5. Manual Verification
|
|
165
|
+
|
|
166
|
+
If manual verification is required:
|
|
167
|
+
|
|
168
|
+
1. Explain that you cannot verify UI/product behavior for the human.
|
|
169
|
+
2. Provide concrete checks based on the requirement, changed files, context packet, and evidence policy.
|
|
170
|
+
3. Ask the human to reply with pass/fail and any observation.
|
|
171
|
+
4. If the human confirms pass, record manual evidence.
|
|
172
|
+
|
|
173
|
+
Use the first profile in `evidencePolicy.manualVerification.profiles`, or `manual-verification` if no profile is configured:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
hive-lite validate <chg_id> \
|
|
177
|
+
--manual <profile> \
|
|
178
|
+
--result passed \
|
|
179
|
+
--note "<human-confirmed note>" \
|
|
180
|
+
--json
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Do not invent the note. It should reflect the user's confirmation.
|
|
184
|
+
|
|
185
|
+
If the human reports failure, do not accept and do not treat failed manual evidence as mandatory. The default next step is repair under the same Context Packet:
|
|
186
|
+
|
|
187
|
+
1. Keep the original context id from the Change Record.
|
|
188
|
+
2. Summarize the human failure clearly.
|
|
189
|
+
3. Output a repair prompt the human can paste into the coding agent session.
|
|
190
|
+
4. Tell the human to rerun `hive-lite check --context <ctx_id>` after the coding agent edits again.
|
|
191
|
+
|
|
192
|
+
Use this repair prompt shape:
|
|
193
|
+
|
|
194
|
+
```text
|
|
195
|
+
The previous implementation failed human verification.
|
|
196
|
+
|
|
197
|
+
Use the same Hive Lite Context Packet:
|
|
198
|
+
.hive/context/<ctx_id>.md
|
|
199
|
+
|
|
200
|
+
Failure:
|
|
201
|
+
<human failure observation>
|
|
202
|
+
|
|
203
|
+
Revise the implementation using the same context packet.
|
|
204
|
+
Modify only the Direct Writable files in that packet.
|
|
205
|
+
Do not expand scope.
|
|
206
|
+
If you need a Review-Gated file, stop and explain why.
|
|
207
|
+
After editing, stop and ask the human to rerun:
|
|
208
|
+
hive-lite check --context <ctx_id>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Only record failed manual evidence if the human explicitly wants the failed attempt captured:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
hive-lite validate <chg_id> \
|
|
215
|
+
--manual <profile> \
|
|
216
|
+
--result failed \
|
|
217
|
+
--note "<human failure observation>" \
|
|
218
|
+
--json
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
If failed evidence is recorded, the current Change Record becomes blocked. The next coding attempt should create a fresh Change Record with `hive-lite check --context <ctx_id>`.
|
|
222
|
+
|
|
223
|
+
### 6. Review Reason Or Insufficient Evidence
|
|
224
|
+
|
|
225
|
+
If Hive reports `needs_review_reason` or `evidence_insufficient`, explain the difference:
|
|
226
|
+
|
|
227
|
+
- review reason: evidence may be enough after human code review, but Hive needs the reason recorded.
|
|
228
|
+
- evidence insufficient: focused verification is preferred; review reason or accept-risk is an explicit escape hatch.
|
|
229
|
+
|
|
230
|
+
Offer options:
|
|
231
|
+
|
|
232
|
+
```text
|
|
233
|
+
1. Ask the coding agent to add focused verification.
|
|
234
|
+
2. Record a reviewed accept reason, if you believe evidence is enough.
|
|
235
|
+
3. Accept risk, if you knowingly accept insufficient evidence.
|
|
236
|
+
4. Stop.
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
You may draft a reason, but the human must approve it before use.
|
|
240
|
+
|
|
241
|
+
### 7. Accept And Commit
|
|
242
|
+
|
|
243
|
+
Before accepting, rerun:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
hive-lite check <chg_id> --json
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Accept only when:
|
|
250
|
+
|
|
251
|
+
- the verdict is `acceptable`, or
|
|
252
|
+
- the human explicitly approved `--reviewed --reason`, or
|
|
253
|
+
- the human explicitly approved `--accept-risk --reason`.
|
|
254
|
+
|
|
255
|
+
Ask for or propose a commit message. Do not commit silently.
|
|
256
|
+
|
|
257
|
+
Run one of:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
hive-lite accept <chg_id> --commit -m "<message>" --json
|
|
261
|
+
hive-lite accept <chg_id> --reviewed --reason "<reason>" --commit -m "<message>" --json
|
|
262
|
+
hive-lite accept <chg_id> --accept-risk --reason "<reason>" --commit -m "<message>" --json
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
After accepting, summarize:
|
|
266
|
+
|
|
267
|
+
```text
|
|
268
|
+
Accepted and committed.
|
|
269
|
+
- Change: chg_xxx
|
|
270
|
+
- Commit: <sha>
|
|
271
|
+
- Evidence: .hive/changes/chg_xxx/evidence.json
|
|
272
|
+
- Map Delta Candidate: <id or none>
|
|
273
|
+
- Split next phase: <handoff prompt or none>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
If no commit was created because the user explicitly asked not to commit, warn that a new Hive Lite requirement should not start until the worktree is clean.
|
|
277
|
+
|
|
278
|
+
## Response Style
|
|
279
|
+
|
|
280
|
+
Do not dump raw JSON unless the user asks. Translate Hive Lite facts into plain language, then show exact commands only when asking for confirmation or reporting what ran.
|
|
281
|
+
|
|
282
|
+
When you must stop for human input, stop cleanly with choices. Do not continue in the same response unless the user had already explicitly chosen an option.
|