@sienklogic/plan-build-run 2.19.1 → 2.19.2

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 (116) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/CLAUDE.md +29 -16
  3. package/README.md +3 -3
  4. package/dashboard/server/index.js +10 -1
  5. package/dashboard/server/routes/agents.js +23 -2
  6. package/dashboard/server/routes/health.js +7 -4
  7. package/dashboard/server/routes/telemetry.js +20 -1
  8. package/dashboard/server/services/planning-reader.js +3 -17
  9. package/package.json +1 -1
  10. package/plan-build-run/bin/config-schema.json +23 -145
  11. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  12. package/plugins/pbr/agents/advisor-researcher.md +1 -0
  13. package/plugins/pbr/agents/debugger.md +0 -4
  14. package/plugins/pbr/agents/researcher.md +0 -4
  15. package/plugins/pbr/agents/synthesizer.md +0 -4
  16. package/plugins/pbr/dist/check-config-change.js +0 -7
  17. package/plugins/pbr/dist/check-cross-plugin-sync.js +1 -1
  18. package/plugins/pbr/dist/check-plan-format.js +0 -32
  19. package/plugins/pbr/dist/check-roadmap-sync.js +15 -11
  20. package/plugins/pbr/dist/check-subagent-output.js +4 -60
  21. package/plugins/pbr/dist/check-summary-gate.js +3 -14
  22. package/plugins/pbr/dist/feedback-loop.js +12 -29
  23. package/plugins/pbr/dist/hook-server.js +58 -6
  24. package/plugins/pbr/dist/milestone-learnings.js +6 -56
  25. package/plugins/pbr/dist/pbr-tools.js +8 -91
  26. package/plugins/pbr/dist/post-bash-triage.js +5 -63
  27. package/plugins/pbr/dist/post-hoc.js +3 -52
  28. package/plugins/pbr/dist/post-write-dispatch.js +0 -36
  29. package/plugins/pbr/dist/pre-bash-dispatch.js +1 -7
  30. package/plugins/pbr/dist/pre-task-dispatch.js +0 -28
  31. package/plugins/pbr/dist/progress-tracker.js +2 -27
  32. package/plugins/pbr/dist/session-cleanup.js +1 -31
  33. package/plugins/pbr/dist/status-line.js +13 -11
  34. package/plugins/pbr/dist/suggest-compact.js +2 -10
  35. package/plugins/pbr/dist/validate-commit.js +8 -64
  36. package/plugins/pbr/dist/validate-task.js +0 -30
  37. package/plugins/pbr/references/config-reference.md +0 -96
  38. package/plugins/pbr/scripts/audit-checks/si-agent-hook-config-checks.js +2 -72
  39. package/plugins/pbr/scripts/audit-checks/workflow-compliance.js +5 -41
  40. package/plugins/pbr/scripts/check-config-change.js +0 -7
  41. package/plugins/pbr/scripts/check-cross-plugin-sync.js +1 -1
  42. package/plugins/pbr/scripts/check-plan-format.js +0 -32
  43. package/plugins/pbr/scripts/check-roadmap-sync.js +15 -11
  44. package/plugins/pbr/scripts/check-subagent-output.js +4 -60
  45. package/plugins/pbr/scripts/check-summary-gate.js +3 -14
  46. package/plugins/pbr/scripts/config-schema.json +16 -129
  47. package/plugins/pbr/scripts/feedback-loop.js +12 -29
  48. package/plugins/pbr/scripts/hook-server.js +58 -6
  49. package/plugins/pbr/scripts/lib/config.js +4 -11
  50. package/plugins/pbr/scripts/lib/contextual-help.js +5 -29
  51. package/plugins/pbr/scripts/lib/format-validators.js +1 -26
  52. package/plugins/pbr/scripts/lib/frontmatter.js +4 -4
  53. package/plugins/pbr/scripts/lib/gates/rich-agent-context.js +13 -19
  54. package/plugins/pbr/scripts/lib/health.js +4 -5
  55. package/plugins/pbr/scripts/lib/help.js +3 -54
  56. package/plugins/pbr/scripts/lib/phase.js +2 -4
  57. package/plugins/pbr/scripts/lib/pre-commit-checks.js +1 -1
  58. package/plugins/pbr/scripts/lib/pre-research.js +10 -17
  59. package/plugins/pbr/scripts/lib/roadmap.js +11 -35
  60. package/plugins/pbr/scripts/lib/smart-next-task.js +11 -20
  61. package/plugins/pbr/scripts/lib/spot-check.js +3 -106
  62. package/plugins/pbr/scripts/lib/state.js +25 -130
  63. package/plugins/pbr/scripts/lib/verify.js +56 -46
  64. package/plugins/pbr/scripts/milestone-learnings.js +6 -56
  65. package/plugins/pbr/scripts/pbr-tools.js +8 -91
  66. package/plugins/pbr/scripts/post-bash-triage.js +5 -63
  67. package/plugins/pbr/scripts/post-hoc.js +3 -52
  68. package/plugins/pbr/scripts/post-write-dispatch.js +0 -36
  69. package/plugins/pbr/scripts/pre-bash-dispatch.js +1 -7
  70. package/plugins/pbr/scripts/pre-task-dispatch.js +0 -28
  71. package/plugins/pbr/scripts/progress-tracker.js +2 -27
  72. package/plugins/pbr/scripts/session-cleanup.js +1 -31
  73. package/plugins/pbr/scripts/status-line.js +13 -11
  74. package/plugins/pbr/scripts/suggest-compact.js +2 -10
  75. package/plugins/pbr/scripts/test/state.test.js +5 -13
  76. package/plugins/pbr/scripts/validate-commit.js +8 -64
  77. package/plugins/pbr/scripts/validate-task.js +0 -30
  78. package/plugins/pbr/skills/begin/SKILL.md +1 -0
  79. package/plugins/pbr/skills/begin/templates/config.json.tmpl +0 -4
  80. package/plugins/pbr/skills/build/SKILL.md +6 -6
  81. package/plugins/pbr/skills/config/SKILL.md +1 -0
  82. package/plugins/pbr/skills/help/SKILL.md +1 -0
  83. package/plugins/pbr/skills/pause/SKILL.md +1 -0
  84. package/plugins/pbr/skills/profile-user/SKILL.md +1 -0
  85. package/plugins/pbr/skills/quick/SKILL.md +2 -1
  86. package/plugins/pbr/skills/resume/SKILL.md +1 -0
  87. package/plugins/pbr/skills/scan/SKILL.md +1 -0
  88. package/plugins/pbr/skills/setup/SKILL.md +1 -0
  89. package/plugins/pbr/skills/shared/state-update.md +2 -2
  90. package/plugins/pbr/skills/status/SKILL.md +1 -0
  91. package/plugins/pbr/references/behavioral-contexts.md +0 -53
  92. package/plugins/pbr/scripts/lib/autonomy.js +0 -91
  93. package/plugins/pbr/scripts/lib/circuit-state.js +0 -133
  94. package/plugins/pbr/scripts/lib/completion.js +0 -377
  95. package/plugins/pbr/scripts/lib/hypothesis-runner.js +0 -127
  96. package/plugins/pbr/scripts/lib/local-llm/client.js +0 -237
  97. package/plugins/pbr/scripts/lib/local-llm/health.js +0 -12
  98. package/plugins/pbr/scripts/lib/local-llm/index.js +0 -89
  99. package/plugins/pbr/scripts/lib/local-llm/metrics.js +0 -20
  100. package/plugins/pbr/scripts/lib/local-llm/operations/classify-artifact.js +0 -4
  101. package/plugins/pbr/scripts/lib/local-llm/operations/classify-commit.js +0 -4
  102. package/plugins/pbr/scripts/lib/local-llm/operations/classify-error.js +0 -4
  103. package/plugins/pbr/scripts/lib/local-llm/operations/classify-file-intent.js +0 -4
  104. package/plugins/pbr/scripts/lib/local-llm/operations/score-source.js +0 -72
  105. package/plugins/pbr/scripts/lib/local-llm/operations/summarize-context.js +0 -62
  106. package/plugins/pbr/scripts/lib/local-llm/operations/triage-test-output.js +0 -12
  107. package/plugins/pbr/scripts/lib/local-llm/operations/validate-task.js +0 -4
  108. package/plugins/pbr/scripts/lib/local-llm/router.js +0 -101
  109. package/plugins/pbr/scripts/lib/local-llm/shadow.js +0 -60
  110. package/plugins/pbr/scripts/lib/local-llm/threshold-tuner.js +0 -118
  111. package/plugins/pbr/scripts/lib/team-composer.js +0 -87
  112. package/plugins/pbr/scripts/lib/team-coordinator.js +0 -153
  113. package/plugins/pbr/scripts/lib/template.js +0 -222
  114. package/plugins/pbr/scripts/lib/test-cache.js +0 -54
  115. package/plugins/pbr/scripts/lib/trust-gate.js +0 -84
  116. package/plugins/pbr/scripts/lib/wiring-check.js +0 -196
