karajan-code 2.19.0 → 2.19.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 (51) hide show
  1. package/README.md +2 -0
  2. package/package.json +9 -1
  3. package/packages/hu-board/README.md +69 -0
  4. package/packages/hu-board/package.json +23 -0
  5. package/packages/hu-board/public/app.js +4038 -0
  6. package/packages/hu-board/public/index.html +55 -0
  7. package/packages/hu-board/public/pipeline.css +132 -0
  8. package/packages/hu-board/public/pipeline.html +48 -0
  9. package/packages/hu-board/public/pipeline.js +200 -0
  10. package/packages/hu-board/public/styles.css +918 -0
  11. package/packages/hu-board/src/auth.js +92 -0
  12. package/packages/hu-board/src/boot-info.js +16 -0
  13. package/packages/hu-board/src/cleanup-zombies.js +142 -0
  14. package/packages/hu-board/src/command-runner.js +134 -0
  15. package/packages/hu-board/src/config-yaml.js +285 -0
  16. package/packages/hu-board/src/db.js +739 -0
  17. package/packages/hu-board/src/ephemeral-cleaner.js +198 -0
  18. package/packages/hu-board/src/event-bus.js +58 -0
  19. package/packages/hu-board/src/format.js +83 -0
  20. package/packages/hu-board/src/hu-zombie-reaper.js +103 -0
  21. package/packages/hu-board/src/journal-parser.js +180 -0
  22. package/packages/hu-board/src/plan-mutations.js +422 -0
  23. package/packages/hu-board/src/preflight.js +285 -0
  24. package/packages/hu-board/src/routes/api.js +1271 -0
  25. package/packages/hu-board/src/routes/pipeline.js +45 -0
  26. package/packages/hu-board/src/run-tracker.js +121 -0
  27. package/packages/hu-board/src/server.js +435 -0
  28. package/packages/hu-board/src/sync.js +626 -0
  29. package/packages/hu-board/src/token-store.js +57 -0
  30. package/packages/hu-board/src/zombie-reaper.js +207 -0
  31. package/src/audit/webperf-input.js +4 -7
  32. package/src/checks/dir-setup.js +5 -3
  33. package/src/cli/register-pipeline.js +1 -0
  34. package/src/cli/register-plan.js +1 -0
  35. package/src/commands/plan/generate.js +15 -0
  36. package/src/commands/run.js +19 -1
  37. package/src/commands/webperf.js +4 -6
  38. package/src/config/role-resolver.js +3 -1
  39. package/src/mcp/handlers/direct-handlers.js +3 -0
  40. package/src/mcp/handlers/run-handler.js +5 -0
  41. package/src/mcp/tools.js +4 -2
  42. package/src/prompts/spec-reviewer.js +66 -0
  43. package/src/roles/perf-role.js +4 -4
  44. package/src/roles/spec-reviewer-role.js +106 -0
  45. package/src/spec-review/refine-loop.js +58 -0
  46. package/src/spec-review/run-spec-review.js +70 -0
  47. package/src/utils/board-prompt-bridge.js +4 -5
  48. package/src/utils/display/spec-findings.js +44 -0
  49. package/src/utils/paths.js +15 -0
  50. package/src/utils/run-registry.js +4 -4
  51. package/templates/roles/spec-reviewer.md +38 -0
package/README.md CHANGED
@@ -345,6 +345,8 @@ Opt out: set `telemetry: false` in `~/.karajan/kj.config.yml`
345
345
 
346
346
  ## Recent releases
347
347
 
