kc-beta 0.7.5 → 0.8.3

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 (81) hide show
  1. package/README.md +47 -0
  2. package/package.json +3 -2
  3. package/src/agent/context.js +17 -1
  4. package/src/agent/engine.js +467 -100
  5. package/src/agent/llm-client.js +24 -1
  6. package/src/agent/pipelines/_advance-hints.js +92 -0
  7. package/src/agent/pipelines/_milestone-derive.js +325 -20
  8. package/src/agent/pipelines/skill-authoring.js +49 -3
  9. package/src/agent/tools/agent-tool.js +2 -2
  10. package/src/agent/tools/consult-skill.js +15 -0
  11. package/src/agent/tools/dashboard-render.js +48 -1
  12. package/src/agent/tools/document-parse.js +31 -2
  13. package/src/agent/tools/phase-advance.js +17 -13
  14. package/src/agent/tools/release.js +343 -7
  15. package/src/agent/tools/sandbox-exec.js +65 -8
  16. package/src/agent/tools/worker-llm-call.js +95 -15
  17. package/src/agent/workspace.js +25 -4
  18. package/src/cli/components.js +4 -1
  19. package/src/cli/index.js +125 -8
  20. package/src/config.js +19 -2
  21. package/src/marathon/driver.js +217 -0
  22. package/src/marathon/prompts.js +93 -0
  23. package/template/.env.template +17 -1
  24. package/template/AGENT.md +2 -2
  25. package/template/skills/en/auto-model-selection/SKILL.md +55 -35
  26. package/template/skills/en/bootstrap-workspace/SKILL.md +27 -0
  27. package/template/skills/en/compliance-judgment/SKILL.md +14 -0
  28. package/template/skills/en/confidence-system/SKILL.md +30 -8
  29. package/template/skills/en/corner-case-management/SKILL.md +53 -33
  30. package/template/skills/en/cross-document-verification/SKILL.md +88 -83
  31. package/template/skills/en/dashboard-reporting/SKILL.md +91 -66
  32. package/template/skills/en/dashboard-reporting/scripts/generate_dashboard.py +1 -1
  33. package/template/skills/en/data-sensibility/SKILL.md +19 -12
  34. package/template/skills/en/document-chunking/SKILL.md +99 -15
  35. package/template/skills/en/entity-extraction/SKILL.md +14 -4
  36. package/template/skills/en/quality-control/SKILL.md +23 -0
  37. package/template/skills/en/rule-extraction/SKILL.md +92 -94
  38. package/template/skills/en/rule-extraction/references/chunking-strategies.md +7 -78
  39. package/template/skills/en/skill-authoring/SKILL.md +85 -2
  40. package/template/skills/en/skill-creator/SKILL.md +25 -3
  41. package/template/skills/en/skill-to-workflow/SKILL.md +73 -1
  42. package/template/skills/en/task-decomposition/SKILL.md +1 -1
  43. package/template/skills/en/tree-processing/SKILL.md +1 -1
  44. package/template/skills/en/version-control/SKILL.md +15 -0
  45. package/template/skills/en/work-decomposition/SKILL.md +52 -32
  46. package/template/skills/phase_skills.yaml +5 -0
  47. package/template/skills/zh/auto-model-selection/SKILL.md +54 -33
  48. package/template/skills/zh/bootstrap-workspace/SKILL.md +27 -0
  49. package/template/skills/zh/compliance-judgment/SKILL.md +51 -37
  50. package/template/skills/zh/compliance-judgment/references/output-format.md +62 -62
  51. package/template/skills/zh/confidence-system/SKILL.md +34 -9
  52. package/template/skills/zh/corner-case-management/SKILL.md +71 -104
  53. package/template/skills/zh/cross-document-verification/SKILL.md +90 -195
  54. package/template/skills/zh/cross-document-verification/references/contradiction-taxonomy.md +36 -36
  55. package/template/skills/zh/dashboard-reporting/SKILL.md +82 -232
  56. package/template/skills/zh/dashboard-reporting/scripts/generate_dashboard.py +1 -1
  57. package/template/skills/zh/data-sensibility/SKILL.md +13 -0
  58. package/template/skills/zh/document-chunking/SKILL.md +101 -18
  59. package/template/skills/zh/document-parsing/SKILL.md +65 -65
  60. package/template/skills/zh/document-parsing/references/parser-catalog.md +26 -26
  61. package/template/skills/zh/entity-extraction/SKILL.md +78 -68
  62. package/template/skills/zh/evolution-loop/references/convergence-guide.md +38 -38
  63. package/template/skills/zh/quality-control/SKILL.md +23 -0
  64. package/template/skills/zh/quality-control/references/qa-layers.md +65 -65
  65. package/template/skills/zh/quality-control/references/sampling-strategies.md +49 -49
  66. package/template/skills/zh/rule-extraction/SKILL.md +199 -188
  67. package/template/skills/zh/rule-extraction/references/chunking-strategies.md +5 -78
  68. package/template/skills/zh/skill-authoring/SKILL.md +136 -58
  69. package/template/skills/zh/skill-authoring/references/skill-format-spec.md +39 -39
  70. package/template/skills/zh/skill-creator/SKILL.md +215 -201
  71. package/template/skills/zh/skill-creator/references/schemas.md +60 -60
  72. package/template/skills/zh/skill-to-workflow/SKILL.md +73 -1
  73. package/template/skills/zh/skill-to-workflow/references/worker-llm-catalog.md +24 -24
  74. package/template/skills/zh/task-decomposition/SKILL.md +1 -1
  75. package/template/skills/zh/task-decomposition/references/decision-matrix.md +54 -54
  76. package/template/skills/zh/tree-processing/SKILL.md +67 -63
  77. package/template/skills/zh/version-control/SKILL.md +15 -0
  78. package/template/skills/zh/version-control/references/trace-id-spec.md +34 -34
  79. package/template/skills/zh/work-decomposition/SKILL.md +52 -30
  80. package/template/workflows/common/llm_client.py +168 -0
  81. package/template/workflows/common/utils.py +132 -0
