patterns_quarantine
patterns_quarantine
¶
Pattern quarantine lifecycle mixin for GlobalLearningStore.
Provides quarantine lifecycle management methods: - quarantine_pattern: Move to QUARANTINED status - validate_pattern: Move to VALIDATED status - retire_pattern: Move to RETIRED status - get_quarantined_patterns: Get patterns needing review
Classes¶
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. |