@ngockhoale/ukit 3.0.12 → 3.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -0
  3. package/manifests/documentation.yaml +12 -0
  4. package/manifests/platform.full.yaml +24 -0
  5. package/package.json +1 -1
  6. package/scripts/bench/data-foundation.mjs +368 -50
  7. package/src/cli/commands/doctor.js +232 -3
  8. package/src/cli/commands/feedback.js +64 -1
  9. package/src/cli/commands/install.js +18 -0
  10. package/src/cli/commands/memory.js +42 -37
  11. package/src/cli/commands/telemetry.js +460 -0
  12. package/src/cli/index.js +7 -0
  13. package/src/core/agentRuntime/adapters.js +83 -2
  14. package/src/core/agentRuntime/diagnostics.js +104 -0
  15. package/src/core/agentRuntime/supervisor.js +137 -0
  16. package/src/core/agentRuntime/telemetry.js +204 -0
  17. package/src/core/memory/memoryEmit.js +131 -0
  18. package/src/core/memory/memoryHit.js +1 -1
  19. package/src/core/memory/migrate.js +18 -11
  20. package/src/core/memory/migrateMapping.js +15 -7
  21. package/src/core/memory/mutateMemory.js +22 -4
  22. package/src/core/memory/recordIndex.js +10 -3
  23. package/src/core/memory/recordStore.js +28 -3
  24. package/src/core/memory/retrieval.js +79 -38
  25. package/src/core/memory/store.js +37 -37
  26. package/src/core/memory/storeV2.js +28 -25
  27. package/src/core/memory/storeV2Loader.js +2 -2
  28. package/src/core/observability/adapters/ingest.js +576 -0
  29. package/src/core/observability/analytics/anomalies.js +415 -0
  30. package/src/core/observability/analytics/summary.js +16 -1
  31. package/src/core/observability/emit/config.js +69 -1
  32. package/src/core/observability/emit/crash.js +434 -0
  33. package/src/core/observability/emit/lifecycle.js +349 -0
  34. package/src/core/observability/emit/recorder.js +135 -9
  35. package/src/core/observability/evaluation/aiPacket.js +52 -10
  36. package/src/core/observability/evaluation/outcomes.js +95 -0
  37. package/src/core/observability/evaluation/runner.js +225 -0
  38. package/src/core/observability/privacy/allowlist.js +23 -3
  39. package/src/core/observability/schema/compatibility.js +48 -3
  40. package/src/core/observability/schema/constants.js +5 -0
  41. package/src/core/observability/schema/registry.js +57 -0
  42. package/src/core/observability/schema/validate.js +68 -6
  43. package/src/core/observability/segments/internal.js +42 -8
  44. package/src/core/observability/segments/readSegments.js +35 -1
  45. package/src/core/observability/segments/recovery.js +3 -2
  46. package/src/core/observability/segments/retention.js +137 -33
  47. package/src/core/observability/support/projector.js +88 -18
  48. package/src/core/observability/support/provision.js +160 -0
  49. package/src/core/observability/support/renderer.js +2 -2
  50. package/src/core/observability/support/schedule.js +174 -0
  51. package/src/decision/registry.js +144 -0
  52. package/src/decision/reviewVerdict.js +309 -0
  53. package/template_project/.claude/agents/code-reviewer.md +25 -1
  54. package/template_project/.claude/agents/ukit-small-task-maintainer.md +16 -0
  55. package/template_project/.claude/commands/ukit/handoff-fullstack.md +2 -0
  56. package/template_project/.claude/commands/ukit/handoff-review.md +12 -0
  57. package/template_project/.claude/hooks/auto-allow-bash.sh +7 -1
  58. package/template_project/.claude/hooks/auto-prune-bash.sh +16 -7
  59. package/template_project/.claude/hooks/verification-guard.sh +13 -4
  60. package/template_project/.claude/ukit/index/review-verdict.mjs +592 -0
  61. package/template_project/.claude/ukit/index/sidecar-decision.mjs +595 -0
  62. package/template_project/.claude/ukit/index/unic-decision.mjs +10 -1
  63. package/template_project/.claude/ukit/runtime/async-lock.mjs +26 -0
  64. package/template_project/.codex/settings.json +3 -0
  65. package/template_project/.omp/agents/code-reviewer.md +25 -1
  66. package/template_project/.omp/agents/ukit-small-task-maintainer.md +16 -0
@@ -48,6 +48,26 @@ If any input is missing, return `CHANGES-REQUESTED` with reason "incomplete hand
48
48
  - **APPROVED-WITH-MINOR** — Minor naming / doc / style issues. Logged on task file but handoff allowed.
