hive-lite 0.1.9 → 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 +304 -31
- 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
package/src/lib/map.js
CHANGED
|
@@ -317,6 +317,24 @@ function currentMapFilesSection(result) {
|
|
|
317
317
|
return lines;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
function fromFindRepairRequirements(findContext) {
|
|
321
|
+
if (!findContext) return [];
|
|
322
|
+
return [
|
|
323
|
+
'Map Repair Draft Requirements:',
|
|
324
|
+
'- Account for `readable_reference`: put old peer files, copy sources, examples, and comparison-only files here instead of Direct Writable.',
|
|
325
|
+
'- Account for `writable_existing`: use exact existing files for registry hooks, routers, indexes, config, or other required update targets.',
|
|
326
|
+
'- Account for `writable_create_patterns`: use narrow create patterns for every new artifact family the intent must create.',
|
|
327
|
+
'- Account for `artifact_families`: declare trigger terms, `create_requires`, and required hooks for repeated provider/adapter/endpoint families.',
|
|
328
|
+
'- Account for `identity_aliases`: map user-facing names, model names, and vendor nicknames to canonical peer identities when identity routing matters.',
|
|
329
|
+
'- Account for `peer_file_templates`: add read-only candidate path templates for repeated peer file families; do not treat them as write permission.',
|
|
330
|
+
'- Account for required hooks: if an artifact family needs an existing registry/router/index update, add exact `writable_existing` coverage for that hook.',
|
|
331
|
+
'- Explain why old peer or copy-source files remain reference-only when the intent creates or targets a different peer identity.',
|
|
332
|
+
'- Explain why the selected Direct Writable scope is narrow, relevant to this intent, operation-specific, and not review-gated.',
|
|
333
|
+
'- Do not fix a map gap by moving broad fallback patterns into `writable_direct`.',
|
|
334
|
+
'',
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
|
|
320
338
|
function summarizeFindContext(context) {
|
|
321
339
|
if (!context) return null;
|
|
322
340
|
const scope = context.scope || {};
|
|
@@ -441,6 +459,11 @@ function repairFocusFromFind(findContext, userFocus) {
|
|
|
441
459
|
if (warnings.includes('TARGET_ENTITY_MISMATCH')) goals.push('add direct scope for the requested target identity or mark old peers as references');
|
|
442
460
|
if (warnings.includes('MISSING_ARTIFACT_FAMILY_SCOPE')) goals.push('add writable_create_patterns for required artifact families');
|
|
443
461
|
if (warnings.includes('MISSING_REQUIRED_HOOK_SCOPE')) goals.push('add writable_existing hook files required by the artifact family');
|
|
462
|
+
if (warnings.includes('AMBIGUOUS_TARGET_IDENTITY')) goals.push('clarify the target identity so Direct Writable is selected for one intent target');
|
|
463
|
+
if (warnings.includes('REFERENCE_DIRECT_ROLE_CONFLICT')) goals.push('separate readable_reference peer examples from update-capable Direct Writable scope');
|
|
464
|
+
if (warnings.includes('DIRECT_SCOPE_OPERATION_UNSPECIFIED')) goals.push('declare operations under writable_existing or writable_create_patterns');
|
|
465
|
+
if (warnings.includes('UNKNOWN_NEW_FILE')) goals.push('add an exact or narrow create capability for the new file, or remove it from the diff');
|
|
466
|
+
if (warnings.includes('LOW_CONFIDENCE_INTENT_WRITE_PLAN')) goals.push('add artifact_families and narrow write capabilities for the inferred write operation');
|
|
444
467
|
if (warnings.includes('MISSING_ENTRYPOINT')) goals.push('add durable entrypoints');
|
|
445
468
|
if (warnings.includes('MISSING_VALIDATION')) goals.push('add validation profile references');
|
|
446
469
|
if (warnings.includes('NO_CONFIDENT_AREA')) goals.push('create or refine a focused area');
|
|
@@ -481,6 +504,8 @@ function findContextPromptSection(findContext) {
|
|
|
481
504
|
...listLines(findContext.writePlan.blockingWarnings || [], (item) => `- ${item.code}: ${item.message}`),
|
|
482
505
|
'Reference files from write plan:',
|
|
483
506
|
...listLines(findContext.writePlan.referenceFiles || [], (file) => `- ${file.path}: ${file.reason || ''}`),
|
|
507
|
+
'Peer file template candidates from write plan:',
|
|
508
|
+
...listLines(findContext.writePlan.peerFileCandidates || [], (file) => `- ${file.artifact}: ${file.candidatePath || file.template} (read-only; not Direct Writable)`),
|
|
484
509
|
'',
|
|
485
510
|
] : []),
|
|
486
511
|
'Candidate/area scores:',
|
|
@@ -556,6 +581,19 @@ function buildMapPrompt(result) {
|
|
|
556
581
|
'',
|
|
557
582
|
...fromFindTask,
|
|
558
583
|
'',
|
|
584
|
+
...fromFindRepairRequirements(result.findContext),
|
|
585
|
+
'Context Gathering:',
|
|
586
|
+
'- Use the repo evidence below first; inspect additional files only when needed to avoid guessing paths, scripts, or entrypoints.',
|
|
587
|
+
'- Stop once the map draft or repair can name exact paths, active validation profiles, and any TODO uncertainty.',
|
|
588
|
+
'- Mark uncertain paths, validation, or risk items as TODOs instead of continuing broad architecture exploration.',
|
|
589
|
+
'',
|
|
590
|
+
'Completion Contract:',
|
|
591
|
+
result.findContext
|
|
592
|
+
? '- If editing-capable, finish by changing only the relevant `.hive/map/*.yaml` files and summarizing the exact map changes.'
|
|
593
|
+
: '- Finish with a concise Project Map draft, not an implementation plan.',
|
|
594
|
+
'- Do not include product-code edits or coding-agent instructions.',
|
|
595
|
+
'- Include verification commands needed for the human to confirm the map quality.',
|
|
596
|
+
'',
|
|
559
597
|
'Boundaries:',
|
|
560
598
|
'- Group areas by user intent or work area, not by a pure directory tree.',
|
|
561
599
|
'- Do not invent nonexistent paths.',
|
|
@@ -572,6 +610,12 @@ function buildMapPrompt(result) {
|
|
|
572
610
|
'- Prefer `writable_existing` for exact update targets and `writable_create_patterns` for new peer files when a repo has create/update distinctions.',
|
|
573
611
|
'- Put copy sources and peer examples under `readable_reference`, not under selected Direct Writable for new peer intents.',
|
|
574
612
|
'- Use `artifact_families` to declare required create artifacts and hook files for provider/adapter/endpoint families.',
|
|
613
|
+
'- Use `identity_aliases` when user-facing names such as ChatGPT, image2, or vendor nicknames should map to one canonical peer identity.',
|
|
614
|
+
'- Use `peer_file_templates` only as read-only candidate path hints; they never grant create or update permission.',
|
|
615
|
+
'- Relevant files, entrypoints, peer examples, and broad fallback scope are not write permission by themselves.',
|
|
616
|
+
'- Direct Writable is selected per intent; do not copy every writable file in an area into the selected edit target.',
|
|
617
|
+
'- For create intents, include narrow `writable_create_patterns` entries with `operations: [create_file]`, `artifact`, and `intent_kinds` when possible.',
|
|
618
|
+
'- For required existing hooks, include exact `writable_existing` entries with `operations: [update_existing]` and the hook artifact.',
|
|
575
619
|
'- Entrypoint roles must use this fixed taxonomy only: ' + roleListText() + '.',
|
|
576
620
|
'- Do not invent role names. If unsure, use `role: unknown` plus a TODO note.',
|
|
577
621
|
'- Add `source` and `confidence` to entrypoints when possible. Use `source: agent_draft` for your own draft and `confidence: low|medium|high`.',
|
|
@@ -616,6 +660,19 @@ function buildMapPrompt(result) {
|
|
|
616
660
|
' - phrase users may say',
|
|
617
661
|
' concepts:',
|
|
618
662
|
' - concept keyword',
|
|
663
|
+
' identity_aliases:',
|
|
664
|
+
' openai:',
|
|
665
|
+
' canonical: OpenAI',
|
|
666
|
+
' aliases:',
|
|
667
|
+
' - chatgpt',
|
|
668
|
+
' - gpt-image',
|
|
669
|
+
' - image2',
|
|
670
|
+
' peer_file_templates:',
|
|
671
|
+
' provider_proxy:',
|
|
672
|
+
' target_slot: provider',
|
|
673
|
+
' artifacts:',
|
|
674
|
+
' service_impl: path/to/{Provider}Provider.ts',
|
|
675
|
+
' request_dto: path/to/{Provider}Request.ts',
|
|
619
676
|
' entrypoints:',
|
|
620
677
|
' - path: path/to/real/file.ts',
|
|
621
678
|
' role: ui_component',
|