Add LLMCompress subsystem - sandbox for symbolic compression of LLM behavior

New subsystem fully self-contained:

Components:
- LLMCompress/llm_adapter.py: LLMAdapter + LLMResponse (abstract over LLM backends)
- LLMCompress/compression_report.py: CompressionReport (symbolic analysis results)
- LLMCompress/llm_compressor.py: compress_interaction() and compress_session()
- LLMCompress/tests/test_llm_compress.py: 5 comprehensive tests

Integration:
- Uses GlyphOS Cognitive Kernel for symbolic analysis
- Integrates with GlyphOS Event System
- Emits cognition.started and cognition.completed events
- Supports in-memory GX execution via execute_symbolic()

Test Coverage:
- LLMCompress tests: 5/5 PASS
- All existing tests still pass (52/52)
- Total: 57 tests passing

Bug fixes in cognitive_kernel.py:
- Fixed execute_symbolic() method calls to use correct function signatures
- normalize_segments(manifest, segments, payload)
- map_lanes(segments)
- build_envelope(manifest, lanes, payload, context)
- execute_with_lain(envelope)

Constraints:
- No modifications to gx_compiler/*
- No modifications to glyphs/super_registry.py
- Self-contained subsystem with proper isolation
- Full backward compatibility maintained
This commit is contained in:
GlyphRunner System
2026-05-20 20:51:01 -04:00
parent c63b390625
commit 1a0b45df9c
12 changed files with 473 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
"""LLMCompress
Sandbox for symbolic compression of LLM behavior using:
- GlyphOS Cognitive Kernel
- Supercharged Glyph Registry
- GlyphOS Event System
"""
from .llm_adapter import LLMAdapter, LLMResponse
from .compression_report import CompressionReport
from .llm_compressor import (
compress_interaction,
compress_session,
)
__all__ = [
"LLMAdapter",
"LLMResponse",
"CompressionReport",
"compress_interaction",
"compress_session",
]