Class: ClaudeMemory::Distill::NullDistiller
- Defined in:
- lib/claude_memory/distill/null_distiller.rb
Constant Summary collapse
- DECISION_PATTERNS =
[ /\b(?:we\s+)?decided\s+to\s+(.+)/i, /\b(?:we\s+)?agreed\s+(?:to\s+|on\s+)(.+)/i, /\blet'?s\s+(?:go\s+with|use)\s+(.+)/i, /\bgoing\s+(?:forward|ahead)\s+with\s+(.+)/i ].freeze
- CONVENTION_PATTERNS =
[ /\balways\s+(.+)/i, /\bnever\s+(.+)/i, /\bconvention[:\s]+(.+)/i, /\bstandard[:\s]+(.+)/i, /\bwe\s+use\s+(.+)/i ].freeze
- ENTITY_PATTERNS =
{ "database" => /\b(postgresql|postgres|mysql|sqlite|mongodb|redis)\b/i, "framework" => /\b(rails|sinatra|django|express|next\.?js|react|vue)\b/i, # `Go` is matched case-sensitively (via the inline (?-i:) flag) so the # English verb "go" / "go-to" doesn't masquerade as the language; the # other languages stay case-insensitive. `golang` normalizes to `go`. "language" => /\b(ruby|python|javascript|typescript|rust|(?-i:Go)|golang)\b/i, "platform" => /\b(aws|gcp|azure|heroku|vercel|netlify|docker|kubernetes)\b/i }.freeze
- GLOBAL_SCOPE_PATTERNS =
[ /\bi\s+always\b/i, /\bin\s+all\s+(?:my\s+)?projects\b/i, /\beverywhere\b/i, /\bacross\s+all\s+(?:my\s+)?(?:projects|repos|codebases)\b/i, /\bmy\s+(?:personal\s+)?(?:preference|convention|standard)\b/i, /\bglobally\b/i, /\buniversally\b/i ].freeze
- OBSERVATION_CONVENTION_PATTERNS =
Observation-specific convention patterns: stricter than the shared CONVENTION_PATTERNS. Bare ‘always (.+)` / `never (.+)` / `we use (.+)` match code, prose, and instruction text (“never answer from memory”, “never nil. def …”), so observations require explicit convention framing or a first-person “we always/never”.
[ /\bconvention[:\s]+(.+)/i, /\bstandard[:\s]+(.+)/i, /\bwe\s+(?:should\s+)?(?:always|never)\s+(.+)/i ].freeze
- NOISE_BODY_SIGNATURE =
Bodies that look like code / JSON / shell rather than a statement.
/\bdef\s|\bclass\s|\bmodule\s|=>|::|","|":\s*"|[{}]|\$\(|&&|\|\|/
Instance Method Summary collapse
Instance Method Details
#distill(text, content_item_id: nil) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/claude_memory/distill/null_distiller.rb', line 55 def distill(text, content_item_id: nil) entities = extract_entities(text) facts = extract_facts(text, entities) decisions = extract_decisions(text) signals = extract_signals(text) observations = extract_observations(text) Extraction.new( entities: entities, facts: facts, decisions: decisions, signals: signals, observations: observations ) end |