49
49
  - **APPROVED** — Clean.
50
50
 
51
+ ### Stage gate — verdict emission (unic-decision)
52
+
53
+ You generate the findings; the FINAL verdict/bucket classification is a bounded
54
+ decision owned by the local decision model when staged. Read
55
+ `decisionPlane.families.review.stage` from `.ukit/storage/config.json`:
56
+
57
+ - `off` (default) or any adapter failure (`outcomeClass` ≠ `accepted`/`partial`) →
58
+ you emit the verdict directly, exactly as today; the deterministic severity
59
+ aggregate (any critical → CHANGES-REQUESTED; ≥1 important or any
60
+ unclassified/unknown severity → APPROVED-WITH-MINOR; else APPROVED) stays
61
+ authoritative.
62
+ - not `off` → emit the verdict via `node .claude/ukit/index/review-verdict.mjs`
63
+ (registered key `review.verdict.v1`): pipe your extracted findings as JSON on
64
+ stdin — whitelisted fields only (`id`, `severity`, `file`, `line`, short
65
+ `claim`; never diff hunks or secrets). Use the adapter's `verdict`/`buckets`
66
+ fields in the `## Reviewer Verdict` block.
67
+
68
+ Model isolation is preserved: the verdict pass runs on the local unic-decision
69
+ model, so reviewer ≠ executor still stands.
70
+
51
71
  ### Output (append to task file as `## Reviewer Verdict`)
52
72
 
53
73
  ```
@@ -139,7 +159,11 @@ additions:
139
159
  `node .claude/ukit/index/review-panel-aggregate.mjs <TASK-xxx.md...>` and hands you
140
160
  the output, the lead fills `AGREEMENT_MAP` with the emitted finding → members map
141
161
  and applies the lead-judgment buckets to every finding: **Act on** / **Consider** /
142
- **Noted** / **Dismissed**.
162
+ **Noted** / **Dismissed**. When `decisionPlane.families.review.stage` is not `off`,
163
+ the lead's bucketing and panel verdict go through
164
+ `node .claude/ukit/index/review-verdict.mjs --panel` (`review.finding-bucket.v1` /
165
+ `review.panel-verdict.v1`) per the stage gate above — the deterministic aggregate
166
+ stays authoritative at `off` or on adapter failure.
143
167
  - `consensus≥2 identical findings = high signal`: a finding reported by two or more
144
168
  panel members is high-signal and must not be bucketed below **Consider** without a
145
169
  stated reason.
@@ -27,6 +27,22 @@ You are UKit's internal small-task maintainer. You run as a sidecar/parallel/non
27
27
  - Keeping agent context compact without removing existing lanes: Claude PreCompact/reinject stays active and Codex Desktop soft handoffs use `compact.codexContext.compactTarget` (default 150 lines; preferred 120-150; hard max 170) while preserving critical state.
28
28
  - Small, reversible UKit runtime maintenance decisions.
29
29
 
30
+ ## Bounded Decisions (stage-gated unic-decision)
31
+
32
+ The six bounded decisions enumerated in `.codex/settings.json` `smallTaskModel.decisionPolicy.decisions` — `fast-vs-slow-lane`, `safe-vs-risky-lane`, `skill-routing-needed`, `step-budget-enough`, `compact-now-or-later`, `summarize-docs-or-keep-detail` — consult `unic-decision` first via the installed CLI when the decision-plane stage allows:
33
+
34
+ ```
35
+ node .claude/ukit/index/sidecar-decision.mjs --decision <name> [--root <dir>] # context JSON on stdin
36
+ ```
37
+
38
+ The CLI resolves `decisionPlane.families.workflow.stage` and owns the name → `workflow.*` decision-key mapping (`--list` prints it):
39
+
40
+ - `off` (default): the CLI's deterministic rules answer directly — zero transport, authoritative.
41
+ - `shadow`: run the batch for comparison only; the deterministic rule answer stays authoritative.
42
+ - `canary`/`default`: a valid unic-decision answer wins; an invalid or unavailable adapter falls back to the deterministic rule (`outcomeClass: 'unavailable'`).
43
+
44
+ `unic-decision` is the only model allowed in these decision steps — on any failure the deterministic rule is the fallback, never another LLM for the verdict. This lane's own model (`unic-lite`) keeps generative work only: summarization, doc maintenance, and cleanup — it never emits a verdict for these decisions.
45
+
30
46
  ## Never Use For
31
47
 
32
48
  - Security/auth/permission/secrets work.