patterns
patterns
¶
Pattern-related mixin for GlobalLearningStore.
This module provides the PatternMixin class that handles all pattern-related operations including: - Recording and updating patterns - Pattern application tracking - Effectiveness and priority calculations - Quarantine lifecycle management - Trust scoring - Success factor analysis (metacognitive reflection) - Pattern discovery broadcasting
Extracted from global_store.py as part of the modularization effort.
Architecture
PatternMixin is now composed from focused sub-mixins, each handling a specific domain of pattern functionality:
- PatternQueryMixin: Core query operations (get_patterns, get_pattern_by_id, etc.)
- PatternCrudMixin: Create/update operations and effectiveness calculations
- PatternQuarantineMixin: Quarantine lifecycle (quarantine, validate, retire)
- PatternTrustMixin: Trust scoring and auto-apply eligibility
- PatternSuccessFactorsMixin: Metacognitive reflection (WHY analysis)
- PatternBroadcastMixin: Real-time pattern discovery broadcasting
This decomposition improves maintainability while preserving the original public API through composition.
Classes¶
PatternBroadcastMixin
¶
Bases: _BroadcastBase
Mixin providing pattern discovery broadcasting methods.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - _row_to_discovery_event(): For row conversion (from PatternQueryMixin)
Functions¶
record_pattern_discovery
¶
record_pattern_discovery(pattern_id, pattern_name, pattern_type, job_id, effectiveness_score=1.0, context_tags=None, ttl_seconds=300.0)
Record a pattern discovery for cross-job broadcasting.
When a job discovers a new pattern, it broadcasts the discovery so other concurrent jobs can benefit immediately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
ID of the discovered pattern. |
required |
pattern_name
|
str
|
Human-readable name of the pattern. |
required |
pattern_type
|
str
|
Type of pattern (validation_failure, etc.). |
required |
job_id
|
str
|
ID of the job that discovered the pattern. |
required |
effectiveness_score
|
float
|
Initial effectiveness score (0.0-1.0). |
1.0
|
context_tags
|
list[str] | None
|
Optional context tags for pattern matching. |
None
|
ttl_seconds
|
float
|
Time-to-live in seconds (default 5 minutes). |
300.0
|
Returns:
| Type | Description |
|---|---|
str
|
The discovery event record ID. |
Source code in src/marianne/learning/store/patterns_broadcast.py
check_recent_pattern_discoveries
¶
check_recent_pattern_discoveries(exclude_job_id=None, pattern_type=None, min_effectiveness=0.0, limit=20)
Check for recent pattern discoveries from other jobs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclude_job_id
|
str | None
|
Optional job ID to exclude (typically self). |
None
|
pattern_type
|
str | None
|
Optional filter by pattern type. |
None
|
min_effectiveness
|
float
|
Minimum effectiveness score to include. |
0.0
|
limit
|
int
|
Maximum number of discoveries to return. |
20
|
Returns:
| Type | Description |
|---|---|
list[PatternDiscoveryEvent]
|
List of PatternDiscoveryEvent objects from other jobs. |
Source code in src/marianne/learning/store/patterns_broadcast.py
cleanup_expired_pattern_discoveries
¶
Remove expired pattern discovery events.
Returns:
| Type | Description |
|---|---|
int
|
Number of expired events removed. |
Source code in src/marianne/learning/store/patterns_broadcast.py
get_active_pattern_discoveries
¶
Get all active (unexpired) pattern discovery events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_type
|
str | None
|
Optional filter by pattern type. |
None
|
Returns:
| Type | Description |
|---|---|
list[PatternDiscoveryEvent]
|
List of PatternDiscoveryEvent objects that haven't expired yet. |
Source code in src/marianne/learning/store/patterns_broadcast.py
PatternCrudMixin
¶
Mixin providing pattern CRUD and effectiveness methods.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - update_pattern_effectiveness(): For batch recalculation (self-referential)
Functions¶
record_pattern
¶
record_pattern(pattern_type, pattern_name, description=None, context_tags=None, suggested_action=None, provenance=None, provenance_job_hash=None, provenance_sheet_num=None, instrument_name=None)
Record or update a pattern in the global store.
Resolution order: 1. If a pattern with the same type+name ID exists, upsert it (existing behavior). 2. If no type+name match but a content_hash match exists, merge into the highest-priority existing pattern (incrementing its count, updating last_seen). Soft-deleted matches are reactivated. 3. Otherwise, insert a new pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_type
|
str
|
The type of pattern (e.g., 'validation_failure'). |
required |
pattern_name
|
str
|
A unique name for this pattern. |
required |
description
|
str | None
|
Human-readable description. |
None
|
context_tags
|
list[str] | None
|
Tags for matching context. |
None
|
suggested_action
|
str | None
|
Recommended action for this pattern. |
None
|
provenance
|
PatternProvenance | None
|
Grouped provenance info (job_hash + sheet_num). |
None
|
provenance_job_hash
|
str | None
|
Deprecated — use provenance instead. |
None
|
provenance_sheet_num
|
int | None
|
Deprecated — use provenance instead. |
None
|
instrument_name
|
str | None
|
Backend instrument that produced this pattern. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The pattern ID (may be a merged-to existing ID). |
Source code in src/marianne/learning/store/patterns_crud.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
record_pattern_application
¶
record_pattern_application(pattern_id, execution_id, pattern_led_to_success, retry_count_before=0, retry_count_after=0, application_mode='exploitation', validation_passed=None, grounding_confidence=None)
Record that a pattern was applied to an execution.
Creates the feedback loop for effectiveness tracking. After recording the application, automatically updates effectiveness_score and priority_score.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern that was applied. |
required |
execution_id
|
str
|
The execution it was applied to. |
required |
pattern_led_to_success
|
bool
|
Whether applying this pattern led to execution success (validation passed on first attempt). |
required |
retry_count_before
|
int
|
Retry count before pattern applied. |
0
|
retry_count_after
|
int
|
Retry count after pattern applied. |
0
|
application_mode
|
str
|
'exploration' or 'exploitation'. |
'exploitation'
|
validation_passed
|
bool | None
|
Whether validation passed on first attempt. |
None
|
grounding_confidence
|
float | None
|
Grounding confidence (0.0-1.0). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The application record ID. |
Source code in src/marianne/learning/store/patterns_crud.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | |
soft_delete_pattern
¶
Soft-delete a pattern by setting active=0.
Preserves FK integrity — the row remains in the database so pattern_applications referencing it don't violate constraints. Re-recording a soft-deleted pattern reactivates it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern to soft-delete. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the pattern was found and deactivated, False if not found. |
Source code in src/marianne/learning/store/patterns_crud.py
update_pattern_effectiveness
¶
Manually recalculate and update a pattern's effectiveness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern to update. |
required |
Returns:
| Type | Description |
|---|---|
float | None
|
New effectiveness score, or None if pattern not found. |
Source code in src/marianne/learning/store/patterns_crud.py
recalculate_all_pattern_priorities
¶
Recalculate priorities for all patterns.
Uses batch_connection() to reuse a single SQLite connection across all pattern updates, avoiding N+1 connection overhead.
Returns:
| Type | Description |
|---|---|
int
|
Number of patterns updated. |
Source code in src/marianne/learning/store/patterns_crud.py
PatternLifecycleMixin
¶
Bases: _LifecycleBase
Mixin providing pattern lifecycle and promotion automation.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - get_pattern_by_id(): For pattern lookup (from PatternQueryMixin)
Functions¶
promote_ready_patterns
¶
Auto-promote or quarantine patterns based on effectiveness thresholds.
Queries all PENDING patterns and transitions them based on criteria: - PENDING → ACTIVE: occurrences >= 3 AND effectiveness > 0.60 - PENDING → QUARANTINED: occurrences >= 3 AND effectiveness < 0.35
Also checks ACTIVE patterns for degradation: - ACTIVE → QUARANTINED: effectiveness < 0.30
Returns:
| Type | Description |
|---|---|
dict[str, list[str]]
|
Dict with keys: |
dict[str, list[str]]
|
|
dict[str, list[str]]
|
|
dict[str, list[str]]
|
|
Source code in src/marianne/learning/store/patterns_lifecycle.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
update_quarantine_status
¶
Manually update a pattern's quarantine status.
This is for operator-driven lifecycle transitions that bypass automatic thresholds (e.g., promoting a validated pattern after manual review, or retiring an obsolete pattern).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern to update. |
required |
new_status
|
QuarantineStatus
|
New quarantine status. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if updated, False if pattern not found. |
Source code in src/marianne/learning/store/patterns_lifecycle.py
PatternQuarantineMixin
¶
Bases: _QuarantineBase
Mixin providing pattern quarantine lifecycle methods.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - get_patterns(): For querying quarantined patterns (from PatternQueryMixin)
Functions¶
quarantine_pattern
¶
Move a pattern to QUARANTINED status.
Quarantined patterns are excluded from automatic application but retained for investigation and historical reference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to quarantine. |
required |
reason
|
str | None
|
Optional reason for quarantine. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if pattern was quarantined, False if pattern not found. |
Source code in src/marianne/learning/store/patterns_quarantine.py
validate_pattern
¶
Move a pattern to VALIDATED status.
Validated patterns are trusted for autonomous application and receive a trust bonus in relevance scoring.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to validate. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if pattern was validated, False if pattern not found. |
Source code in src/marianne/learning/store/patterns_quarantine.py
retire_pattern
¶
Move a pattern to RETIRED status.
Retired patterns are no longer in active use but retained for historical reference and trend analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to retire. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if pattern was retired, False if pattern not found. |
Source code in src/marianne/learning/store/patterns_quarantine.py
get_quarantined_patterns
¶
Get all patterns currently in QUARANTINED status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of patterns to return. |
50
|
Returns:
| Type | Description |
|---|---|
list[PatternRecord]
|
List of quarantined PatternRecord objects. |
Source code in src/marianne/learning/store/patterns_quarantine.py
PatternQueryMixin
¶
Mixin providing pattern query methods for GlobalLearningStore.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection
Functions¶
get_patterns
¶
get_patterns(pattern_type=None, min_priority=0.01, limit=20, context_tags=None, quarantine_status=None, exclude_quarantined=False, min_trust=None, max_trust=None, include_inactive=False, instrument_name=None, include_universal=True)
Get patterns from the global store.
v19 Evolution: Extended with quarantine and trust filtering options. v14 (cycle 2): Extended with soft-delete and instrument filtering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_type
|
str | None
|
Optional filter by pattern type. |
None
|
min_priority
|
float
|
Minimum priority score to include. |
0.01
|
limit
|
int
|
Maximum number of patterns to return. |
20
|
context_tags
|
list[str] | None
|
Optional list of tags for context-based filtering. Patterns match if ANY of their tags match ANY query tag. If None or empty, no tag filtering is applied. |
None
|
quarantine_status
|
QuarantineStatus | None
|
Filter by specific quarantine status. |
None
|
exclude_quarantined
|
bool
|
If True, exclude QUARANTINED patterns. |
False
|
min_trust
|
float | None
|
Filter patterns with trust_score >= this value. |
None
|
max_trust
|
float | None
|
Filter patterns with trust_score <= this value. |
None
|
include_inactive
|
bool
|
If True, include soft-deleted patterns (active=0). |
False
|
instrument_name
|
str | None
|
Filter by instrument name. None means no filter. |
None
|
include_universal
|
bool
|
If True (default) AND instrument_name is set, also include patterns where instrument_name is NULL (universal patterns applicable to all instruments). |
True
|
Returns:
| Type | Description |
|---|---|
list[PatternRecord]
|
List of PatternRecord objects sorted by priority. |
Source code in src/marianne/learning/store/patterns_query.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
get_pattern_by_id
¶
Get a single pattern by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
PatternRecord | None
|
PatternRecord if found, None otherwise. |
Source code in src/marianne/learning/store/patterns_query.py
get_pattern_provenance
¶
Get provenance information for a pattern.
Returns details about the pattern's origin and lifecycle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to query. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
Dict with provenance info, or None if pattern not found. |
Source code in src/marianne/learning/store/patterns_query.py
PatternSuccessFactorsMixin
¶
Bases: _SuccessFactorsBase
Mixin providing pattern success factor analysis methods.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - get_pattern_by_id(): For pattern lookup (from PatternQueryMixin) - _row_to_pattern_record(): For row conversion (from PatternQueryMixin) - analyze_pattern_why(): Self-reference for get_patterns_with_why
Functions¶
update_success_factors
¶
update_success_factors(pattern_id, validation_types=None, error_categories=None, prior_sheet_status=None, retry_iteration=0, escalation_was_pending=False, grounding_confidence=None)
Update success factors for a pattern based on a successful application.
Captures the WHY behind pattern success — the context conditions that were present when the pattern worked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern that succeeded. |
required |
validation_types
|
list[str] | None
|
Validation types active (file, regex, artifact, etc.) |
None
|
error_categories
|
list[str] | None
|
Error categories present (rate_limit, auth, etc.) |
None
|
prior_sheet_status
|
str | None
|
Status of prior sheet (completed, failed, skipped) |
None
|
retry_iteration
|
int
|
Which retry this success occurred on (0 = first) |
0
|
escalation_was_pending
|
bool
|
Whether escalation was pending |
False
|
grounding_confidence
|
float | None
|
Grounding confidence if external validation present |
None
|
Returns:
| Type | Description |
|---|---|
SuccessFactors | None
|
Updated SuccessFactors, or None if pattern not found. |
Source code in src/marianne/learning/store/patterns_success_factors.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
get_success_factors
¶
Get the success factors for a pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to get factors for. |
required |
Returns:
| Type | Description |
|---|---|
SuccessFactors | None
|
SuccessFactors if the pattern has captured factors, None otherwise. |
Source code in src/marianne/learning/store/patterns_success_factors.py
analyze_pattern_why
¶
Analyze WHY a pattern succeeds with structured explanation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern to analyze. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with analysis results including factors_summary, |
dict[str, Any]
|
key_conditions, confidence, and recommendations. |
Source code in src/marianne/learning/store/patterns_success_factors.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
get_patterns_with_why
¶
Get patterns with their WHY analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_observations
|
int
|
Minimum success factor observations required. |
1
|
limit
|
int
|
Maximum number of patterns to return. |
20
|
Returns:
| Type | Description |
|---|---|
list[tuple[PatternRecord, dict[str, Any]]]
|
List of (PatternRecord, analysis_dict) tuples. |
Source code in src/marianne/learning/store/patterns_success_factors.py
PatternTrustMixin
¶
Bases: _TrustBase
Mixin providing pattern trust scoring methods.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - get_pattern_by_id(): For pattern lookup (from PatternQueryMixin) - get_patterns(): For filtered queries (from PatternQueryMixin) - _row_to_pattern_record(): For row conversion (from PatternQueryMixin)
Functions¶
calculate_trust_score
¶
Calculate and update trust score for a pattern.
Trust score formula
trust: float = 0.5 + (success_rate * 0.3) - (failure_rate * 0.4) + (age_factor * 0.2)
Quarantined patterns get a -0.2 penalty. Validated patterns get a +0.1 bonus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to calculate trust for. |
required |
Returns:
| Type | Description |
|---|---|
float | None
|
New trust score (0.0-1.0), or None if pattern not found. |
Source code in src/marianne/learning/store/patterns_trust.py
update_trust_score
¶
Update trust score by a delta amount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern_id
|
str
|
The pattern ID to update. |
required |
delta
|
float
|
Amount to add to trust score (can be negative). |
required |
Returns:
| Type | Description |
|---|---|
float | None
|
New trust score after update, or None if pattern not found. |
Source code in src/marianne/learning/store/patterns_trust.py
get_high_trust_patterns
¶
Get patterns with high trust scores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Minimum trust score to include. |
0.7
|
limit
|
int
|
Maximum number of patterns to return. |
50
|
Returns:
| Type | Description |
|---|---|
list[PatternRecord]
|
List of high-trust PatternRecord objects. |
Source code in src/marianne/learning/store/patterns_trust.py
get_low_trust_patterns
¶
Get patterns with low trust scores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Maximum trust score to include. |
0.3
|
limit
|
int
|
Maximum number of patterns to return. |
50
|
Returns:
| Type | Description |
|---|---|
list[PatternRecord]
|
List of low-trust PatternRecord objects. |
Source code in src/marianne/learning/store/patterns_trust.py
get_patterns_for_auto_apply
¶
get_patterns_for_auto_apply(trust_threshold=0.85, require_validated=True, limit=3, context_tags=None)
Get patterns eligible for autonomous application.
Criteria: 1. Trust score >= trust_threshold (default 0.85) 2. Quarantine status == VALIDATED (if require_validated=True) 3. Pattern is not retired
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trust_threshold
|
float
|
Minimum trust score for auto-apply. |
0.85
|
require_validated
|
bool
|
Require VALIDATED quarantine status. |
True
|
limit
|
int
|
Maximum patterns to return. |
3
|
context_tags
|
list[str] | None
|
Optional context tags to filter by relevance. |
None
|
Returns:
| Type | Description |
|---|---|
list[PatternRecord]
|
List of PatternRecord objects eligible for auto-apply. |
Source code in src/marianne/learning/store/patterns_trust.py
recalculate_all_trust_scores
¶
Recalculate trust scores for all patterns.
Returns:
| Type | Description |
|---|---|
int
|
Number of patterns updated. |
Source code in src/marianne/learning/store/patterns_trust.py
PatternMixin
¶
Bases: PatternCrudMixin, PatternQueryMixin, PatternQuarantineMixin, PatternTrustMixin, PatternSuccessFactorsMixin, PatternBroadcastMixin, PatternLifecycleMixin
Mixin providing all pattern-related methods for GlobalLearningStore.
This mixin requires that the composed class provides: - _get_connection(): Context manager yielding sqlite3.Connection - _logger: Logger instance for logging
Composed from focused sub-mixins: - PatternQueryMixin: get_patterns, get_pattern_by_id, get_pattern_provenance - PatternCrudMixin: record_pattern, record_pattern_application, effectiveness - PatternQuarantineMixin: quarantine_pattern, validate_pattern, retire_pattern - PatternTrustMixin: calculate_trust_score, get_high/low_trust_patterns - PatternSuccessFactorsMixin: update_success_factors, analyze_pattern_why - PatternBroadcastMixin: record_pattern_discovery, check_recent_pattern_discoveries - PatternLifecycleMixin: promote_ready_patterns, update_quarantine_status (v25)