Category: Development & Process Patterns (META-PATTERN) Status: Active Created: 2025-11-04 Meta-Level: Pattern about validating patterns across contexts Related: Pattern-036 (Signal Convergence), Pattern-038 (Temporal Clustering)
Validate concept emergence and terminology evolution by tracking appearances across multiple independent contexts (ADR, code, omnibus, tests) rather than single-source validation.
New concepts/terminology can appear in documentation but never materialize in code, or vice versa:
Manual validation requires checking multiple locations, which is time-consuming and error-prone.
Track concept appearances across independent contexts and calculate validation score:
KEY_CONTEXTS = {
"adr", # Architecture Decision Records
"omnibus", # Omnibus synthesis logs
"code", # Production code (services/, web/)
"test", # Test files
"doc", # General documentation
"session_log" # Session logs
}
def calculate_validation_score(contexts: Dict[str, int]) -> float:
"""
Score based on cross-context appearances.
Returns:
0.0-1.0 where higher = more validated
"""
key_contexts = {"adr", "omnibus", "code"}
present_contexts = set(contexts.keys()) & key_contexts
return len(present_contexts) / len(key_contexts)
AsyncSessionFactory, EnhancedErrorMiddlewareActionHumanizer Pattern (Nov 3, 2025):
contexts = {
"session_log": 3, # Discussed in 3 session logs
"omnibus": 1, # Captured in omnibus log
"code": 2, # Implemented in 2 files
}
validation_score = 2/3 = 0.67 # ADR context missing
After ADR-042 created:
contexts = {
"adr": 1, # ADR-042 documents pattern
"session_log": 3,
"omnibus": 1,
"code": 2,
}
validation_score = 3/3 = 1.00 # Fully validated!
SemanticAnalyzer
├── _build_term_timeline()
│ ├── Scan ADR files (docs/internal/architecture/current/adrs/)
│ ├── Scan omnibus logs (docs/omnibus-logs/)
│ ├── Scan code files (services/, web/)
│ └── Scan session logs (dev/2025/)
│
├── _classify_file_context()
│ └── Determine context type from file path
│
├── _classify_term_contexts()
│ └── Count term appearances by context
│
└── _calculate_validation_scores()
└── Score = present_contexts / total_key_contexts
class SemanticAnalyzer:
def _classify_term_contexts(
self, term_timeline: Dict[str, List[Dict]]
) -> Dict[str, Dict[str, int]]:
"""Count term appearances by context type"""
classification = {}
for term, occurrences in term_timeline.items():
context_counts = Counter(occ["context"] for occ in occurrences)
classification[term] = dict(context_counts)
return classification
def _calculate_validation_scores(
self, context_classification: Dict[str, Dict[str, int]]
) -> Dict[str, float]:
"""Calculate validation scores (0.0-1.0)"""
scores = {}
key_contexts = {"adr", "omnibus", "code"}
for term, contexts in context_classification.items():
present_contexts = set(contexts.keys()) & key_contexts
score = len(present_contexts) / len(key_contexts)
scores[term] = score
return scores
Positive:
Negative:
Nov 3, 2025 Concepts:
ActionHumanizer: 67% validation (code + omnibus, ADR pending)75% pattern: 67% validation (session_log + omnibus)EnhancedErrorMiddleware: 67% validation (code + session_log)High-validation concepts triggered ARCHITECTURAL_INSIGHT breakthrough signal.
This pattern emerged from Enhanced Pattern Sweep implementation (2025-11-04). Key insight: Concepts appearing in multiple independent contexts are more “real” than single-source concepts.
The pattern enables detecting:
Cross-context validation is a form of empirical validation - the concept proves itself by appearing in independent sources, not by declaration.