Implements all phases of the symbolic pipeline extension: **Phase 1: Symbolic Pipeline Abstraction** - Created glyphos/symbolic_pipeline.py with: - SymbolicStep: tracks individual pipeline steps (name, kind, payload, context) - SymbolicPipelineResult: complete pipeline execution result (steps, output_text, fused_symbol) - run_symbolic_pipeline(prompt, context, glyph_id): high-level pipeline entrypoint - Integrated with glyphos/__init__.py exports **Phase 2: Glyph-Aware Transformations** - Updated glyphos/cognitive_kernel.py: - run_symbolic_prompt() now thin wrapper around pipeline - Maintains backward compatibility - Updated xic_ops.py operations: - op_RUN_PROMPT: uses pipeline in symbolic mode - op_STREAM: uses pipeline with line-by-line output - op_CALL_GLYPH: routes through pipeline with explicit glyph_id parameter - Context propagation: glyph_id automatically injected into LAIN context **Phase 3: XIC Instruction Semantics v1.5** - Created XIC_SEMANTICS_v1_5.md: - Formal specification of all 9 XIC instructions - Complete semantics: preconditions, postconditions, side effects - Symbolic vs compressed behavior for each op - Context model and pipeline semantics - Execution paths (compressed vs symbolic) - Backward compatibility guarantees **Phase 4: Demo Program & Validation** - Created programs/demo_symbolic_pipeline.gx.json - Demonstrates symbolic pipeline with glyph-aware cognition - Uses CALL_GLYPH, RUN_PROMPT, SET_CONTEXT, CHAIN, LOG - All 7 validation tests pass: ✅ Pipeline module imports ✅ Pipeline execution ✅ Glyph-aware transformations ✅ Demo program ✅ CALL_GLYPH result storage ✅ Backward compatibility ✅ run_symbolic_prompt() wrapper **Phase 5: Final Report** - Created XIC_SYMBOLIC_PIPELINE_REPORT.md - Architecture and module hierarchy - Integration points and data flow - Design decisions and rationale - Usage examples Key Features: - Step-level introspection: full SymbolicPipelineResult with step history - Glyph-aware: explicit glyph_id routing through LAIN kernel - Formal semantics: complete specification for tool builders - Backward compatible: all v1 programs work unchanged - No breaking changes: compressed execution path untouched Constraints Met: ✅ No GPU code ✅ No XIC v2 binary container ✅ No .gx format changes ✅ Full backward compatibility
10 KiB
XIC v1.5 Symbolic Pipeline Extension Report
Date: 2026-05-21
Status: ✅ Complete and validated
Scope: Symbolic pipeline abstraction + glyph-aware transformations + formal semantics
Executive Summary
Extended XIC v1 to v1.5 with:
-
Symbolic Pipeline Abstraction (
glyphos/symbolic_pipeline.py)- Explicit pipeline with step tracking
- Data structures: SymbolicStep, SymbolicPipelineResult
- Function:
run_symbolic_pipeline(prompt, context, glyph_id)
-
Glyph-Aware Transformations
- CALL_GLYPH now routes through pipeline with explicit glyph_id
- Context includes glyph metadata for LAIN kernel
- Fused symbols captured in results
-
Formal Semantics Specification (
XIC_SEMANTICS_v1_5.md)- Complete instruction semantics for all 9 ops
- Preconditions, postconditions, side effects
- Context model and pipeline flow
- Backward compatibility guarantees
Zero breaking changes. All XIC v1 programs work unchanged.
Phase 1: Symbolic Pipeline Abstraction
File: glyphos/symbolic_pipeline.py
Data Structures
@dataclass
class SymbolicStep:
name: str # e.g., "initial_prompt", "glyph:xyz", "fusion"
kind: str # "prompt", "glyph_call", "fused_symbol"
payload: Any # Step data
context: Dict[str, Any] # Context at this step
@dataclass
class SymbolicPipelineResult:
steps: List[SymbolicStep] # Execution steps taken
output_text: str # Final text output
fused_symbol: Optional[Dict] # Fused symbolic representation
Core Function
def run_symbolic_pipeline(
prompt: str,
context: Optional[Dict[str, Any]] = None,
glyph_id: Optional[str] = None,
) -> SymbolicPipelineResult
Behavior:
- Creates SymbolicStep for initial_prompt
- If glyph_id: adds glyph_id to context, creates glyph_call step
- Compresses prompt → GSZ3
- Builds minimal manifest/segments
- Calls
CognitiveKernel.execute_symbolic(manifest, segments, payload, mode="symbolic", context=...) - Extracts output_text and fused_symbol
- If fused_symbol: creates fusion step
- Returns SymbolicPipelineResult
Integration with Cognitive Kernel:
- Uses existing
CognitiveKernel.execute_symbolic()API - Wraps it with step tracking and glyph-aware routing
- No circular imports (lazy import in glyphos/cognitive_kernel.py)
Phase 2: Glyph-Aware Transformations
Integration Points
1. RUN_PROMPT
def op_RUN_PROMPT(ctx, *args):
if ctx.symbolic_mode:
pipeline_result = run_symbolic_pipeline(
prompt=prompt,
context=ctx.params.get("context")
)
ctx._state["last_symbolic_pipeline"] = pipeline_result
Stores:
last_symbolic_result: output_text stringlast_symbolic_pipeline: full SymbolicPipelineResult
2. STREAM
Same routing as RUN_PROMPT, but streams output line-by-line.
3. CALL_GLYPH
def op_CALL_GLYPH(ctx, *args):
glyph_id = str(args[0])
payload = str(args[1]) if len(args) > 1 else ""
glyph_context = dict(ctx.params.get("context", {}))
glyph_context["glyph_id"] = glyph_id
pipeline_result = run_symbolic_pipeline(
prompt=payload,
context=glyph_context,
glyph_id=glyph_id,
)
ctx._state[f"glyph_{glyph_id}"] = {
"output_text": pipeline_result.output_text,
"fused_symbol": pipeline_result.fused_symbol,
"steps": [step metadata...]
}
Stores:
- Key:
glyph_{glyph_id} - Value: Dict with output_text, fused_symbol, steps
Context Propagation
SET_CONTEXT "domain" "glyph_cognition"
SET_CONTEXT "style" "analytic"
CALL_GLYPH "glyph://compression" "prompt..."
↓
context = {"domain": "glyph_cognition", "style": "analytic", "glyph_id": "glyph://compression"}
↓
run_symbolic_pipeline(prompt, context, glyph_id)
↓
LAIN kernel processes with glyph-aware context
Phase 3: XIC Instruction Semantics v1.5
File: XIC_SEMANTICS_v1_5.md
Comprehensive formal specification covering:
- Overview: Dual execution modes (compressed/symbolic), architecture
- XICContext model: Field definitions, context propagation
- Instruction semantics: All 9 ops with:
- Signature (JSON form)
- Preconditions
- Postconditions
- Side effects
- Symbolic vs compressed behavior
- Symbolic pipeline semantics: run_symbolic_pipeline, SymbolicPipelineResult, SymbolicStep
- Execution paths: Compressed and symbolic flowcharts
- Context flow: Example of glyph-aware cognition
- Backward compatibility: v1 → v1.5 changes
Key Changes from v1
| Aspect | v1 | v1.5 |
|---|---|---|
| Pipeline implementation | Inline in run_symbolic_prompt | Separate glyphos/symbolic_pipeline.py |
| Glyph support | Manual context manipulation | Explicit glyph_id parameter |
| Step tracking | None | Full SymbolicStep list |
| Result structure | String only | SymbolicPipelineResult (steps + fused_symbol) |
| Formal spec | Docstrings | XIC_SEMANTICS_v1_5.md |
Phase 4: Demo Program and Validation
Demo Program: programs/demo_symbolic_pipeline.gx.json
{
"instructions": [
{ "op": "SET_MODE", "args": ["symbolic"] },
{ "op": "SET_CONTEXT", "args": ["domain", "glyph_cognition"] },
{ "op": "SET_CONTEXT", "args": ["style", "analytic"] },
{ "op": "CHAIN", "args": ["glyph_analysis"] },
{ "op": "LOG", "args": ["Starting glyph-aware symbolic pipeline"] },
{ "op": "CALL_GLYPH", "args": ["glyph://compression", "..."] },
{ "op": "RUN_PROMPT", "args": ["..."] }
]
}
Validation Results (7/7 Tests Passed)
✅ Symbolic pipeline module imports
✅ run_symbolic_pipeline() execution
✅ Glyph-aware pipeline (glyph_id parameter)
✅ Demo symbolic pipeline program
✅ CALL_GLYPH result storage (output_text, fused_symbol, steps)
✅ Backward compatibility (demo_chat.gx.json)
✅ run_symbolic_prompt() wrapper works
Architecture
Module Hierarchy
glyphos/
├── cognitive_kernel.py (CognitiveKernel, get_kernel, run_symbolic_prompt wrapper)
├── symbolic_pipeline.py (SymbolicStep, SymbolicPipelineResult, run_symbolic_pipeline)
├── events.py (EventBus, emit, on)
└── __init__.py (exports all)
xic_ops.py
└── Uses: run_symbolic_pipeline (lazy import inside ops)
└── RUN_PROMPT, STREAM, CALL_GLYPH route through pipeline
Data Flow (Symbolic Mode)
XIC Program
↓
RUN_PROMPT / STREAM / CALL_GLYPH
↓
run_symbolic_pipeline(prompt, context, glyph_id)
↓
[Step 1] Initial prompt
[Step 2] Glyph call (if glyph_id present)
[Step 3] Compress + build manifest
[Step 4] CognitiveKernel.execute_symbolic()
[Step 5] LAIN 8-lane cognition
[Step 6] Fusion step (if fused_symbol present)
↓
SymbolicPipelineResult
├── steps: [...SymbolicStep...]
├── output_text: str
└── fused_symbol: Dict | None
↓
Store in ctx._state
Backward Compatibility
✅ XIC v1 programs work unchanged:
- demo_chat.gx.json executes identically
- execute_gx() behavior preserved
- Compressed mode execution path unchanged
✅ run_symbolic_prompt() thin wrapper:
- Existing code importing run_symbolic_prompt() still works
- Now routes through pipeline (transparent upgrade)
✅ No binary format changes:
- .gx files unchanged
- JSON manifest format unchanged
- GXIC1 magic and version unchanged
Files Modified or Created
Created
| File | Purpose |
|---|---|
| glyphos/symbolic_pipeline.py | Symbolic pipeline abstraction |
| XIC_SEMANTICS_v1_5.md | Formal instruction semantics spec |
| programs/demo_symbolic_pipeline.gx.json | Demo of glyph-aware pipeline |
Modified
| File | Changes |
|---|---|
| glyphos/__init__.py | +export SymbolicStep, SymbolicPipelineResult, run_symbolic_pipeline |
| glyphos/cognitive_kernel.py | run_symbolic_prompt() → thin wrapper around pipeline |
| xic_ops.py | op_RUN_PROMPT, op_STREAM, op_CALL_GLYPH → use pipeline |
Unchanged (Backward Compatibility)
- xic_loader.py
- xic_vm.py
- xic_executor.py
- runtime_executor/runner.py
- All .gx binary files
Key Design Decisions
1. Separate Pipeline Module (symbolic_pipeline.py)
Rationale: Makes pipeline structure explicit and testable. Enables step tracking without modifying core kernel.
2. SymbolicPipelineResult with Steps
Rationale: Supports introspection, debugging, and future enhancements (e.g., step replay, conditional routing).
3. Explicit glyph_id Parameter
Rationale: Makes glyph-aware cognition intentional and traceable. Simplifies context propagation.
4. Formal Semantics Specification
Rationale: Documents contract clearly for tool builders, enables static analysis, serves as implementation guide.
Usage Examples
Example 1: Symbolic Mode with Context
glyph --xic -c "
SET_MODE symbolic
SET_CONTEXT domain compression_theory
SET_CONTEXT style analytical
RUN_PROMPT 'Explain lossy compression as a glyph.'
"
Example 2: Glyph-Aware Cognition
glyph --xic programs/demo_symbolic_pipeline.gx.json
Results in:
ctx._state["glyph_glyph://compression"]with output_text, fused_symbol, steps- Full execution trace via SymbolicPipelineResult
Testing
All validation tests pass:
[TEST 1] Symbolic pipeline module imports ✅
[TEST 2] run_symbolic_pipeline() execution ✅
[TEST 3] Glyph-aware pipeline (glyph_id parameter) ✅
[TEST 4] Demo symbolic pipeline program ✅
[TEST 5] CALL_GLYPH result storage ✅
[TEST 6] Backward compatibility ✅
[TEST 7] run_symbolic_prompt() wrapper ✅
References
- Formal Specification: See
XIC_SEMANTICS_v1_5.mdfor complete instruction semantics - Previous Reports:
XIC_SYMBOLIC_EXTENSION_REPORT.mddocuments symbolic mode v1 - Cognitive Kernel:
glyphos/cognitive_kernel.py(CognitiveKernel.execute_symbolic API)
Summary
XIC v1.5 extends the v1 engine with:
- Explicit symbolic pipeline abstraction
- Glyph-aware transformations with context propagation
- Formal instruction semantics specification
- Full backward compatibility
No breaking changes. All XIC v1 programs continue to work unchanged.
Implementation Complete ✅
All tests passing ✅
Backward compatible ✅
Formal semantics documented ✅