All files / lib/runners meta_reflection_runner.ts

0% Statements 0/27
0% Branches 0/1
0% Functions 0/1
0% Lines 0/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                                                                             
/**
 * Runner: Phase 6.5 — Meta Reflection & Self-Rewrite
 * 1) detect patterns
 * 2) generate blueprints
 * 3) validate plan
 * 4) (optional) apply plan with dryRun or real apply
 */
import { detectMetaPatterns } from '../meta/reflection_core';
import { generateBlueprints } from '../meta/blueprint_generator';
import { validateRewrites } from '../meta/rewrite_validator';
import { applyBlueprints } from '../meta/apply_blueprints';
import { MetaConfig } from '../../config/meta.config';
 
(async () => {
  console.log('🧠 Running Meta-Reflection...');
  const patterns = detectMetaPatterns();
  console.table(patterns);
 
  const blueprints = generateBlueprints(patterns);
  console.log('—— Generated Blueprints ——');
  console.table(blueprints);
 
  const plan = validateRewrites(blueprints);
  console.log('—— Validation Plan ——');
  console.table(plan);
 
  // Dry-run first (safety)
  const dryRes = applyBlueprints(plan, { dryRun: true, step: 0.05 });
  console.log('—— Dry-Run Updates ——');
  console.table(dryRes.updates);
 
  // Uncomment to perform a real apply (after reviewing plan):
  const realRes = applyBlueprints(plan, { dryRun: false, step: 0.05 });
  console.log('—— REAL Updates ——');
  console.table(realRes.updates);
 
  console.log(`✅ Meta-Reflection complete (dryRun=${MetaConfig.dryRunByDefault}).`);
})();