// add-obvious-patterns.patch
// Modifications to mcp-contemplation for finding "obvious but overlooked" patterns
// 1. Add to thought types (around line 390)
const THOUGHT_TYPES = {
pattern: "pattern",
connection: "connection",
question: "question",
general: "general",
obvious: "obvious_overlooked" // NEW: For simple solutions hiding in plain sight
};
// 2. Add new prompts for obvious solutions
const OBVIOUS_PROMPTS = {
simple_first: "What's the simplest possible solution that everyone is ignoring?",
plain_sight: "What obvious answer is hiding in plain sight?",
child_perspective: "How would a child solve this problem?",
remove_complexity: "If we removed all the complex parts, what remains?",
common_sense: "What would common sense suggest here?",
too_simple: "What solution seems too simple to work but might actually be perfect?"
};
// 3. Modify scoring to favor "obvious retrospectively" insights
function scoreInsight(insight) {
let baseScore = insight.significance || 5;
// Bonus for simple solutions
if (insight.thought_type === 'obvious_overlooked') {
baseScore += 2;
}
// Bonus for insights that use common words/concepts
const commonWords = ['simple', 'just', 'basic', 'obvious', 'clear', 'easy'];
const hasCommonApproach = commonWords.some(word =>
insight.content.toLowerCase().includes(word)
);
if (hasCommonApproach) {
baseScore += 1;
}
// Penalty for over-complexity
const complexityMarkers = ['framework', 'system', 'protocol', 'architecture'];
const isOverComplex = complexityMarkers.filter(word =>
insight.content.toLowerCase().includes(word)
).length > 2;
if (isOverComplex) {
baseScore -= 1;
}
return Math.min(10, Math.max(1, baseScore));
}
// 4. Pattern detector for "hiding in plain sight" discoveries
class ObviousPatternDetector {
constructor() {
this.patterns = [];
}
detectPattern(thought) {
const indicators = {
everyone_does_but_nobody_measures: /everyone\s+(does|assumes|thinks).*but\s+(nobody|no\s+one)/i,
too_simple_to_notice: /too\s+simple|obviously|surely\s+someone/i,
assumption_challenge: /assumed|taken\s+for\s+granted|never\s+questioned/i,
daily_behavior: /every\s+day|daily|constantly|always/i
};
for (const [pattern, regex] of Object.entries(indicators)) {
if (regex.test(thought)) {
return {
type: 'obvious_overlooked',
pattern: pattern,
confidence: 0.8
};
}
}
return null;
}
}
// 5. Integration into contemplation loop
// Add this to the thought processing function
async function processThoughtWithObviousDetection(thought) {
const detector = new ObviousPatternDetector();
const pattern = detector.detectPattern(thought.content);
if (pattern) {
// Route to special "obvious solution" processing
const prompt = OBVIOUS_PROMPTS.simple_first + "\n\nContext: " + thought.content;
// Process with Ollama using this prompt
}
// Continue normal processing...
}