refactor: remove self-learning and the optimizer package (P1.4)

Self-learning is excluded from the community edition (ADR-0004); the
project owner reworks it separately. Cost tracking stays.

- agent: delete behaviour evolution (evolve-schema, iterative GEPA,
  compose-evolution, evolution gates, orchestrator and deploy),
  improvement and correction detection, AgentLearning, the eval-dataset
  builder, optimization-capture and the agent_insights tool. Secret
  detection moves from eval-dataset to secret-patterns. The LLM wiring
  keeps only the Haiku adapter and judge call used by skill audit and
  hygiene, so @ax-llm/ax is now declared by agent instead of server.
- server: delete /api/evolution/*, the evolution and optimizer services,
  GEPA expansion of the first chat message, the prompt_optimization and
  monthly_assessment jobs, the idle-session reviewer and its
  session-reviewer persona, prompt injection of past corrections and
  thumbs-down recorded as correction signals. Existing job rows of the
  removed types are ignored, not deleted.
- core: delete OptimizationLogStore; stop re-exporting the improvement
  signal and evolution run stores.
- web: delete the Evolution screen and the two job types in the
  automation editor.
- delete packages/optimizer.

Also logs UF-027 (self-learning loops read data nothing collects) and
UF-028 (the Settings prompt-shape choice is ignored by chat).
This commit is contained in:
shumeiko.it
2026-10-20 00:54:58 +02:00
parent b734c1d3d2
commit 2e1999a3f6
112 changed files with 336 additions and 16165 deletions

View File

@@ -5,7 +5,6 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as os from 'node:os';
import { MindDB, ImprovementSignalStore } from '@waggle/core';
import { retireStaleSkills } from '../src/skill-retirement.js';
import {
recordSkillUsage,
@@ -74,8 +73,6 @@ describe('skill-usage — gap F', () => {
describe('retireStaleSkills — gap F', () => {
let waggleHome: string;
let skillsDir: string;
let db: MindDB;
let signals: ImprovementSignalStore;
const NOW = new Date('2026-04-15T00:00:00Z');
const DAY = 24 * 60 * 60 * 1000;
@@ -83,12 +80,9 @@ describe('retireStaleSkills — gap F', () => {
beforeEach(() => {
waggleHome = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-retire-'));
skillsDir = path.join(waggleHome, 'skills');
db = new MindDB(':memory:');
signals = new ImprovementSignalStore(db);
});
afterEach(() => {
db.close();
fs.rmSync(waggleHome, {
recursive: true,
force: true,
@@ -110,7 +104,6 @@ describe('retireStaleSkills — gap F', () => {
const report = retireStaleSkills(waggleHome, {
maxIdleDays: 90,
now: () => NOW,
improvementSignals: signals,
});
expect(report.scanned).toBe(2);
@@ -123,10 +116,6 @@ describe('retireStaleSkills — gap F', () => {
// Usage entry for the retired skill is cleared
expect(loadSkillUsage(waggleHome).stale).toBeUndefined();
expect(loadSkillUsage(waggleHome).fresh).toBeDefined();
// Signal recorded
const recorded = signals.getByCategory('workflow_pattern').find(s => s.pattern_key === 'retire:stale');
expect(recorded).toBeDefined();
});
it('falls back to file mtime when no usage entry exists', () => {