348
+ > **v2.19.1 released** — Patch. **APPLICATION BLOCKER fix** for the HU Board: every fresh `npm install -g karajan-code` since the HU Board feature shipped was producing tarballs without the `packages/hu-board/` directory (the `files` array in `package.json` did not include it), and even when the user copied that directory manually, the board crashed at startup with `Cannot find package 'helmet' imported from .../packages/hu-board/src/server.js` because its five dependencies (`helmet`, `chokidar`, `better-sqlite3`, `express`, `express-rate-limit`) were declared in `packages/hu-board/package.json` but missing from the root `dependencies`. PR #791 adds `packages/hu-board/{src,public,package.json}` to `files`, adds the five deps at root at the exact same versions so `npm dedupe` collapses to one copy resolvable by upward traversal, and regenerates `package-lock.json`. Verified end-to-end: `npm pack --dry-run` now ships 12 board files; `node packages/hu-board/src/server.js` boots cleanly. Also internal: 38 direct `os.homedir()` callers routed through the unified resolver (PR #790, `KARAJAN_HOME` now redirects every component) and 5 inline constructions of `~/.karajan/hu-board-runs/` unified under one helper (PR #789). Reported by [@aitormf](https://github.com/aitormf). **If you tried v2.19.0 and `kj board start` failed, upgrade to v2.19.1.**
349
+ >
348
350
  > **v2.19.0 released** — Minor. Consolidates the HOME-level state of Karajan into a single root: **`~/.karajan/`**. Previously `~/.kj/` held plans, hibernated standby state, run-registry entries and worktrees, while `~/.karajan/` held sessions, hu-stories, config and the rest — no ADR justified the split and four divergent `getKjHome()` implementations had drifted. Three internal PRs land the change without breaking anyone: PR #781 unifies the resolver and introduces **`KARAJAN_HOME`** as the canonical env var (with `KJ_HOME` honoured + one-shot deprecation warning); PR #782 ships an idempotent **auto-migrator** that runs once on the next `kj` invocation — tarball backup at `~/.karajan/backup/kj-pre-migration-<ISO>.tar.gz` BEFORE moving, marker file `~/.karajan/.kj-migrated.json` prevents re-runs, cross-device safe (`rename` → `cp + rm` on `EXDEV`); PR #783 flips every default to `~/.karajan/` and adds a `legacy-kj-home` check to `kj doctor`. The HU Board reads BOTH locations until the migrator fires, so users who start the board first never see "missing plans". Restore is one `tar -xzf ~/.karajan/backup/kj-pre-migration-<ts>.tar.gz -C ~` away. Safe upgrade from 2.18.x.
349
351
  >
350
352
  > **v2.18.1 released** — Patch. Six user-feedback follow-ups to v2.18.0: **`kj-tail` after `kj resume`** (#772, was silent because `resume.js` skipped `withCliRunLog`); **standby waits in-process instead of exiting on a short cooldown** (#773, kj stays alive for waits ≤ 12 h and retries on its own; Ctrl+C during the wait prints `kj standby resume <id>`); **closed KJC-BUG-0040 — SEA linux binaries** (#774, was a race between `gh release create` and softprops, not `better-sqlite3` as the memory said — 60 s poll fix + `make_latest:false`); **stack bias — Python repos no longer get vitest** (#775 + #776 + #777, `detectProjectStack` finally cabled into the coder prompt, the HU auto-generator templates by language, and the synthesizer + `auto-hu-batch` take the stack from the filesystem). 4 971/4 971 tests passing across 416 files. Safe upgrade from 2.18.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karajan-code",
3
- "version": "2.19.0",
3
+ "version": "2.19.1",
4
4
  "description": "Local multi-agent coding orchestrator with TDD, SonarQube, and code review pipeline",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
@@ -37,6 +37,9 @@
37
37
  "bin/",
38
38
  "templates/",
39
39
  "scripts/",
40
+ "packages/hu-board/src/",
41
+ "packages/hu-board/public/",
42
+ "packages/hu-board/package.json",
40
43
  "docs/karajan-code-logo-small.png",
41
44
  "docs/README.es.md",
42
45
  "LICENSE",
@@ -67,8 +70,13 @@
67
70
  },
