kc-beta 0.5.6 → 0.6.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/QUICKSTART.md +17 -4
- package/README.md +58 -11
- package/bin/kc-beta.js +35 -1
- package/package.json +1 -1
- package/src/agent/bundle-tree.js +553 -0
- package/src/agent/context.js +40 -1
- package/src/agent/engine.js +828 -31
- package/src/agent/llm-client.js +67 -18
- package/src/agent/pipelines/distillation.js +15 -0
- package/src/agent/pipelines/extraction.js +60 -3
- package/src/agent/pipelines/finalization.js +186 -0
- package/src/agent/pipelines/index.js +8 -0
- package/src/agent/pipelines/initializer.js +40 -0
- package/src/agent/pipelines/production-qc.js +63 -13
- package/src/agent/pipelines/skill-authoring.js +136 -7
- package/src/agent/skill-loader.js +54 -4
- package/src/agent/task-manager.js +81 -3
- package/src/agent/tools/agent-tool.js +283 -35
- package/src/agent/tools/bundle-search.js +146 -0
- package/src/agent/tools/document-chunk.js +246 -0
- package/src/agent/tools/document-classify.js +311 -0
- package/src/agent/tools/document-parse.js +8 -1
- package/src/agent/tools/phase-advance.js +30 -7
- package/src/agent/tools/registry.js +10 -0
- package/src/agent/tools/rule-catalog.js +17 -3
- package/src/agent/tools/sandbox-exec.js +30 -0
- package/src/agent/tools/workflow-run.js +34 -1
- package/src/agent/workspace.js +168 -14
- package/src/cli/components.js +165 -17
- package/src/cli/index.js +166 -19
- package/src/cli/meme.js +58 -0
- package/src/config.js +39 -2
- package/src/providers.js +26 -0
- package/template/skills/en/meta-meta/evolution-loop/SKILL.md +13 -1
- package/template/skills/en/meta-meta/rule-extraction/SKILL.md +74 -0
- package/template/skills/zh/meta-meta/evolution-loop/SKILL.md +7 -1
- package/template/skills/zh/meta-meta/rule-extraction/SKILL.md +73 -0
package/QUICKSTART.md
CHANGED
|
@@ -93,7 +93,12 @@ Once regulations and samples are in place, the agent advances through 6 phases a
|
|
|
93
93
|
| Command | Description |
|
|
94
94
|
|---------|-------------|
|
|
95
95
|
| `/help` | Show available commands |
|
|
96
|
-
| `/status` | Session info, model, phase, context usage |
|
|
96
|
+
| `/status` | Session info, model, phase, context usage, parallelism |
|
|
97
|
+
| `/tasks` | Show ralph-loop task list and progress |
|
|
98
|
+
| `/tools` | List registered tools + which phase gates each (v0.6.0) |
|
|
99
|
+
| `/phase [sub]` | advance / status / `<name>` — manual phase override |
|
|
100
|
+
| `/parallelism [N]` | Show / set parallel worker count 1-8 (v0.6.0) |
|
|
101
|
+
| `/schedule` | Show scheduled ingestion jobs and recent logs |
|
|
97
102
|
| `/clear` | Clear conversation history |
|
|
98
103
|
| `/compact` | Summarize older messages to reduce context usage |
|
|
99
104
|
| `/sessions` | List all sessions |
|
|
@@ -101,9 +106,12 @@ Once regulations and samples are in place, the agent advances through 6 phases a
|
|
|
101
106
|
| `/rename <name>` | Rename current session |
|
|
102
107
|
| `/exit` | Save state and quit |
|
|
103
108
|
|
|
104
|
-
## Keyboard Shortcuts
|
|
109
|
+
## Keyboard Shortcuts (v0.6.0 TUI upgrades)
|
|
105
110
|
|
|
106
|
-
- **Enter** — Send message
|
|
111
|
+
- **Enter** — Send message (or queue it if the agent is mid-turn)
|
|
112
|
+
- **Left / Right** — Move cursor inside the current line
|
|
113
|
+
- **Up / Down** — Navigate session-local input history
|
|
114
|
+
- **Ctrl+A / Ctrl+E** — Jump to start / end of line
|
|
107
115
|
- **Ctrl+C** — Clear queue (if streaming) or save & exit
|
|
108
116
|
- **Ctrl+D** — Save & exit
|
|
109
117
|
|
|
@@ -111,7 +119,12 @@ Once regulations and samples are in place, the agent advances through 6 phases a
|
|
|
111
119
|
|
|
112
120
|
The status bar shows:
|
|
113
121
|
- Session ID and current phase
|
|
114
|
-
- **Context usage**: `CTX: 45.2k/200k (23%)` —
|
|
122
|
+
- **Context usage**: `CTX: 45.2k/200k (23%)` — smoothed over 30 samples;
|
|
123
|
+
shows `· peak 52.1k` when the session has spiked meaningfully above
|
|
124
|
+
the current value
|
|
125
|
+
- **Parallelism**: effective worker count (silently clamped to 1 unless
|
|
126
|
+
`KC_PARALLELISM_VERIFIED=1` — see the "Parallel Ralph-Loop" section
|
|
127
|
+
of the README)
|
|
115
128
|
|
|
116
129
|
## Per-Project Config
|
|
117
130
|
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Requires **Node.js 20+**. See [QUICKSTART.md](./QUICKSTART.md) for the full setu
|
|
|
29
29
|
|
|
30
30
|
## What It Does
|
|
31
31
|
|
|
32
|
-
KC drives a single coding agent through
|
|
32
|
+
KC drives a single coding agent through seven phases:
|
|
33
33
|
|
|
34
34
|
| Phase | What it does |
|
|
35
35
|
|-------|-------------|
|
|
@@ -39,10 +39,11 @@ KC drives a single coding agent through six phases:
|
|
|
39
39
|
| **SKILL_TESTING** | Run skills on samples, iterate via the evolution loop |
|
|
40
40
|
| **DISTILLATION** | Convert proven skills into cheap worker-LLM workflows |
|
|
41
41
|
| **PRODUCTION_QC** | Run workflows on production batches with confidence-based sampling |
|
|
42
|
+
| **FINALIZATION** | Package deliverables — canonical layout, README, coverage report, final dashboard (v0.6.0) |
|
|
42
43
|
|
|
43
44
|
The conductor LLM (your main model) drives all reasoning. Worker LLM tools
|
|
44
|
-
are gated to DISTILL phases
|
|
45
|
-
high-quality output.
|
|
45
|
+
are gated to DISTILL + FINALIZATION phases, so the build phase is always
|
|
46
|
+
grounded in high-quality output.
|
|
46
47
|
|
|
47
48
|
---
|
|
48
49
|
|
|
@@ -127,8 +128,12 @@ the task manager only tells it *what's next*.
|
|
|
127
128
|
|
|
128
129
|
```
|
|
129
130
|
/help Show available commands
|
|
130
|
-
/status Session, model, phase, context usage
|
|
131
|
+
/status Session, model, phase, context usage, parallelism
|
|
131
132
|
/tasks Show task list and progress
|
|
133
|
+
/tools List registered tools + which phase gates each (v0.6.0)
|
|
134
|
+
/phase [sub] advance | status | <name> — manual phase override
|
|
135
|
+
/parallelism [N] Show / set parallel ralph-loop worker count 1-8 (v0.6.0)
|
|
136
|
+
/schedule Show scheduled ingestion jobs
|
|
132
137
|
/clear Clear conversation (workspace preserved)
|
|
133
138
|
/compact Summarize older messages via the conductor
|
|
134
139
|
/sessions List all sessions
|
|
@@ -137,7 +142,12 @@ the task manager only tells it *what's next*.
|
|
|
137
142
|
/exit Save state and quit
|
|
138
143
|
```
|
|
139
144
|
|
|
140
|
-
`--en` / `--zh` flags override
|
|
145
|
+
`--en` / `--zh` / `--parallelism=N` flags override for one session without writing config.
|
|
146
|
+
|
|
147
|
+
**v0.6.0 TUI upgrades:** input stays active during streaming (type-ahead
|
|
148
|
+
queues automatically), left/right arrow keys move the cursor, up/down
|
|
149
|
+
recalls session history, Ctrl-A/Ctrl-E jump to start/end. CTX status bar
|
|
150
|
+
smooths over 30 samples and tracks a session peak.
|
|
141
151
|
|
|
142
152
|
---
|
|
143
153
|
|
|
@@ -156,6 +166,27 @@ demand, rather than always-on dependencies:
|
|
|
156
166
|
Both are bundled in `template/skills/{en,zh}/meta-meta/` and discovered by
|
|
157
167
|
the skill loader at startup.
|
|
158
168
|
|
|
169
|
+
## Parallel Ralph-Loop (v0.6.0)
|
|
170
|
+
|
|
171
|
+
`--parallelism=N` (1-8) runs up to N verification tasks concurrently via
|
|
172
|
+
subagent orchestration. Safety guardrails:
|
|
173
|
+
|
|
174
|
+
- Silently clamps to 1 unless `KC_PARALLELISM_VERIFIED=1` is set in the
|
|
175
|
+
workspace `.env` — prevents accidental multi-hundred-dollar runs before
|
|
176
|
+
you've confirmed heap behavior.
|
|
177
|
+
- `logs/heap.jsonl` is sampled every 60 s permanently. Run
|
|
178
|
+
`node scripts/heap-analyze.js` to get a FLAT / DRIFTING / GROWING
|
|
179
|
+
verdict from the current workspace's run.
|
|
180
|
+
- `rules/catalog.json` writes serialize through a POSIX file lock;
|
|
181
|
+
concurrent workers no longer race each other.
|
|
182
|
+
- `agent_tool` operations: `spawn` / `wait` / `poll` / `list` / `kill`
|
|
183
|
+
give the agent visibility and control over its own subagents. A
|
|
184
|
+
`stale_subagents` pipeline event on phase_advance lets the main agent
|
|
185
|
+
clean up before moving on.
|
|
186
|
+
|
|
187
|
+
Recommended flow: run a 2h serial baseline first, confirm the heap
|
|
188
|
+
verdict is FLAT, then set `KC_PARALLELISM_VERIFIED=1` and try N=2.
|
|
189
|
+
|
|
159
190
|
---
|
|
160
191
|
|
|
161
192
|
## Configuration
|
|
@@ -185,13 +216,29 @@ Quality Thresholds, Language.
|
|
|
185
216
|
|
|
186
217
|
## Status
|
|
187
218
|
|
|
188
|
-
**v0.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
219
|
+
**v0.6.0 — first architectural beta.** This release lands:
|
|
220
|
+
|
|
221
|
+
- Parallel ralph-loop (up to 8 concurrent workers) with a heap-safety
|
|
222
|
+
conformance gate
|
|
223
|
+
- Native chunker + RAG (onion-peeler + CJK bigram keyword index +
|
|
224
|
+
one-shot LLM bundle classifier, ported from the AMC verification app)
|
|
225
|
+
- Source-context auto-attach on skill_authoring tasks (rule NL + evidence
|
|
226
|
+
chunks + sibling rules injected into the prompt, no manual search needed)
|
|
227
|
+
- Workspace file locking for shared coordination files (`rules/catalog.json`,
|
|
228
|
+
`rules/manifest.json`, `tasks.json`, etc.)
|
|
229
|
+
- `agent_tool` gets `wait` / `poll` / `list` / `kill` operations +
|
|
230
|
+
`stale_subagents` phase-advance signal
|
|
231
|
+
- New FINALIZATION phase packages the session into a shippable deliverable
|
|
232
|
+
(canonical `rule_skills/` layout + README + coverage report + final
|
|
233
|
+
dashboard)
|
|
234
|
+
- Input stays active during streaming (type-ahead queue), arrow keys +
|
|
235
|
+
history recall, CTX smoothing + peak, per-provider context-limit caps,
|
|
236
|
+
`/tools`, `/parallelism`, and more
|
|
237
|
+
|
|
238
|
+
See [DEV_LOG.md](./DEV_LOG.md) for the full v0.6.0 change breakdown and
|
|
239
|
+
[docs/update_design_v5.md](./docs/update_design_v5.md) for the plan that
|
|
240
|
+
drove it.
|
|
193
241
|
|
|
194
|
-
We are inviting a small group of developer users to test before public launch.
|
|
195
242
|
Bug reports and PRs welcome at <https://github.com/kitchen-engineer42/kc-cli>.
|
|
196
243
|
|
|
197
244
|
---
|
package/bin/kc-beta.js
CHANGED
|
@@ -1,16 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
|
|
7
|
+
// Parse --en / --zh / --parallelism from anywhere in argv
|
|
4
8
|
const args = process.argv.slice(2);
|
|
5
9
|
let languageOverride = null;
|
|
10
|
+
let parallelismOverride = null;
|
|
6
11
|
const filtered = [];
|
|
7
12
|
for (const arg of args) {
|
|
8
13
|
if (arg === "--en") languageOverride = "en";
|
|
9
14
|
else if (arg === "--zh") languageOverride = "zh";
|
|
15
|
+
else if (arg.startsWith("--parallelism=")) {
|
|
16
|
+
const n = parseInt(arg.slice("--parallelism=".length), 10);
|
|
17
|
+
if (Number.isFinite(n) && n >= 1) parallelismOverride = Math.min(n, 8);
|
|
18
|
+
}
|
|
10
19
|
else filtered.push(arg);
|
|
11
20
|
}
|
|
12
21
|
const subcommand = filtered[0];
|
|
13
22
|
|
|
23
|
+
// B3: Surface parallelism intent via env so loadSettings() picks it up uniformly.
|
|
24
|
+
// Matches the workspace-.env pattern other KC configs use.
|
|
25
|
+
if (parallelismOverride !== null) {
|
|
26
|
+
process.env.KC_PARALLELISM = String(parallelismOverride);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// A4: Startup banner. Prevents the v0.3.2-ghost-install problem (user ran
|
|
30
|
+
// 4 releases worth of "fixes" that were silently not installed because of
|
|
31
|
+
// a stale global npm cache — invisible in field trials until v0.5.5).
|
|
32
|
+
// Always-on; prints version + resolved script path so users can immediately
|
|
33
|
+
// see what's running. Skipped for `--version` / `--help` because those have
|
|
34
|
+
// their own output.
|
|
35
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
36
|
+
const __dirname = dirname(__filename);
|
|
37
|
+
function printBanner() {
|
|
38
|
+
try {
|
|
39
|
+
const pkg = JSON.parse(readFileSync(resolve(__dirname, "..", "package.json"), "utf-8"));
|
|
40
|
+
const scriptPath = __filename;
|
|
41
|
+
process.stderr.write(`⏵⏵ KC Agent CLI v${pkg.version} · ${scriptPath}\n`);
|
|
42
|
+
} catch { /* package.json missing or unreadable — silent */ }
|
|
43
|
+
}
|
|
44
|
+
const suppressBanner = args.includes("--version") || args.includes("-v") ||
|
|
45
|
+
args.includes("--help") || args.includes("-h");
|
|
46
|
+
if (!suppressBanner) printBanner();
|
|
47
|
+
|
|
14
48
|
(async () => {
|
|
15
49
|
if (subcommand === "onboard" || subcommand === "setup") {
|
|
16
50
|
const { onboard } = await import("../src/cli/onboard.js");
|