package/README.md CHANGED
@@ -21,12 +21,59 @@ npm install -g kc-beta
21
21
  kc-beta onboard # configure provider + API key
22
22
  cd my-project # a folder containing rules/ and samples/
23
23
  kc-beta # launch the agent
24
+
25
+ # v0.8.1+ unattended runs: type the slash command inside the kc-beta TUI
26
+ > /marathon Verify the new regulation against samples/. Iterate twice. If
27
+ most workflows work with regex, build another version using tier1+tier2
28
+ worker LLMs more aggressively.
29
+ # Marathon mode chains turns automatically. /marathon off disengages.
30
+ # /marathon status shows the driver state.
24
31
  ```
25
32
 
26
33
  Requires **Node.js 20+**. See [QUICKSTART.md](./QUICKSTART.md) for the full setup walkthrough.
27
34
 
28
35
  ---
29
36
 
37
+ ## v0.8 Highlights
38
+
39
+ - **`/marathon <goal>` slash command** (v0.8.1; replaces the v0.8.0
40
+ separate-process `kc-marathon` CLI). Activates an inline driver inside
41
+ the running kc-beta TUI. Goal embedded in the command. `/marathon off`
42
+ to disengage manually; `/marathon status` to inspect. F5
43
+ one-phase-per-prompt stays enabled for interactive sessions and
44
+ bypasses cleanly when marathon is active. Status-bar shows
45
+ `🏃 MARATHON` only when active — no clutter in normal mode. v0.8.0's
46
+ separate-process driver was scrapped after E2E #11 found drivers
47
+ died silently when their parent terminal closed (SIGHUP unhandled).
48
+ - **Skill usage counter** — passive Layer-B measurement of which skills
49
+ the engine actually ships to the LLM. `skill_byte_send` events go to
50
+ events.jsonl; the audit script aggregates per-phase × per-skill.
51
+ Agent-blind by design.
52
+ - **`worker_llm_call` batch mode** — `prompts: [...]` array input with
53
+ concurrency control (default 5, max 10). Pairs with a canonical
54
+ `workflows/common/llm_client.py` shim (taught in `skill-to-workflow`)
55
+ so distilled workflows route through the engine where possible and
56
+ log to `output/llm_ledger.jsonl` when they don't.
57
+ - **`sandbox_exec` timeout model** — default 120s (was 30s); per-call
58
+ `timeout_ms` up to 600s for known-slow commands. Configurable via
59
+ `KC_EXEC_DEFAULT_TIMEOUT_MS` + `KC_EXEC_MAX_TIMEOUT_MS`.
60
+ - **Prescriptive phase-advance hints** — refusal messages now name
61
+ concrete next-action artifacts (`workflows/<rule_id>/workflow_v1.py`,
62
+ `output/results/production_qc_results.json`, etc.) instead of
63
+ descriptive `engineCounts` only.
64
+ - **`check.py` substantiveness audit** — engine detects stub-shaped
65
+ rule_skills/<id>/check.py files (NOT_APPLICABLE-only returns with no
66
+ workflow delegation). Surfaced in milestones; opt-in enforcement via
67
+ `KC_ENFORCE_CHECK_PY_SUBSTANTIVE=1`.
68
+
69
+ Plus engine-fix carryover from the v0.7.5 audit cycle: H3 calibration
70
+ aggregator schema, milestone-derivation gaps (review_001.json + multi-
71
+ path coverage_report.md), VLM runtime hardcode (workspace .env overlay),
72
+ heap_mb periodic-write fix, stale release detection, taskboard skill
73
+ availability in every phase. Full list: see DEV_LOG v0.8 entry.
74
+
75
+ ---
76
+
30
77
  ## What It Does
31
78
 
32
79
  KC drives a single coding agent through seven phases:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kc-beta",
3
- "version": "0.7.5",
3
+ "version": "0.8.3",
4
4
  "description": "KC Agent — LLM document verification agent (pure Node.js CLI). Dual-licensed: PolyForm Noncommercial 1.0.0 for personal/noncommercial use; commercial license required for enterprise production. See LICENSE and LICENSE-COMMERCIAL.md.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,8 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "build:meme": "node scripts/build-meme.js",
21
- "prepublishOnly": "node scripts/build-meme.js"
21
+ "prepublishOnly": "node scripts/build-meme.js",
22
+ "test": "node scripts/run-tests.js"
22
23
  },
23
24
  "homepage": "https://github.com/kitchen-engineer42/kc-cli",
24
25
  "repository": {
@@ -152,10 +152,26 @@ export class ContextAssembler {
152
152
  * @param {string} [opts.projectMemory] - v0.7.0 B3: rules/PATTERNS.md
153
153
  * content. Capped at ~5 KB by the caller. Surfaced for phases the
154
154
  * work-decomposition skill operates in (skill_authoring + skill_testing).
155
+ * @param {string} [opts.marathonGoal] - v0.8.2 P12-A: the active marathon
156
+ * goal text. Pinned at the system-prompt layer (never windowed) for the
157
+ * duration of the marathon session. Surfaced only when marathon mode is
158
+ * active; absent otherwise. Fixes the v0.8.1 regression where the goal
159
+ * user_message got evicted by context_windowed before distillation, so
160
+ * agents reverted to default behavior mid-run.
155
161
  * @returns {string}
156
162
  */
157
- build({ agentMd, pipelineState, workspaceState, skillIndex, projectMemory } = {}) {
163
+ build({ agentMd, pipelineState, workspaceState, skillIndex, projectMemory, marathonGoal } = {}) {
158
164
  const parts = [AGENT_IDENTITY];
165
+ if (marathonGoal) {
166
+ parts.push(
167
+ "## Marathon goal (pinned for the duration of this session)\n\n" +
168
+ marathonGoal.trim() + "\n\n" +
169
+ "You are running in marathon mode — no manual user check-ins between " +
170
+ "phases. This goal is your north star; keep returning to it as you " +
171
+ "advance through the pipeline. If a continuation prompt focuses on " +
172
+ "phase mechanics, the goal above tells you *why*.",
173
+ );
174
+ }
159
175
  if (agentMd) parts.push(agentMd);
160
176
  if (skillIndex) parts.push(skillIndex);
161
177
  if (projectMemory) {