package/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  All notable changes to Plan-Build-Run will be documented in this file.
4
4
 
5
+ ## [2.19.2](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.19.1...plan-build-run-v2.19.2) — 2026-03-24
6
+
7
+ ### CI/CD
8
+
9
+ * Remove double blank line in config-reference.md (markdownlint MD012) ([f72d4f2f](https://github.com/SienkLogic/plan-build-run/commit/f72d4f2f))
10
+ * Wire spot-check CLI command and fix empty block lint errors ([b4abfc2c](https://github.com/SienkLogic/plan-build-run/commit/b4abfc2c))
11
+
12
+ ### CLI Tools
13
+
14
+ * Repair pbr-tools.test.js brace nesting from Phase 141 legacy removal ([031c0d06](https://github.com/SienkLogic/plan-build-run/commit/031c0d06))
15
+
16
+ ### Configuration
17
+
18
+ * Add missing feature flags to schema and fix default drift ([248e5b5a](https://github.com/SienkLogic/plan-build-run/commit/248e5b5a))
19
+
20
+ ### Dashboard
21
+
22
+ * Fix log filename, health require paths, version, and research date ([b0eadc4a](https://github.com/SienkLogic/plan-build-run/commit/b0eadc4a))
23
+
24
+ ### Hooks
25
+
26
+ * Suppress git diff --cached stderr output with stdio pipe ([7cec470b](https://github.com/SienkLogic/plan-build-run/commit/7cec470b))
27
+ * Restrict dashboard CORS to localhost and add hook event log rotation ([57e829dd](https://github.com/SienkLogic/plan-build-run/commit/57e829dd))
28
+ * Remove leftover enrichCommitLlm reference from pre-bash-dispatch ([ffa1ba03](https://github.com/SienkLogic/plan-build-run/commit/ffa1ba03))
29
+ * Add PreToolUse response translation layer in hook-server.js ([b8cbbef6](https://github.com/SienkLogic/plan-build-run/commit/b8cbbef6))
30
+
31
+ ### Skills
32
+
33
+ * Replace stale plan-build-run/bin/lib/ paths and fix state-update line limit ([a67d6c4b](https://github.com/SienkLogic/plan-build-run/commit/a67d6c4b))
34
+
35
+ ### Testing
36
+
37
+ * Update suggest-compact test for legacy .compact-counter removal ([f9e35aeb](https://github.com/SienkLogic/plan-build-run/commit/f9e35aeb))
38
+
39
+ ### Other
40
+
41
+ * Remove orphaned config keys and wrap git diff --cached in try-catch ([4d863ecd](https://github.com/SienkLogic/plan-build-run/commit/4d863ecd))
42
+ * Add PBR_DEBUG logging to empty catches and fix 9 .cjs extension mismatches in verify.js ([1931893d](https://github.com/SienkLogic/plan-build-run/commit/1931893d))
43
+
5
44
  ## [2.19.1](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.19.0...plan-build-run-v2.19.1) — 2026-03-23
6
45
 
7
46
  ### Skills
package/CLAUDE.md CHANGED
@@ -50,17 +50,17 @@ Three layers:
50
50
 
51
51
  Markdown files with YAML frontmatter defining slash commands (`/pbr:new-project`, `/pbr:plan-phase`, etc.). Each SKILL.md is a complete prompt that tells the orchestrator what to do. Skills read state, interact with the user, and spawn agents.
52
52
 
53
- 34 skills: audit, begin, build, config, continue, dashboard, debug, discuss, do, explore, health, help, import, intel, milestone, note, pause, plan, profile, quick, resume, review, scan, setup, status, statusline, test, todo, undo, and more.
53
+ 46 skills: audit, begin, build, config, continue, dashboard, debug, discuss, do, explore, health, help, import, intel, milestone, note, pause, plan, profile, quick, resume, review, scan, setup, status, statusline, test, todo, undo, and more.
54
54
 
55
55
  ### Agents (`agents/{name}.md`)
56
56
 
57
57
  Markdown files with YAML frontmatter defining specialized subagent prompts. Agents run in fresh `Task()` contexts with clean 200k token windows. Spawned via `subagent_type: "pbr:{name}"` — auto-loaded by Claude Code.
58
58
 
59
- 17 agents: audit, codebase-mapper, debugger, dev-sync, executor, general, integration-checker, intel-updater, nyquist-auditor, plan-checker, planner, researcher, roadmapper, synthesizer, ui-checker, ui-researcher, verifier.
59
+ 18 agents: audit, codebase-mapper, debugger, dev-sync, executor, general, integration-checker, intel-updater, nyquist-auditor, plan-checker, planner, researcher, roadmapper, synthesizer, ui-checker, ui-researcher, verifier.
60
60
 
61
- ### Hook Scripts (`hooks/*.js`)
61
+ ### Hook Scripts (`plugins/pbr/scripts/*.js`)
62
62
 
63
- 50 Node.js hook scripts that fire on Claude Code lifecycle events. Configured in `hooks/hooks.json`. All use CommonJS, must be cross-platform (`path.join()`, not hardcoded separators), and log via `logHook()` from `hook-logger.js`.
63
+ 66 Node.js hook scripts that fire on Claude Code lifecycle events. Configured in `plugins/pbr/hooks/hooks.json`. All use CommonJS, must be cross-platform (`path.join()`, not hardcoded separators), and log via `logHook()` from `hook-logger.js`.
64
64
 
65
65
  **Dispatch pattern**: Several hooks use dispatch scripts that fan out to sub-scripts based on the file being written/read:
66
66
 
@@ -68,22 +68,33 @@ Markdown files with YAML frontmatter defining specialized subagent prompts. Agen
68
68
  |------------|-------------|-------------|
69
69
  | SessionStart | progress-tracker.js | — (injects project state) |
70
70
  | PostToolUse (Write\|Edit) | post-write-dispatch.js | check-plan-format.js, check-roadmap-sync.js, check-state-sync.js |
71
- | PostToolUse (Write\|Edit) | post-write-quality.js | — (autoFormat, typeCheck, detectConsoleLogs) |
72
- | PostToolUse (Task) | check-subagent-output.js | — (validates agent output) |
71
+ | PostToolUse (Write\|Edit) | context-bridge.js | — (context tier tracking) |
72
+ | PostToolUse (Write\|Edit) | graph-update.js | — (architecture graph) |
73
+ | PostToolUse (Write\|Edit) | architecture-guard.js | — (dependency violations) |
73
74
  | PostToolUse (Write\|Edit) | suggest-compact.js | — (context budget warnings) |
74
- | PostToolUse (Read) | track-context-budget.js | — (tracks reads for budget) |
75
+ | PostToolUse (Read\|Glob\|Grep) | track-context-budget.js | — (tracks reads for budget) |
76
+ | PostToolUse (Bash) | post-bash-triage.js | — (test output triage) |
77
+ | PostToolUse (Bash) | context-bridge.js | — (context tier tracking) |
78
+ | PostToolUse (Task) | check-subagent-output.js | — (validates agent output) |
79
+ | PostToolUse (Task) | context-bridge.js | — (context tier tracking) |
80
+ | PostToolUse (AskUserQuestion) | track-user-gates.js | — (gate tracking) |
75
81
  | PostToolUseFailure | log-tool-failure.js | — (logs failures) |
76
82
  | PreToolUse (Bash) | pre-bash-dispatch.js | validate-commit.js, check-dangerous-commands.js |
77
83
  | PreToolUse (Write\|Edit) | pre-write-dispatch.js | check-skill-workflow.js, check-summary-gate.js, check-doc-sprawl.js |
84
+ | PreToolUse (Task) | pre-task-dispatch.js | — (build/plan gates) |
85
+ | PreToolUse (Skill) | pre-skill-dispatch.js | — (context budget, args) |
86
+ | PreToolUse (Read) | block-skill-self-read.js | — (prevents SKILL.md self-read) |
87
+ | PreToolUse (EnterPlanMode) | intercept-plan-mode.js | — (blocks plan mode in PBR) |
78
88
  | PreCompact | context-budget-check.js | — (preserves STATE.md) |
89
+ | PostCompact | post-compact.js | — (post-compact recovery) |
79
90
  | Stop | auto-continue.js | — (chains next command) |
80
- | SubagentStart/Stop | log-subagent.js | — (tracks lifecycle) |
81
- | SubagentStop | event-handler.js | — (auto-verification trigger) |
91
+ | SubagentStart | log-subagent.js | — (tracks lifecycle) |
92
+ | SubagentStop | log-subagent.js, event-handler.js | — (auto-verification trigger) |
82
93
  | TaskCompleted | task-completed.js | — (processes task completion) |
83
- | InstructionsLoaded | hook-server-client.js | — (detects instruction reload) |
84
- | ConfigChange | hook-server-client.js | — (config change detection) |
85
- | WorktreeCreate | hook-server-client.js | — (worktree setup) |
86
- | WorktreeRemove | hook-server-client.js | — (worktree cleanup) |
94
+ | InstructionsLoaded | instructions-loaded.js | — (instruction reload detection) |
95
+ | ConfigChange | check-config-change.js | — (config change detection) |
96
+ | WorktreeCreate | worktree-create.js | — (worktree setup) |
97
+ | WorktreeRemove | worktree-remove.js | — (worktree cleanup) |
87
98
  | Notification | log-notification.js | — (notification logging) |
88
99
  | UserPromptSubmit | prompt-routing.js | — (prompt routing) |
89
100
  | SessionEnd | session-cleanup.js | — (cleanup) |
@@ -99,8 +110,8 @@ Markdown files with YAML frontmatter defining specialized subagent prompts. Agen
99
110
  - **`plan-build-run/bin/`** — CLI tools (`pbr-tools.js` + `lib/` modules)
100
111
  - **`plan-build-run/references/`** — Shared reference docs loaded by skills (plan format, commit conventions, UI formatting, deviation rules)
101
112
  - **`plan-build-run/templates/`** — EJS-style `.tmpl` files for generated markdown (VERIFICATION.md, SUMMARY.md, etc.)
102
- - **`plugins/pbr/commands/`** — 63 command registration files (one `.md` per command mapping to its skill)
103
- - **`plan-build-run/skills/shared/`** — 12 shared skill fragments extracted from repeated patterns across skills
113
+ - **`plugins/pbr/commands/`** — 71 command registration files (one `.md` per command mapping to its skill)
114
+ - **`plan-build-run/skills/shared/`** — 15 shared skill fragments extracted from repeated patterns across skills
104
115
  - **`plugins/`** — Derivative plugins (codex-pbr, cursor-pbr, copilot-pbr)
105
116
  - **`dashboard/`** — Vite + React 18 dashboard with Express backend
106
117
 
@@ -125,10 +136,10 @@ argument-hint: "<N> [--flag]"
125
136
  ---
126
137
  name: agent-name
127
138
  description: "What this agent does"
128
- model: sonnet|inherit|haiku
129
139
  memory: none|user|project
130
140
  isolation: worktree # Run agent in isolated git worktree (optional)
131
141
  color: <name|hex> # Terminal color for agent output (optional)
142
+ permissionMode: default # Optional: permissions for agent (optional)
132
143
  tools:
133
144
  - Read
134
145
  - Write
@@ -136,6 +147,8 @@ tools:
136
147
  ---
137
148
  ```
138
149
 
150
+ Model selection is config-driven via `config.json` `models` map, not via agent frontmatter.
151
+
139
152
  ## Data Flow
140
153
 
141
154
  Skills and agents communicate through files on disk, not messages:
package/README.md CHANGED
@@ -145,11 +145,11 @@ Plans are grouped into **waves** based on dependencies. Within each wave, plans
145
145
  <details>
146
146
  <summary><strong>Three layers: Skills → Agents → Hooks</strong></summary>
147
147
 
148
- ### Skills (39 slash commands)
148
+ ### Skills (46 slash commands)
149
149
 
150
150
  Markdown files with YAML frontmatter defining `/pbr:*` slash commands. Each skill is a complete prompt that reads state, interacts with the user, and spawns agents. Skills are the user-facing interface.
151
151
 
152
- ### Agents (17 specialized subagents)
152
+ ### Agents (18 specialized subagents)
153
153
 
154
154
  Markdown files defining agent prompts that run in fresh `Task()` contexts with clean 200k token windows. Each agent type has a specific role:
155
155
 
@@ -526,7 +526,7 @@ CI runs on Node 18/20/22 across Windows, macOS, and Linux (9 platform combinatio
526
526
 
527
527
  <div align="center">
528
528
 
529
- **39 skills &bull; 17 agents &bull; 26 hooks &bull; 38 server routes &bull; 4 platforms**
529
+ **46 skills &bull; 18 agents &bull; 26 hooks &bull; 38 server routes &bull; 4 platforms**
530
530
 
531
531
  **Claude Code is powerful. PBR makes it reliable.**
532
532
 
@@ -44,7 +44,16 @@ function createApp(options = {}) {
44
44
  const app = express();
45
45
 
46
46
  // Core middleware
47
- app.use(cors());
47
+ app.use(cors({
48
+ origin: (origin, callback) => {
49
+ // Allow requests with no origin (same-origin, curl, etc.) or localhost
50
+ if (!origin || /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin)) {
51
+ callback(null, true);
52
+ } else {
53
+ callback(new Error('Not allowed by CORS'));
54
+ }
55
+ }
56
+ }));
48
57
  app.use(express.json());
49
58
 
50
59
  // Store resolved options on app for downstream middleware
@@ -5,6 +5,27 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const { parseFrontmatter } = require('../lib/frontmatter');
7
7
 
8
+ /**
9
+ * Get the path to the current hook log file.
10
+ * Prefers today's dated file, falls back to most recent, then legacy hooks.jsonl.
11
+ */
12
+ function getHookLogPath(planningDir) {
13
+ const today = new Date().toISOString().slice(0, 10);
14
+ const dated = path.join(planningDir, 'logs', `hooks-${today}.jsonl`);
15
+ if (fs.existsSync(dated)) return dated;
16
+ // Fallback: find most recent hooks-*.jsonl
17
+ const logsDir = path.join(planningDir, 'logs');
18
+ try {
19
+ const files = fs.readdirSync(logsDir)
20
+ .filter(f => /^hooks-\d{4}-\d{2}-\d{2}\.jsonl$/.test(f))
21
+ .sort()
22
+ .reverse();
23
+ if (files.length > 0) return path.join(logsDir, files[0]);
24
+ } catch (_e) { /* no logs dir */ }
25
+ // Last fallback: legacy filename
26
+ return path.join(planningDir, 'logs', 'hooks.jsonl');
27
+ }
28
+
8
29
  /**
9
30
  * Agents route factory.
10
31
  * Reads agent definitions from plugins/pbr/agents/*.md.
@@ -143,7 +164,7 @@ function createAgentsRouter({ planningDir, agentsDir }) {
143
164
  */
144
165
  router.get('/hooks', async (_req, res) => {
145
166
  try {
146
- const eventsPath = path.join(planningDir, 'logs', 'hooks.jsonl');
167
+ const eventsPath = getHookLogPath(planningDir);
147
168
  let events = [];
148
169
 
149
170
  try {
@@ -179,7 +200,7 @@ function createAgentsRouter({ planningDir, agentsDir }) {
179
200
  */
180
201
  router.get('/errors', async (_req, res) => {
181
202
  try {
182
- const eventsPath = path.join(planningDir, 'logs', 'hooks.jsonl');
203
+ const eventsPath = getHookLogPath(planningDir);
183
204
  let errors = [];
184
205
 
185
206
  try {
@@ -5,6 +5,9 @@ const path = require('path');
5
5
 
6
6
  const router = express.Router();
7
7
  const startTime = Date.now();
8
+ const pbrVersion = (() => {
9
+ try { return require('../../../../package.json').version; } catch (_e) { return 'unknown'; }
10
+ })();
8
11
 
9
12
  /**
10
13
  * Resolve the planning directory from request app config.
@@ -35,7 +38,7 @@ router.get('/', (_req, res) => {
35
38
  res.json({
36
39
  status: 'ok',
37
40
  uptime: Math.floor((Date.now() - startTime) / 1000),
38
- version: '4.0.0',
41
+ version: pbrVersion,
39
42
  timestamp: new Date().toISOString(),
40
43
  });
41
44
  });
@@ -53,17 +56,17 @@ router.get('/features', (req, res) => {
53
56
  const featureChecks = [
54
57
  {
55
58
  name: 'progress_visualization',
56
- module: '../../../plan-build-run/bin/lib/progress-visualization.cjs',
59
+ module: '../../../plugins/pbr/scripts/lib/progress-visualization.js',
57
60
  fn: 'getProgressData',
58
61
  },
59
62
  {
60
63
  name: 'contextual_help',
61
- module: '../../../plan-build-run/bin/lib/contextual-help.cjs',
64
+ module: '../../../plugins/pbr/scripts/lib/contextual-help.js',
62
65
  fn: 'getContextualHelp',
63
66
  },
64
67
  {
65
68
  name: 'team_onboarding',
66
- module: '../../../plan-build-run/bin/lib/onboarding-generator.cjs',
69
+ module: '../../../plugins/pbr/scripts/lib/onboarding-generator.js',
67
70
  fn: 'generateOnboardingGuide',
68
71
  },
69
72
  ];
@@ -4,6 +4,25 @@ const express = require('express');
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
 
7
+ /**
8
+ * Get the path to the current hook log file.
9
+ * Prefers today's dated file, falls back to most recent, then legacy hooks.jsonl.
10
+ */
11
+ function getHookLogPath(planningDir) {
12
+ const today = new Date().toISOString().slice(0, 10);
13
+ const dated = path.join(planningDir, 'logs', `hooks-${today}.jsonl`);
14
+ if (fs.existsSync(dated)) return dated;
15
+ const logsDir = path.join(planningDir, 'logs');
16
+ try {
17
+ const files = fs.readdirSync(logsDir)
18
+ .filter(f => /^hooks-\d{4}-\d{2}-\d{2}\.jsonl$/.test(f))
19
+ .sort()
20
+ .reverse();
21
+ if (files.length > 0) return path.join(logsDir, files[0]);
22
+ } catch (_e) { /* no logs dir */ }
23
+ return path.join(planningDir, 'logs', 'hooks.jsonl');
24
+ }
25
+
7
26
  /**
8
27
  * Telemetry route factory.
9
28
  * Reads hook event log and telemetry data from .planning/.
@@ -21,7 +40,7 @@ function createTelemetryRouter({ planningDir }) {
21
40
  */
22
41
  router.get('/', async (_req, res) => {
23
42
  try {
24
- const eventsPath = path.join(planningDir, 'logs', 'hooks.jsonl');
43
+ const eventsPath = getHookLogPath(planningDir);
25
44
  let events = [];
26
45
 
27
46
  try {
@@ -64,7 +64,7 @@ class PlanningReader {
64
64
  /**
65
65
  * Read STATE.md and return session state with progress and history.
66
66
  * Returns frontmatter fields plus nested progress object and history text.
67
- * Falls back to legacy HISTORY.md if STATE.md has no ## History section.
67
+ * Reads ## History section from STATE.md body.
68
68
  */
69
69
  async getStatus() {
70
70
  const content = await safeReadFile(path.join(this.planningDir, 'STATE.md'));
@@ -76,13 +76,6 @@ class PlanningReader {
76
76
  const historyMatch = body.match(/## History\n([\s\S]*?)(?=\n## |\s*$)/);
77
77
  if (historyMatch) {
78
78
  history = historyMatch[1].trim();
79
- } else {
80
- // Backwards compat: read legacy HISTORY.md if it exists
81
- const legacyHistory = await safeReadFile(path.join(this.planningDir, 'HISTORY.md'));
82
- if (legacyHistory) {
83
- const { body: histBody } = parseFrontmatter(legacyHistory);
84
- history = histBody.trim() || null;
85
- }
86
79
  }
87
80
 
88
81
  // Build response with progress as nested object (parsed by frontmatter lib)
@@ -112,7 +105,7 @@ class PlanningReader {
112
105
  /**
113
106
  * Read PROJECT.md and extract the ## Context section.
114
107
  * Returns { context: string } or { context: null } if not found.
115
- * Falls back to legacy CONTEXT.md if PROJECT.md has no ## Context section.
108
+ * Reads ## Context section from PROJECT.md body.
116
109
  */
117
110
  async getProjectContext() {
118
111
  const content = await safeReadFile(path.join(this.planningDir, 'PROJECT.md'));
@@ -124,13 +117,6 @@ class PlanningReader {
124
117
  }
125
118
  }
126
119
 
127
- // Backwards compat: read legacy CONTEXT.md
128
- const legacyContext = await safeReadFile(path.join(this.planningDir, 'CONTEXT.md'));
129
- if (legacyContext) {
130
- const { body: ctxBody } = parseFrontmatter(legacyContext);
131
- return { context: ctxBody.trim() || null };
132
- }
133
-
134
120
  return { context: null };
135
121
  }
136
122
 
@@ -331,7 +317,7 @@ class PlanningReader {
331
317
  title: titleMatch ? titleMatch[1] : r.file.replace(/\.md$/, '').replace(/-/g, ' '),
332
318
  status: r.status || 'collected',
333
319
  source: r.mode || 'research',
334
- date: r.Research_date || r.file.match(/^(\d{4}-\d{2}-\d{2})/)?.[1] || null,
320
+ date: r.research_date || r.file.match(/^(\d{4}-\d{2}-\d{2})/)?.[1] || null,
335
321
  relevance: r.confidence || 'medium',
336
322
  summary: r.body ? r.body.replace(/^#.+\n+/, '').slice(0, 300) : '',
337
323
  keyTakeaways: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.19.1",
3
+ "version": "2.19.2",
4
4
  "description": "Plan it, Build it, Run it -- structured development workflow for Claude Code, OpenCode, Gemini and Codex",
5
5
  "bin": {
6
6
  "plan-build-run": "bin/install.js"
@@ -288,7 +288,7 @@
288
288
  },
289
289
  "reverse_spec": {
290
290
  "type": "boolean",
291
- "default": true,
291
+ "default": false,
292
292
  "description": "Enable reverse spec generation from existing code."
293
293
  },
294
294
  "predictive_impact": {
@@ -311,12 +311,6 @@
311
311
  "default": true,
312
312
  "description": "Enable team onboarding guide generation from ROADMAP.md, CONTEXT.md, and project conventions."
313
313
  },
314
- "multi_layer_validation": {
315
- "type": "boolean",
316
- "default": false,
317
- "deprecated": true,
318
- "description": "DEPRECATED. Parallel multi-layer review passes were never integrated. Key retained for backward compatibility."
319
- },
320
314
  "regression_prevention": {
321
315
  "type": "boolean",
322
316
  "default": true,
@@ -336,20 +330,25 @@
336
330
  "type": "boolean",
337
331
  "default": true,
338
332
  "description": "Enable architecture consistency guard that warns on dependency violations."
333
+ },
334
+ "cross_project_patterns": {
335
+ "type": "boolean",
336
+ "default": false,
337
+ "description": "Enable cross-project pattern detection and reuse across repositories."
338
+ },
339
+ "spec_templates": {
340
+ "type": "boolean",
341
+ "default": false,
342
+ "description": "Enable spec template generation from existing code patterns."
343
+ },
344
+ "global_learnings": {
345
+ "type": "boolean",
346
+ "default": false,
347
+ "description": "Enable global learnings aggregation across phases into KNOWLEDGE.md."
339
348
  }
340
349
  },
341
350
  "additionalProperties": false
342
351
  },
343
- "validation_passes": {
344
- "type": "array",
345
- "items": {
346
- "type": "string",
347
- "enum": ["correctness", "security", "performance", "style", "tests", "accessibility", "docs", "deps"]
348
- },
349
- "default": ["correctness", "security"],
350
- "deprecated": true,
351
- "description": "DEPRECATED. Used only with multi_layer_validation which was never integrated. Key retained for backward compatibility."
352
- },
353
352
  "autonomy": {
354
353
  "type": "object",
355
354
  "properties": {
@@ -1093,134 +1092,6 @@
1093
1092
  },
1094
1093
  "additionalProperties": false
1095
1094
  },
1096
- "local_llm": {
1097
- "type": "object",
1098
- "deprecated": true,
1099
- "description": "DEPRECATED. Local LLM infrastructure removed in v14.0. Key retained for backward compatibility.",
1100
- "properties": {
1101
- "enabled": {
1102
- "type": "boolean"
1103
- },
1104
- "provider": {
1105
- "type": "string",
1106
- "enum": [
1107
- "ollama"
1108
- ]
1109
- },
1110
- "endpoint": {
1111
- "type": "string",
1112
- "format": "uri"
1113
- },
1114
- "model": {
1115
- "type": "string"
1116
- },
1117
- "timeout_ms": {
1118
- "type": "integer",
1119
- "minimum": 500
1120
- },
1121
- "max_retries": {
1122
- "type": "integer",
1123
- "minimum": 0,
1124
- "maximum": 3
1125
- },
1126
- "fallback": {
1127
- "type": "string",
1128
- "enum": [
1129
- "frontier",
1130
- "skip"
1131
- ]
1132
- },
1133
- "routing_strategy": {
1134
- "type": "string",
1135
- "enum": [
1136
- "local_first",
1137
- "frontier_first"
1138
- ]
1139
- },
1140
- "features": {
1141
- "type": "object",
1142
- "properties": {
1143
- "artifact_classification": {
1144
- "type": "boolean"
1145
- },
1146
- "task_validation": {
1147
- "type": "boolean"
1148
- },
1149
- "plan_adequacy": {
1150
- "type": "boolean"
1151
- },
1152
- "gap_detection": {
1153
- "type": "boolean"
1154
- },
1155
- "context_summarization": {
1156
- "type": "boolean"
1157
- },
1158
- "source_scoring": {
1159
- "type": "boolean"
1160
- },
1161
- "commit_classification": {
1162
- "type": "boolean"
1163
- },
1164
- "test_triage": {
1165
- "type": "boolean"
1166
- },
1167
- "file_intent_classification": {
1168
- "type": "boolean"
1169
- }
1170
- },
1171
- "additionalProperties": false
1172
- },
1173
- "metrics": {
1174
- "type": "object",
1175
- "properties": {
1176
- "enabled": {
1177
- "type": "boolean"
1178
- },
1179
- "log_file": {
1180
- "type": "string"
1181
- },
1182
- "show_session_summary": {
1183
- "type": "boolean"
1184
- },
1185
- "frontier_token_rate": {
1186
- "type": "number",
1187
- "minimum": 0
1188
- }
1189
- },
1190
- "additionalProperties": false
1191
- },
1192
- "advanced": {
1193
- "type": "object",
1194
- "properties": {
1195
- "confidence_threshold": {
1196
- "type": "number",
1197
- "minimum": 0,
1198
- "maximum": 1
1199
- },
1200
- "max_input_tokens": {
1201
- "type": "integer",
1202
- "minimum": 100
1203
- },
1204
- "keep_alive": {
1205
- "type": "string"
1206
- },
1207
- "num_ctx": {
1208
- "type": "integer",
1209
- "minimum": 512
1210
- },
1211
- "disable_after_failures": {
1212
- "type": "integer",
1213
- "minimum": 1
1214
- },
1215
- "shadow_mode": {
1216
- "type": "boolean"
1217
- }
1218
- },
1219
- "additionalProperties": false
1220
- }
1221
- },
1222
- "additionalProperties": false
1223
- },
1224
1095
  "intel": {
1225
1096
  "type": "object",
1226
1097
  "properties": {
@@ -1297,6 +1168,13 @@
1297
1168
  "maximum": 1,
1298
1169
  "default": 1,
1299
1170
  "description": "Minimum completion confidence (0.5-1.0) required to skip verification. 1.0 means 100% must-haves must pass."
1171
+ },
1172
+ "min_full_percent": {
1173
+ "type": "integer",
1174
+ "minimum": 0,
1175
+ "maximum": 100,
1176
+ "default": 30,
1177
+ "description": "Minimum percentage of phases in autonomous mode that must receive full verification (not just confidence-gate). 0 = all confidence-gate, 100 = all full verification. Default 30 means at least 30% of phases get full /pbr:review verification."
1300
1178
  }
1301
1179
  },
1302
1180
  "additionalProperties": false
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pbr",
3
- "version": "2.19.1",
3
+ "version": "2.19.2",
4
4
  "description": "Plan-Build-Run — Structured development workflow for Claude Code. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
5
5
  "author": {
6
6
  "name": "SienkLogic",
@@ -9,6 +9,7 @@ tools:
9
9
  - WebSearch
10
10
  - WebFetch
11
11
  color: "#60A5FA"
12
+ memory: none
12
13
  ---
13
14
 
14
15
  <files_to_read>
@@ -196,10 +196,6 @@ When you need human input, emit a checkpoint block. Always include `Debug file:`
196
196
  | `HUMAN-ACTION` | User must do something you cannot | action needed, why, steps |
197
197
  | `DECISION` | Investigation branched | options with pros/cons, recommendation |
198
198
 
199
- ## Local LLM Error Classification (DEPRECATED -- no-op)
200
-
201
- The local_llm feature was removed in v14.0. These commands are no-ops that return `{ deprecated: true }`. Skip this section and proceed with manual hypothesis generation.
202
-
203
199
  ## Common Bug Patterns
204
200
 
205
201
  Reference: `references/common-bug-patterns.md` — covers off-by-one, null/undefined, async/timing, state management, import/module, environment, and data shape patterns.
@@ -75,10 +75,6 @@ All claims must be attributed to a source level. Higher levels override lower le
75
75
 
76
76
  **Offline Fallback**: If web tools are unavailable (air-gapped environment, MCP not configured), rely on local sources: codebase analysis via Glob/Grep, existing documentation, and README files. Assign these S3-S4 confidence levels. Do not attempt WebFetch or WebSearch -- note in the output header that external sources were unavailable.
77
77
 
78
- ## Local LLM Source Scoring (DEPRECATED -- no-op)
79
-
80
- The local_llm feature was removed in v14.0. These commands are no-ops that return `{ deprecated: true }`. Skip this section and assign source levels manually per the hierarchy table above.
81
-
82
78
  ---
83
79
 
84
80
  ## Confidence Levels
@@ -201,10 +201,6 @@ conflicts: N
201
201
  - **Research gaps**: Add `[RESEARCH GAP]` flag, add to Open Questions with high impact, never fabricate
202
202
  - **Duplicates**: Consolidate into one entry, note multi-source agreement, reference all documents
203
203
 
204
- ## Local LLM Context Summarization (DEPRECATED -- no-op)
205
-
206
- The local_llm feature was removed in v14.0. These commands are no-ops that return `{ deprecated: true }`. Skip this section and read documents normally.
207
-
208
204
  ## Context Budget
209
205
 
210
206
  ### Context Quality Tiers
@@ -64,8 +64,6 @@ function validateConfig(configPath) {
64
64
  }
65
65
  }
66
66
 
67
- // local_llm is deprecated — no advisory for missing key
68
-
69
67
  // Check version
70
68
  if (config.version && config.version < 2) {
71
69
  warnings.push(`Config version ${config.version} is outdated — expected version 2+`);
@@ -92,11 +90,6 @@ function validateConfig(configPath) {
92
90
  }
93
91
  }
94
92
 
95
- // DEPRECATED: local_llm infrastructure removed in v14.0
96
- if (config.local_llm && config.local_llm.enabled === true) {
97
- warnings.push('local_llm feature is deprecated and has no effect. Set enabled: false to suppress this warning.');
98
- }
99
-
100
93
  return warnings;
101
94
  }
102
95
 
@@ -29,7 +29,7 @@ function checkCrossPluginSync(data) {
29
29
 
30
30
  let stagedFiles;
31
31
  try {
32
- stagedFiles = execSync('git diff --cached --name-only', { encoding: 'utf8' }).trim().split('\n').filter(Boolean);
32
+ stagedFiles = execSync('git diff --cached --name-only', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim().split('\n').filter(Boolean);
33
33
  } catch (_e) {
34
34
  return null;
35
35
  }