@bragi-gmbh/codebus 1.4.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/ci-hooks/ci-hooks.js +126 -0
  2. package/dist/ci-hooks/ci-hooks.js.map +1 -0
  3. package/dist/commands/adr.js +30 -0
  4. package/dist/commands/adr.js.map +1 -0
  5. package/dist/commands/agent.js +175 -0
  6. package/dist/commands/agent.js.map +1 -0
  7. package/dist/commands/as.js +1 -1
  8. package/dist/commands/as.js.map +1 -1
  9. package/dist/commands/ask.js +1 -1
  10. package/dist/commands/ask.js.map +1 -1
  11. package/dist/commands/checkin.js +1 -1
  12. package/dist/commands/checkin.js.map +1 -1
  13. package/dist/commands/ci-findings.js +129 -0
  14. package/dist/commands/ci-findings.js.map +1 -0
  15. package/dist/commands/ci-reply.js +117 -0
  16. package/dist/commands/ci-reply.js.map +1 -0
  17. package/dist/commands/ci-steer-escalate.js +65 -0
  18. package/dist/commands/ci-steer-escalate.js.map +1 -0
  19. package/dist/commands/cli-mcp-correlation.js +131 -0
  20. package/dist/commands/cli-mcp-correlation.js.map +1 -0
  21. package/dist/commands/connector-attach-detach.js +542 -0
  22. package/dist/commands/connector-attach-detach.js.map +1 -0
  23. package/dist/commands/connector.js +513 -0
  24. package/dist/commands/connector.js.map +1 -0
  25. package/dist/commands/contract.js +33 -0
  26. package/dist/commands/contract.js.map +1 -0
  27. package/dist/commands/correlation.js +194 -0
  28. package/dist/commands/correlation.js.map +1 -0
  29. package/dist/commands/decision.js +63 -0
  30. package/dist/commands/decision.js.map +1 -1
  31. package/dist/commands/digest.js +14 -3
  32. package/dist/commands/digest.js.map +1 -1
  33. package/dist/commands/do.js +127 -0
  34. package/dist/commands/do.js.map +1 -0
  35. package/dist/commands/factory-attention.js +106 -0
  36. package/dist/commands/factory-attention.js.map +1 -0
  37. package/dist/commands/factory-context-read.js +171 -0
  38. package/dist/commands/factory-context-read.js.map +1 -0
  39. package/dist/commands/factory-interventions.js +102 -0
  40. package/dist/commands/factory-interventions.js.map +1 -0
  41. package/dist/commands/factory.js +187 -0
  42. package/dist/commands/factory.js.map +1 -1
  43. package/dist/commands/github-login.js +109 -53
  44. package/dist/commands/github-login.js.map +1 -1
  45. package/dist/commands/graph-pull.js +130 -0
  46. package/dist/commands/graph-pull.js.map +1 -0
  47. package/dist/commands/graph.js +5 -1
  48. package/dist/commands/graph.js.map +1 -1
  49. package/dist/commands/inbox.js +7 -7
  50. package/dist/commands/inbox.js.map +1 -1
  51. package/dist/commands/ingest.js +1 -1
  52. package/dist/commands/ingest.js.map +1 -1
  53. package/dist/commands/init.js +10 -1
  54. package/dist/commands/init.js.map +1 -1
  55. package/dist/commands/install.js +1160 -55
  56. package/dist/commands/install.js.map +1 -1
  57. package/dist/commands/integration-ledger.js +81 -0
  58. package/dist/commands/integration-ledger.js.map +1 -0
  59. package/dist/commands/knowledge.js +194 -0
  60. package/dist/commands/knowledge.js.map +1 -0
  61. package/dist/commands/links.js +1 -1
  62. package/dist/commands/links.js.map +1 -1
  63. package/dist/commands/login.js +1 -1
  64. package/dist/commands/login.js.map +1 -1
  65. package/dist/commands/morning.js +50 -1
  66. package/dist/commands/morning.js.map +1 -1
  67. package/dist/commands/plan-compiler.js +260 -0
  68. package/dist/commands/plan-compiler.js.map +1 -0
  69. package/dist/commands/plan-lint.js +275 -0
  70. package/dist/commands/plan-lint.js.map +1 -0
  71. package/dist/commands/plan-score.js +203 -0
  72. package/dist/commands/plan-score.js.map +1 -0
  73. package/dist/commands/plan.js +481 -15
  74. package/dist/commands/plan.js.map +1 -1
  75. package/dist/commands/product-validity.js +168 -0
  76. package/dist/commands/product-validity.js.map +1 -0
  77. package/dist/commands/question.js +1 -1
  78. package/dist/commands/question.js.map +1 -1
  79. package/dist/commands/read-policy.js +131 -0
  80. package/dist/commands/read-policy.js.map +1 -0
  81. package/dist/commands/read.js +1 -1
  82. package/dist/commands/read.js.map +1 -1
  83. package/dist/commands/repo.js +106 -8
  84. package/dist/commands/repo.js.map +1 -1
  85. package/dist/commands/repository-protection.js +209 -0
  86. package/dist/commands/repository-protection.js.map +1 -0
  87. package/dist/commands/resolve.js +2 -2
  88. package/dist/commands/resolve.js.map +1 -1
  89. package/dist/commands/self-healing.js +26 -0
  90. package/dist/commands/self-healing.js.map +1 -0
  91. package/dist/commands/send.js +1 -1
  92. package/dist/commands/send.js.map +1 -1
  93. package/dist/commands/serial-merge.js +303 -0
  94. package/dist/commands/serial-merge.js.map +1 -0
  95. package/dist/commands/session.js +1 -1
  96. package/dist/commands/session.js.map +1 -1
  97. package/dist/commands/spend.js +31 -0
  98. package/dist/commands/spend.js.map +1 -0
  99. package/dist/commands/task.js +92 -1
  100. package/dist/commands/task.js.map +1 -1
  101. package/dist/commands/taxonomy.js +21 -0
  102. package/dist/commands/taxonomy.js.map +1 -0
  103. package/dist/commands/verify.js +77 -0
  104. package/dist/commands/verify.js.map +1 -0
  105. package/dist/config/self-healing-analysis.json +158 -0
  106. package/dist/errors.js +18 -4
  107. package/dist/errors.js.map +1 -1
  108. package/dist/execution/client.js +53 -0
  109. package/dist/execution/client.js.map +1 -0
  110. package/dist/execution/local.js +24 -0
  111. package/dist/execution/local.js.map +1 -0
  112. package/dist/execution/ssh.js +38 -0
  113. package/dist/execution/ssh.js.map +1 -0
  114. package/dist/graph.js +78 -16
  115. package/dist/graph.js.map +1 -1
  116. package/dist/index.js +40 -2
  117. package/dist/index.js.map +1 -1
  118. package/dist/json-lite.js +248 -0
  119. package/dist/json-lite.js.map +1 -0
  120. package/dist/knowledge-drift.js +40 -0
  121. package/dist/knowledge-drift.js.map +1 -0
  122. package/dist/lint/parallelism.js +414 -0
  123. package/dist/lint/parallelism.js.map +1 -0
  124. package/dist/mail-latency.js +11 -1
  125. package/dist/mail-latency.js.map +1 -1
  126. package/dist/mcp-ci-findings.js +31 -0
  127. package/dist/mcp-ci-findings.js.map +1 -0
  128. package/dist/mcp-correlation.js +290 -0
  129. package/dist/mcp-correlation.js.map +1 -0
  130. package/dist/mcp-factory-context-read.js +81 -0
  131. package/dist/mcp-factory-context-read.js.map +1 -0
  132. package/dist/mcp-registry.js +147 -1
  133. package/dist/mcp-registry.js.map +1 -1
  134. package/dist/mcp.js +94 -5
  135. package/dist/mcp.js.map +1 -1
  136. package/dist/openrouter-reservation-guard.js +97 -0
  137. package/dist/openrouter-reservation-guard.js.map +1 -0
  138. package/dist/self-healing-analysis-loader.js +150 -0
  139. package/dist/self-healing-analysis-loader.js.map +1 -0
  140. package/dist/sender.js +11 -9
  141. package/dist/sender.js.map +1 -1
  142. package/dist/toml-lite.js +546 -0
  143. package/dist/toml-lite.js.map +1 -0
  144. package/dist/version-check.js +23 -7
  145. package/dist/version-check.js.map +1 -1
  146. package/package.json +5 -3
