kc-beta 0.7.3 → 0.8.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 +57 -4
- package/bin/kc-beta.js +20 -6
- package/package.json +3 -2
- package/src/agent/engine.js +493 -132
- package/src/agent/pipelines/_advance-hints.js +92 -0
- package/src/agent/pipelines/_milestone-derive.js +387 -17
- package/src/agent/pipelines/initializer.js +4 -1
- package/src/agent/pipelines/skill-authoring.js +30 -1
- package/src/agent/skill-loader.js +433 -111
- package/src/agent/tools/agent-tool.js +2 -2
- package/src/agent/tools/consult-skill.js +127 -0
- package/src/agent/tools/copy-to-workspace.js +4 -3
- package/src/agent/tools/dashboard-render.js +48 -1
- package/src/agent/tools/document-parse.js +31 -2
- package/src/agent/tools/phase-advance.js +17 -13
- package/src/agent/tools/release.js +378 -8
- package/src/agent/tools/sandbox-exec.js +65 -8
- package/src/agent/tools/worker-llm-call.js +95 -15
- package/src/agent/tools/workspace-file.js +7 -7
- package/src/agent/workspace.js +25 -4
- package/src/cli/components.js +4 -1
- package/src/cli/index.js +97 -1
- package/src/config.js +20 -3
- package/src/marathon/driver.js +217 -0
- package/src/marathon/prompts.js +93 -0
- package/template/.env.template +16 -0
- package/template/AGENT.md +182 -7
- package/template/skills/en/{meta-meta/auto-model-selection → auto-model-selection}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/bootstrap-workspace → bootstrap-workspace}/SKILL.md +15 -0
- package/template/skills/{zh/meta → en}/compliance-judgment/SKILL.md +1 -0
- package/template/skills/en/{meta/confidence-system → confidence-system}/SKILL.md +1 -0
- package/template/skills/en/{meta/corner-case-management → corner-case-management}/SKILL.md +1 -0
- package/template/skills/en/{meta/cross-document-verification → cross-document-verification}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/dashboard-reporting → dashboard-reporting}/SKILL.md +1 -0
- package/template/skills/en/{meta/data-sensibility → data-sensibility}/SKILL.md +1 -0
- package/template/skills/{zh/meta → en}/document-chunking/SKILL.md +1 -0
- package/template/skills/en/{meta/document-parsing → document-parsing}/SKILL.md +1 -0
- package/template/skills/{zh/meta → en}/entity-extraction/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/evolution-loop → evolution-loop}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/pdf-review-dashboard → pdf-review-dashboard}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/quality-control → quality-control}/SKILL.md +10 -0
- package/template/skills/en/{meta-meta/rule-extraction → rule-extraction}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/rule-graph → rule-graph}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/skill-authoring → skill-authoring}/SKILL.md +40 -0
- package/template/skills/en/skill-creator/SKILL.md +2 -1
- package/template/skills/en/{meta-meta/skill-to-workflow → skill-to-workflow}/SKILL.md +58 -4
- package/template/skills/en/{meta-meta/task-decomposition → task-decomposition}/SKILL.md +1 -0
- package/template/skills/en/{meta/tree-processing → tree-processing}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/version-control → version-control}/SKILL.md +1 -0
- package/template/skills/en/{meta-meta/work-decomposition → work-decomposition}/SKILL.md +51 -6
- package/template/skills/phase_skills.yaml +112 -0
- package/template/skills/zh/{meta-meta/auto-model-selection → auto-model-selection}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/bootstrap-workspace → bootstrap-workspace}/SKILL.md +15 -0
- package/template/skills/zh/compliance-judgment/SKILL.md +83 -0
- package/template/skills/zh/{meta/confidence-system → confidence-system}/SKILL.md +1 -0
- package/template/skills/zh/{meta/corner-case-management → corner-case-management}/SKILL.md +1 -0
- package/template/skills/zh/{meta/cross-document-verification → cross-document-verification}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/dashboard-reporting → dashboard-reporting}/SKILL.md +1 -0
- package/template/skills/zh/{meta/data-sensibility → data-sensibility}/SKILL.md +1 -0
- package/template/skills/zh/document-chunking/SKILL.md +40 -0
- package/template/skills/zh/document-parsing/SKILL.md +102 -0
- package/template/skills/zh/entity-extraction/SKILL.md +121 -0
- package/template/skills/zh/{meta-meta/evolution-loop → evolution-loop}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/pdf-review-dashboard → pdf-review-dashboard}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/quality-control → quality-control}/SKILL.md +10 -0
- package/template/skills/zh/{meta-meta/rule-extraction → rule-extraction}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/rule-graph → rule-graph}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/skill-authoring → skill-authoring}/SKILL.md +40 -0
- package/template/skills/zh/skill-creator/SKILL.md +205 -200
- package/template/skills/zh/skill-to-workflow/SKILL.md +243 -0
- package/template/skills/zh/{meta-meta/task-decomposition → task-decomposition}/SKILL.md +1 -0
- package/template/skills/zh/tree-processing/SKILL.md +126 -0
- package/template/skills/zh/{meta-meta/version-control → version-control}/SKILL.md +1 -0
- package/template/skills/zh/{meta-meta/work-decomposition → work-decomposition}/SKILL.md +49 -4
- package/template/workflows/common/llm_client.py +168 -0
- package/template/workflows/common/utils.py +132 -0
- package/template/CLAUDE.md +0 -150
- package/template/skills/en/meta/compliance-judgment/SKILL.md +0 -82
- package/template/skills/en/meta/document-chunking/SKILL.md +0 -32
- package/template/skills/en/meta/entity-extraction/SKILL.md +0 -120
- package/template/skills/zh/meta/document-parsing/SKILL.md +0 -101
- package/template/skills/zh/meta/tree-processing/SKILL.md +0 -121
- package/template/skills/zh/meta-meta/skill-to-workflow/SKILL.md +0 -188
- /package/template/skills/en/{meta/compliance-judgment → compliance-judgment}/references/output-format.md +0 -0
- /package/template/skills/en/{meta/cross-document-verification → cross-document-verification}/references/contradiction-taxonomy.md +0 -0
- /package/template/skills/en/{meta-meta/dashboard-reporting → dashboard-reporting}/scripts/generate_dashboard.py +0 -0
- /package/template/skills/en/{meta/document-parsing → document-parsing}/references/parser-catalog.md +0 -0
- /package/template/skills/en/{meta-meta/evolution-loop → evolution-loop}/references/convergence-guide.md +0 -0
- /package/template/skills/en/{meta-meta/pdf-review-dashboard → pdf-review-dashboard}/scripts/generate_review.js +0 -0
- /package/template/skills/en/{meta-meta/quality-control → quality-control}/references/qa-layers.md +0 -0
- /package/template/skills/en/{meta-meta/quality-control → quality-control}/references/sampling-strategies.md +0 -0
- /package/template/skills/en/{meta-meta/rule-extraction → rule-extraction}/references/chunking-strategies.md +0 -0
- /package/template/skills/en/{meta-meta/skill-authoring → skill-authoring}/references/skill-format-spec.md +0 -0
- /package/template/skills/en/{meta-meta/skill-to-workflow → skill-to-workflow}/references/worker-llm-catalog.md +0 -0
- /package/template/skills/en/{meta-meta/task-decomposition → task-decomposition}/references/decision-matrix.md +0 -0
- /package/template/skills/en/{meta-meta/version-control → version-control}/references/trace-id-spec.md +0 -0
- /package/template/skills/zh/{meta/compliance-judgment → compliance-judgment}/references/output-format.md +0 -0
- /package/template/skills/zh/{meta/cross-document-verification → cross-document-verification}/references/contradiction-taxonomy.md +0 -0
- /package/template/skills/zh/{meta-meta/dashboard-reporting → dashboard-reporting}/scripts/generate_dashboard.py +0 -0
- /package/template/skills/zh/{meta/document-parsing → document-parsing}/references/parser-catalog.md +0 -0
- /package/template/skills/zh/{meta-meta/evolution-loop → evolution-loop}/references/convergence-guide.md +0 -0
- /package/template/skills/zh/{meta-meta/pdf-review-dashboard → pdf-review-dashboard}/scripts/generate_review.js +0 -0
- /package/template/skills/zh/{meta-meta/quality-control → quality-control}/references/qa-layers.md +0 -0
- /package/template/skills/zh/{meta-meta/quality-control → quality-control}/references/sampling-strategies.md +0 -0
- /package/template/skills/zh/{meta-meta/rule-extraction → rule-extraction}/references/chunking-strategies.md +0 -0
- /package/template/skills/zh/{meta-meta/skill-authoring → skill-authoring}/references/skill-format-spec.md +0 -0
- /package/template/skills/zh/{meta-meta/skill-to-workflow → skill-to-workflow}/references/worker-llm-catalog.md +0 -0
- /package/template/skills/zh/{meta-meta/task-decomposition → task-decomposition}/references/decision-matrix.md +0 -0
- /package/template/skills/zh/{meta-meta/version-control → version-control}/references/trace-id-spec.md +0 -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:
|
|
@@ -216,8 +263,8 @@ Quality Thresholds, Language.
|
|
|
216
263
|
|
|
217
264
|
## Status
|
|
218
265
|
|
|
219
|
-
**v0.7.
|
|
220
|
-
|
|
266
|
+
**v0.7.4 — phase-control fix + codex review re-attempt.** Architectural
|
|
267
|
+
payload from v0.6.0+ is still in place:
|
|
221
268
|
|
|
222
269
|
- Parallel ralph-loop (up to 8 concurrent workers) with a heap-safety
|
|
223
270
|
conformance gate
|
|
@@ -226,8 +273,14 @@ hardening track. Architectural payload from v0.6.0+ is still in place:
|
|
|
226
273
|
- Agent-owned task board: the agent reads the rule list from
|
|
227
274
|
`describeState`, decides decomposition (per-rule / grouped / range),
|
|
228
275
|
and calls `TaskCreate` / `TaskUpdate` / `TaskComplete` to drive the
|
|
229
|
-
Ralph loop
|
|
230
|
-
|
|
276
|
+
Ralph loop **within the current phase only** (v0.7.4). Source-context
|
|
277
|
+
auto-attach pulls rule NL + evidence chunks + sibling rules into each
|
|
278
|
+
task's prompt.
|
|
279
|
+
- Phase boundaries = user checkpoints: the Ralph loop exits at every
|
|
280
|
+
phase transition, returning control to the user. The engine doesn't
|
|
281
|
+
auto-advance; phase advance is explicit (agent's `phase_advance` tool
|
|
282
|
+
call or user re-prompt). Marathon-style end-to-end autonomy lives
|
|
283
|
+
outside the engine.
|
|
231
284
|
- Workspace file locking for shared coordination files (`rules/catalog.json`,
|
|
232
285
|
`rules/manifest.json`, `refs/manifest.json`, `tasks.json`,
|
|
233
286
|
`session-state.json`) — every writer goes through `withFileLock`.
|
package/bin/kc-beta.js
CHANGED
|
@@ -34,17 +34,31 @@ if (parallelismOverride !== null) {
|
|
|
34
34
|
// their own output.
|
|
35
35
|
const __filename = fileURLToPath(import.meta.url);
|
|
36
36
|
const __dirname = dirname(__filename);
|
|
37
|
-
function
|
|
37
|
+
function readPkgVersion() {
|
|
38
38
|
try {
|
|
39
39
|
const pkg = JSON.parse(readFileSync(resolve(__dirname, "..", "package.json"), "utf-8"));
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
return pkg.version || "unknown";
|
|
41
|
+
} catch { return "unknown"; }
|
|
42
|
+
}
|
|
43
|
+
function printBanner() {
|
|
44
|
+
try {
|
|
45
|
+
const v = readPkgVersion();
|
|
46
|
+
process.stderr.write(`⏵⏵ KC Agent CLI v${v} · ${__filename}\n`);
|
|
47
|
+
} catch { /* silent */ }
|
|
43
48
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
49
|
+
const isVersion = args.includes("--version") || args.includes("-v");
|
|
50
|
+
const isHelp = args.includes("--help") || args.includes("-h");
|
|
51
|
+
const suppressBanner = isVersion || isHelp;
|
|
46
52
|
if (!suppressBanner) printBanner();
|
|
47
53
|
|
|
54
|
+
// v0.7.5 G-F1: `--version` prints version and exits. Previously the flag
|
|
55
|
+
// suppressed the banner but fell through to TUI launch (audit confirmed
|
|
56
|
+
// during v0.7.4 testing). Print + exit before the subcommand dispatch.
|
|
57
|
+
if (isVersion) {
|
|
58
|
+
process.stdout.write(`${readPkgVersion()}\n`);
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
48
62
|
(async () => {
|
|
49
63
|
if (subcommand === "onboard" || subcommand === "setup") {
|
|
50
64
|
const { onboard } = await import("../src/cli/onboard.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kc-beta",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
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": {
|