Development-local control plane

← Approvals

Exact ChangeSet approval

BuzzBuddy Rebuild

Setze den ersten Meilenstein aus den Docs um · APPROVED · Apply SUCCEEDED

Applying these changes will modify the registered Project source.

Scope: one Project, Run, Workspace and fingerprint. Source and Workspace are checked again in the Worker. No shell, Git, network or secrets.

baseline.js

ADDED · TEXT

--- a/baseline.js
+++ b/baseline.js
@@ bounded old/new @@
-
+export function median(values) {
+  if (!Array.isArray(values) || values.length === 0) throw new Error('median requires values');
+  const sorted = [...values].sort((a, b) => a - b);
+  const mid = Math.floor(sorted.length / 2);
+  return sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
+}
+
+export function stdDev(values) {
+  if (!Array.isArray(values) || values.length < 2) throw new Error('stdDev requires at least 2 values');
+  const mean = values.reduce((sum, value) => sum + value, 0) / values.length;
+  const variance = values.reduce((sum, value) => sum + (value - mean) ** 2, 0) / (values.length - 1);
+  return Math.sqrt(variance);
+}
+
+export function buildBaseline(runs) {
+  if (!Array.isArray(runs) || runs.length < 3) throw new Error('buildBaseline requires at least 3 runs');
+  return {
+    count: runs.length,
+    median: median(runs),
+    stdDev: stdDev(runs)
+  };
+}
+

package.json

ADDED · TEXT

--- a/package.json
+++ b/package.json
@@ bounded old/new @@
-
+{
+  "type": "module",
+  "scripts": {
+    "test": "node --test"
+  }
+}
+
Decision: APPROVED · rollback NOT_REQUIRED