@@ -0,0 +1,203 @@
1
+ import { CodebusError } from "../errors.js";
2
+ import { makeCtx, workspaceId } from "../client.js";
3
+ import { resolveConfig } from "../config.js";
4
+ // Twelve triage categories from ADR-0007.
5
+ export const PLAN_SCORE_CATEGORIES = [
6
+ "architecture",
7
+ "cost-bounds",
8
+ "requirements-clarity",
9
+ "risk-assessment",
10
+ "team-capacity",
11
+ "schedule-realism",
12
+ "scope-ambiguity",
13
+ "specification-completeness",
14
+ "stakeholder-alignment",
15
+ "success-criteria",
16
+ "trade-offs",
17
+ "versioning-strategy",
18
+ ];
19
+ /**
20
+ * Compute twelve-category scores for a plan revision.
21
+ * This is a deterministic, context-aware scoring function that evaluates:
22
+ *
23
+ * - Architecture: design patterns, modularity, scalability
24
+ * - Cost-bounds: budget clarity, cost justification
25
+ * - Requirements-clarity: problem statement, acceptance criteria
26
+ * - Risk-assessment: identified risks, mitigation strategy
27
+ * - Team-capacity: skills, availability, team size
28
+ * - Schedule-realism: timeline, dependencies, padding
29
+ * - Scope-ambiguity: scope boundaries, change control
30
+ * - Specification-completeness: detail level, acceptance criteria
31
+ * - Stakeholder-alignment: approvals, buy-in, communication
32
+ * - Success-criteria: measurable outcomes, verification method
33
+ * - Trade-offs: alternatives considered, rationale
34
+ * - Versioning-strategy: versioning, deprecation, rollback
35
+ *
36
+ * Returns scores 0-5 per category based on plan quality indicators.
37
+ */
38
+ export function computePlanScores(planDocument, reporterRole) {
39
+ const scores = {};
40
+ // Helper utilities.
41
+ const obj = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
42
+ const text = (value) => typeof value === "string" ? value : "";
43
+ const list = (value) => Array.isArray(value) ? value : [];
44
+ const num = (value) => typeof value === "number" ? value : 0;
45
+ const plan = obj(planDocument);
46
+ // 1. Architecture: multi-stage structure, clear role separation
47
+ const stages = list(plan.stages).map(obj);
48
+ const roles = obj(plan.roles);
49
+ const stageQuality = stages.length >= 3 ? 2 : stages.length > 0 ? 1 : 0;
50
+ const roleQuality = ["owner", "driver", "reviewer", "approver"].every(r => obj(roles[r]).id) ? 2 : 1;
51
+ scores.architecture = Math.min(5, 1 + stageQuality + roleQuality);
52
+ // 2. Cost-bounds: budget explicitly stated and reasonable
53
+ const budget = num(plan.budget_usd);
54
+ scores["cost-bounds"] = budget > 0 && budget <= 2000 ? 4.5 : budget > 0 ? 3.5 : 1;
55
+ // 3. Requirements-clarity: plan name, stage goals documented
56
+ const hasName = text(plan.name).length > 10;
57
+ const hasStageGoals = stages.some(s => text(s.goal).length > 10);
58
+ scores["requirements-clarity"] = (hasName ? 2.5 : 1) + (hasStageGoals ? 2 : 1);
59
+ // 4. Risk-assessment: irreversible tags declared, gates present
60
+ const hasIrreversible = stages.some(s => list(s.irreversible_tags).length > 0 || s.irreversible === true);
61
+ const hasHumanGates = stages.some(s => s.gate === "human");
62
+ scores["risk-assessment"] = (hasIrreversible ? 2 : 1) + (hasHumanGates ? 2 : 0);
63
+ // 5. Team-capacity: reviewer, executor roles assigned
64
+ const hasReviewer = !!text(obj(roles.reviewer).id);
65
+ const executors = list(roles.executor).filter(e => text(obj(e).id));
66
+ scores["team-capacity"] = (hasReviewer ? 2 : 1) + Math.min(2, executors.length);
67
+ // 6. Schedule-realism: stages have reasonable time bounds
68
+ const stageTimes = stages.map(s => num(s.max_minutes)).filter(m => m > 0);
69
+ const totalTime = stageTimes.reduce((a, b) => a + b, 0);
70
+ scores["schedule-realism"] = totalTime > 0 && totalTime <= 75 && stageTimes.length === stages.length ? 4.5 : 2;
71
+ // 7. Scope-ambiguity: allowed_paths declared, dependencies explicit
72
+ const hasPaths = stages.every(s => list(s.allowed_paths).length > 0);
73
+ const hasDeps = stages.some(s => list(s.depends_on).length > 0 || stages.length === 1);
74
+ scores["scope-ambiguity"] = (hasPaths ? 2 : 1) + (hasDeps ? 2.5 : 1.5);
75
+ // 8. Specification-completeness: each stage has done_when, metric, prompt_ref
76
+ const specComplete = stages.every(s => text(s.done_when).length > 10 && text(s.metric).length > 5 && text(s.prompt_ref).length > 0);
77
+ scores["specification-completeness"] = specComplete && stages.length > 0 ? 4.5 : stages.length > 0 ? 2 : 1;
78
+ // 9. Stakeholder-alignment: approver role clearly defined
79
+ const hasApprover = !!text(obj(roles.approver).id);
80
+ const approverKind = text(obj(roles.approver).kind);
81
+ scores["stakeholder-alignment"] = hasApprover && ["person", "agent"].includes(approverKind) ? 4 : 2;
82
+ // 10. Success-criteria: metric field present on each stage
83
+ const hasMetrics = stages.length > 0 && stages.every(s => text(s.metric).length > 0);
84
+ scores["success-criteria"] = hasMetrics ? 4.5 : stages.length > 0 ? 2 : 1;
85
+ // 11. Trade-offs: stages present dependencies indicating design decisions
86
+ const maxDepth = stages.length > 0 ? Math.max(...stages.map(s => list(s.depends_on).length)) : 0;
87
+ scores["trade-offs"] = 2 + (stages.length > 1 ? 1.5 : 0) + (maxDepth > 1 ? 1 : 0);
88
+ // 12. Versioning-strategy: document version or stage versioning evident
89
+ const hasVersion = text(plan.version).length > 0 || text(plan.revision).length > 0;
90
+ scores["versioning-strategy"] = hasVersion ? 4 : stages.length > 1 ? 3 : 2;
91
+ // Clamp all scores to 0–5 range.
92
+ for (const category of PLAN_SCORE_CATEGORIES) {
93
+ scores[category] = Math.max(0, Math.min(5, scores[category]));
94
+ }
95
+ return scores;
96
+ }
97
+ /**
98
+ * Submit a plan score report online to CodeBus.
99
+ * Resolves the plan by reference (UUID or display_id), validates the revision digest,
100
+ * computes scores, and records the report via the plan_score_report_record RPC.
101
+ */
102
+ export async function scorePlanOnline(ctx, planRef, revisionDigest, reporterRole) {
103
+ const ws = await workspaceId(ctx);
104
+ const key = /^CB-PLAN-/i.test(planRef) ? "display_id" : "id";
105
+ // Resolve plan and verify digest.
106
+ const { data: plan, error: planError } = await ctx.supabase
107
+ .from("plan_list_v1")
108
+ .select("*")
109
+ .eq("workspace_id", ws)
110
+ .eq(key, key === "display_id" ? planRef.toUpperCase() : planRef)
111
+ .single();
112
+ if (planError || !plan || plan.revision_digest !== revisionDigest || !plan.latest_revision_id) {
113
+ return {
114
+ revision_id: "",
115
+ reporter_role: reporterRole,
116
+ scores: {},
117
+ mean_score: 0,
118
+ success: false,
119
+ error: "plan score requires the exact latest revision digest",
120
+ };
121
+ }
122
+ // Fetch the plan revision document.
123
+ const { data: revision, error: revisionError } = await ctx.supabase
124
+ .from("plan_revisions")
125
+ .select("document")
126
+ .eq("id", plan.latest_revision_id)
127
+ .single();
128
+ if (revisionError || !revision?.document) {
129
+ return {
130
+ revision_id: plan.latest_revision_id,
131
+ reporter_role: reporterRole,
132
+ scores: {},
133
+ mean_score: 0,
134
+ success: false,
135
+ error: "plan revision source is unavailable",
136
+ };
137
+ }
138
+ // Compute scores deterministically.
139
+ const scores = computePlanScores(revision.document, reporterRole);
140
+ const meanScore = PLAN_SCORE_CATEGORIES.reduce((sum, cat) => sum + scores[cat], 0) / PLAN_SCORE_CATEGORIES.length;
141
+ // Submit the score report.
142
+ const { data: report, error: reportError } = await ctx.supabase.rpc("plan_score_report_record", {
143
+ p_revision_id: plan.latest_revision_id,
144
+ p_revision_digest: revisionDigest,
145
+ p_reporter_role: reporterRole,
146
+ p_scores: scores,
147
+ p_report: {
148
+ ruleset: "ADR-0007",
149
+ categories_count: PLAN_SCORE_CATEGORIES.length,
150
+ computed_at: new Date().toISOString(),
151
+ },
152
+ });
153
+ if (reportError) {
154
+ return {
155
+ revision_id: plan.latest_revision_id,
156
+ reporter_role: reporterRole,
157
+ scores,
158
+ mean_score: meanScore,
159
+ success: false,
160
+ error: reportError.message,
161
+ };
162
+ }
163
+ return {
164
+ revision_id: plan.latest_revision_id,
165
+ reporter_role: reporterRole,
166
+ scores,
167
+ mean_score: meanScore,
168
+ success: true,
169
+ };
170
+ }
171
+ export function registerPlanScore(plan) {
172
+ plan
173
+ .command("score")
174
+ .argument("<plan-ref>", "plan UUID or display_id (CB-PLAN-XXXX)")
175
+ .argument("<revision-digest>", "exact immutable revision SHA256 digest")
176
+ .argument("<reporter-role>", "scoring role: reason, research, or executor")
177
+ .option("--json", "JSON output")
178
+ .action(async (planRef, revisionDigest, reporterRole, options, command) => {
179
+ if (!["reason", "research", "executor"].includes(reporterRole)) {
180
+ throw new CodebusError("reporter-role must be one of: reason, research, executor");
181
+ }
182
+ const result = await scorePlanOnline(await makeCtx(resolveConfig(command.optsWithGlobals())), planRef, revisionDigest, reporterRole);
183
+ if (options.json) {
184
+ console.log(JSON.stringify(result, null, 2));
185
+ }
186
+ else {
187
+ if (result.success) {
188
+ console.log(`✓ Score report recorded for ${result.reporter_role}`);
189
+ console.log(`Mean score: ${result.mean_score.toFixed(2)}/5.0`);
190
+ for (const cat of PLAN_SCORE_CATEGORIES) {
191
+ console.log(` ${cat}: ${result.scores[cat].toFixed(1)}`);
192
+ }
193
+ }
194
+ else {
195
+ console.log(`✗ Score report failed: ${result.error}`);
196
+ }
197
+ }
198
+ if (!result.success) {
199
+ throw new CodebusError(`plan score failed: ${result.error}`);
200
+ }
201
+ });
202
+ }
203
+ //# sourceMappingURL=plan-score.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-score.js","sourceRoot":"","sources":["../../src/commands/plan-score.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MA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