Files
2125_GCE/integrations/fedmart/__pycache__/xic_adapter.cpython-314.pyc
T

89 lines
12 KiB
Plaintext
Raw Normal View History

+
2026-07-09 12:54:44 -04:00
þÜ0jùãóºaRt0tRt^RIt^RIt^RIHtHtHtHt^RI H t ^RI
H t !RR4t Rs
]^kRRRlltR R
ltR R ltR
RltRRRlltR#)aFedMart adapter for XIC telemetry ingestion and spec map registration.
Provides:
- emit_telemetry(telemetry): normalize and forward telemetry to FedMart
- register_spec_map(spec_map): push XIC specification status to FedMart
- Control hooks for guardrail actions (pause, throttle)
N)ÚDictÚAnyÚListÚOptional)Údatetime)ÚPathcóòa]tRt^toRtRV3RlRlltV3RlRltV3RlRltV3R lR
2026-07-09 12:54:44 -04:00
ltRV3R lR llt V3R
lRlt
V3RlRlt V3RlRlt V3RlRlt
V3RlRltV3RlRltRtVtR#)ÚFedMartAdapteru(Adapter for XIC → FedMart integration.Ncó6<V^8„dQhRS[S[,RS[/#)éÚendpointÚ
local_mode)rÚstrÚbool)ÚformatÚ
__classdict__s"€Ú7/home/t420/2125_GCE/integrations/fedmart/xic_adapter.pyÚ __annotate__ÚFedMartAdapter.__annotate__sø€÷
ñ
¡©#¥ð
Á4ñ
óc óPT;'gRVnW n.Vn/VnR#)zÊInitialize FedMart adapter.
Args:
endpoint: FedMart ingestion endpoint (default: http://localhost:8080/fedmart/ingest)
local_mode: If True, store telemetry locally instead of sending to remote
z$http://localhost:8080/fedmart/ingestN)r r
Útelemetry_bufferÚ spec_status)Úselfr r
s&&&rÚ__init__ÚFedMartAdapter.__init__s)ð!×JÐ$JˆŒ
ØØ68ˆÔ؈Örcó<<V^8„dQhRS[S[S[3,RS[/#©r Ú telemetryÚreturn©rrrr)rrs"€rrrs#ø€÷©S±#¨X­ð5¹4ñ5rc óèVPV4pVP'd@VPPV4\ R\ VP4 R24R#VP
V4#)z“Emit telemetry event to FedMart.
Args:
telemetry: Telemetry dict with schema-defined fields
Returns:
True if successful, False otherwise
2026-07-09 12:54:44 -04:00
z-[FEDMART] Telemetry buffered locally (total: Ú)T)Ú_normalize_telemetryr
rÚappendÚprintÚlenÚ_send_to_fedmart©rrÚ
normalizeds&& rÚemit_telemetryÚFedMartAdapter.emit_telemetrysfð×.¨yÓ
à ??ˆ?à × Ô ÐAÄ#Àd×F[ÑF[ÓB\ÐA]Ð]^Ð ð×Ó 4rcó<<V^8„dQhRS[S[S[3,RS[/#©r Úspec_maprr )rrs"€rrr4s#ø€÷8©$©s±C¨x­8¹Tñ8rc óÆVPPV4VP'd%\R\ VP4 R24R#VP V4#)zµRegister XIC specification status with FedMart.
Args:
spec_map: Dict with spec entries (instruction, phase, status, coverage)
2026-07-09 12:54:44 -04:00
Returns:
True if successful, False otherwise
z'[FEDMART] Spec map registered locally (z entries)T)rÚupdater
r%r&Ú_send_spec_to_fedmart)rr.s&&rÚregister_spec_mapÚ FedMartAdapter.register_spec_map4sTð
×Ñ×Ñ Ô ??ˆ?Ü Ð;¼CÀ×@PÑ@PÓ<QÐ;RÐR[Ð à×-¨hÓ 7rcó&<V^8„dQhRS[RS[/#©r Úrun_idr©rr)rrs"€rrrEsø€÷
ñ
¡ð
2026-07-09 12:54:44 -04:00
©ñ
rc óJ\RV 24VP'dR#R#)z‡Pause a pipeline run (guardrail control action).
Args:
run_id: Unique run identifier
2026-07-09 12:54:44 -04:00
Returns:
True if pause command accepted
z*[FEDMART-CONTROL] Pause requested for run T©r%r
2026-07-09 12:54:44 -04:00
)rr6s&&rÚ pause_runÚFedMartAdapter.pause_runEs#ô Ð:¸6¸ ??ˆárcó,<V^8„dQhRS[RS[RS[/#©r r6Úfactorr©rÚfloatr)rrs"€rrrTs"ø€÷ñ¡3ð±ðÁñrc óR\RVR
RV 24VP'dR#R#)zÇThrottle a pipeline run (reduce glyph_count or slow execution).
Args:
run_id: Unique run identifier
factor: Throttle factor (0.5 = 50% speed)
2026-07-09 12:54:44 -04:00
Returns:
2026-07-09 12:54:44 -04:00
True if throttle command accepted
zEDMART-CONTROL] Throttle z.1%z requested for run Tr9)rr6r>s&&&rÚ throttle_runÚFedMartAdapter.throttle_runTs,ô Ð+¨F°3¨<Ð7JÈ6È(Ð ??ˆárcóR<V^8„dQhRS[S[S[3,RS[S[S[3,/#r)rrr)rrs"€rrrds+ø€÷"ñ"©d±3¹°8­"ÁÁcÉ3ÀhÅñ"rc  óˆ\V4pRV9d/\P!4P4R,VR&MR\ VR,\
4'd6\P !VR,4P4R,VR&RV9dVP4VR&VPRR4VPR.4VPR\VPR.444VPRR 4VPR
^4VPR .4R V9d
R
.RR /VR &V#)zSNormalize telemetry to schema.
Ensures timestamp is ISO 8601, adds defaults, etc.
Ú timestampÚZr6Ú
2026-07-09 12:54:44 -04:00
event_typeÚsymbolic_pipeline_runÚ glyph_idsÚ glyph_countÚglobal_resonance_scoregÚsteps_executedÚguardrails_triggeredÚresonance_map_summaryÚ
top_glyphsÚaverage_resonance) ÚdictrÚutcnowÚ isoformatÚ
isinstancer@ÚutcfromtimestampÚ_generate_run_idÚ
2026-07-09 12:54:44 -04:00
setdefaultr&Úgetr(s&& rr#Ú#FedMartAdapter._normalize_telemetryds/ô
˜)“_ˆ
ð ˜ (Ü&.§o¢oÓ&7×&AÑ&AÓ&CÀcÕ&IˆJ
˜
2026-07-09 12:54:44 -04:00
 /´×
7Ü&.×&?Ò&?ؘ'ç‰ik˜' ˆJ
˜ %Ø#'×#8Ñ#8Ó#:ˆJ ð ×јlÐ,CÔ×јk¨2Ô×јm¬S°·±À ÈRÓ1PÓ-QÔ×ÑÐÔ×ÑÐÔ×ÑÐ4°bÔ #¨*Ô ˜# 3ˆJÐ