mirror of
https://github.com/LerianStudio/ring
synced 2026-04-21 13:37:27 +00:00
Extracts session learnings automatically via SessionEnd hook, detects recurring patterns across sessions (3+ occurrences), and generates proposals for new rules/skills with user approval. Includes pattern detection with fuzzy matching, rule/skill generation, and secure file handling with path traversal prevention. X-Lerian-Ref: 0x1
72 lines
1.7 KiB
Python
72 lines
1.7 KiB
Python
"""Compound Learnings Library - Transform session learnings into permanent capabilities.
|
|
|
|
This package provides:
|
|
- Learning file parsing (learning_parser)
|
|
- Pattern detection across sessions (pattern_detector)
|
|
- Rule/skill generation from patterns (rule_generator)
|
|
"""
|
|
|
|
from .learning_parser import (
|
|
parse_learning_file,
|
|
extract_patterns,
|
|
extract_what_worked,
|
|
extract_what_failed,
|
|
extract_key_decisions,
|
|
load_all_learnings,
|
|
)
|
|
|
|
from .pattern_detector import (
|
|
normalize_pattern,
|
|
find_similar_patterns,
|
|
aggregate_patterns,
|
|
detect_recurring_patterns,
|
|
categorize_pattern,
|
|
generate_pattern_summary,
|
|
similarity_score,
|
|
DEFAULT_SIMILARITY_THRESHOLD,
|
|
)
|
|
|
|
from .rule_generator import (
|
|
generate_rule_content,
|
|
generate_skill_content,
|
|
create_rule_file,
|
|
create_skill_file,
|
|
generate_proposal,
|
|
save_proposal,
|
|
load_pending_proposals,
|
|
approve_proposal,
|
|
reject_proposal,
|
|
slugify,
|
|
RuleGenerationError,
|
|
)
|
|
|
|
__all__ = [
|
|
# learning_parser
|
|
"parse_learning_file",
|
|
"extract_patterns",
|
|
"extract_what_worked",
|
|
"extract_what_failed",
|
|
"extract_key_decisions",
|
|
"load_all_learnings",
|
|
# pattern_detector
|
|
"normalize_pattern",
|
|
"find_similar_patterns",
|
|
"aggregate_patterns",
|
|
"detect_recurring_patterns",
|
|
"categorize_pattern",
|
|
"generate_pattern_summary",
|
|
"similarity_score",
|
|
"DEFAULT_SIMILARITY_THRESHOLD",
|
|
# rule_generator
|
|
"generate_rule_content",
|
|
"generate_skill_content",
|
|
"create_rule_file",
|
|
"create_skill_file",
|
|
"generate_proposal",
|
|
"save_proposal",
|
|
"load_pending_proposals",
|
|
"approve_proposal",
|
|
"reject_proposal",
|
|
"slugify",
|
|
"RuleGenerationError",
|
|
]
|