package oracle import "git.mleku.dev/mleku/dendrite/pkg/state" // DomainType classifies the information environment (outer trigram). // This determines what kind of source the organism should emphasize. type DomainType uint8 const ( DomainEmpirical DomainType = iota // Earth (000): data, measurements, benchmarks DomainEmerging // Thunder (001): new discoveries, recent commits DomainCritiques // Water (010): failure modes, edge cases, bugs DomainApplications // Lake (011): examples, tests, working code DomainVisualization // Fire (100): diagrams, architecture, intuition DomainFoundations // Heaven (101): axioms, first principles, theory DomainMethodology // Wind (110): techniques, algorithms, how-to DomainCanon // Mountain (111): textbooks, proofs, standards ) // IntentionType classifies the understanding gap (inner trigram). // This determines what kind of understanding the organism needs. type IntentionType uint8 const ( IntentEmpirical IntentionType = iota // Earth: need evidence/grounding IntentEmerging // Thunder: need awareness of new work IntentCritiques // Water: need to understand failures IntentApplications // Lake: need practical experience IntentVisualization // Fire: need intuitive grasp IntentFoundations // Heaven: need axiomatic understanding IntentMethodology // Wind: need technique/process IntentCanon // Mountain: need established knowledge ) // EngagementStyle is the ADSR-modulated depth of engagement with data. type EngagementStyle uint8 const ( StyleBroad EngagementStyle = iota // Attack: many results, shallow, orientation StyleTargeted // Decay: specific gap-filling, fewer, deeper StyleReference // Sustain: occasional lookups, integration StyleSynthesis // Release: cross-domain connections, meta-level ) // TrigramToDomain maps an outer trigram to a domain type. func TrigramToDomain(t state.Trigram) DomainType { switch t { case state.Earth: return DomainEmpirical case state.Thunder: return DomainEmerging case state.Water: return DomainCritiques case state.Lake: return DomainApplications case state.Fire: return DomainVisualization case state.Heaven: return DomainFoundations case state.Wind: return DomainMethodology case state.Mountain: return DomainCanon default: return DomainEmpirical } } // TrigramToIntention maps an inner trigram to an intention type. func TrigramToIntention(t state.Trigram) IntentionType { switch t { case state.Earth: return IntentEmpirical case state.Thunder: return IntentEmerging case state.Water: return IntentCritiques case state.Lake: return IntentApplications case state.Fire: return IntentVisualization case state.Heaven: return IntentFoundations case state.Wind: return IntentMethodology case state.Mountain: return IntentCanon default: return IntentEmpirical } } // DomainKeywords returns search/focus keywords for a domain type. func DomainKeywords(d DomainType) []string { switch d { case DomainEmpirical: return []string{"data", "empirical", "measurements", "benchmarks", "results"} case DomainEmerging: return []string{"preprint", "new", "emerging", "recent", "2026"} case DomainCritiques: return []string{"critique", "failure", "edge case", "limitation", "bug"} case DomainApplications: return []string{"example", "application", "tutorial", "playground", "test"} case DomainVisualization: return []string{"diagram", "visualization", "intuition", "geometric", "visual"} case DomainFoundations: return []string{"axioms", "first principles", "foundations", "theory"} case DomainMethodology: return []string{"how to", "technique", "method", "algorithm", "implementation"} case DomainCanon: return []string{"textbook", "established", "canonical", "proof", "standard"} default: return nil } } // IntentionPrefix returns the query prefix expressing what understanding is needed. func IntentionPrefix(i IntentionType) string { switch i { case IntentEmpirical: return "What empirical evidence exists for" case IntentEmerging: return "What recent developments exist in" case IntentCritiques: return "What are the failure modes and critiques of" case IntentApplications: return "What are practical examples and applications of" case IntentVisualization: return "How can one visualize or intuitively understand" case IntentFoundations: return "What are the foundational principles of" case IntentMethodology: return "How does one implement or apply" case IntentCanon: return "What is the established canonical knowledge about" default: return "What is" } } // ADSRToStyle maps an ADSR phase (0-3) to an engagement style. func ADSRToStyle(phase uint8) EngagementStyle { if phase > 3 { return StyleBroad } return EngagementStyle(phase) } // ChangingBitFocus returns the dimension-specific focus string for a // changing line's bit position. isInner distinguishes inner (understanding) // from outer (source) trigram lines. func ChangingBitFocus(bit int, isInner bool) string { context := "understanding of" if !isInner { context = "sources about" } switch bit { case 0: // bonding return "How the accretion/dissolution balance shifts in " + context case 1: // constraint return "What structural constraints are being revised in " + context case 2: // energy return "What is expanding or contracting in scope of " + context default: return "What is changing in " + context } }