Files
2125_GCE/glyphos/__pycache__/cognitive_kernel.cpython-314.pyc
T

163 lines
14 KiB
Plaintext
Raw Normal View History

2026-05-20 18:03:25 -04:00
+
T—j)ãóÞaRt0tRt^RIHtHtHtHt^RIt^RIH t ^RI
H t H t H
t
2026-05-20 18:03:25 -04:00
HtHtHt^RIHtHt^RIHt!RR4tRR R
lltRs]^kR R ltR
RRR/RRlltRRltR#)z¶GlyphOS Cognitive Kernel
2026-05-20 18:03:25 -04:00
Orchestrates LAIN cognition engine with Supercharged Glyph Registry.
Provides a clean service API for executing GX files and managing glyph-aware analysis.
)ÚOptionalÚDictÚAnyÚListN)ÚPath)Úexecute_gx_pathÚload_gxÚnormalize_segmentsÚ map_lanesÚbuild_envelopeÚexecute_with_lain)Úload_all_superchargedÚ super_stats)Úemitcóæa]tRt^toRtRR/V3RlRlltV3RlRltRR R
R /V3R lR
lltRR R
R /V3RlRlltV3RlRlt V3RlRlt
V3RlRlt V3RlRlt V3RlRlt
RtVtR #)ÚCognitiveKernelz¬System service for GlyphOS cognition pipeline.
2026-05-20 18:03:25 -04:00
Orchestrates:
- LAIN 8-lane symbolic cognition
- Supercharged Glyph Registry integration
- Result caching and introspection
Úauto_load_glyphsTcó <V^8„dQhRS[/#)ér)Úbool)ÚformatÚ
__classdict__s"€Ú0/home/dave/superdave/glyphos/cognitive_kernel.pyÚ __annotate__ÚCognitiveKernel.__annotate__sø€÷  .©Dñ c óXWnRVnRVnRVnRVnRVnR#)zInitialize the Cognitive Kernel.
2026-05-20 18:03:25 -04:00
Args:
auto_load_glyphs: If True, load Supercharged Glyphs during warmup.
Defaults to True.
NF)Ú_auto_load_glyphsÚ _last_resultÚ
_startup_timeÚ_glyph_stats_cacheÚ
_warmed_upÚ
_last_mode)Úselfrs&$rÚ__init__ÚCognitiveKernel.__init__s0ð"2ÔØ6:ˆÔØ.2ˆÔØ<@ˆÔ؈ŒØ)-ˆŽrcó<V^8„dQhRR/#)rÚreturnN©)rrs"€rrr'sø€÷ ñ ˜ñ rc óVP'dR#\P!4VnVP'd \ 4\ 4VnRVn\RRVP RVP/4R#)z³Perform one-time initialization.
Loads:
- Supercharged Glyphs (if auto_load_glyphs)
- Registry statistics
Records:
- Kernel startup time
Emits:
- kernel.warmup.completed event
2026-05-20 18:03:25 -04:00
NTzkernel.warmup.completedÚ glyph_statsÚ startup_time)r!Útimerrr
rr r©r#s&rÚwarmupÚCognitiveKernel.warmup'skð ??ˆ?Ù ä!ŸYšY›[ˆÔà × #.£-ˆÔàˆŒô
Ð
˜4× ˜D×)
ö rÚmodeÚanalyzeÚcontextNc
ón<V^8„dQhRS[RS[RS[S[S[S[3,,RS[S[S[3,/#©rÚgx_pathr0r2r'©Ústrrrr)rrs"€rrrGsNø€÷EñEáðEñð Eñ
™$™s¡C˜x Eñ
‰c3ˆhñ
Erc óLVP'gVP4\RRVRVRV/4T;'g/pW$R&\WR7pWPnW nVP
R/4pVP
R/4p\R RVRVR
VP
R
4R VP
R 4R VP
R 4/4VP
R 4pV'dHVP
R
4'd1\RRVP
R4RVP
R4R V/4V#)aExecute a .gx file through the full cognition pipeline.
Args:
2026-05-20 18:03:25 -04:00
gx_path: Path to .gx file
mode: Cognitive mode (e.g., "analyze", "debug")
2026-05-20 18:03:25 -04:00
context: Optional execution context dict
Returns:
ExecutionResult dict with:
- fused_symbol: Combined 8-lane analysis
- output_text: Rendered analysis
- cognition_trace: Step-by-step processing
- diagnostics: Performance metrics + glyph resonance
Emits:
- cognition.started event
- cognition.completed event
2026-05-20 18:03:25 -04:00
- glyph.resonance.updated event (if glyph resonance present)
zcognition.startedr5r0r2Úcognitive_mode©r2Ú fused_symbolÚ diagnosticszcognition.completedÚelapsedÚglyph_resonanceÚsummaryÚ glyph_foundzglyph.resonance.updatedÚglyph_idÚ glyph_score)r!r.rrrr"Úget) r#r5r0r2Ú exec_contextÚresultr;r<r>s &&$$ rÚ
execute_gxÚCognitiveKernel.execute_gxGs1ð4ˆØ K‰KŒMô
Ð
Ø   #
ô ð—}} "ˆ Ø)-ÐÔðØŒð—z‘z .°"Ó Ø—jj °Ó ô
Ð
  {— yÓ ˜{ŸÐ/@Ó |×'¨ Ó %
ô ð&Ÿ/™/Ð*;Ó<ˆß ˜×2°=× Ð˜O×
Ó˜×2°=Ó! ?ð-ô
ð ˆ
2026-05-20 18:03:25 -04:00
rcó¶<V^8„dQhRS[S[S[3,RS[S[S[S[3,,RS[RS[RS[S[S[S[3,,RS[S[S[3,/#)rÚmanifestÚsegmentsÚpayloadr0r2r')rr7rrÚbytesr)rrs"€rrrŽsqø€÷,ñ,á‘s™Cx•.ð,ñt™C¡˜H•~Õ,ñð ,ñ ð
,ñ™$™s¡C˜x,ñ
‰c3ˆhñ,rc óàVP'gVP4T;'g/pWFR&\WV4p\V4p\ WW6R7p \ V 4p
W nW@nV
2026-05-20 18:03:25 -04:00
#)aExecute cognition on in-memory GX components (no filesystem).
Args:
manifest: GX manifest dict
2026-05-20 18:03:25 -04:00
segments: GX segments list
payload: Compressed GX payload bytes
mode: Cognitive mode
context: Optional execution context
2026-05-20 18:03:25 -04:00
Returns:
ExecutionResult dict
2026-05-20 18:03:25 -04:00
r9r:)r!r.r r
r r rr") r#rIrJrKr0r2rDÚnormalized_segsÚlane_assignmentsÚenveloperEs &&&&$$ rÚexecute_symbolicÚ CognitiveKernel.execute_symbolicŽssð*ˆØ K‰KŒMð—}} "ˆ Ø)-Ð-¨XÀÓIˆô% ô" (¸\ˆô# ðØŒàˆ
rcó6<V^8„dQhRS[S[S[3,/#©rr'©rr7r)rrs"€rrr¼sø€÷ñ¡¡c©3 h¥ñrc ó¤VP'gVP4VP;'g \4pVPVR&V#)aVGet Supercharged Glyph Registry statistics.
Returns:
Dict with:
- total_glyphs: 600
2026-05-20 18:03:25 -04:00
- categories: List of category names
- fields_present: All fields in registry
- sample_ids: First 5 glyph IDs
- loaded: Whether registry is loaded
2026-05-20 18:03:25 -04:00
- load_path: Path to data file
- kernel_startup_time: Kernel warmup timestamp
Úkernel_startup_time)r!r.r rr)r#Ústatss& rÚget_glyph_statsÚCognitiveKernel.get_glyph_stats¼sCðˆØ K‰KŒMà×'×8¬;«=ˆð(,×'9Ñ'9ˆÐˆ rcóF<V^8„dQhRS[S[S[S[3,,/#rT©rrr7r)rrs"€rrrÓs!ø€÷©$©s±C¨x­.Õ!9ñ!rc óVP#)zYReturn the last ExecutionResult, if any.
Returns:
Full ExecutionResult dict or None
)rr-s&rÚget_last_resultÚCognitiveKernel.get_last_resultÓsð × Ñ Ð rcóV<V^8„dQhRS[S[S[S[S[3,,,/#rT)rrrr7r)rrs"€rrrÛs&ø€÷©©d±3¹°8­nÕ)=Õ >ñ8rc óXVPfR#VPPR4#)zhReturn cognition_trace from last ExecutionResult, if present.
Returns:
List of trace steps or None
cognition_trace©rrCr-s&rÚget_last_traceÚCognitiveKernel.get_last_traceÛs+ð × Ñ Ò Ø× Ñ ×$Ð%6Ó7rcóF<V^8„dQhRS[S[S[S[3,,/#rTr\)rrs"€rrrås!ø€÷5¡x±±S¹#°XµÕ'?ñ5rc óXVPfR#VPPR4#)zcReturn fused_symbol from last ExecutionResult, if present.
2026-05-20 18:03:25 -04:00
Returns:
Fused symbol dict or None
Nr;rcr-s&rÚget_last_fused_symbolÚ%CognitiveKernel.get_last_fused_symbolås*ð × Ñ Ò Ø× Ñ ×$ ^Ó4rcóF<V^8„dQhRS[S[S[S[3,,/#rTr\)rrs"€rrrïs!ø€÷
ñ
¡H©T±#±s°(­^Õ$<ñ
rc óÄVPfR#VPPR/4pRVPR4RVPR4RVPR4/#)zìReturn resonance metrics from last ExecutionResult, if present.
Returns:
Dict with:
- resonance: Overall resonance metrics (if present)
2026-05-20 18:03:25 -04:00
- glyph_resonance: Glyph-specific metrics (if glyph was used)
Or None if no result
2026-05-20 18:03:25 -04:00
Nr<Ú resonancer>r=rc)r#r<s& rÚget_last_resonanceÚ"CognitiveKernel.get_last_resonanceïsbð × Ñ Ò à×'×+¨M¸>ˆ ð
˜Ÿ¨Ó ˜{ŸÐ/@Ó {— yÓ
ð
r)rr r"rrr!)Ú__name__Ú
__module__Ú __qualname__Ú__firstlineno__Ú__doc__r$r.rFrQrYr^rdrhrmÚ__static_attributes__Ú__classdictcell__)rs@rrrø‡ñð .°4÷   ð ð@Eðð Eð
-1÷ EòEðN,ð ð
,ð-1÷,ò,÷\ð÷.
ö
rrcóJV^8„dQhR\R\R,R\/#)rÚpromptr2Nr')r7Údict)rs"rrrs%÷ñ¤ð¬d°T­kðÄSñrcó8^RIHpV!WR7pVP#)a*Thin wrapper around the symbolic pipeline for backward compatibility.
Routes through run_symbolic_pipeline() and returns output_text.
2026-05-20 18:03:25 -04:00
Args:
prompt: User or system prompt text
context: Optional symbolic/cognitive context dict
Returns:
String result from the 8-lane cognition pipeline
)Úrun_symbolic_pipeline)rwr2)Úsymbolic_pipelinerzÚ output_text)rwr2rzrEs&& rÚrun_symbolic_promptr}sõ
"¨&Ô
B€FØ × Ñ Ðrcó$V^8„dQhR\/#rT)r)rs"rrrs÷ñ”Oñrcó^\f!\RR7s\P4\#)z½Get or create the singleton CognitiveKernel instance.
On first call:
- Creates a new CognitiveKernel