#!/usr/bin/env node const fs = require('fs'); const data = JSON.parse(fs.readFileSync('.claude/instruction-history.json', 'utf8')); console.log('═══════════════════════════════════════════════════════════'); console.log(' GOVERNANCE RULES VERIFICATION'); console.log('═══════════════════════════════════════════════════════════\n'); console.log('📊 OVERVIEW'); console.log(' Version:', data.version); console.log(' Total instructions:', data.instructions.length); console.log(' Active instructions:', data.stats.active_instructions); console.log(''); // Check all new/consolidated rules const newRules = [ 'inst_008_CONSOLIDATED', 'inst_020_CONSOLIDATED', 'inst_041_CONSOLIDATED', 'inst_063_CONSOLIDATED', 'inst_064', 'inst_065', 'inst_066', 'inst_067', 'inst_068', 'inst_024a', 'inst_024b', 'inst_024c', 'inst_024d', 'inst_024e' ]; console.log('✅ NEW/CONSOLIDATED RULES VERIFICATION\n'); let allFound = true; newRules.forEach(id => { const rule = data.instructions.find(i => i.id === id); if (rule && rule.active !== false) { console.log(' ✓', id, '- Active:', rule.active, '| Quadrant:', rule.quadrant); } else if (rule) { console.log(' ⚠️ ', id, '- INACTIVE'); allFound = false; } else { console.log(' ✗', id, '- NOT FOUND'); allFound = false; } }); console.log(''); // Check deprecated rules are inactive const deprecated = [ 'inst_007', 'inst_008', 'inst_020', 'inst_022', 'inst_024', 'inst_028', 'inst_041', 'inst_042', 'inst_044', 'inst_048', 'inst_062', 'inst_063' ]; console.log('🗑️ DEPRECATED RULES VERIFICATION\n'); let allDeprecated = true; deprecated.forEach(id => { const rule = data.instructions.find(i => i.id === id); if (rule && rule.active === false) { console.log(' ✓', id, '- Properly deprecated'); } else if (rule) { console.log(' ⚠️ ', id, '- STILL ACTIVE (should be deprecated)'); allDeprecated = false; } else { console.log(' ✗', id, '- NOT FOUND'); } }); console.log(''); console.log('═══════════════════════════════════════════════════════════'); if (allFound && allDeprecated) { console.log(' ✅ ALL RULES VERIFIED - IMPLEMENTATION COMPLETE'); } else { console.log(' ⚠️ ISSUES DETECTED - REVIEW NEEDED'); } console.log('═══════════════════════════════════════════════════════════'); console.log(''); process.exit(allFound && allDeprecated ? 0 : 1);