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

@@ -9,7 +9,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 {
autoExtractAndCreateSkill,
skillFilename,
@@ -35,24 +34,18 @@ function repeatedSession(): AutoExtractMessage[] {
describe('autoExtractAndCreateSkill — gap A', () => {
let tmpDir: string;
let db: MindDB;
let signals: ImprovementSignalStore;
beforeEach(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-autoextract-'));
db = new MindDB(':memory:');
signals = new ImprovementSignalStore(db);
});
afterEach(() => {
db.close();
fs.rmSync(tmpDir, { recursive: true, force: true });
});
it('creates a personal-scope SKILL.md from a repeated workflow', async () => {
const result = await autoExtractAndCreateSkill(repeatedSession(), {
personalSkillsDir: tmpDir,
improvementSignals: signals,
});
expect(result.filePath).not.toBeNull();
@@ -67,19 +60,6 @@ describe('autoExtractAndCreateSkill — gap A', () => {
expect(body).toContain('## Tools Used');
});
it('records a workflow_pattern signal with auto-extract pattern_key', async () => {
const result = await autoExtractAndCreateSkill(repeatedSession(), {
personalSkillsDir: tmpDir,
improvementSignals: signals,
});
expect(result.filePath).not.toBeNull();
const recorded = signals.getByCategory('workflow_pattern');
const autoExtract = recorded.find(s => s.pattern_key.startsWith('auto-extract:'));
expect(autoExtract).toBeDefined();
expect(autoExtract!.detail).toContain('Auto-extracted');
});
it('returns no_pattern for short or random sessions', async () => {
const messages: AutoExtractMessage[] = [
{ role: 'user', content: 'Hi' },