hive-lite 0.1.0 → 0.1.1

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 CHANGED
@@ -301,6 +301,7 @@ The durable context router under `.hive/map`.
301
301
  `map prompt` prints a copyable prompt for an external agent CLI. It does not call an LLM and does not write map files. Its job is to help draft 3-8 high-value areas from repo evidence, then a human reviews and edits `.hive/map/areas.yaml`.
302
302
 
303
303
  `map health` is a deterministic readiness check for the Project Map. It does not score the map or repair it. It checks whether areas have enough precise routing, writable scope, entrypoints, validation, verification policy, and boundaries for `find` to safely generate an `edit_context` and for `check` to explain evidence needs.
304
+ An initialized repo with zero configured areas is `needs_mapping`, not `healthy`; it still needs `$hive-lite-map-maintainer` bootstrap work before real requirements can be routed safely.
304
305
 
305
306
  ```bash
306
307
  node bin/hive.js map health
@@ -352,6 +352,7 @@ node bin/hive.js map health --json
352
352
  | Value | Meaning | What To Do |
353
353
  | --- | --- | --- |
354
354
  | `healthy` | No critical/warning findings. | Map can support edit-ready areas. |
355
+ | `needs_mapping` | Map files are valid, but no areas are configured. | Bootstrap focused areas before starting requirements. |
355
356
  | `needs_attention` | Map has warnings. | Refresh or repair if relevant to the next requirement. |
356
357
  | `unsafe_for_edit_context` | Map has critical findings. | Repair map before relying on edit context. |
357
358
  | `invalid_map` | Map YAML/schema is missing or invalid. | Fix map files before using Hive Lite. |
@@ -30,18 +30,30 @@ hive-lite skills doctor --agent <codex|claude|gemini>
30
30
  hive-lite skills install --agent <codex|claude|gemini>
31
31
  ```
32
32
 
33
- ## Boundaries
33
+ ## Authority Boundary
34
34
 
35
- - Only edit:
35
+ This skill has lifecycle-scoped authority.
36
+
37
+ Bootstrap / repair exception:
38
+
39
+ - If Hive Lite is not initialized, partially initialized, or explicitly being initialized, this skill may run the approved bootstrap command, normally `hive-lite init`.
40
+ - Preserve setup side effects produced by the bootstrap command, including `.hive/config.yaml`, `.hive/map/*.yaml`, Hive Lite runtime/evidence directories, and `.gitignore` entries for those runtime/evidence directories.
41
+ - These bootstrap side effects are authorized setup artifacts. Do not delete, revert, or "clean up" them merely because they are outside `.hive/map/`.
42
+ - Do not hand-edit setup files as ordinary map maintenance. If setup files are missing or inconsistent after bootstrap, report a setup/repair condition or rerun an approved bootstrap/repair command when the task allows it.
43
+
44
+ Normal map-maintenance mode:
45
+
46
+ - After Hive Lite is initialized, directly edit only:
36
47
  - `.hive/map/project.yaml`
37
48
  - `.hive/map/areas.yaml`
38
49
  - `.hive/map/rules.yaml`
39
50
  - `.hive/map/validation.yaml`
40
- - Do not edit application source, tests, docs, generated artifacts, `.hive/context`, `.hive/changes`, or `.hive/deltas`.
51
+ - You may read `.hive/config.yaml`, `.gitignore`, and runtime metadata as needed, but must not directly modify them during normal map maintenance.
52
+ - Do not edit application source, tests, docs, generated artifacts, or non-map project files.
41
53
  - Do not run `hive check`, `hive validate`, `hive accept`, app formatters, app tests, commits, pushes, merges, deploys, or destructive git commands.
42
54
  - Do not call an LLM API from Hive Lite. Use Hive Lite CLI facts plus repo inspection.
43
55
  - Do not turn the map into a wiki. Only add information that improves `find` or `check`.
44
- - Durable map changes require human awareness. If you changed map files, summarize exactly what changed and tell the user to run/approve commit separately.
56
+ - Durable setup and map changes require human awareness. Summarize setup effects separately from map edits and tell the user to run/approve commit separately.
45
57
  - Apply Map Delta Candidates only when the user explicitly asked for or confirmed that action. Otherwise list/summarize them and stop.
46
58
 
47
59
  ## Find The CLI
@@ -98,6 +110,7 @@ hive-lite init
98
110
  ```
99
111
 
100
112
  This is setup work. Do it automatically; do not ask the user whether to initialize Hive Lite. Then continue with bootstrap or recovery.
113
+ Preserve all setup artifacts created by `hive-lite init`; do not remove `.hive/config.yaml` or Hive Lite `.gitignore` entries as part of cleanup.
101
114
 
102
115
  If the target directory is not a git repo or Hive Lite init fails, stop and report the blocker instead of inventing map files manually.
103
116
 
@@ -106,7 +119,7 @@ If the target directory is not a git repo or Hive Lite init fails, stop and repo
106
119
  Run:
107
120
 
108
121
  ```bash
