Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: require reliable model evidence

[._.]/ Adam Eivye9a8640b26d3
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 9c1e4de466..6034ca50f2 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,7 +2,7 @@
## Changed
-- **Series Autopilot can learn which models actually work at each step.** AI run history now distinguishes technical completion from a later editorial keep/revert decision and aggregates evidence by orchestration step, creative-versus-judge role, provider, model, and reasoning effort. The new opt-in selector requires multiple quality-reviewed samples, ignores disabled providers and removed models, and remains a soft default beneath explicit run choices and exact prompt-stage pins. The Options panel reports how much attributed and quality-reviewed evidence exists, while local APIs expose the full metrics and allow an operator to correct or backfill a historical outcome, including its effort when the older run predates effort telemetry. Concurrent metadata updates for one run are serialized so provider telemetry cannot overwrite its Autopilot step/role attribution. Foundation judges record contract-valid responses separately from true editorial approval, and foundation repairs automatically record accepted versus rolled-back outcomes, so a model that finishes a long run but makes the story worse is not learned as a success.
+- **Series Autopilot can learn which models actually work at each step.** AI run history now distinguishes technical completion from a later editorial keep/revert decision and aggregates evidence by orchestration step, creative-versus-judge role, provider, model, and reasoning effort. The new opt-in selector requires multiple quality-reviewed samples plus a positive reliability threshold, ignores disabled providers and removed models, and remains a soft default beneath explicit run choices and exact prompt-stage pins. The Options panel reports how much attributed and quality-reviewed evidence exists, while local APIs expose the full metrics and allow an operator to correct or backfill a historical outcome, including its effort when the older run predates effort telemetry. Concurrent metadata updates for one run are serialized so provider telemetry cannot overwrite its Autopilot step/role attribution. Foundation judges record contract-valid responses separately from true editorial approval, and foundation repairs automatically record accepted versus rolled-back outcomes, so a model that finishes a long run but makes the story worse is not learned as a success.
- **Completed CoS agents no longer strand a worktree because of their own completion marker.** The `.agent-done` sentinel is consumed before worktree cleanup, but Git still reported the untracked file as ordinary authored work and the safety gate preserved the otherwise-clean checkout with a high-priority warning. Cleanup now ignores only that runtime marker: sentinel-only trees are removed normally, while any real source change still preserves the worktree and is named in the warning.
diff --git a/client/src/components/pipeline/AutopilotPanel.jsx b/client/src/components/pipeline/AutopilotPanel.jsx
index 767ea840b1..f6f20af40f 100644
--- a/client/src/components/pipeline/AutopilotPanel.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.jsx
@@ -928,7 +928,7 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
</label>
{opt.autoSelectModels ? (
<p className="text-[11px] text-gray-500">
- Uses separate technical and quality outcomes by step, role, provider, model and effort. Historical outcomes can backfill effort when older run records lack it. A route needs at least {modelMetrics?.minimumQualitySamples ?? 2} quality-reviewed samples; explicit choices above and exact Prompts-stage pins still win. Current history: {modelMetrics?.evidenceRuns ?? 0} attributed run{modelMetrics?.evidenceRuns === 1 ? '' : 's'}, {modelMetrics?.metrics?.reduce((sum, metric) => sum + (metric.qualityEvaluated || 0), 0) ?? 0} quality-reviewed.
+ Uses separate technical and quality outcomes by step, role, provider, model and effort. Historical outcomes can backfill effort when older run records lack it. A route needs at least {modelMetrics?.minimumQualitySamples ?? 2} quality-reviewed samples and a positive reliability threshold; explicit choices above and exact Prompts-stage pins still win. Current history: {modelMetrics?.evidenceRuns ?? 0} attributed run{modelMetrics?.evidenceRuns === 1 ? '' : 's'}, {modelMetrics?.metrics?.reduce((sum, metric) => sum + (metric.qualityEvaluated || 0), 0) ?? 0} quality-reviewed.
</p>
) : null}
<label className="flex items-center gap-2 text-xs text-gray-300">
diff --git a/server/services/pipeline/seriesAutopilot/modelPerformance.js b/server/services/pipeline/seriesAutopilot/modelPerformance.js
index f6945d157b..a189572426 100644
--- a/server/services/pipeline/seriesAutopilot/modelPerformance.js
+++ b/server/services/pipeline/seriesAutopilot/modelPerformance.js
@@ -12,6 +12,7 @@ import { getRun, listRuns, patchRunMetadata } from '../../runner.js';
const MAX_RUNS = 5_000;
export const MIN_QUALITY_SAMPLES = 2;
+export const MIN_QUALITY_RATE = 0.6;
const POSITIVE_OUTCOMES = new Set(['accepted']);
const NEGATIVE_OUTCOMES = new Set(['rejected']);
@@ -134,7 +135,11 @@ export function summarizeModelPerformance(runs = [], providers = []) {
const recommendations = {};
for (const metric of metrics) {
- if (!metric.eligible || metric.qualityEvaluated < MIN_QUALITY_SAMPLES) continue;
+ if (
+ !metric.eligible
+ || metric.qualityEvaluated < MIN_QUALITY_SAMPLES
+ || metric.qualityRate < MIN_QUALITY_RATE
+ ) continue;
recommendations[metric.pipelineStage] ||= {};
if (recommendations[metric.pipelineStage][metric.pipelineRole]) continue;
recommendations[metric.pipelineStage][metric.pipelineRole] = {
@@ -162,6 +167,7 @@ export async function getModelPerformanceReport() {
...report,
evidenceRuns: report.metrics.reduce((sum, metric) => sum + metric.attempts, 0),
minimumQualitySamples: MIN_QUALITY_SAMPLES,
+ minimumQualityRate: MIN_QUALITY_RATE,
};
}
diff --git a/server/services/pipeline/seriesAutopilot/modelPerformance.test.js b/server/services/pipeline/seriesAutopilot/modelPerformance.test.js
index 2d604c6fd9..83bafb0c50 100644
--- a/server/services/pipeline/seriesAutopilot/modelPerformance.test.js
+++ b/server/services/pipeline/seriesAutopilot/modelPerformance.test.js
@@ -8,7 +8,9 @@ vi.mock('../../runner.js', () => ({
patchRunMetadata,
}));
-import { MIN_QUALITY_SAMPLES, recordModelOutcome, summarizeModelPerformance } from './modelPerformance.js';
+import {
+ MIN_QUALITY_RATE, MIN_QUALITY_SAMPLES, recordModelOutcome, summarizeModelPerformance,
+} from './modelPerformance.js';
const provider = (id, models, enabled = true) => ({ id, name: id, models, enabled });
const run = (over = {}) => ({
@@ -74,6 +76,16 @@ describe('Series Autopilot model performance', () => {
});
});
+ it('does not recommend a sufficiently sampled but unreliable route', () => {
+ expect(MIN_QUALITY_RATE).toBe(0.6);
+ const report = summarizeModelPerformance([
+ run({ qualityOutcome: 'accepted' }),
+ run({ qualityOutcome: 'rejected', startTime: '2026-01-02T00:00:00.000Z' }),
+ ], [provider('cloud', ['large'])]);
+ expect(report.metrics[0]).toMatchObject({ qualityEvaluated: 2, qualityRate: 0.5 });
+ expect(report.recommendations).toEqual({});
+ });
+
it('ranks accepted local evidence above repeatedly rejected cloud work', () => {
const runs = [
run({ qualityOutcome: 'rejected' }),