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

@@ -203,7 +203,6 @@ export { buildSelfAwareness, type AgentCapabilities } from './self-awareness.js'
export {
loadSystemPrompt,
loadSystemPromptWithOverrides,
assertOverridesReachActiveSpec,
loadSkills,
type ComposedSystemPrompt,
type LoadedSkill,
@@ -214,69 +213,11 @@ export { checkGrounding, extractClaimedSpecifics, type GroundingResult, type Cla
export { CostTracker, DEFAULT_MODEL_PRICING, type ModelPricing, type UsageStats, type UsageEntry } from './cost-tracker.js';
export { extractEntities, type ExtractedEntity } from './entity-extractor.js';
export { CognifyPipeline, type CognifyConfig, type CognifyResult } from './cognify.js';
export { AgentLearning, type LearnedBehavior, type PersonaEffectiveness, type LearningSnapshot } from './agent-learning.js';
export {
TraceRecorder, truncate as truncateTraceText, scrubSecrets,
type TraceHandle, type FinalizeOptions as TraceFinalizeOptions,
} from './trace-recorder.js';
export {
EvalDatasetBuilder, detectSecrets, redactSecrets, SECRET_PATTERN_NAMES,
toJSONL as evalToJSONL, fromJSONL as evalFromJSONL,
type EvalExample, type EvalExampleMetadata, type DatasetSplit,
type BuildOptions as EvalBuildOptions, type JudgeVerdict,
} from './eval-dataset.js';
export {
IterativeGEPA, paretoFront, scoreCandidate, aggregateScores,
pickWinner, pickSample as pickGepaSample,
type Candidate as GEPACandidate, type CandidateScore as GEPACandidateScore,
type IterativeGEPAOptions, type GEPARunResult, type GEPAProgress,
type ScoreCandidateOptions,
type MutateArgs, type MutateFn, type MutationStrategy, type EvolutionTarget,
} from './iterative-optimizer.js';
export {
runGates, DEFAULT_SIZE_LIMITS,
checkNonEmpty, checkSize, checkGrowth,
checkBalancedFences, checkNoPlaceholders, checkNoObviousTodos, checkRegression,
type GateVerdict, type GateResult as EvolutionGateResult, type GateCheckResult,
type SizeLimits, type GateOptions, type CheckInput as GateCheckInput,
} from './evolution-gates.js';
export {
EvolveSchema,
addOutputField, removeField, editFieldDescription,
changeFieldType, addConstraint, removeConstraint,
reorderFields, replaceOutputFields,
schemaComplexity, aggregateSchemaScores, paretoFrontSchema,
scoreSchemaCandidate, pickSchemaWinner,
generateStructureMutations, generateOrderMutations, generateRefinementMutations,
pickSample as pickSchemaSample,
type Schema, type SchemaField, type FieldType, type FieldConstraint,
type Mutation as SchemaMutation, type MutationKind as SchemaMutationKind,
type SchemaCandidate, type SchemaCandidateScore, type SchemaExampleResult,
type SchemaExecuteFn, type EvolveSchemaOptions, type EvolveSchemaResult,
type EvolveSchemaProgress,
} from './evolve-schema.js';
export {
ComposeEvolution, defaultFeedbackFilter, filterJudgeFeedback,
stripStructuralLines, schemaExecutorFromInstructionRunner,
type ComposeEvolutionOptions, type ComposeEvolutionResult,
type ComposeProgress, type FeedbackFilter,
} from './compose-evolution.js';
export {
EvolutionOrchestrator, eligibleForEvolution, summarizeRuns,
type EvolutionOrchestratorDeps, type EvolutionOrchestratorOptions,
type EvolutionAutoTriggerConfig, type OrchestratorRunResult,
type OrchestratorOutcome, type EvolutionProgress,
type SchemaBaselineInput,
} from './evolution-orchestrator.js';
export {
deployPersonaOverride, rollbackPersonaOverride,
deployBehavioralSpecOverride, rollbackBehavioralSpecOverride,
loadBehavioralSpecOverrides, applyBehavioralSpecOverrides,
BEHAVIORAL_SPEC_SECTIONS,
type DeployResult, type DeployPersonaInput,
type DeployBehavioralSpecInput, type BehavioralSpecOverride,
type BehavioralSpecSection,
} from './evolution-deploy.js';
export { detectSecrets, redactSecrets, SECRET_PATTERN_NAMES } from './secret-patterns.js';
export {
LLMJudge, DEFAULT_WEIGHTS, DEFAULT_RUBRIC,
buildPrompt as buildJudgePrompt,
@@ -285,17 +226,12 @@ export {
type ParsedJudgeResponse,
} from './judge.js';
export {
createAnthropicEvolutionLLM,
buildJudgeLLMCall, buildGEPAMutateFn, buildSchemaExecuteFn,
buildReflectiveMutationPrompt, buildSchemaFillPrompt,
makeRunningJudge, isRunningJudge, RUNNING_JUDGE_BRAND,
createAnthropicEvolutionLLM, buildJudgeLLMCall,
retryWithBackoff, wrapWithRetry,
isRetryableEvolutionError, computeRetryDelay,
DEFAULT_RETRY_OPTIONS,
type EvolutionLLM, type CreateAnthropicEvolutionLLMOptions,
type BuildReflectiveMutationPromptArgs,
type RetryOptions, type RetryInfo,
type RunningJudge,
} from './evolution-llm-wiring.js';
export {
createHarnessRun, advancePhase, getCurrentPhaseInstruction,
@@ -346,7 +282,6 @@ export { createDocumentTools } from './document-tools.js';
export { createSpreadsheetTools } from './spreadsheet-tools.js';
export { createPresentationTools } from './presentation-tools.js';
export { createPdfTools } from './pdf-tools.js';
export { createInsightsTools, type InsightsDeps } from './insights-tools.js';
export { createConnectorSearchTools } from './connector-search.js';
export { createCrossWorkspaceTools, type CrossWorkspaceToolDeps } from './cross-workspace-tools.js';
export { extractEntitiesWithLLM, type LLMCallFn as EntityLLMCallFn } from './entity-extractor.js';
@@ -480,7 +415,6 @@ export {
ComposioConnector, MSTeamsConnector, OutlookConnector, OneDriveConnector, OneNoteConnector,
} from './connectors/index.js';
export { IterationBudget, type IterationBudgetConfig } from './iteration-budget.js';
export { captureInteraction, getRecentLogs, isWithinBudget, type CaptureInteractionInput } from './optimization-capture.js';
export { routeMessage, type RoutingDecision } from './smart-router.js';
export {
compressConversation, estimateTokens, needsCompression,
@@ -511,13 +445,7 @@ export {
type DeliveryChannel, type DeliveryPreferences, type DeliveryMessage, type DeliveryResult,
type DeliveryConnector, type DeliveryConnectorRegistry, type InAppEmitter,
} from './cron-delivery-router.js';
export { detectCorrection, detectCorrectionsInHistory, type DetectedCorrection, type CorrectionDurability } from './correction-detector.js';
export { detectContradiction, type ContradictionResult } from './contradiction-detector.js';
export {
recordCapabilityGap, analyzeAndRecordCorrection, recordWorkflowPattern,
buildAwarenessSummary, formatAwarenessPrompt, markSummarySurfaced,
type AwarenessSummary, type CapabilityGapSignal, type CorrectionSignal, type WorkflowPatternSignal,
} from './improvement-detector.js';
export {
lintMemoryWrite,
type MemoryLintResult, type MemoryLintVerdict,