Integrate XIC telemetry with FedMart (Phase 1)
Implement telemetry schema, adapter, and pipeline integration for FedMart real-time monitoring of XIC symbolic pipeline execution. ## Components ### Telemetry Schema (integrations/fedmart/telemetry_schema.json) - JSON schema defining XIC telemetry event structure - Required fields: event_type, timestamp, run_id, glyph_count, etc. - Optional: metadata, raw_payload for detailed analysis - Supports multi-glyph resonance summaries and guardrail events ### FedMart Adapter (integrations/fedmart/xic_adapter.py) - FedMartAdapter class for telemetry emission and spec registration - emit_telemetry(): normalize and forward telemetry events - register_spec_map(): push XIC specification status - Control hooks: pause_run(), throttle_run() for guardrail actions - Local mode (buffering) and remote mode (HTTP POST) - Global singleton instance via get_adapter() ### Pipeline Integration (glyphos/symbolic_pipeline.py) - Emit telemetry at end of run_symbolic_pipeline() - Captures: glyph_ids, resonance scores, execution steps, guardrails - Builds resonance_map_summary with top glyphs and averages - Optional import (graceful degradation if FedMart not available) ### Validation Suite (tests/validate_fedmart_integration.py) - 12 comprehensive tests covering all adapter functions - Tests: telemetry emission, normalization, spec registration - Tests: control actions, buffer operations, schema compliance - Tests: multi-glyph resonance tracking, guardrail event capture - All 12 tests passing ✅ ## Key Features ✅ Telemetry normalization (timestamp ISO 8601, run_id generation) ✅ Multi-glyph resonance summaries (top 5 glyphs, average resonance) ✅ Guardrail event tracking (truncation, max steps, etc.) ✅ Spec map registration for specification tracking ✅ Control actions (pause/throttle for guardrail responses) ✅ Local mode for testing, remote mode for production ✅ Schema compliance validation ✅ Graceful degradation if FedMart not available ## Testing All 12 validation tests passing: ✅ Schema validation ✅ Adapter initialization ✅ Telemetry emission (local mode) ✅ Normalization with defaults ✅ Spec map registration ✅ Control actions ✅ Pipeline telemetry integration ✅ Guardrail event capture ✅ Multi-glyph resonance tracking ✅ Buffer operations ✅ Schema compliance ✅ Empty buffer handling ## Next Steps Phase 2: UI Visualization - real-time dashboard for FedMart Phase 3: XIC v2 Control Flow - IF, MATCH, LOOP operations Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "XIC Telemetry Event",
|
||||
"description": "Telemetry event from XIC symbolic pipeline execution, compatible with FedMart ingestion",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string",
|
||||
"description": "Type of telemetry event (e.g., 'symbolic_pipeline_run', 'guardrail_triggered')",
|
||||
"enum": ["symbolic_pipeline_run", "guardrail_triggered", "control_flow_decision", "resonance_update"]
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of event"
|
||||
},
|
||||
"run_id": {
|
||||
"type": "string",
|
||||
"description": "Unique identifier for this pipeline execution"
|
||||
},
|
||||
"program": {
|
||||
"type": "string",
|
||||
"description": "XIC program name or path"
|
||||
},
|
||||
"chain_label": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Current CHAIN label if in a named chain"
|
||||
},
|
||||
"glyph_ids": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "List of glyph IDs in this resonance computation"
|
||||
},
|
||||
"glyph_count": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Number of glyphs processed"
|
||||
},
|
||||
"global_resonance_score": {
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"description": "Overall resonance score [0.0, 1.0]"
|
||||
},
|
||||
"steps_executed": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Number of SymbolicStep entries in pipeline execution"
|
||||
},
|
||||
"guardrails_triggered": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "List of guardrail messages triggered during execution"
|
||||
},
|
||||
"resonance_map_summary": {
|
||||
"type": "object",
|
||||
"description": "Summary of resonance metrics",
|
||||
"properties": {
|
||||
"top_glyphs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"glyph_id": {"type": "string"},
|
||||
"weight": {"type": "number", "minimum": 0.0, "maximum": 1.0}
|
||||
},
|
||||
"required": ["glyph_id", "weight"]
|
||||
},
|
||||
"description": "Top 5 glyphs by weight"
|
||||
},
|
||||
"average_resonance": {
|
||||
"type": "number",
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"description": "Average resonance across all glyphs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"raw_payload": {
|
||||
"type": "object",
|
||||
"description": "Full execution result for detailed analysis"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"description": "Optional additional metadata"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"event_type",
|
||||
"timestamp",
|
||||
"run_id",
|
||||
"glyph_count",
|
||||
"global_resonance_score",
|
||||
"steps_executed",
|
||||
"guardrails_triggered"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user