agent-bober 0.15.0 → 0.17.0
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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +30 -0
- package/README.md +127 -3
- package/agents/bober-architect.md +34 -0
- package/agents/bober-code-reviewer.md +2 -0
- package/agents/bober-curator.md +12 -0
- package/agents/bober-documenter.md +129 -0
- package/agents/bober-evaluator.md +46 -0
- package/agents/bober-generator.md +12 -0
- package/agents/bober-planner.md +8 -1
- package/dist/cli/commands/graph.js +3 -3
- package/dist/cli/commands/graph.js.map +1 -1
- package/dist/cli/commands/init.js +4 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/memory.d.ts +14 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +132 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +14 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +7 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/role-providers.d.ts +29 -0
- package/dist/config/role-providers.d.ts.map +1 -0
- package/dist/config/role-providers.js +115 -0
- package/dist/config/role-providers.js.map +1 -0
- package/dist/config/schema.d.ts +383 -14
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +42 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/contracts/eval-result.d.ts +112 -56
- package/dist/contracts/eval-result.d.ts.map +1 -1
- package/dist/contracts/eval-result.js +3 -0
- package/dist/contracts/eval-result.js.map +1 -1
- package/dist/contracts/sprint-contract.d.ts +30 -30
- package/dist/fleet/aggregator.d.ts +5 -0
- package/dist/fleet/aggregator.d.ts.map +1 -0
- package/dist/fleet/aggregator.js +39 -0
- package/dist/fleet/aggregator.js.map +1 -0
- package/dist/fleet/child-config.d.ts +12 -0
- package/dist/fleet/child-config.d.ts.map +1 -0
- package/dist/fleet/child-config.js +38 -0
- package/dist/fleet/child-config.js.map +1 -0
- package/dist/fleet/coordinator.d.ts +25 -0
- package/dist/fleet/coordinator.d.ts.map +1 -0
- package/dist/fleet/coordinator.js +40 -0
- package/dist/fleet/coordinator.js.map +1 -0
- package/dist/fleet/index.d.ts +40 -0
- package/dist/fleet/index.d.ts.map +1 -0
- package/dist/fleet/index.js +117 -0
- package/dist/fleet/index.js.map +1 -0
- package/dist/fleet/manifest.d.ts +51 -0
- package/dist/fleet/manifest.d.ts.map +1 -0
- package/dist/fleet/manifest.js +32 -0
- package/dist/fleet/manifest.js.map +1 -0
- package/dist/fleet/reporter.d.ts +32 -0
- package/dist/fleet/reporter.d.ts.map +1 -0
- package/dist/fleet/reporter.js +71 -0
- package/dist/fleet/reporter.js.map +1 -0
- package/dist/fleet/runner.d.ts +48 -0
- package/dist/fleet/runner.d.ts.map +1 -0
- package/dist/fleet/runner.js +104 -0
- package/dist/fleet/runner.js.map +1 -0
- package/dist/fleet/scaffolder.d.ts +12 -0
- package/dist/fleet/scaffolder.d.ts.map +1 -0
- package/dist/fleet/scaffolder.js +82 -0
- package/dist/fleet/scaffolder.js.map +1 -0
- package/dist/fleet/types.d.ts +21 -0
- package/dist/fleet/types.d.ts.map +1 -0
- package/dist/fleet/types.js +2 -0
- package/dist/fleet/types.js.map +1 -0
- package/dist/graph/cli.d.ts +6 -2
- package/dist/graph/cli.d.ts.map +1 -1
- package/dist/graph/cli.js +53 -12
- package/dist/graph/cli.js.map +1 -1
- package/dist/graph/pipeline-lifecycle.d.ts +9 -0
- package/dist/graph/pipeline-lifecycle.d.ts.map +1 -1
- package/dist/graph/pipeline-lifecycle.js +12 -0
- package/dist/graph/pipeline-lifecycle.js.map +1 -1
- package/dist/graph/preflight-injector.d.ts +14 -0
- package/dist/graph/preflight-injector.d.ts.map +1 -1
- package/dist/graph/preflight-injector.js +84 -4
- package/dist/graph/preflight-injector.js.map +1 -1
- package/dist/incident/types.d.ts +24 -24
- package/dist/mcp/tools/graph-schemas.d.ts +7 -7
- package/dist/mcp/tools/init.d.ts.map +1 -1
- package/dist/mcp/tools/init.js +2 -0
- package/dist/mcp/tools/init.js.map +1 -1
- package/dist/orchestrator/agent-loader.d.ts.map +1 -1
- package/dist/orchestrator/agent-loader.js +15 -1
- package/dist/orchestrator/agent-loader.js.map +1 -1
- package/dist/orchestrator/agentic-loop.d.ts +51 -0
- package/dist/orchestrator/agentic-loop.d.ts.map +1 -1
- package/dist/orchestrator/agentic-loop.js +123 -4
- package/dist/orchestrator/agentic-loop.js.map +1 -1
- package/dist/orchestrator/arch-lenses.d.ts +7 -0
- package/dist/orchestrator/arch-lenses.d.ts.map +1 -0
- package/dist/orchestrator/arch-lenses.js +22 -0
- package/dist/orchestrator/arch-lenses.js.map +1 -0
- package/dist/orchestrator/architect-agent.d.ts +16 -0
- package/dist/orchestrator/architect-agent.d.ts.map +1 -1
- package/dist/orchestrator/architect-agent.js +509 -1
- package/dist/orchestrator/architect-agent.js.map +1 -1
- package/dist/orchestrator/curator-agent.js +1 -1
- package/dist/orchestrator/curator-agent.js.map +1 -1
- package/dist/orchestrator/deploy/types.d.ts +2 -2
- package/dist/orchestrator/documenter-agent.d.ts +57 -0
- package/dist/orchestrator/documenter-agent.d.ts.map +1 -0
- package/dist/orchestrator/documenter-agent.js +195 -0
- package/dist/orchestrator/documenter-agent.js.map +1 -0
- package/dist/orchestrator/environment.d.ts +45 -0
- package/dist/orchestrator/environment.d.ts.map +1 -0
- package/dist/orchestrator/environment.js +151 -0
- package/dist/orchestrator/environment.js.map +1 -0
- package/dist/orchestrator/eval-lenses.d.ts +7 -0
- package/dist/orchestrator/eval-lenses.d.ts.map +1 -0
- package/dist/orchestrator/eval-lenses.js +19 -0
- package/dist/orchestrator/eval-lenses.js.map +1 -0
- package/dist/orchestrator/eval-persist.d.ts +25 -0
- package/dist/orchestrator/eval-persist.d.ts.map +1 -0
- package/dist/orchestrator/eval-persist.js +74 -0
- package/dist/orchestrator/eval-persist.js.map +1 -0
- package/dist/orchestrator/evaluator-agent.d.ts +23 -0
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +60 -3
- package/dist/orchestrator/evaluator-agent.js.map +1 -1
- package/dist/orchestrator/generator-agent.d.ts.map +1 -1
- package/dist/orchestrator/generator-agent.js +32 -0
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/memory/distill.d.ts +60 -0
- package/dist/orchestrator/memory/distill.d.ts.map +1 -0
- package/dist/orchestrator/memory/distill.js +177 -0
- package/dist/orchestrator/memory/distill.js.map +1 -0
- package/dist/orchestrator/memory/eval-source.d.ts +20 -0
- package/dist/orchestrator/memory/eval-source.d.ts.map +1 -0
- package/dist/orchestrator/memory/eval-source.js +88 -0
- package/dist/orchestrator/memory/eval-source.js.map +1 -0
- package/dist/orchestrator/memory/retrieve.d.ts +45 -0
- package/dist/orchestrator/memory/retrieve.d.ts.map +1 -0
- package/dist/orchestrator/memory/retrieve.js +102 -0
- package/dist/orchestrator/memory/retrieve.js.map +1 -0
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +12 -0
- package/dist/orchestrator/model-resolver.js.map +1 -1
- package/dist/orchestrator/pipeline.d.ts +10 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +111 -3
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts +22 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +160 -4
- package/dist/orchestrator/planner-agent.js.map +1 -1
- package/dist/orchestrator/research-agent.js +2 -2
- package/dist/orchestrator/research-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +14 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
- package/dist/orchestrator/tools/handlers.js +29 -4
- package/dist/orchestrator/tools/handlers.js.map +1 -1
- package/dist/orchestrator/tools/schemas.js +5 -5
- package/dist/orchestrator/tools/schemas.js.map +1 -1
- package/dist/orchestrator/workflow/args-builder.d.ts +35 -0
- package/dist/orchestrator/workflow/args-builder.d.ts.map +1 -0
- package/dist/orchestrator/workflow/args-builder.js +142 -0
- package/dist/orchestrator/workflow/args-builder.js.map +1 -0
- package/dist/orchestrator/workflow/budget.d.ts +57 -0
- package/dist/orchestrator/workflow/budget.d.ts.map +1 -0
- package/dist/orchestrator/workflow/budget.js +80 -0
- package/dist/orchestrator/workflow/budget.js.map +1 -0
- package/dist/orchestrator/workflow/conformance.d.ts +27 -0
- package/dist/orchestrator/workflow/conformance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/conformance.js +111 -0
- package/dist/orchestrator/workflow/conformance.js.map +1 -0
- package/dist/orchestrator/workflow/eligibility.d.ts +8 -0
- package/dist/orchestrator/workflow/eligibility.d.ts.map +1 -0
- package/dist/orchestrator/workflow/eligibility.js +10 -0
- package/dist/orchestrator/workflow/eligibility.js.map +1 -0
- package/dist/orchestrator/workflow/engine.d.ts +10 -0
- package/dist/orchestrator/workflow/engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/engine.js +2 -0
- package/dist/orchestrator/workflow/engine.js.map +1 -0
- package/dist/orchestrator/workflow/errors.d.ts +13 -0
- package/dist/orchestrator/workflow/errors.d.ts.map +1 -0
- package/dist/orchestrator/workflow/errors.js +26 -0
- package/dist/orchestrator/workflow/errors.js.map +1 -0
- package/dist/orchestrator/workflow/flusher.d.ts +19 -0
- package/dist/orchestrator/workflow/flusher.d.ts.map +1 -0
- package/dist/orchestrator/workflow/flusher.js +81 -0
- package/dist/orchestrator/workflow/flusher.js.map +1 -0
- package/dist/orchestrator/workflow/interpreter.d.ts +48 -0
- package/dist/orchestrator/workflow/interpreter.d.ts.map +1 -0
- package/dist/orchestrator/workflow/interpreter.js +92 -0
- package/dist/orchestrator/workflow/interpreter.js.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts +65 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.js +82 -0
- package/dist/orchestrator/workflow/pure-sprint.js.map +1 -0
- package/dist/orchestrator/workflow/reconciler.d.ts +15 -0
- package/dist/orchestrator/workflow/reconciler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/reconciler.js +65 -0
- package/dist/orchestrator/workflow/reconciler.js.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts +10 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.js +25 -0
- package/dist/orchestrator/workflow/resume-cursor.js.map +1 -0
- package/dist/orchestrator/workflow/retry.d.ts +50 -0
- package/dist/orchestrator/workflow/retry.d.ts.map +1 -0
- package/dist/orchestrator/workflow/retry.js +100 -0
- package/dist/orchestrator/workflow/retry.js.map +1 -0
- package/dist/orchestrator/workflow/scheduler.d.ts +87 -0
- package/dist/orchestrator/workflow/scheduler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/scheduler.js +158 -0
- package/dist/orchestrator/workflow/scheduler.js.map +1 -0
- package/dist/orchestrator/workflow/selector.d.ts +26 -0
- package/dist/orchestrator/workflow/selector.d.ts.map +1 -0
- package/dist/orchestrator/workflow/selector.js +54 -0
- package/dist/orchestrator/workflow/selector.js.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts +52 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.js +75 -0
- package/dist/orchestrator/workflow/synthesizer.js.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts +13 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.js +14 -0
- package/dist/orchestrator/workflow/ts-engine.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +55 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +3 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts +31 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.js +70 -0
- package/dist/orchestrator/workflow/workflow-engine.js.map +1 -0
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +49 -6
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/claude-code.d.ts +44 -0
- package/dist/providers/claude-code.d.ts.map +1 -0
- package/dist/providers/claude-code.js +143 -0
- package/dist/providers/claude-code.js.map +1 -0
- package/dist/providers/factory.d.ts +16 -2
- package/dist/providers/factory.d.ts.map +1 -1
- package/dist/providers/factory.js +66 -12
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +27 -3
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +24 -3
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/preflight.d.ts +22 -0
- package/dist/providers/preflight.d.ts.map +1 -0
- package/dist/providers/preflight.js +54 -0
- package/dist/providers/preflight.js.map +1 -0
- package/dist/providers/structured.d.ts +130 -0
- package/dist/providers/structured.d.ts.map +1 -0
- package/dist/providers/structured.js +205 -0
- package/dist/providers/structured.js.map +1 -0
- package/dist/providers/types.d.ts +28 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/state/history-rotation.d.ts +17 -0
- package/dist/state/history-rotation.d.ts.map +1 -0
- package/dist/state/history-rotation.js +84 -0
- package/dist/state/history-rotation.js.map +1 -0
- package/dist/state/history.d.ts +16 -4
- package/dist/state/history.d.ts.map +1 -1
- package/dist/state/history.js +62 -20
- package/dist/state/history.js.map +1 -1
- package/dist/state/index.d.ts +1 -1
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +1 -1
- package/dist/state/index.js.map +1 -1
- package/dist/state/memory.d.ts +60 -0
- package/dist/state/memory.d.ts.map +1 -0
- package/dist/state/memory.js +242 -0
- package/dist/state/memory.js.map +1 -0
- package/hooks/hooks.json +12 -2
- package/package.json +9 -5
- package/scripts/spike-claude-code-provider.mjs +66 -0
- package/scripts/spike-deepseek.mjs +63 -0
- package/scripts/sync-targets.json +12 -0
- package/scripts/update-all.mjs +255 -0
- package/skills/bober.architect/SKILL.md +13 -0
- package/skills/bober.architect/references/arch-lens-panel.md +126 -0
- package/skills/bober.eval/SKILL.md +9 -0
- package/skills/bober.eval/references/lens-panel.md +115 -0
- package/skills/bober.plan/SKILL.md +6 -0
- package/skills/bober.run/SKILL.md +23 -4
- package/skills/bober.run/references/lens-panel.md +115 -0
- package/skills/bober.sprint/SKILL.md +44 -2
- package/skills/bober.sprint/references/lens-panel.md +115 -0
- package/skills/shared/arch-lens-panel.md +126 -0
- package/skills/shared/lens-panel.md +115 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
3
|
+
// update-all — propagate an agent-bober change to every consuming project.
|
|
4
|
+
//
|
|
5
|
+
// agent-bober is distributed two ways at once:
|
|
6
|
+
// 1. CLI/engine code → ONE copy, shared via npm symlink. `npm run build`
|
|
7
|
+
// recompiles src→dist and every symlinked project picks it up for free.
|
|
8
|
+
// 2. Skills/agents → COPIED into each project's .claude/ by `init`
|
|
9
|
+
// (skills are inlined: SKILL.md + sorted references concatenated into a
|
|
10
|
+
// single .claude/commands/<name>.md). These copies go stale on every
|
|
11
|
+
// skill edit and must be re-emitted per project.
|
|
12
|
+
//
|
|
13
|
+
// This script does both: build once, then re-inline skills + copy agents into
|
|
14
|
+
// every target listed in scripts/sync-targets.json. The inlining format is
|
|
15
|
+
// kept byte-identical to src/cli/commands/init.ts (installClaudeCommands) so a
|
|
16
|
+
// synced project is indistinguishable from a freshly `init`-ed one.
|
|
17
|
+
//
|
|
18
|
+
// Usage:
|
|
19
|
+
// node scripts/update-all.mjs # build + sync all targets
|
|
20
|
+
// node scripts/update-all.mjs --check # dry-run: report drift, write nothing
|
|
21
|
+
// node scripts/update-all.mjs --skills-only # skip the build
|
|
22
|
+
// node scripts/update-all.mjs --no-build # alias of --skills-only
|
|
23
|
+
// node scripts/update-all.mjs --discover # add initialized projects under discoverRoots to the registry
|
|
24
|
+
// node scripts/update-all.mjs /abs/path ... # sync ONLY these paths (ignore registry)
|
|
25
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
import { readFile, writeFile, readdir, mkdir, stat } from "node:fs/promises";
|
|
28
|
+
import { join, dirname, resolve } from "node:path";
|
|
29
|
+
import { fileURLToPath } from "node:url";
|
|
30
|
+
import { execSync } from "node:child_process";
|
|
31
|
+
|
|
32
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
const PKG_ROOT = resolve(__dirname, "..");
|
|
34
|
+
const SKILLS_ROOT = join(PKG_ROOT, "skills");
|
|
35
|
+
const AGENTS_ROOT = join(PKG_ROOT, "agents");
|
|
36
|
+
const TARGETS_FILE = join(__dirname, "sync-targets.json");
|
|
37
|
+
|
|
38
|
+
// Skill-dir → command-file map. MUST match installClaudeCommands in
|
|
39
|
+
// src/cli/commands/init.ts. Derived at runtime from skills/ so it can never
|
|
40
|
+
// drift: every skills/bober.X dir maps to bober-X.md.
|
|
41
|
+
async function buildSkillMap() {
|
|
42
|
+
const entries = await readdir(SKILLS_ROOT, { withFileTypes: true });
|
|
43
|
+
const map = {};
|
|
44
|
+
for (const e of entries) {
|
|
45
|
+
if (!e.isDirectory()) continue;
|
|
46
|
+
if (!e.name.startsWith("bober.")) continue;
|
|
47
|
+
// bober.code-review → bober-code-review.md
|
|
48
|
+
const cmd = e.name.replace(/\./g, "-") + ".md";
|
|
49
|
+
map[e.name] = cmd;
|
|
50
|
+
}
|
|
51
|
+
return map;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Re-create the inlined command file for one skill, byte-identical to init.ts.
|
|
55
|
+
async function inlineSkill(skillDir) {
|
|
56
|
+
const srcSkill = join(SKILLS_ROOT, skillDir, "SKILL.md");
|
|
57
|
+
let content = await readFile(srcSkill, "utf-8");
|
|
58
|
+
|
|
59
|
+
const refsDir = join(SKILLS_ROOT, skillDir, "references");
|
|
60
|
+
try {
|
|
61
|
+
const refFiles = await readdir(refsDir);
|
|
62
|
+
for (const refFile of refFiles.sort()) {
|
|
63
|
+
if (!refFile.endsWith(".md")) continue;
|
|
64
|
+
const refContent = await readFile(join(refsDir, refFile), "utf-8");
|
|
65
|
+
content += `\n\n---\n\n<!-- Reference: ${refFile} -->\n\n${refContent}`;
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
// No references directory — fine.
|
|
69
|
+
}
|
|
70
|
+
return content;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function isDir(p) {
|
|
74
|
+
try {
|
|
75
|
+
return (await stat(p)).isDirectory();
|
|
76
|
+
} catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function fileEquals(path, expected) {
|
|
82
|
+
try {
|
|
83
|
+
return (await readFile(path, "utf-8")) === expected;
|
|
84
|
+
} catch {
|
|
85
|
+
return false; // missing → counts as changed
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Sync skills + agents into ONE project. Returns a per-target report.
|
|
90
|
+
async function syncTarget(projectRoot, { check }) {
|
|
91
|
+
const claudeDir = join(projectRoot, ".claude");
|
|
92
|
+
const commandsDir = join(claudeDir, "commands");
|
|
93
|
+
const agentsDir = join(claudeDir, "agents");
|
|
94
|
+
|
|
95
|
+
const report = { projectRoot, commandsChanged: [], agentsChanged: [], skipped: false };
|
|
96
|
+
|
|
97
|
+
// A target must already be a project (have a .claude/ or bober.config.json).
|
|
98
|
+
// We never create .claude from scratch here — that's init's job.
|
|
99
|
+
if (!(await isDir(claudeDir)) && !(await fileEquals(join(projectRoot, "bober.config.json"), "__never__"))) {
|
|
100
|
+
// bober.config.json may exist even if .claude doesn't; tolerate either.
|
|
101
|
+
if (!(await isDir(claudeDir))) {
|
|
102
|
+
const hasCfg = await readFile(join(projectRoot, "bober.config.json"), "utf-8").then(() => true).catch(() => false);
|
|
103
|
+
if (!hasCfg) {
|
|
104
|
+
report.skipped = true;
|
|
105
|
+
report.reason = "no .claude/ and no bober.config.json — not an agent-bober project";
|
|
106
|
+
return report;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const skillMap = await buildSkillMap();
|
|
112
|
+
|
|
113
|
+
// ── Commands (inlined skills) ──────────────────────────────────────
|
|
114
|
+
if (!check) await mkdir(commandsDir, { recursive: true });
|
|
115
|
+
for (const [skillDir, commandFile] of Object.entries(skillMap)) {
|
|
116
|
+
let content;
|
|
117
|
+
try {
|
|
118
|
+
content = await inlineSkill(skillDir);
|
|
119
|
+
} catch {
|
|
120
|
+
continue; // SKILL.md missing — skip, mirrors init's behaviour
|
|
121
|
+
}
|
|
122
|
+
const dest = join(commandsDir, commandFile);
|
|
123
|
+
if (!(await fileEquals(dest, content))) {
|
|
124
|
+
report.commandsChanged.push(commandFile);
|
|
125
|
+
if (!check) await writeFile(dest, content, "utf-8");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ── Agents (verbatim) ──────────────────────────────────────────────
|
|
130
|
+
if (!check) await mkdir(agentsDir, { recursive: true });
|
|
131
|
+
let agentFiles = [];
|
|
132
|
+
try {
|
|
133
|
+
agentFiles = await readdir(AGENTS_ROOT);
|
|
134
|
+
} catch {
|
|
135
|
+
/* no agents dir in package — unusual but tolerate */
|
|
136
|
+
}
|
|
137
|
+
for (const agentFile of agentFiles) {
|
|
138
|
+
if (!agentFile.endsWith(".md")) continue;
|
|
139
|
+
const content = await readFile(join(AGENTS_ROOT, agentFile), "utf-8");
|
|
140
|
+
const dest = join(agentsDir, agentFile);
|
|
141
|
+
if (!(await fileEquals(dest, content))) {
|
|
142
|
+
report.agentsChanged.push(agentFile);
|
|
143
|
+
if (!check) await writeFile(dest, content, "utf-8");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return report;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Walk discoverRoots and return any initialized project (has a bober-plan.md
|
|
151
|
+
// command — the marker that init ran there). Bounded depth to stay safe/fast.
|
|
152
|
+
async function discover(roots) {
|
|
153
|
+
const found = new Set();
|
|
154
|
+
async function walk(dir, depth) {
|
|
155
|
+
if (depth > 4) return;
|
|
156
|
+
let entries;
|
|
157
|
+
try {
|
|
158
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
159
|
+
} catch {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
// Initialized? marker file present.
|
|
163
|
+
const marker = join(dir, ".claude", "commands", "bober-plan.md");
|
|
164
|
+
if (await readFile(marker, "utf-8").then(() => true).catch(() => false)) {
|
|
165
|
+
found.add(dir);
|
|
166
|
+
}
|
|
167
|
+
for (const e of entries) {
|
|
168
|
+
if (!e.isDirectory()) continue;
|
|
169
|
+
if (e.name === "node_modules" || e.name === ".git" || e.name === "dist") continue;
|
|
170
|
+
await walk(join(dir, e.name), depth + 1);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
for (const r of roots) await walk(r, 0);
|
|
174
|
+
return [...found];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async function loadRegistry() {
|
|
178
|
+
const raw = JSON.parse(await readFile(TARGETS_FILE, "utf-8"));
|
|
179
|
+
return raw;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async function main() {
|
|
183
|
+
const argv = process.argv.slice(2);
|
|
184
|
+
const flags = new Set(argv.filter((a) => a.startsWith("--")));
|
|
185
|
+
const pathArgs = argv.filter((a) => !a.startsWith("--"));
|
|
186
|
+
const check = flags.has("--check");
|
|
187
|
+
const skillsOnly = flags.has("--skills-only") || flags.has("--no-build");
|
|
188
|
+
|
|
189
|
+
// ── Optional: discovery mode (mutates the registry, then exits) ─────
|
|
190
|
+
if (flags.has("--discover")) {
|
|
191
|
+
const reg = await loadRegistry();
|
|
192
|
+
const discovered = await discover(reg.discoverRoots ?? []);
|
|
193
|
+
const before = new Set(reg.targets);
|
|
194
|
+
for (const d of discovered) before.add(d);
|
|
195
|
+
reg.targets = [...before].sort();
|
|
196
|
+
await writeFile(TARGETS_FILE, JSON.stringify(reg, null, 2) + "\n", "utf-8");
|
|
197
|
+
console.log(`Discovered ${discovered.length} initialized project(s); registry now has ${reg.targets.length}:`);
|
|
198
|
+
for (const t of reg.targets) console.log(` - ${t}`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ── 1. Build the CLI (the shared half) ─────────────────────────────
|
|
203
|
+
if (!skillsOnly && !check) {
|
|
204
|
+
console.log("▸ Building CLI (src → dist)…");
|
|
205
|
+
execSync("npm run build", { cwd: PKG_ROOT, stdio: "inherit" });
|
|
206
|
+
console.log(" ✓ dist rebuilt — every symlinked project now runs current code.\n");
|
|
207
|
+
} else if (check) {
|
|
208
|
+
console.log("▸ --check: dry run, nothing will be written.\n");
|
|
209
|
+
} else {
|
|
210
|
+
console.log("▸ --skills-only: skipping build.\n");
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ── 2. Resolve targets ─────────────────────────────────────────────
|
|
214
|
+
let targets;
|
|
215
|
+
if (pathArgs.length > 0) {
|
|
216
|
+
targets = pathArgs.map((p) => resolve(p));
|
|
217
|
+
} else {
|
|
218
|
+
const reg = await loadRegistry();
|
|
219
|
+
targets = reg.targets ?? [];
|
|
220
|
+
}
|
|
221
|
+
if (targets.length === 0) {
|
|
222
|
+
console.error("No targets. Add paths to scripts/sync-targets.json or pass them as args (or run --discover).");
|
|
223
|
+
process.exit(1);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// ── 3. Sync skills + agents into each target ───────────────────────
|
|
227
|
+
console.log(`▸ Syncing skills + agents into ${targets.length} project(s):\n`);
|
|
228
|
+
let totalChanged = 0;
|
|
229
|
+
for (const t of targets) {
|
|
230
|
+
const r = await syncTarget(t, { check });
|
|
231
|
+
if (r.skipped) {
|
|
232
|
+
console.log(` ⊘ ${t}\n skipped: ${r.reason}`);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
const n = r.commandsChanged.length + r.agentsChanged.length;
|
|
236
|
+
totalChanged += n;
|
|
237
|
+
if (n === 0) {
|
|
238
|
+
console.log(` ✓ ${t}\n already up to date`);
|
|
239
|
+
} else {
|
|
240
|
+
console.log(` ${check ? "✎" : "✓"} ${t}`);
|
|
241
|
+
if (r.commandsChanged.length) console.log(` commands ${check ? "would update" : "updated"}: ${r.commandsChanged.length} (${r.commandsChanged.slice(0, 5).join(", ")}${r.commandsChanged.length > 5 ? ", …" : ""})`);
|
|
242
|
+
if (r.agentsChanged.length) console.log(` agents ${check ? "would update" : "updated"}: ${r.agentsChanged.length} (${r.agentsChanged.join(", ")})`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
console.log(
|
|
247
|
+
`\n${check ? "Drift check complete" : "Sync complete"}: ${totalChanged} file(s) ${check ? "out of date" : "written"} across ${targets.length} project(s).`,
|
|
248
|
+
);
|
|
249
|
+
if (check && totalChanged > 0) process.exitCode = 1; // CI-friendly: drift → nonzero
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
main().catch((err) => {
|
|
253
|
+
console.error(err);
|
|
254
|
+
process.exit(1);
|
|
255
|
+
});
|
|
@@ -106,6 +106,13 @@ Wait for user response. If (B) or (C): respawn the subagent with the user's feed
|
|
|
106
106
|
|
|
107
107
|
## Step 6: Checkpoint 2 — Approach Selection
|
|
108
108
|
|
|
109
|
+
**Panel mode (gated, off by default):** Read `config.architect?.panel`. If `panel.enabled` is `true` AND `panel.lenses.length >= 2`, run the PANEL flow described in the inlined Lens Panel reference below (`<!-- Reference: arch-lens-panel.md -->`):
|
|
110
|
+
- First spawn a generate-approaches subagent (producing 2–3 candidate approaches that satisfy the Checkpoint 1 constraints).
|
|
111
|
+
- Then spawn one bober-architect subagent per lens in **MODE:lens-score:\<name\>** for each name in `panel.lenses`, bounded by `panel.maxConcurrent` concurrent spawns. Each scorer receives the same candidate set and scores them exclusively through its lens focus fragment (see `resolveArchLensFocus(lens)` in the reference).
|
|
112
|
+
- Call `synthesize()` (see `src/orchestrator/synthesizer.ts`) to aggregate per-lens scores and produce the ranked winner with dissent. Proceed with the highest-scoring approach as the selected approach.
|
|
113
|
+
|
|
114
|
+
OTHERWISE (panel disabled, or fewer than 2 lenses), spawn exactly ONE bober-architect subagent as described below — byte-identical to today's behaviour.
|
|
115
|
+
|
|
109
116
|
Spawn a subagent with the approved Problem Statement included:
|
|
110
117
|
|
|
111
118
|
```
|
|
@@ -295,6 +302,12 @@ Handle (B)/(C) by respawning with feedback.
|
|
|
295
302
|
|
|
296
303
|
## Step 9: Checkpoint 5 — Final Assembly
|
|
297
304
|
|
|
305
|
+
**Panel mode (gated, off by default):** Read `config.architect?.panel`. If `panel.enabled` is `true` AND `panel.lenses.length >= 2`, run the PANEL flow described in the inlined Lens Panel reference below (`<!-- Reference: arch-lens-panel.md -->`):
|
|
306
|
+
- Spawn one bober-architect subagent per lens in **MODE:lens-review:\<name\>** for each name in `panel.lenses`, bounded by `panel.maxConcurrent` concurrent spawns. Each reviewer receives the assembled architecture document and ADRs and produces a PASS/FAIL verdict exclusively through its lens focus fragment.
|
|
307
|
+
- Call `reconcile()` (see `src/orchestrator/workflow/reconciler.ts`) to aggregate verdicts: strict majority (`passCount > failCount`), **fail-closed on tie** (tie → false). Record the reconciled verdict (including `lensVerdicts` array) in the assembly output.
|
|
308
|
+
|
|
309
|
+
OTHERWISE (panel disabled, or fewer than 2 lenses), spawn exactly ONE bober-architect subagent as described below — byte-identical to today's behaviour.
|
|
310
|
+
|
|
298
311
|
Spawn a subagent to compile the complete architecture document:
|
|
299
312
|
|
|
300
313
|
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Arch Lens Panel — Canonical Protocol Reference
|
|
2
|
+
|
|
3
|
+
This document is the single source of truth for native architect panel orchestration in agent-bober.
|
|
4
|
+
It embeds the seven canonical arch lens focus fragments verbatim from
|
|
5
|
+
`src/orchestrator/arch-lenses.ts` (the `ARCH_LENS_CATALOG` literal) and documents the
|
|
6
|
+
CP2 synthesis panel and CP5 reconcile panel protocols.
|
|
7
|
+
The drift gate (`src/orchestrator/arch-lens-panel-parity.test.ts`) enforces byte-exact parity.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Lens Focus Fragments
|
|
12
|
+
|
|
13
|
+
The following fragments are the exact strings returned by `resolveArchLensFocus(lens)` for each
|
|
14
|
+
built-in arch lens. They MUST remain byte-for-byte identical to the corresponding entries in
|
|
15
|
+
`ARCH_LENS_CATALOG` — the drift gate (`src/orchestrator/arch-lens-panel-parity.test.ts`) enforces this.
|
|
16
|
+
|
|
17
|
+
### scalability
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Focus on whether the proposed architecture can handle projected load growth. Evaluate horizontal and vertical scaling paths, bottlenecks, stateful vs stateless components, and whether partitioning or sharding strategies are available when needed.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### security
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Focus on the threat surface introduced by this architecture. Evaluate trust boundaries, data flows across zones, authentication and authorisation enforcement points, secrets management, and exposure of internal services.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### cost
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Focus on the total cost of ownership implied by this architecture. Evaluate compute, storage, and egress costs at projected scale, licensing or SaaS subscription expenses, and the operational overhead of running, monitoring, and scaling the system.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### operability
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Focus on how easy it will be to operate this architecture in production. Evaluate observability (metrics, logs, traces), deployment complexity, rollout and rollback procedures, on-call burden, and the blast radius of common failure modes.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### maintainability
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Focus on how easy it will be to change and extend this architecture over time. Evaluate coupling between components, clarity of boundaries, documentation needs, onboarding friction for new contributors, and the risk of accruing technical debt.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### reversibility
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Focus on how difficult or costly it would be to undo or replace this architectural decision. Evaluate lock-in to vendors or proprietary technologies, data migration complexity, and whether a strangler-fig or incremental migration path exists if the approach needs to change.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### simplicity
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Focus on whether this is the simplest architecture that satisfies the Checkpoint 1 constraints. Challenge whether each component needs to exist, whether a native platform feature or an already-present dependency removes a proposed custom layer, whether two components should collapse into one, and whether any abstraction is speculative — added for a use case absent from the problem statement. Reward the smallest design that honours every hard constraint; penalise layers introduced for unproven future flexibility, but never at the expense of a stated constraint.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> The `simplicity` lens enforces the top rung of the YAGNI ladder at design time: "does this
|
|
60
|
+
> component need to exist at all?". It is constraint-bounded by construction — it may never
|
|
61
|
+
> recommend dropping a layer that a Checkpoint 1 hard constraint requires. This keeps it
|
|
62
|
+
> consistent with the architect's IRON LAW (every decision must cite the constraint that
|
|
63
|
+
> eliminates the rejected alternative): a simplification that violates a constraint is not simpler,
|
|
64
|
+
> it is wrong.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Native Architect Panel Protocol
|
|
69
|
+
|
|
70
|
+
### CP2 Synthesis Panel
|
|
71
|
+
|
|
72
|
+
At Checkpoint 2 (candidate generation + scoring), the orchestrator runs the synthesis panel:
|
|
73
|
+
|
|
74
|
+
1. **Generate candidates:** The architect produces 2–3 candidate approaches that satisfy the
|
|
75
|
+
Checkpoint 1 constraints.
|
|
76
|
+
|
|
77
|
+
2. **Lens scorer fan-out (one per lens):** The orchestrator spawns one scorer subagent per
|
|
78
|
+
configured arch lens (scalability, security, cost, operability, maintainability, reversibility,
|
|
79
|
+
simplicity), bounded by `maxConcurrent`. Each scorer receives the same candidate set and is instructed to
|
|
80
|
+
score the candidates exclusively through its lens focus fragment (the exact string returned by
|
|
81
|
+
`resolveArchLensFocus(lens)` from `src/orchestrator/arch-lenses.ts`).
|
|
82
|
+
|
|
83
|
+
3. **Synthesis:** `synthesize()` in `src/orchestrator/synthesizer.ts` aggregates the per-lens
|
|
84
|
+
scores and produces a ranked winner with dissent. The highest-scoring approach across lenses
|
|
85
|
+
becomes the recommended architecture; any lens that preferred a different candidate is recorded
|
|
86
|
+
as a dissenting voice in the synthesis output.
|
|
87
|
+
|
|
88
|
+
### CP5 Reconcile Panel
|
|
89
|
+
|
|
90
|
+
At Checkpoint 5 (review pass), the orchestrator runs the reconcile panel:
|
|
91
|
+
|
|
92
|
+
1. **Lens reviewer fan-out (one per lens):** The orchestrator spawns one reviewer subagent per
|
|
93
|
+
configured arch lens. Each reviewer receives the assembled architecture document and ADRs, and
|
|
94
|
+
is instructed to produce a PASS/FAIL verdict exclusively through its lens focus fragment.
|
|
95
|
+
|
|
96
|
+
2. **Reconciliation — fail-closed on tie:** `reconcile()` in
|
|
97
|
+
`src/orchestrator/workflow/reconciler.ts` aggregates the per-lens verdicts using the following
|
|
98
|
+
semantics:
|
|
99
|
+
|
|
100
|
+
- **Inputs:** the array of per-lens `EvalResult` objects (`lensVerdicts`).
|
|
101
|
+
- **Require non-empty:** an empty array throws `"reconcile: lensVerdicts must be non-empty"`.
|
|
102
|
+
- **Vote count:** `passCount` = number of lenses where `passed === true`;
|
|
103
|
+
`failCount` = total − passCount.
|
|
104
|
+
- **Verdict:** `passed = passCount > failCount` (strict majority).
|
|
105
|
+
- **Fail-closed on tie:** when `passCount === failCount` the panel verdict is `false`.
|
|
106
|
+
- **Details:** union of all failing lens details, de-duplicated by `(criterion, message)` key.
|
|
107
|
+
- **Feedback:** failing lenses' feedback joined with `\n`; `"All lenses passed."` when all pass.
|
|
108
|
+
- **Summary:** `"Panel verdict: ${passCount}/${n} lenses passed"`.
|
|
109
|
+
- **Score:** `Math.round((100 * passCount) / n)`.
|
|
110
|
+
- **Evaluator tag:** `evaluator = "panel"`.
|
|
111
|
+
|
|
112
|
+
### lensVerdicts Output Shape
|
|
113
|
+
|
|
114
|
+
After reconciliation the orchestrator writes a `lensVerdicts` array into the saved result.
|
|
115
|
+
The array shape is:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
lensVerdicts: Array<{
|
|
119
|
+
lens: string; // e.g. "scalability", "security", "cost", "operability", "maintainability", "reversibility", "simplicity"
|
|
120
|
+
passed: boolean; // individual lens verdict
|
|
121
|
+
summary: string; // per-lens summary from the scorer or reviewer subagent
|
|
122
|
+
}>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This field is optional and backward-compatible: results produced before the panel feature
|
|
126
|
+
(or by non-panel architect runs) simply omit it.
|
|
@@ -61,6 +61,15 @@ Determine the iteration number: if prior eval results exist for this contract in
|
|
|
61
61
|
|
|
62
62
|
## Step 3: Spawn the Evaluator Subagent
|
|
63
63
|
|
|
64
|
+
**Panel mode (gated, off by default):** Read `config.evaluator.panel`. If `panel.enabled` is `true` AND `panel.lenses.length >= 2`, run the PANEL flow described in the inlined Lens Panel reference below (`<!-- Reference: lens-panel.md -->`):
|
|
65
|
+
- Spawn ONE bober-evaluator with **MODE:deterministic** — runs the configured strategy suite exactly once.
|
|
66
|
+
- Then spawn one bober-evaluator per lens with **MODE:lens:<name>** for each name in `panel.lenses`, bounded by `panel.maxConcurrent` concurrent spawns.
|
|
67
|
+
- Collect each lens verdict; majority-vote: `passed = passCount > failCount`, **FAIL-CLOSED on tie** (tie → false).
|
|
68
|
+
- Set `final.passed = deterministic.passed && reconciled.passed`.
|
|
69
|
+
- Save the eval-result with `evaluator: "panel"` and a `lensVerdicts: [{ lens, passed, summary }]` array.
|
|
70
|
+
|
|
71
|
+
OTHERWISE (panel disabled, or fewer than 2 lenses), spawn exactly ONE bober-evaluator with **MODE:full** exactly as described below — byte-identical to today's behaviour.
|
|
72
|
+
|
|
64
73
|
Use the **Agent tool** to spawn an evaluator subagent.
|
|
65
74
|
|
|
66
75
|
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Lens Panel — Canonical Protocol Reference
|
|
2
|
+
|
|
3
|
+
This document is the single source of truth for native panel orchestration in agent-bober.
|
|
4
|
+
It embeds the five canonical lens focus fragments verbatim from
|
|
5
|
+
`src/orchestrator/eval-lenses.ts` (the `LENS_CATALOG` literal) and documents the
|
|
6
|
+
split fan-out, majority-vote/fail-closed reconciliation, and the `lensVerdicts` output shape.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Lens Focus Fragments
|
|
11
|
+
|
|
12
|
+
The following fragments are the exact strings returned by `resolveLensFocus(lens)` for each
|
|
13
|
+
built-in lens. They MUST remain byte-for-byte identical to the corresponding entries in
|
|
14
|
+
`LENS_CATALOG` — the drift gate (`src/orchestrator/lens-panel-parity.test.ts`) enforces this.
|
|
15
|
+
|
|
16
|
+
### correctness
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Focus on whether the implementation actually satisfies each success criterion verbatim. Check that all required behaviours exist, all edge cases are handled, and the contract's definitionOfDone is met.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### security
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Focus on injection vulnerabilities, authentication and authorisation gaps, secret handling, unsafe input validation, and any path traversal or privilege escalation risks.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### regression
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Focus on whether previously working behaviour still works after the changes. Verify that pre-existing tests pass, that no public API or config interface was broken, and that the sprint diff does not silently remove functionality.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### quality
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Focus on principles violations, dead code, misleading naming, smells, duplicated logic, and whether the implementation follows the project's established patterns and conventions.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### simplicity
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Focus exclusively on over-engineering in the production code: logic that reinvents the standard library, dependencies or hand-rolled code doing what a native platform feature already provides, abstractions with a single implementation, configuration nobody reads, dead flexibility, and code expressible in materially fewer lines. For each, name the location, what to cut, and what replaces it. Never flag tests, assertion-based self-checks, input validation at trust boundaries, error handling, security measures, or accessibility as deletable — minimalism governs production code, never the verification or safety discipline.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> The `simplicity` lens is the complexity-only counterpart to `quality`. `quality` asks
|
|
47
|
+
> "does this follow our patterns and is it free of smells?"; `simplicity` asks "what can be
|
|
48
|
+
> deleted, replaced by stdlib/native, or shrunk?" — and is forbidden from ever recommending the
|
|
49
|
+
> removal of a test, a validation, or a safety measure. It pairs cleanly with the evaluator's
|
|
50
|
+
> test/verification Iron Law: minimalism governs what is built, never what is verified.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Native Panel Protocol
|
|
55
|
+
|
|
56
|
+
### Split Fan-out
|
|
57
|
+
|
|
58
|
+
When the native panel is active, the orchestrator spawns evaluators in two passes:
|
|
59
|
+
|
|
60
|
+
1. **Deterministic evaluator (one instance):** runs the configured strategy suite exactly once
|
|
61
|
+
(build, typecheck, lint, unit-test, playwright, api-check, etc.). This produces the
|
|
62
|
+
deterministic verdict — objective, tool-based checks that do not depend on lens focus.
|
|
63
|
+
|
|
64
|
+
2. **Qualitative evaluators (one per configured lens):** each evaluator receives the same
|
|
65
|
+
sprint diff and context but is instructed to judge the contract's success criteria
|
|
66
|
+
exclusively through its lens focus fragment. The strategy suite is **not** re-run for
|
|
67
|
+
these evaluators — they perform qualitative assessment only, using the results already
|
|
68
|
+
collected by the deterministic evaluator as supporting context.
|
|
69
|
+
|
|
70
|
+
This split ensures strategies execute once (no duplicate CI cost) while each lens evaluates
|
|
71
|
+
the diff independently.
|
|
72
|
+
|
|
73
|
+
### Reconciliation — Majority Vote, Fail-Closed
|
|
74
|
+
|
|
75
|
+
The lens verdicts are reconciled by `reconcile()` in
|
|
76
|
+
`src/orchestrator/workflow/reconciler.ts` using the following semantics:
|
|
77
|
+
|
|
78
|
+
- **Inputs:** the array of per-lens `EvalResult` objects (`lensVerdicts`).
|
|
79
|
+
- **Require non-empty:** an empty array throws `"reconcile: lensVerdicts must be non-empty"`.
|
|
80
|
+
- **Vote count:** `passCount` = number of lenses where `passed === true`;
|
|
81
|
+
`failCount` = total − passCount.
|
|
82
|
+
- **Verdict:** `passed = passCount > failCount` (strict majority).
|
|
83
|
+
- **Fail-closed on tie:** when `passCount === failCount` the panel verdict is `false`.
|
|
84
|
+
- **Details:** union of all failing lens details, de-duplicated by `(criterion, message)` key.
|
|
85
|
+
- **Feedback:** failing lenses' feedback joined with `\n`; `"All lenses passed."` when all pass.
|
|
86
|
+
- **Summary:** `"Panel verdict: ${passCount}/${n} lenses passed"`.
|
|
87
|
+
- **Score:** `Math.round((100 * passCount) / n)`.
|
|
88
|
+
- **Evaluator tag:** `evaluator = "panel"`.
|
|
89
|
+
- **Timestamp:** echoed verbatim from the input argument (pure function, ADR-4).
|
|
90
|
+
|
|
91
|
+
### Combine
|
|
92
|
+
|
|
93
|
+
The final sprint verdict combines both passes:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
final.passed = deterministic.passed && reconciled.passed
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Both must pass for the sprint to be accepted.
|
|
100
|
+
|
|
101
|
+
### lensVerdicts Output Shape
|
|
102
|
+
|
|
103
|
+
After reconciliation the orchestrator writes a `lensVerdicts` array into the saved
|
|
104
|
+
`EvalResult` JSON and sets `evaluator = "panel"`. The array shape is:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
lensVerdicts: Array<{
|
|
108
|
+
lens: string; // e.g. "correctness", "security", "regression", "quality", "simplicity"
|
|
109
|
+
passed: boolean; // individual lens verdict
|
|
110
|
+
summary: string; // per-lens summary from the qualitative evaluator
|
|
111
|
+
}>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This field is optional and backward-compatible: eval results produced before the panel
|
|
115
|
+
feature (or by non-panel evaluators) simply omit it.
|
|
@@ -77,6 +77,12 @@ Read the following files if they exist (skip those that do not):
|
|
|
77
77
|
3. `package.json` — dependencies, scripts, project metadata
|
|
78
78
|
4. `tsconfig.json` — TypeScript configuration
|
|
79
79
|
5. Any files listed in `planner.contextFiles` from the config
|
|
80
|
+
6. **Learn from past sprint outcomes (bounded memory):** Load the distilled lessons index via
|
|
81
|
+
`retrieveRelevantLessons(projectRoot, keywords, { topK })`, deriving `keywords` from the feature
|
|
82
|
+
title/description. This reads ONLY the bounded `.bober/memory/INDEX.md` and returns at most
|
|
83
|
+
`topK` deterministically-ranked lessons. **Do NOT read `.bober/history.jsonl` directly** — the raw
|
|
84
|
+
history is unbounded and is intentionally off-limits to the planner. Use the returned lessons to
|
|
85
|
+
avoid repeating past failure patterns when shaping sprints.
|
|
80
86
|
|
|
81
87
|
Survey the project structure:
|
|
82
88
|
- Use Glob with patterns appropriate to the stack to understand the file layout (e.g., `src/**/*.ts`, `contracts/**/*.sol`, `programs/**/*.rs`, `app/**/*`, `pages/**/*`)
|
|
@@ -52,7 +52,7 @@ ORCHESTRATOR (you — this session)
|
|
|
52
52
|
│ │ └─ Add evaluator feedback to handoff
|
|
53
53
|
│ │ └─ Go to 4b (spawn FRESH generator with feedback)
|
|
54
54
|
│ │
|
|
55
|
-
│ └─ 4e. If PASSED: update contract status, log, next sprint
|
|
55
|
+
│ └─ 4e. If PASSED: update contract status, log, spawn documenter (per-sprint docs), next sprint
|
|
56
56
|
│
|
|
57
57
|
└─ 5. Final summary
|
|
58
58
|
```
|
|
@@ -443,6 +443,15 @@ When done, respond with EXACTLY this JSON structure (no other text):
|
|
|
443
443
|
|
|
444
444
|
### 3f. Spawn the Evaluator Subagent
|
|
445
445
|
|
|
446
|
+
**Panel mode (gated, off by default):** Read `config.evaluator.panel`. If `panel.enabled` is `true` AND `panel.lenses.length >= 2`, run the PANEL flow described in the inlined Lens Panel reference below (`<!-- Reference: lens-panel.md -->`):
|
|
447
|
+
- Spawn ONE bober-evaluator with **MODE:deterministic** — runs the configured strategy suite exactly once.
|
|
448
|
+
- Then spawn one bober-evaluator per lens with **MODE:lens:<name>** for each name in `panel.lenses`, bounded by `panel.maxConcurrent` concurrent spawns.
|
|
449
|
+
- Collect each lens verdict; majority-vote: `passed = passCount > failCount`, **FAIL-CLOSED on tie** (tie → false).
|
|
450
|
+
- Set `final.passed = deterministic.passed && reconciled.passed`.
|
|
451
|
+
- Save the eval-result with `evaluator: "panel"` and a `lensVerdicts: [{ lens, passed, summary }]` array.
|
|
452
|
+
|
|
453
|
+
OTHERWISE (panel disabled, or fewer than 2 lenses), spawn exactly ONE bober-evaluator with **MODE:full** exactly as described below — byte-identical to today's behaviour.
|
|
454
|
+
|
|
446
455
|
Use the **Agent tool** to spawn an evaluator subagent.
|
|
447
456
|
|
|
448
457
|
**How to call the Agent tool:**
|
|
@@ -547,20 +556,30 @@ When done, respond with EXACTLY this JSON structure (no other text):
|
|
|
547
556
|
```json
|
|
548
557
|
{"event":"sprint-completed","contractId":"...","specId":"...","iteration":N,"timestamp":"..."}
|
|
549
558
|
```
|
|
550
|
-
4. **
|
|
559
|
+
4. **Spawn the Documenter subagent — write docs now, per-sprint, while the change is fresh.** Do NOT defer documentation to a final sprint. Use the Agent tool with `subagent_type: bober-documenter` and `mode: auto`:
|
|
560
|
+
```
|
|
561
|
+
You are the Bober Documenter subagent. Sprint <N> just PASSED evaluation and was marked complete. Write its documentation and update related docs while the change is fresh.
|
|
562
|
+
|
|
563
|
+
Read from disk: .bober/contracts/<contractId>.json, .bober/handoffs/gen-report-<contractId>-<iteration>.json, .bober/eval-results/eval-<contractId>-<iteration>.json, and .bober/principles.md if it exists.
|
|
564
|
+
|
|
565
|
+
Follow your agent instructions: determine what was built from the committed diff, write the sprint record to docs/sprints/<contractId>.md, find & update related existing docs (README, ADRs, CLAUDE.md, module docs) made stale by the change, and commit ONLY the doc files separately. Do NOT modify application code or tests. Respond with the JSON structure defined in your agent spec.
|
|
566
|
+
```
|
|
567
|
+
After it returns: parse the JSON. If it crashed, do NOT fail the sprint (it already passed) — log `{"event":"sprint-docs-failed","contractId":"...","timestamp":"..."}` and continue. Carry any non-empty `concerns` into the milestone print.
|
|
568
|
+
5. **Check if the plan is now fully complete.** Read the PlanSpec's `sprints` array to get the total sprint count. Count how many of those contracts now have `status: "completed"`. If ALL sprints are completed (N/N):
|
|
551
569
|
- Update the PlanSpec: set `status` to `"completed"` and `completedAt` to current ISO-8601 timestamp. Save to `.bober/specs/<specId>.json`. **The `status` field MUST remain in the first 10 lines of the JSON** so future runs can skip it with a partial read.
|
|
552
570
|
- Update `.bober/progress.md` — change the plan's status line to `completed (N/N sprints)`.
|
|
553
571
|
- Log event: `{"event":"plan-completed","specId":"...","sprintsCompleted":N,"timestamp":"..."}`
|
|
554
|
-
|
|
572
|
+
6. Print milestone:
|
|
555
573
|
```
|
|
556
574
|
=== Sprint <N>/<total> PASSED ===
|
|
557
575
|
Title: <title>
|
|
558
576
|
Iteration: <M>
|
|
559
577
|
Progress: [=====> ] <N>/<total> sprints complete
|
|
578
|
+
Docs: <sprintDocPath> (+ <count> related docs updated)
|
|
560
579
|
Next: <next sprint title>
|
|
561
580
|
```
|
|
562
581
|
If all sprints are done, print `=== PLAN COMPLETE ===` instead of "Next:".
|
|
563
|
-
|
|
582
|
+
7. Move to next sprint.
|
|
564
583
|
|
|
565
584
|
**On FAIL with retries remaining:**
|
|
566
585
|
1. Check if iteration < `evaluator.maxIterations` (default: 3).
|