68
71
  "dependencies": {
69
72
  "@modelcontextprotocol/sdk": "^1.26.0",
73
+ "better-sqlite3": "^11.0.0",
74
+ "chokidar": "^4.0.0",
70
75
  "commander": "^14.0.0",
71
76
  "execa": "^9.6.0",
77
+ "express": "^5.1.0",
78
+ "express-rate-limit": "^8.5.0",
79
+ "helmet": "^8.1.0",
72
80
  "js-yaml": "^4.1.0",
73
81
  "knip": "^6.14.1",
74
82
  "madge": "^8.0.0",
@@ -0,0 +1,69 @@
1
+ # Karajan HU Board
2
+
3
+ A web dashboard that visualizes all HU (User Story) stories managed by Karajan Code. Reads from `~/.karajan/hu-stories/` and `~/.karajan/sessions/`, groups by project, and provides a read-only kanban board with quality metrics and session timelines.
4
+
5
+ ## Quick Start
6
+
7
+ ### Without Docker
8
+
9
+ ```bash
10
+ cd packages/hu-board
11
+ npm install
12
+ npm start
13
+ # Open http://localhost:4000
14
+ ```
15
+
16
+ ### With Docker
17
+
18
+ ```bash
19
+ cd packages/hu-board
20
+ docker compose up -d
21
+ # Open http://localhost:4000
22
+ ```
23
+
24
+ ### Development (auto-reload)
25
+
26
+ ```bash
27
+ npm run dev
28
+ ```
29
+
30
+ ## Configuration
31
+
32
+ | Variable | Default | Description |
33
+ |----------|---------|-------------|
34
+ | `PORT` | `4000` | Server port (auto-detects next available if busy) |
35
+ | `KJ_HOME` | `~/.karajan` | Path to Karajan data directory |
36
+
37
+ You can also use `--port` flag:
38
+
39
+ ```bash
40
+ node src/server.js --port 5000
41
+ ```
42
+
43
+ ## Architecture
44
+
45
+ - **Backend**: Node.js + Express serving REST API + static files
46
+ - **Frontend**: Vanilla JS single-page app with hash-based routing
47
+ - **Database**: SQLite (via `better-sqlite3`) at `$KJ_HOME/hu-board.db`
48
+ - **Sync**: Chokidar watches JSON files and syncs to SQLite in real-time
49
+
50
+ The SQLite database is a read index over the JSON source files. If deleted, it rebuilds automatically on next startup.
51
+
52
+ ## API Endpoints
53
+
54
+ | Method | Path | Description |
55
+ |--------|------|-------------|
56
+ | GET | `/api/dashboard` | Global statistics |
57
+ | GET | `/api/projects` | List all projects with counts |
58
+ | GET | `/api/projects/:id` | Project detail |
59
+ | GET | `/api/projects/:id/stories` | Stories for a project |
60
+ | GET | `/api/stories/:id` | Story detail with quality, AC, context requests |
61
+ | GET | `/api/projects/:id/sessions` | Sessions for a project |
62
+ | GET | `/api/sessions` | All sessions |
63
+ | GET | `/api/sessions/:id` | Session detail with timeline |
64
+
65
+ ## Views
66
+
67
+ 1. **Dashboard** - Global stats cards + project overview grid
68
+ 2. **Board** - Kanban columns (Pending / Needs Context / Certified / Done)
69
+ 3. **Sessions** - Timeline of Karajan pipeline sessions with stages and duration
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@karajan/hu-board",
3
+ "version": "1.0.0",
4
+ "description": "HU Story Board dashboard for Karajan Code",
5
+ "type": "module",
6
+ "private": true,
7
+ "scripts": {
8
+ "start": "node src/server.js",
9
+ "dev": "node --watch src/server.js",
10
+ "test": "vitest run"
11
+ },
12
+ "dependencies": {
13
+ "better-sqlite3": "^11.0.0",
14
+ "chokidar": "^4.0.0",
15
+ "express": "^5.1.0",
16
+ "express-rate-limit": "^8.5.0",
17
+ "helmet": "^8.1.0"
18
+ },
19
+ "devDependencies": {
20
+ "supertest": "^7.1.0",
21
+ "vitest": "^4.0.0"
22
+ }
23
+ }