109
- hive-lite map verify
122
+ hive-lite map verify --json
110
123
  ```
111
124
 
112
125
  If YAML is invalid, fix only `.hive/map/*.yaml` if the repair is obvious. If not obvious, stop with the exact file and parser error.
@@ -149,7 +162,7 @@ Read [repair-rules.md](references/repair-rules.md). Keep edits narrow:
149
162
  Always run:
150
163
 
151
164
  ```bash
152
- hive-lite map verify
165
+ hive-lite map verify --json
153
166
  hive-lite map health --json
154
167
  ```
155
168
 
@@ -181,6 +194,10 @@ Map maintenance complete.
181
194
  Mode:
182
195
  - <bootstrap|refresh|intent_repair|continuous_delta|recovery>
183
196
 
197
+ Hive Lite setup:
198
+ - <initialized with hive-lite init / no setup changes / setup repair needed>
199
+ - Setup artifacts preserved: <.hive/config.yaml, .gitignore runtime rules, runtime directories, or none>
200
+
184
201
  Changed map files:
185
202
  - <file or none>
186
203
 
@@ -188,7 +205,7 @@ Changed areas/profiles:
188
205
  - <area/profile id and concise change>
189
206
 
190
207
  Verification:
191
- - hive-lite map verify: <ok/fail>
208
+ - hive-lite map verify --json: <ok/fail>
192
209
  - hive-lite map health: <healthy/needs_attention/...>
193
210
  - focused find rerun, if applicable: <edit_context/discovery_context/needs_map>
194
211
 
@@ -19,12 +19,12 @@ hive-lite init
19
19
  hive-lite map prompt --focus "highest value product and workflow areas" --max-areas 8
20
20
  ```
21
21
 
22
- Then inspect repo files and edit `.hive/map/*.yaml` directly.
22
+ Preserve setup artifacts created by `hive-lite init`, including `.hive/config.yaml`, Hive Lite runtime/evidence directories, and `.gitignore` runtime/evidence rules. Then inspect repo files and edit `.hive/map/*.yaml` directly.
23
23
 
24
24
  Success:
25
25
 
26
- - `map verify` passes.
27
- - `map health` has no critical findings for the first useful areas.
26
+ - `map verify --json` reports `ok`.
27
+ - `map health --json` has no critical findings for the first useful areas.
28
28
  - A sample `find` can produce `edit_context`.
29
29
 
30
30
  ## refresh
@@ -33,8 +33,9 @@ hive-lite skills install --agent <codex|claude|gemini>
33
33
 
34
34
  ## Boundaries
35
35
 
36
- - Do not edit application source, tests, docs, `.gitignore`, generated artifacts, `.hive/context`, `.hive/changes`, or `.hive/deltas`.
36
+ - Do not directly edit application source, tests, docs, `.gitignore`, generated artifacts, `.hive/context`, `.hive/changes`, or `.hive/deltas`.
37
37
  - 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`.
38
+ - Bootstrap exception: when Hive Lite map files are missing, this skill may run `hive-lite init` and must preserve setup artifacts created by that command, including `.hive/config.yaml`, runtime/evidence directories, and Hive Lite `.gitignore` entries. Do not delete or revert those artifacts merely because they are outside `.hive/map/`.
38
39
  - 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.
39
40
  - During preflight, you may help finish or isolate pre-existing work only after explicit user confirmation.
40
41
  - Never discard changes with destructive commands such as `git reset --hard`, `git checkout --`, or forced branch switches.
@@ -72,7 +73,7 @@ If `.hive/map/project.yaml`, `.hive/map/areas.yaml`, `.hive/map/rules.yaml`, or
72
73
  hive-lite init
73
74
  ```
74
75
 
75
- Do this automatically; do not ask the user whether to initialize Hive Lite. Initialization is setup work, not the requested product change.
76
+ Do this automatically; do not ask the user whether to initialize Hive Lite. Initialization is setup work, not the requested product change. Preserve all setup artifacts created by `hive-lite init`; do not remove `.hive/config.yaml` or Hive Lite `.gitignore` entries as cleanup.
76
77
 
77
78
  Run:
78
79
 
@@ -93,7 +94,7 @@ After any preflight action, rerun `hive-lite status --json`; continue only when
93
94
  Run:
94
95
 
95
96
  ```bash
96
- hive-lite map verify
97
+ hive-lite map verify --json
97
98
  ```
98
99
 
99
100
  If YAML is invalid or required map files are missing, repair only `.hive/map/*.yaml` if the fix is obvious. Otherwise stop and report the blocker.
@@ -182,7 +183,7 @@ Repair principles:
182
183
  After each repair, run:
183
184
 
184
185
  ```bash
185
- hive-lite map verify
186
+ hive-lite map verify --json
186
187
  hive-lite map health --area <area_id> --json
187
188
  hive-lite find "<findIntent>" --json
188
189
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hive-lite",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local Project Map + Change Control for coding agents.",
5
5
  "keywords": [
6
6
  "codex",
@@ -37,4 +37,4 @@
37
37
  "engines": {
38
38
  "node": ">=16"
39
39
  }
40
- }
40
+ }
package/src/cli.js CHANGED
@@ -43,6 +43,14 @@ function parseArgs(args) {
43
43
  return { positional, flags };
44
44
  }
45
45
 
46
+ function isHelpArg(arg) {
47
+ return arg === 'help' || arg === '--help' || arg === '-h';
48
+ }
49
+
50
+ function isHelpFlag(arg) {
51
+ return arg === '--help' || arg === '-h';
52
+ }
53
+
46
54
  function printHelp() {
47
55
  console.log(`
48
56
  Hive Lite - local Project Map + Change Control
@@ -719,7 +727,12 @@ function printSkillsMutation(result) {
719
727
 
720
728
  async function main(argv) {
721
729
  const [command, subcommand, subsubcommand, ...rest] = argv;
722
- if (!command || command === 'help' || command === '--help' || command === '-h') {
730
+ if (!command || isHelpArg(command)) {
731
+ printHelp();
732
+ return;
733
+ }
734
+
735
+ if (subcommand === 'help' || isHelpFlag(subcommand) || isHelpFlag(subsubcommand) || rest.some(isHelpFlag)) {
723
736
  printHelp();
724
737
  return;
725
738
  }
package/src/lib/health.js CHANGED
@@ -877,6 +877,7 @@ function summarize(result, areas, findings) {
877
877
  };
878
878
  let status = 'healthy';
879
879
  if (result.invalidMap) status = 'invalid_map';
880
+ else if (result.emptyMap) status = 'needs_mapping';
880
881
  else if (counts.critical > 0) status = 'unsafe_for_edit_context';
881
882
  else if (counts.warnings > 0) status = 'needs_attention';
882
883
  return {
@@ -912,6 +913,16 @@ function evaluateMapHealth(root, options = {}) {
912
913
  }
913
914
 
914
915
  const allAreas = Array.isArray(areasDoc.areas) ? areasDoc.areas : [];
916
+ if (allAreas.length === 0) {
917
+ addFinding(findings, {
918
+ severity: 'critical',
919
+ code: 'NO_AREAS_CONFIGURED',
920
+ field: 'areas',
921
+ message: 'Project Map has no areas configured.',
922
+ impact: 'Hive Lite cannot safely route requirements until at least one focused area is mapped.',
923
+ fix: 'Use hive-lite-map-maintainer to bootstrap focused Project Map areas.',
924
+ });
925
+ }
915
926
  const selectedAreas = options.area ? allAreas.filter((area) => area.id === options.area) : allAreas;
916
927
  if (options.area && selectedAreas.length === 0) {
917
928
  addFinding(findings, {
@@ -951,7 +962,7 @@ function evaluateMapHealth(root, options = {}) {
951
962
  validateRisk(area, findings);
952
963
  }
953
964
 
954
- const base = { invalidMap, findings };
965
+ const base = { invalidMap, emptyMap: allAreas.length === 0, findings };
955
966
  const summarized = summarize(base, selectedAreas, findings);
956
967
  const areas = selectedAreas.map((area) => {
957
968
  const areaFindings = findings.filter((finding) => finding.areaId === area.id);
package/src/lib/next.js CHANGED
@@ -105,7 +105,7 @@ function mapMaintainerPrompt(mode) {
105
105
  if (mode === 'bootstrap') {
106
106
  return [
107
107
  '$hive-lite-map-maintainer',
108
- '这个项目第一次使用 Hive Lite,请初始化并建立第一版 3-8 个高价值 areas。',
108
+ '这个项目第一次使用 Hive Lite,请初始化并建立第一版 3-8 个高价值 areas。保留 hive-lite init 创建的 setup 产物,例如 .hive/config.yaml 和 .gitignore runtime 规则;初始化后只直接编辑 .hive/map/*.yaml。',
109
109
  ].join('\n');
110
110
  }
111
111
  if (mode === 'delta') {