hive-lite 0.1.8 → 0.2.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 +3 -1
- package/docs/cli-semantics.md +53 -1
- package/docs/skills/hive-lite-bootstrap/SKILL.md +28 -0
- package/docs/skills/hive-lite-discovery/SKILL.md +151 -0
- package/docs/skills/hive-lite-discovery/agents/openai.yaml +4 -0
- package/docs/skills/hive-lite-finish/SKILL.md +62 -5
- package/docs/skills/hive-lite-map-maintainer/SKILL.md +28 -0
- package/docs/skills/hive-lite-map-maintainer/references/lifecycle.md +1 -1
- package/docs/skills/hive-lite-map-maintainer/references/repair-rules.md +7 -0
- package/docs/skills/hive-lite-start-prompt/SKILL.md +175 -52
- package/docs/skills/hive-lite-start-prompt/references/preflight.md +70 -20
- package/package.json +3 -3
- package/src/cli.js +146 -3
- package/src/lib/change.js +93 -0
- package/src/lib/context.js +312 -35
- package/src/lib/git.js +1 -0
- package/src/lib/health.js +208 -0
- package/src/lib/intent.js +620 -0
- package/src/lib/map.js +57 -0
- package/src/lib/operator.js +1067 -0
- package/src/lib/skills.js +1 -0
|
@@ -7,7 +7,7 @@ description: Use this skill when a user gives a coding requirement, screenshot,
|
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
Turn a natural-language or visual requirement into an edit-ready Hive Lite Context Packet and a concise prompt for a separate coding agent.
|
|
10
|
+
Turn a natural-language or visual requirement, or a saved Start Intent Handoff id/path, into an edit-ready Hive Lite Context Packet and a concise prompt for a separate coding agent.
|
|
11
11
|
|
|
12
12
|
This is a pre-work skill. It may refine `.hive/map/*.yaml` so Hive Lite can route the requirement safely, but it must not implement the requested product/code change.
|
|
13
13
|
|
|
@@ -19,7 +19,9 @@ This is a pre-work skill. It may refine `.hive/map/*.yaml` so Hive Lite can rout
|
|
|
19
19
|
|
|
20
20
|
## Skill Handoffs
|
|
21
21
|
|
|
22
|
-
Do not assume this skill can invoke another skill automatically. Handoffs are text for the user to
|
|
22
|
+
Do not assume this skill can invoke another skill automatically. Handoffs are text for the user to paste as a new skill invocation message.
|
|
23
|
+
|
|
24
|
+
Skill handoffs are not terminal commands. Do not run raw `hive-lite find/check/validate` commands as a substitute for a `$hive-lite-start-prompt`, `$hive-lite-finish`, or `$hive-lite-map-maintainer` handoff. If the human asks you to run the next skill for them, remind them to paste the provided `$...` block as a new message so the correct skill is loaded.
|
|
23
25
|
|
|
24
26
|
- To map maintenance: output a `$hive-lite-map-maintainer` prompt and stop.
|
|
25
27
|
- To finish work after coding: include `$hive-lite-finish` in the final instructions, but do not run finish actions here.
|
|
@@ -32,16 +34,40 @@ hive-lite --version
|
|
|
32
34
|
hive-lite skills sync --agent all
|
|
33
35
|
```
|
|
34
36
|
|
|
37
|
+
## Operator Runner Mode
|
|
38
|
+
|
|
39
|
+
If the invocation includes `Step result path`, `Artifacts directory`, and `Step-result schema_version`, you are running under `hive-lite operator run`.
|
|
40
|
+
|
|
41
|
+
- Treat natural-language output as human/debug text only; the runner reads `step-result.json`.
|
|
42
|
+
- Write copyable artifacts under the provided `Artifacts directory`, then write `step-result.json` to the exact `Step result path`.
|
|
43
|
+
- For `prompt_ready`, write the coding prompt artifact and set `recommended_action` to `copy_coding_prompt`.
|
|
44
|
+
- For `split_required`, write a ready-phase handoff prompt artifact and set `recommended_action` to `start_ready_phase`.
|
|
45
|
+
- For map-maintainer handoffs, use `map_update_required` with `recommended_action: map_update_required`.
|
|
46
|
+
- For setup, preflight, validation, or irrecoverable start blockers, use `blocked` with `recommended_action: revise_required`, or `failed` for unexpected tool/runtime failures.
|
|
47
|
+
- After writing the structured result, stop. Do not wait for human input inside the operator-agent session.
|
|
48
|
+
|
|
35
49
|
## Boundaries
|
|
36
50
|
|
|
37
51
|
- Do not directly edit application source, tests, docs, `.gitignore`, generated artifacts, `.hive/context`, `.hive/changes`, or `.hive/deltas`.
|
|
38
52
|
- Only edit these Project Map files when map repair is needed: `.hive/map/project.yaml`, `.hive/map/areas.yaml`, `.hive/map/rules.yaml`, `.hive/map/validation.yaml`.
|
|
39
53
|
- Do not run `hive-lite init`. If Hive Lite setup is missing or incomplete, stop and recommend `$hive-lite-bootstrap` before using this skill.
|
|
40
54
|
- Do not run `hive check`, `hive validate`, `hive accept`, commits, formatters, or app tests for the new requirement. Those belong after the coding agent changes code.
|
|
55
|
+
- Do not continue a discovery conversation. If a Start Intent Handoff is invalid, not `ready_for_hive`, or still has `Blocking Questions`, send the user back to `$hive-lite-discovery`.
|
|
41
56
|
- During preflight, you may help finish or isolate pre-existing work only after explicit user confirmation.
|
|
42
57
|
- Never discard changes with destructive commands such as `git reset --hard`, `git checkout --`, or forced branch switches.
|
|
43
58
|
- Do not call an LLM API from Hive Lite. If a map gap exists, use `hive map prompt --from-find` as the repair brief and edit the map directly as the current agent.
|
|
44
59
|
|
|
60
|
+
## Completion Contract
|
|
61
|
+
|
|
62
|
+
End with exactly one clear outcome:
|
|
63
|
+
|
|
64
|
+
- `prompt_ready`: one edit-ready Context Packet exists, one coding-agent prompt is produced, and the human/runner knows to use `$hive-lite-finish` with the context id after coding.
|
|
65
|
+
- `split_required`: no coding prompt is produced; the human gets one copyable `$hive-lite-start-prompt` handoff for the recommended ready phase.
|
|
66
|
+
- `map_update_required` or blocked start: no coding prompt is produced; the human gets exact terminal commands or a skill handoff to unblock the map/setup/preflight issue.
|
|
67
|
+
- `failed`: only for an unexpected tool/runtime failure that prevents a normal blocked result.
|
|
68
|
+
|
|
69
|
+
Do not end with an open-ended suggestion when the next required action can be stated exactly.
|
|
70
|
+
|
|
45
71
|
## Find The CLI
|
|
46
72
|
|
|
47
73
|
Run Hive Lite from the target repo root. Prefer the package command:
|
|
@@ -65,12 +91,104 @@ Then rerun this skill.
|
|
|
65
91
|
|
|
66
92
|
Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
|
|
67
93
|
|
|
94
|
+
## Language Style
|
|
95
|
+
|
|
96
|
+
Use Chinese for human-facing process guidance, warnings, and instructions, especially text that tells the user what to do next or why the flow is stopping.
|
|
97
|
+
|
|
98
|
+
Keep technical identifiers and structured Hive Lite labels in English. Do not translate:
|
|
99
|
+
|
|
100
|
+
- Hive Lite fields and labels such as `Context Packet`, `Direct Writable`, `Reference Files`, `Review-Gated`, `Do Not Touch`, `Validation`, `Evidence`, `Change`, `Commit`, `Map Delta Candidate`, `Worktree`.
|
|
101
|
+
- CLI commands, file paths, context/change ids, validation profile ids, verdict names, risk levels, branch names, commit hashes, package names, and code symbols.
|
|
102
|
+
- Copyable prompt blocks that are meant for another agent, unless the user's original requirement is Chinese.
|
|
103
|
+
|
|
104
|
+
Example style: keep `No push or deploy was run.` as a Chinese reminder such as `没有执行 push 或 deploy。`, but keep nearby structured lines like `Change: chg_xxx`, `Commit: <sha>`, and `Validation: mvn -q -DskipTests compile passed` in English.
|
|
105
|
+
|
|
106
|
+
## Human Action Output
|
|
107
|
+
|
|
108
|
+
Whenever you stop and need the human to do something before this skill can continue, make the action concrete. Do not only say "commit/stash/rerun" or "choose a phase".
|
|
109
|
+
|
|
110
|
+
Separate terminal commands from skill prompts:
|
|
111
|
+
|
|
112
|
+
- Terminal commands are shell commands. Tell the human to run them in a real terminal from the target repo root, not by typing them into the agent chat. Always include `cd <target repo root>` before the command block when you know the path.
|
|
113
|
+
- If the current agent can safely perform a terminal action, offer it as an explicit second option and wait for confirmation. Phrase it as: `Reply here if you want me to run this terminal command for you.` Do not execute commits, stashes, accepts, or other state-changing commands without explicit confirmation.
|
|
114
|
+
- Skill prompts such as `$hive-lite-start-prompt`, `$hive-lite-finish`, and `$hive-lite-map-maintainer` must be pasted by the human as a new skill invocation message. Do not run raw `hive-lite find/check/validate` as a substitute for those skill handoffs. If the human says "help me run the next skill", remind them to paste the provided `$...` block as a new message so the correct skill is loaded.
|
|
115
|
+
|
|
116
|
+
Use this shape:
|
|
117
|
+
|
|
118
|
+
~~~text
|
|
119
|
+
Why I stopped:
|
|
120
|
+
- <one or two bullets explaining the safety boundary>
|
|
121
|
+
|
|
122
|
+
Recommended action option 1: run this in your terminal, not in the agent chat:
|
|
123
|
+
```bash
|
|
124
|
+
cd <target repo root>
|
|
125
|
+
<exact command>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
What this does:
|
|
129
|
+
- <plain-language effect, such as "commits only the Project Map refinement">
|
|
130
|
+
|
|
131
|
+
Option 2: if you want this agent to run the terminal command for you, reply with explicit confirmation and the commit/stash message to use.
|
|
132
|
+
|
|
133
|
+
After that, start the next skill by pasting this as a new message:
|
|
134
|
+
```text
|
|
135
|
+
<exact $hive-lite-start-prompt handoff or rerun prompt>
|
|
136
|
+
```
|
|
137
|
+
~~~
|
|
138
|
+
|
|
139
|
+
If there are reasonable alternatives, keep the recommended action first and then list alternatives with exact commands. For map-only repair, prefer a commit when the map refinement is accepted:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
cd <target repo root>
|
|
143
|
+
git add .hive/map/areas.yaml
|
|
144
|
+
git commit -m "Refine Hive Lite map for <area or requirement>"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
If the human does not want to keep the map repair yet, offer a stash alternative:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
cd <target repo root>
|
|
151
|
+
git stash push -m "WIP Hive Lite map refinement for <area or requirement>" -- .hive/map/areas.yaml .hive/map/project.yaml .hive/map/rules.yaml .hive/map/validation.yaml
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Never run commits, stashes, accepts, resets, or destructive cleanup without explicit human confirmation.
|
|
155
|
+
|
|
156
|
+
## Context Gathering
|
|
157
|
+
|
|
158
|
+
Gather only enough facts to choose the next safe Hive Lite action.
|
|
159
|
+
|
|
160
|
+
Stop searching once these are known:
|
|
161
|
+
|
|
162
|
+
- repo/setup/worktree state from `hive-lite status --json`;
|
|
163
|
+
- valid requirement or Start Intent Handoff-derived `findIntent`;
|
|
164
|
+
- current `find` mode, context id, selected area, warnings, and validation plan;
|
|
165
|
+
- focused map health for the selected area when an edit context is possible.
|
|
166
|
+
|
|
167
|
+
Use `--explain` only when human-readable routing evidence is needed. During map repair, keep the existing two-cycle limit and stop once the next action is clear.
|
|
168
|
+
|
|
68
169
|
## Workflow
|
|
69
170
|
|
|
70
171
|
### 1. Establish Target And Calibrate Input
|
|
71
172
|
|
|
72
173
|
Identify the target repo root, original user requirement, and any screenshot/visual evidence.
|
|
73
174
|
|
|
175
|
+
If the user provides `Use Start Intent Handoff: <intent_id_or_path>` or otherwise gives a Start Intent Handoff id/path, load it before normal input calibration:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
hive-lite intent validate <intent_id_or_path> --json
|
|
179
|
+
hive-lite intent show <intent_id_or_path> --json
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Use the JSON output for decisions. Refuse and send the user back to `$hive-lite-discovery` if validation is not valid, `status` is not `ready_for_hive`, or `fields.blockingQuestions` is not `None`.
|
|
183
|
+
|
|
184
|
+
For a valid handoff:
|
|
185
|
+
|
|
186
|
+
- Set `originalRequirement` from the Start Intent Handoff title plus `fields.agreedDirection`; keep `fields.originalIdea` as provenance only.
|
|
187
|
+
- Set `findIntent` from `show.findIntent` when present. If unavailable, derive it from `Agreed Direction`, `User-Confirmed Decisions`, `Non-Goals`, `Acceptance Signals`, and `Unknowns For Hive Lite To Resolve`.
|
|
188
|
+
- Treat `Pre-Hive Observations / Hints` as non-authoritative hints only. Hive Lite must verify them through Project Map and Context Packet discovery.
|
|
189
|
+
- Do not add Direct Writable files, final file scope, implementation plan, validation plan, or files to modify from the handoff. Those are execution boundaries produced later by `hive-lite find`.
|
|
190
|
+
- Do not ask new discovery questions inside this skill. If product questions are still unresolved, stop with an explicit `$hive-lite-discovery` handoff.
|
|
191
|
+
|
|
74
192
|
Read [input-calibration.md](references/input-calibration.md). Produce:
|
|
75
193
|
|
|
76
194
|
- `originalRequirement`: the user's request preserved for the final prompt.
|
|
@@ -153,16 +271,22 @@ Why:
|
|
|
153
271
|
|
|
154
272
|
Suggested phases:
|
|
155
273
|
1. <area id / phase hint>
|
|
156
|
-
|
|
274
|
+
Copy exactly this block to start this phase:
|
|
275
|
+
```text
|
|
157
276
|
$hive-lite-start-prompt
|
|
158
277
|
Continue split <split_id> with phase <phase_id>.
|
|
159
278
|
Use this find intent: "<candidatePhaseSeeds[n].findIntent>"
|
|
160
|
-
|
|
279
|
+
```
|
|
280
|
+
Notes:
|
|
281
|
+
- Expected evidence: <candidatePhaseSeeds[n].evidenceClasses, or "not configured">
|
|
282
|
+
- Expected validation: <candidatePhaseSeeds[n].validationProfiles, or "not configured">
|
|
161
283
|
2. ...
|
|
162
284
|
|
|
163
285
|
Please choose one phase to start, then rerun this skill with that phase.
|
|
164
286
|
```
|
|
165
287
|
|
|
288
|
+
Only the fenced `$hive-lite-start-prompt` block is user input. Keep evidence, validation, risk, dependencies, and non-goals outside the copyable block as notes, and do not repeat validation lines.
|
|
289
|
+
|
|
166
290
|
Do not create durable Feature/Task objects. Do not edit code. Do not merge candidate areas into a wider prompt.
|
|
167
291
|
|
|
168
292
|
If the JSON includes `splitNote`, mention its markdown path. Treat it as a local context artifact, not a task list. When the user explicitly invokes this skill for a chosen phase, rerun find with the phase source:
|
|
@@ -173,6 +297,8 @@ hive-lite find "<phase.findIntent>" --from-split <split_id> --phase <phase_id> -
|
|
|
173
297
|
|
|
174
298
|
Continue only if that phase-specific find returns `edit_context`.
|
|
175
299
|
|
|
300
|
+
A chosen split phase can still expose its own map gap. If the phase-specific find returns `discovery_context` or map-gap warnings, repair only the selected phase's area using the normal map repair rules. If map files change during that phase repair, stop before generating the coding prompt and provide an explicit command block to commit or stash the map refinement, then provide the exact same phase-specific `$hive-lite-start-prompt` block to rerun after the worktree is clean.
|
|
301
|
+
|
|
176
302
|
If the phase-specific JSON includes `phaseDependencyStatus.canStartNormally: false`, do not output a coding prompt. If `splitFound` or `phaseFound` is false, explain that the copied split command is not an edit permit and recommend finding the current split note with `hive-lite status --json` or rerunning the original broad find command. Otherwise explain the missing required phases and recommend the next dependency phase. If the user says "continue split" or "resume the large requirement", use `hive-lite status --json` and its `recentSplitNotes` to find ready phases, then output a phase-specific `$hive-lite-start-prompt` handoff or continue only if the user explicitly asked this active skill to proceed with that phase.
|
|
177
303
|
|
|
178
304
|
Accept the packet only when all are true:
|
|
@@ -182,7 +308,7 @@ Accept the packet only when all are true:
|
|
|
182
308
|
- `writableScope` contains at least one narrow direct file.
|
|
183
309
|
- `writePlan.blockingWarnings` is empty when present.
|
|
184
310
|
- `validationPlan` is not empty.
|
|
185
|
-
- `warnings` has no map-gap warning such as `NO_CONFIDENT_AREA`, `MISSING_DIRECT_WRITABLE_SCOPE`, `MISSING_DIRECT_NEW_FILE_SCOPE`, `DIRECT_ONLY_REFERENCE_PEERS`, `BROAD_FALLBACK_ONLY`, `TARGET_ENTITY_MISMATCH`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
|
|
311
|
+
- `warnings` has no map-gap warning such as `NO_CONFIDENT_AREA`, `MISSING_DIRECT_WRITABLE_SCOPE`, `MISSING_DIRECT_NEW_FILE_SCOPE`, `DIRECT_ONLY_REFERENCE_PEERS`, `BROAD_FALLBACK_ONLY`, `TARGET_ENTITY_MISMATCH`, `AMBIGUOUS_TARGET_IDENTITY`, `LOW_CONFIDENCE_INTENT_WRITE_PLAN`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
|
|
186
312
|
- `hive-lite map health --area <areaId> --json` reports no critical findings.
|
|
187
313
|
|
|
188
314
|
Review-gated conditional or broad fallback scope is allowed. Include it in the final prompt as a boundary, not as a failure.
|
|
@@ -201,6 +327,10 @@ Repair principles:
|
|
|
201
327
|
|
|
202
328
|
- Prefer focused product/work area ids such as `dashboard.action_inbox`, not one-part ids such as `dashboard`.
|
|
203
329
|
- Preserve unrelated areas exactly unless a change is needed for the reported map gap.
|
|
330
|
+
- Relevant files, entrypoints, peer examples, and broad fallback scope are not write permission.
|
|
331
|
+
- Add `identity_aliases` when user-facing names such as ChatGPT, image2, model names, or vendor nicknames should resolve to one peer identity.
|
|
332
|
+
- Add `peer_file_templates` only as read-only candidate path hints for repeated peer families; they do not replace `writable_create_patterns`.
|
|
333
|
+
- Create intents need `writable_create_patterns`; required hooks need exact `writable_existing`.
|
|
204
334
|
- Use `scope.writable_direct` for exact files the coding agent may edit, or very small direct patterns when the intent needs new peer files such as a provider, proxy, adapter, connector, or plugin.
|
|
205
335
|
- Prefer `scope.writable_existing` for exact update targets and `scope.writable_create_patterns` for narrow create permissions when the map needs operation-specific write capabilities.
|
|
206
336
|
- Put copy sources and peer examples under `scope.readable_reference` when they should guide implementation but not be edited.
|
|
@@ -222,9 +352,9 @@ hive-lite map health --area <area_id> --json
|
|
|
222
352
|
hive-lite find "<findIntent>" --json
|
|
223
353
|
```
|
|
224
354
|
|
|
225
|
-
Repeat at most two repair cycles. If the packet still is not edit-ready, stop and return the blocker, current context id, findings, and
|
|
355
|
+
Repeat at most two repair cycles. If the packet still is not edit-ready, stop and return the blocker, current context id, findings, what the attempted repairs changed, and the exact next command or handoff prompt.
|
|
226
356
|
|
|
227
|
-
If map files were changed during repair, stop before producing a coding prompt unless the worktree has been returned to clean.
|
|
357
|
+
If map files were changed during repair, stop before producing a coding prompt unless the worktree has been returned to clean. Give a recommended terminal commit command with `cd <target repo root>`, explain that it records only the Project Map refinement and not application code, then give the exact `$hive-lite-start-prompt` block for the human to paste as a new message to rerun this same original requirement or chosen phase. Also offer a terminal stash command as an alternative if the human does not want to keep the map repair yet. You may offer to run the terminal commit/stash command after explicit confirmation, but you must not run the next `$hive-lite-start-prompt` handoff yourself.
|
|
228
358
|
|
|
229
359
|
If the repair requires broad map refresh beyond the selected area, stop and hand off to `$hive-lite-map-maintainer`:
|
|
230
360
|
|
|
@@ -248,14 +378,14 @@ If `needs_decomposition` persists after the user selects a smaller phase, ask th
|
|
|
248
378
|
|
|
249
379
|
### 7. Return The Start Prompt
|
|
250
380
|
|
|
251
|
-
When ready, return
|
|
381
|
+
When ready, return a short human summary plus one fenced copy block for the coding agent:
|
|
252
382
|
|
|
253
|
-
- `Preparation Summary`: for the human only. Include preflight actions, commits made before start, whether `.hive/map/*.yaml` changed, and the Context Packet id.
|
|
254
|
-
- `Coding Agent Prompt`: the
|
|
383
|
+
- `Preparation Summary`: for the human only. Include preflight actions, commits made before start, whether `.hive/map/*.yaml` changed, and the Context Packet id. This section is not for the coding agent.
|
|
384
|
+
- `Coding Agent Prompt`: place the entire prompt inside one fenced `text` block. The user should copy only that block to the coding agent.
|
|
255
385
|
|
|
256
|
-
Do not include preparation/provenance notes inside `Coding Agent Prompt
|
|
386
|
+
Do not include preparation/provenance notes inside the fenced `Coding Agent Prompt` block. Do not put copyable prompt text outside that block.
|
|
257
387
|
|
|
258
|
-
|
|
388
|
+
~~~text
|
|
259
389
|
Ready to start.
|
|
260
390
|
|
|
261
391
|
Preparation Summary:
|
|
@@ -265,57 +395,50 @@ Preparation Summary:
|
|
|
265
395
|
- Context Packet: <relative .hive/context/ctx_xxx.md>
|
|
266
396
|
|
|
267
397
|
Coding Agent Prompt:
|
|
268
|
-
|
|
269
|
-
<relative .hive/context/ctx_xxx.md>
|
|
270
|
-
|
|
271
|
-
Requirement:
|
|
272
|
-
<originalRequirement>
|
|
273
|
-
|
|
274
|
-
Use this context packet as your source of truth. Edit only Direct Writable files.
|
|
275
|
-
|
|
276
|
-
Direct Writable:
|
|
277
|
-
- <file>
|
|
278
|
-
|
|
279
|
-
Reference Files:
|
|
280
|
-
- <file and reason, only when useful; do not edit unless it is also Direct Writable>
|
|
398
|
+
Copy everything inside this block to the coding agent. Do not copy the Preparation Summary.
|
|
281
399
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
-
|
|
400
|
+
```text
|
|
401
|
+
Task:
|
|
402
|
+
- Requirement: <originalRequirement>
|
|
403
|
+
- Context Packet: <relative .hive/context/ctx_xxx.md>
|
|
404
|
+
- Read the Context Packet before editing; it is the source of truth for scope.
|
|
287
405
|
|
|
288
|
-
|
|
289
|
-
-
|
|
406
|
+
Authority:
|
|
407
|
+
- Allowed: modify only the Direct Writable files listed in the Context Packet.
|
|
408
|
+
- Reference only: use Reference Files for context, but do not edit them unless they are also Direct Writable.
|
|
409
|
+
- Ask first: if the fix requires a Review-Gated file, stop and explain why it is needed before editing.
|
|
410
|
+
- Forbidden: do not touch Do Not Touch paths, do not expand scope, and do not start another split phase.
|
|
290
411
|
|
|
291
|
-
Verification
|
|
292
|
-
-
|
|
293
|
-
- If
|
|
412
|
+
Verification:
|
|
413
|
+
- Expected validation: <command or manual check>
|
|
414
|
+
- If behavior changes, add or update the smallest focused verification that is practical.
|
|
294
415
|
- Prefer a small existing or new focused test over broad unrelated tests.
|
|
295
|
-
- Do not add broad, brittle, or low-value tests only for process.
|
|
296
416
|
- If focused automated verification is impractical, explain why and provide a concise review rationale.
|
|
297
417
|
- Do not weaken or delete validation, CI, or existing tests.
|
|
298
418
|
|
|
299
|
-
|
|
300
|
-
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
If the human later reports that business/manual verification failed, revise under this same Context Packet instead of expanding scope or treating it as a new requirement. Use the human's failure observation as the repair target, keep the same Direct Writable / Review-Gated / Do Not Touch boundaries, and again tell the human to rerun:
|
|
312
|
-
<resolved hive command> check --context <ctx_id>
|
|
419
|
+
Finish:
|
|
420
|
+
- Summarize changed files and important behavior changes.
|
|
421
|
+
- Tell the human: `Run $hive-lite-finish with context <ctx_id>.`
|
|
422
|
+
- CLI fallback for operators not using skills: `<resolved hive command> check --context <ctx_id>`.
|
|
423
|
+
- Do not tell the human to start another split phase yourself; `$hive-lite-finish` reports the next phase after this change is checked, validated, accepted, and committed.
|
|
424
|
+
|
|
425
|
+
Repair Behavior:
|
|
426
|
+
- If the human later reports that business/manual verification failed, revise under this same Context Packet.
|
|
427
|
+
- Use the human's failure observation as the repair target.
|
|
428
|
+
- Keep the same Direct Writable / Review-Gated / Do Not Touch boundaries.
|
|
429
|
+
- Again tell the human: `Run $hive-lite-finish with context <ctx_id>.`
|
|
313
430
|
```
|
|
431
|
+
~~~
|
|
314
432
|
|
|
315
|
-
Preparation details such as commits made, stashes created, worktree setup, map files changed, or "no map files changed" are for `Preparation Summary` only. Do not list `hive-lite check --context ...` under validation commands; it is the change-control step after the coding agent edits files.
|
|
433
|
+
Preparation details such as commits made, stashes created, worktree setup, map files changed, or "no map files changed" are for `Preparation Summary` only. Do not list `hive-lite check --context ...` under validation commands; it is the lower-level change-control step that `$hive-lite-finish` runs after the coding agent edits files.
|
|
316
434
|
|
|
317
435
|
## Failure Output
|
|
318
436
|
|
|
319
|
-
If no edit-ready prompt can be produced, return the context packet id, current mode, selected area if any, blocking warnings or health critical findings,
|
|
437
|
+
If no edit-ready prompt can be produced, return the context packet id, current mode, selected area if any, blocking warnings or health critical findings, whether `.hive/map/*.yaml` files were changed, and an explicit next action block:
|
|
438
|
+
|
|
439
|
+
- If map files changed: show terminal commands with `cd <target repo root>`, `git status --short`, `git add ...`, and `git commit -m ...`, explain that these commands belong in a terminal, then show the exact `$hive-lite-start-prompt` rerun block as a new message the human must paste manually.
|
|
440
|
+
- If a split is needed: show only the copyable `$hive-lite-start-prompt` block for the recommended phase, with evidence/validation outside the block as notes.
|
|
441
|
+
- If map maintenance is needed: show the exact `$hive-lite-map-maintainer` handoff block.
|
|
442
|
+
- If setup or dirty preflight blocks start: show the exact command or explicit choice list from the relevant preflight guidance.
|
|
320
443
|
|
|
321
444
|
Do not pretend the agent can safely start coding when the packet is `discovery_context` or `needs_map`.
|
|
@@ -48,15 +48,36 @@ Meaning: dirty files are not tied to a Hive Change Record.
|
|
|
48
48
|
|
|
49
49
|
Stop and present options:
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
~~~text
|
|
52
52
|
The worktree has unmanaged dirty changes, so I cannot safely start a new Hive Lite requirement.
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
Recommended option: commit the existing work if it is ready.
|
|
55
|
+
```bash
|
|
56
|
+
cd <target repo root>
|
|
57
|
+
git status --short
|
|
58
|
+
git add <paths-to-keep>
|
|
59
|
+
git commit -m "<message describing the current work>"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Alternative: stash the existing work if it is not ready.
|
|
63
|
+
```bash
|
|
64
|
+
cd <target repo root>
|
|
65
|
+
git stash push -m "WIP before Hive Lite requirement"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Alternative: create a separate worktree for the new requirement.
|
|
69
|
+
```bash
|
|
70
|
+
cd <target repo root>
|
|
71
|
+
git worktree add ../<new-worktree-dir> -b <branch-name>
|
|
72
|
+
cd ../<new-worktree-dir>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
After the chosen action, rerun:
|
|
76
|
+
```bash
|
|
77
|
+
cd <target repo root>
|
|
78
|
+
hive-lite status --json
|
|
59
79
|
```
|
|
80
|
+
~~~
|
|
60
81
|
|
|
61
82
|
Only run a command after the user explicitly chooses an option and provides any required commit message, stash message, or branch/worktree name.
|
|
62
83
|
|
|
@@ -66,20 +87,41 @@ Meaning: an unfinished Hive Change Record exists.
|
|
|
66
87
|
|
|
67
88
|
Stop and present options:
|
|
68
89
|
|
|
69
|
-
|
|
90
|
+
~~~text
|
|
70
91
|
There is an in-progress Hive Change Record: <chg_id>.
|
|
71
92
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
Recommended next step: finish or isolate the in-progress change before starting a new requirement.
|
|
94
|
+
|
|
95
|
+
Refresh/check the current change if the diff changed:
|
|
96
|
+
```bash
|
|
97
|
+
cd <target repo root>
|
|
98
|
+
hive-lite check <chg_id>
|
|
78
99
|
```
|
|
79
100
|
|
|
101
|
+
Run validation if check says validation is needed:
|
|
102
|
+
```bash
|
|
103
|
+
cd <target repo root>
|
|
104
|
+
hive-lite validate <chg_id>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Accept and commit when evidence is acceptable:
|
|
108
|
+
```bash
|
|
109
|
+
cd <target repo root>
|
|
110
|
+
hive-lite accept <chg_id> --commit -m "<message>"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Or create a separate worktree for the new requirement:
|
|
114
|
+
```bash
|
|
115
|
+
cd <target repo root>
|
|
116
|
+
git worktree add ../<new-worktree-dir> -b <branch-name>
|
|
117
|
+
cd ../<new-worktree-dir>
|
|
118
|
+
```
|
|
119
|
+
~~~
|
|
120
|
+
|
|
80
121
|
Use the status JSON's latest change id. If `currentDiffMatchesLatestChange` is false, recommend refreshing with:
|
|
81
122
|
|
|
82
123
|
```bash
|
|
124
|
+
cd <target repo root>
|
|
83
125
|
hive-lite check <chg_id>
|
|
84
126
|
```
|
|
85
127
|
|
|
@@ -89,20 +131,28 @@ Meaning: the latest Hive Change Record was accepted, but no commit was created.
|
|
|
89
131
|
|
|
90
132
|
Stop and present options:
|
|
91
133
|
|
|
92
|
-
|
|
134
|
+
~~~text
|
|
93
135
|
The latest Hive change was accepted but not committed: <chg_id>.
|
|
94
136
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
Recommended option: commit the accepted Hive change.
|
|
138
|
+
```bash
|
|
139
|
+
cd <target repo root>
|
|
140
|
+
hive-lite accept <chg_id> --commit -m "<message>"
|
|
99
141
|
```
|
|
100
142
|
|
|
101
|
-
|
|
143
|
+
Alternative: create a separate worktree for the new requirement.
|
|
144
|
+
```bash
|
|
145
|
+
cd <target repo root>
|
|
146
|
+
git worktree add ../<new-worktree-dir> -b <branch-name>
|
|
147
|
+
cd ../<new-worktree-dir>
|
|
148
|
+
```
|
|
102
149
|
|
|
150
|
+
After the chosen action, rerun:
|
|
103
151
|
```bash
|
|
104
|
-
|
|
152
|
+
cd <target repo root>
|
|
153
|
+
hive-lite status --json
|
|
105
154
|
```
|
|
155
|
+
~~~
|
|
106
156
|
|
|
107
157
|
## Safety Rules
|
|
108
158
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hive-lite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Local Project Map + Change Control for coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codex",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"registry": "https://registry.npmjs.org"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"test": "node test/smoke.js",
|
|
35
|
-
"check": "node --check bin/hive.js && node --check src/cli.js && node --check src/lib/yaml.js && node --check src/lib/map.js && node --check src/lib/context.js && node --check src/lib/change.js && node --check src/lib/risk.js && node --check src/lib/evidence.js && node --check src/lib/roles.js && node --check src/lib/scope.js && node --check src/lib/health.js && node --check src/lib/status.js && node --check src/lib/next.js && node --check src/lib/skills.js && node --check src/lib/git.js && node --check test/smoke.js"
|
|
34
|
+
"test": "node test/intent.js && node test/operator.js && node test/smoke.js",
|
|
35
|
+
"check": "node --check bin/hive.js && node --check src/cli.js && node --check src/lib/yaml.js && node --check src/lib/map.js && node --check src/lib/context.js && node --check src/lib/change.js && node --check src/lib/intent.js && node --check src/lib/operator.js && node --check src/lib/risk.js && node --check src/lib/evidence.js && node --check src/lib/roles.js && node --check src/lib/scope.js && node --check src/lib/health.js && node --check src/lib/status.js && node --check src/lib/next.js && node --check src/lib/skills.js && node --check src/lib/git.js && node --check test/intent.js && node --check test/operator.js && node --check test/smoke.js"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=16"
|