kc-beta 0.3.2 → 0.5.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 (43) hide show
  1. package/package.json +1 -1
  2. package/src/agent/confidence-scorer.js +8 -0
  3. package/src/agent/context.js +25 -0
  4. package/src/agent/corner-case-registry.js +5 -0
  5. package/src/agent/engine.js +514 -75
  6. package/src/agent/event-log.js +15 -2
  7. package/src/agent/history.js +91 -23
  8. package/src/agent/pipelines/initializer.js +3 -6
  9. package/src/agent/retry.js +9 -1
  10. package/src/agent/scheduler.js +276 -0
  11. package/src/agent/session-state.js +11 -2
  12. package/src/agent/task-manager.js +5 -0
  13. package/src/agent/tools/agent-tool.js +57 -14
  14. package/src/agent/tools/archive-file.js +94 -0
  15. package/src/agent/tools/copy-to-workspace.js +140 -0
  16. package/src/agent/tools/phase-advance.js +60 -0
  17. package/src/agent/tools/release.js +322 -0
  18. package/src/agent/tools/schedule-fetch.js +118 -0
  19. package/src/agent/tools/snapshot.js +101 -0
  20. package/src/agent/tools/workspace-file.js +10 -7
  21. package/src/agent/version-manager.js +29 -120
  22. package/src/agent/workspace.js +127 -4
  23. package/src/cli/components.js +4 -1
  24. package/src/cli/index.js +57 -4
  25. package/src/config.js +10 -1
  26. package/template/release-runtime/README.md.tmpl +84 -0
  27. package/template/release-runtime/kc_runtime/__init__.py +2 -0
  28. package/template/release-runtime/kc_runtime/confidence.py +93 -0
  29. package/template/release-runtime/kc_runtime/dashboard.py +208 -0
  30. package/template/release-runtime/render_dashboard.py +49 -0
  31. package/template/release-runtime/run.py +230 -0
  32. package/template/release-runtime/serve.sh +15 -0
  33. package/template/skills/en/meta-meta/bootstrap-workspace/SKILL.md +11 -0
  34. package/template/skills/en/meta-meta/quality-control/SKILL.md +13 -1
  35. package/template/skills/en/meta-meta/skill-to-workflow/SKILL.md +8 -0
  36. package/template/skills/en/meta-meta/task-decomposition/SKILL.md +13 -0
  37. package/template/skills/en/meta-meta/version-control/SKILL.md +13 -0
  38. package/template/skills/zh/meta-meta/bootstrap-workspace/SKILL.md +11 -0
  39. package/template/skills/zh/meta-meta/quality-control/SKILL.md +12 -0
  40. package/template/skills/zh/meta-meta/skill-to-workflow/SKILL.md +8 -0
  41. package/template/skills/zh/meta-meta/task-decomposition/SKILL.md +16 -0
  42. package/template/skills/zh/meta-meta/version-control/SKILL.md +13 -0
  43. package/template/workspace.gitignore +22 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kc-beta",
3
- "version": "0.3.2",
3
+ "version": "0.5.3",
4
4
  "description": "KC Agent — LLM document verification agent (pure Node.js CLI)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,6 +30,14 @@ export class ConfidenceScorer {
30
30
  this._loadCalibration();
31
31
  }
32
32
 
33
+ /** Re-point at a new workspace. Used by `engine.renameSession()` (Bug 3). */
34
+ _setWorkspacePath(newWorkspacePath) {
35
+ this._workspace = newWorkspacePath;
36
+ this._calibrationPath = path.join(newWorkspacePath, "confidence_calibration.json");
37
+ // Re-load priors from the new workspace's .env (in case it was edited externally)
38
+ this._loadConfig();
39
+ }
40
+
33
41
  _loadConfig() {
34
42
  const envPath = path.join(this._workspace, ".env");
35
43
  if (!fs.existsSync(envPath)) return;
@@ -68,6 +68,31 @@ during execution with high-threshold matching, not patched into main workflows.
68
68
  based on extraction method, source text presence, historical accuracy, and corner \
69
69
  case proximity. Confidence bands (high/medium/low) drive QC sampling rates.
70
70
 
71
+ ## File System
72
+
73
+ Your workspace is a git repository. Every write to a tracked path (skills, \
74
+ workflows, rules, glossary, AGENT.md, tasks.json) is auto-committed with a \
75
+ trace ID. Use \`sandbox_exec\` with \`cwd: "workspace"\` to run git directly: \
76
+ \`git log --oneline\`, \`git diff HEAD~3 -- rule_skills/R001/\`, \
77
+ \`git checkout HEAD~5 -- rule_skills/R001/\`. High-volume runtime data \
78
+ (logs/, sub_agents/, input/, output/, samples/) is gitignored — git status \
79
+ shows only meaningful changes.
80
+
81
+ Large tool outputs (above ~2000 tokens) are automatically offloaded — you'll \
82
+ see a digest with \`[…truncated, full at: logs/tool_results/<id>.txt …]\`. \
83
+ Read the full file with \`workspace_file\` only if you need the detail. The \
84
+ event log keeps the full output regardless, so audits never lose data.
85
+
86
+ Three workspace tools beyond \`workspace_file\` and \`sandbox_exec\`:
87
+ - \`copy_to_workspace\` — pull a specific file from the project dir into \
88
+ \`refs/\` when you need a workspace-local working copy. Default is to read \
89
+ project files in place via \`scope: "project"\`; only copy when you genuinely need to.
90
+ - \`snapshot\` — freeze the current workspace state (git tag + manifest). Use \
91
+ before risky operations or for release bundles.
92
+ - \`archive_file\` — move a file to an \`archived/\` subdirectory next to it. \
93
+ Use after a workflow consumes an input doc, or when an old result is no longer \
94
+ the primary view.
95
+
71
96
  ## Working with the Developer User
72
97
 
73
98
  The developer user configures the project, provides regulations and samples, and \
@@ -18,6 +18,11 @@ export class CornerCaseRegistry {
18
18
  this._load();
19
19
  }
20
20
 
21
+ /** Re-point at a new workspace. Used by `engine.renameSession()` (Bug 3). */
22
+ _setWorkspacePath(newWorkspacePath) {
23
+ this._path = path.join(newWorkspacePath, "corner_cases.json");
24
+ }
25
+
21
26
  _load() {
22
27
  if (!fs.existsSync(this._path)) return;
23
28
  try {