1#![allow(dead_code)]
6
7use serde::Serialize;
8
9#[derive(Debug, Serialize)]
12pub struct IRProgram {
13 pub node_type: &'static str,
14 pub source_line: u32,
15 pub source_column: u32,
16 pub personas: Vec<IRPersona>,
17 pub contexts: Vec<IRContext>,
18 pub anchors: Vec<IRAnchor>,
19 pub tools: Vec<IRToolSpec>,
20 pub memories: Vec<IRMemory>,
21 pub types: Vec<IRType>,
22 pub flows: Vec<IRFlow>,
23 pub runs: Vec<IRRun>,
24 pub imports: Vec<IRImport>,
25 pub agents: Vec<IRAgent>,
26 pub shields: Vec<IRShield>,
27 pub daemons: Vec<IRDaemon>,
28 pub ots_specs: Vec<IROts>,
29 pub pix_specs: Vec<IRPix>,
30 pub corpus_specs: Vec<IRCorpus>,
31 pub psyche_specs: Vec<IRPsyche>,
32 pub mandate_specs: Vec<IRMandate>,
33 pub lambda_data_specs: Vec<IRLambdaData>,
34 pub compute_specs: Vec<IRCompute>,
35 pub axonstore_specs: Vec<IRAxonStore>,
36 pub endpoints: Vec<IRAxonEndpoint>,
37 #[serde(skip)]
52 pub extensions: Vec<IRExtension>,
53 #[serde(skip)]
58 pub dataspace_specs: Vec<IRDataspace>,
59 pub resources: Vec<IRResource>,
61 pub fabrics: Vec<IRFabric>,
62 pub manifests: Vec<IRManifest>,
63 pub observations: Vec<IRObserve>,
64 pub intention_tree: Option<IRIntentionTree>,
68 pub reconciles: Vec<IRReconcile>,
70 pub leases: Vec<IRLease>,
71 pub ensembles: Vec<IREnsemble>,
72 pub sessions: Vec<IRSession>,
74 pub topologies: Vec<IRTopology>,
75 pub immunes: Vec<IRImmune>,
77 pub reflexes: Vec<IRReflex>,
78 pub heals: Vec<IRHeal>,
79 pub components: Vec<IRComponent>,
81 pub views: Vec<IRView>,
82 pub channels: Vec<IRChannel>,
84 pub sockets: Vec<IRSocket>,
88 pub effects: Vec<IREffectDeclaration>,
104}
105
106impl IRProgram {
107 pub fn new() -> Self {
108 IRProgram {
109 node_type: "program",
110 source_line: 1,
111 source_column: 1,
112 personas: Vec::new(),
113 contexts: Vec::new(),
114 anchors: Vec::new(),
115 tools: Vec::new(),
116 memories: Vec::new(),
117 types: Vec::new(),
118 flows: Vec::new(),
119 runs: Vec::new(),
120 imports: Vec::new(),
121 agents: Vec::new(),
122 shields: Vec::new(),
123 daemons: Vec::new(),
124 ots_specs: Vec::new(),
125 pix_specs: Vec::new(),
126 corpus_specs: Vec::new(),
127 psyche_specs: Vec::new(),
128 mandate_specs: Vec::new(),
129 lambda_data_specs: Vec::new(),
130 compute_specs: Vec::new(),
131 axonstore_specs: Vec::new(),
132 endpoints: Vec::new(),
133 extensions: Vec::new(),
134 dataspace_specs: Vec::new(),
135 resources: Vec::new(),
136 fabrics: Vec::new(),
137 manifests: Vec::new(),
138 observations: Vec::new(),
139 intention_tree: None,
140 reconciles: Vec::new(),
141 leases: Vec::new(),
142 ensembles: Vec::new(),
143 sessions: Vec::new(),
144 topologies: Vec::new(),
145 immunes: Vec::new(),
146 reflexes: Vec::new(),
147 heals: Vec::new(),
148 components: Vec::new(),
149 views: Vec::new(),
150 channels: Vec::new(),
151 sockets: Vec::new(),
152 effects: Vec::new(),
153 }
154 }
155}
156
157#[derive(Debug, Serialize, Default)]
168pub struct IREffectDeclaration {
169 pub node_type: &'static str,
170 pub source_line: u32,
171 pub source_column: u32,
172 pub name: String,
173 pub operations: Vec<IREffectOperation>,
174}
175
176impl IREffectDeclaration {
177 pub fn new() -> Self {
178 Self {
179 node_type: "effect_declaration",
180 source_line: 0,
181 source_column: 0,
182 name: String::new(),
183 operations: Vec::new(),
184 }
185 }
186}
187
188#[derive(Debug, Serialize, Default)]
189pub struct IREffectOperation {
190 pub node_type: &'static str,
191 pub source_line: u32,
192 pub source_column: u32,
193 pub name: String,
194 pub type_parameters: Vec<String>,
195 pub parameter_names: Vec<String>,
196 pub parameter_types: Vec<String>,
197 pub return_type: String,
198}
199
200impl IREffectOperation {
201 pub fn new() -> Self {
202 Self {
203 node_type: "effect_operation",
204 source_line: 0,
205 source_column: 0,
206 name: String::new(),
207 type_parameters: Vec::new(),
208 parameter_names: Vec::new(),
209 parameter_types: Vec::new(),
210 return_type: String::new(),
211 }
212 }
213}
214
215#[derive(Debug, Clone, Serialize)]
221pub struct IRResource {
222 pub node_type: &'static str,
223 pub source_line: u32,
224 pub source_column: u32,
225 pub name: String,
226 pub kind: String,
227 pub endpoint: String,
228 pub capacity: Option<i64>,
229 pub lifetime: String, pub certainty_floor: Option<f64>, pub shield_ref: String,
232}
233
234impl IRResource {
235 pub fn new(name: String, line: u32, column: u32) -> Self {
236 IRResource {
237 node_type: "resource",
238 source_line: line,
239 source_column: column,
240 name,
241 kind: String::new(),
242 endpoint: String::new(),
243 capacity: None,
244 lifetime: "affine".to_string(),
245 certainty_floor: None,
246 shield_ref: String::new(),
247 }
248 }
249}
250
251#[derive(Debug, Clone, Serialize)]
255pub struct IRFabric {
256 pub node_type: &'static str,
257 pub source_line: u32,
258 pub source_column: u32,
259 pub name: String,
260 pub provider: String,
261 pub region: String,
262 pub zones: Option<i64>,
263 pub ephemeral: Option<bool>,
264 pub shield_ref: String,
265}
266
267#[derive(Debug, Clone, Serialize)]
271pub struct IRManifest {
272 pub node_type: &'static str,
273 pub source_line: u32,
274 pub source_column: u32,
275 pub name: String,
276 pub resources: Vec<String>,
277 pub fabric_ref: String,
278 pub region: String,
279 pub zones: Option<i64>,
280 pub compliance: Vec<String>,
281}
282
283#[derive(Debug, Clone, Serialize)]
294#[serde(untagged)]
295pub enum IRIntentionOperation {
296 Manifest(IRManifest),
297 Observe(IRObserve),
298}
299
300#[derive(Debug, Clone, Serialize)]
303pub struct IRIntentionTree {
304 pub node_type: &'static str,
305 pub source_line: u32,
306 pub source_column: u32,
307 pub operations: Vec<IRIntentionOperation>,
308}
309
310#[derive(Debug, Clone, Serialize)]
312pub struct IRObserve {
313 pub node_type: &'static str,
314 pub source_line: u32,
315 pub source_column: u32,
316 pub name: String,
317 pub target: String,
318 pub sources: Vec<String>,
319 pub quorum: Option<i64>,
320 pub timeout: String,
321 pub on_partition: String,
322 pub certainty_floor: Option<f64>,
323}
324
325#[derive(Debug, Clone, Serialize)]
329pub struct IRReconcile {
330 pub node_type: &'static str,
331 pub source_line: u32,
332 pub source_column: u32,
333 pub name: String,
334 pub observe_ref: String,
335 pub threshold: Option<f64>,
336 pub tolerance: Option<f64>,
337 pub on_drift: String,
338 pub shield_ref: String,
339 pub mandate_ref: String,
340 pub max_retries: i64,
341}
342
343#[derive(Debug, Clone, Serialize)]
345pub struct IRLease {
346 pub node_type: &'static str,
347 pub source_line: u32,
348 pub source_column: u32,
349 pub name: String,
350 pub resource_ref: String,
351 pub duration: String,
352 pub acquire: String,
353 pub on_expire: String,
354}
355
356#[derive(Debug, Clone, Serialize)]
358pub struct IREnsemble {
359 pub node_type: &'static str,
360 pub source_line: u32,
361 pub source_column: u32,
362 pub name: String,
363 pub observations: Vec<String>,
364 pub quorum: Option<i64>,
365 pub aggregation: String,
366 pub certainty_mode: String,
367}
368
369#[derive(Debug, Clone, Serialize)]
374pub struct IRSessionStep {
375 pub node_type: &'static str,
376 pub source_line: u32,
377 pub source_column: u32,
378 pub op: String,
379 pub message_type: String,
380 #[serde(skip_serializing_if = "Vec::is_empty", default)]
382 pub branches: Vec<IRSessionBranch>,
383}
384
385#[derive(Debug, Clone, Serialize)]
387pub struct IRSessionBranch {
388 pub node_type: &'static str,
389 pub label: String,
390 pub steps: Vec<IRSessionStep>,
391}
392
393#[derive(Debug, Clone, Serialize)]
395pub struct IRSessionRole {
396 pub node_type: &'static str,
397 pub source_line: u32,
398 pub source_column: u32,
399 pub name: String,
400 pub steps: Vec<IRSessionStep>,
401}
402
403#[derive(Debug, Clone, Serialize)]
405pub struct IRSession {
406 pub node_type: &'static str,
407 pub source_line: u32,
408 pub source_column: u32,
409 pub name: String,
410 pub roles: Vec<IRSessionRole>,
411}
412
413#[derive(Debug, Clone, Serialize)]
415pub struct IRTopologyEdge {
416 pub node_type: &'static str,
417 pub source_line: u32,
418 pub source_column: u32,
419 pub source: String,
420 pub target: String,
421 pub session_ref: String,
422}
423
424#[derive(Debug, Clone, Serialize)]
426pub struct IRTopology {
427 pub node_type: &'static str,
428 pub source_line: u32,
429 pub source_column: u32,
430 pub name: String,
431 pub nodes: Vec<String>,
432 pub edges: Vec<IRTopologyEdge>,
433}
434
435#[derive(Debug, Clone, Serialize)]
439pub struct IRImmune {
440 pub node_type: &'static str,
441 pub source_line: u32,
442 pub source_column: u32,
443 pub name: String,
444 pub watch: Vec<String>,
445 pub sensitivity: Option<f64>,
446 pub baseline: String,
447 pub window: i64,
448 pub scope: String,
449 pub tau: String,
450 pub decay: String,
451}
452
453#[derive(Debug, Clone, Serialize)]
455pub struct IRReflex {
456 pub node_type: &'static str,
457 pub source_line: u32,
458 pub source_column: u32,
459 pub name: String,
460 pub trigger: String,
461 pub on_level: String,
462 pub action: String,
463 pub scope: String,
464 pub sla: String,
465}
466
467#[derive(Debug, Clone, Serialize)]
469pub struct IRHeal {
470 pub node_type: &'static str,
471 pub source_line: u32,
472 pub source_column: u32,
473 pub name: String,
474 pub source: String,
475 pub on_level: String,
476 pub mode: String,
477 pub scope: String,
478 pub review_sla: String,
479 pub shield_ref: String,
480 pub max_patches: i64,
481}
482
483#[derive(Debug, Clone, Serialize)]
487pub struct IRComponent {
488 pub node_type: &'static str,
489 pub source_line: u32,
490 pub source_column: u32,
491 pub name: String,
492 pub renders: String,
493 pub via_shield: String,
494 pub on_interact: String,
495 pub render_hint: String,
496}
497
498#[derive(Debug, Clone, Serialize)]
500pub struct IRView {
501 pub node_type: &'static str,
502 pub source_line: u32,
503 pub source_column: u32,
504 pub name: String,
505 pub title: String,
506 pub components: Vec<String>,
507 pub route: String,
508}
509
510#[derive(Debug, Serialize)]
513pub struct IRImport {
514 pub node_type: &'static str,
515 pub source_line: u32,
516 pub source_column: u32,
517 pub module_path: Vec<String>,
518 pub names: Vec<String>,
519}
520
521#[derive(Debug, Clone, Serialize)]
524pub struct IRPersona {
525 pub node_type: &'static str,
526 pub source_line: u32,
527 pub source_column: u32,
528 pub name: String,
529 pub domain: Vec<String>,
530 pub tone: String,
531 pub confidence_threshold: Option<f64>,
532 pub cite_sources: Option<bool>,
533 pub refuse_if: Vec<String>,
534 pub language: String,
535 pub description: String,
536}
537
538#[derive(Debug, Clone, Serialize)]
541pub struct IRContext {
542 pub node_type: &'static str,
543 pub source_line: u32,
544 pub source_column: u32,
545 pub name: String,
546 pub memory_scope: String,
547 pub language: String,
548 pub depth: String,
549 pub max_tokens: Option<i64>,
550 pub temperature: Option<f64>,
551 pub cite_sources: Option<bool>,
552}
553
554#[derive(Debug, Clone, Serialize)]
557pub struct IRAnchor {
558 pub node_type: &'static str,
559 pub source_line: u32,
560 pub source_column: u32,
561 pub name: String,
562 pub description: String,
563 pub require: String,
564 pub reject: Vec<String>,
565 pub enforce: String,
566 pub confidence_floor: Option<f64>,
567 pub unknown_response: String,
568 pub on_violation: String,
569 pub on_violation_target: String,
570}
571
572#[derive(Debug, Clone, Serialize, PartialEq)]
580pub struct IRToolParam {
581 pub name: String,
582 pub type_name: String,
583 pub optional: bool,
584}
585
586#[derive(Debug, Clone, Serialize, PartialEq)]
591pub struct IRNamedArg {
592 pub name: String,
593 pub value: String,
594 pub value_kind: String,
600}
601
602#[derive(Debug, Serialize)]
603pub struct IRToolSpec {
604 pub node_type: &'static str,
605 pub source_line: u32,
606 pub source_column: u32,
607 pub name: String,
608 pub provider: String,
609 pub max_results: Option<i64>,
610 pub filter_expr: String,
611 pub timeout: String,
612 pub runtime: String,
613 pub sandbox: Option<bool>,
614 pub input_schema: Vec<String>,
615 pub output_schema: String,
616 pub parameters: Vec<IRToolParam>,
622 pub output_type: Option<String>,
626 pub effect_row: Vec<String>,
627}
628
629#[derive(Debug, Serialize)]
632pub struct IRMemory {
633 pub node_type: &'static str,
634 pub source_line: u32,
635 pub source_column: u32,
636 pub name: String,
637 pub store: String,
638 pub backend: String,
639 pub retrieval: String,
640 pub decay: String,
641}
642
643#[derive(Debug, Clone, Serialize)]
646pub struct IRTypeField {
647 pub node_type: &'static str,
648 pub source_line: u32,
649 pub source_column: u32,
650 pub name: String,
651 pub type_name: String,
652 pub generic_param: String,
653 pub optional: bool,
654}
655
656#[derive(Debug, Serialize)]
657pub struct IRType {
658 pub node_type: &'static str,
659 pub source_line: u32,
660 pub source_column: u32,
661 pub name: String,
662 pub fields: Vec<IRTypeField>,
663 pub range_min: Option<f64>,
664 pub range_max: Option<f64>,
665 pub where_expression: String,
666 pub compliance: Vec<String>,
668}
669
670#[derive(Debug, Clone, Serialize)]
673pub struct IRParameter {
674 pub node_type: &'static str,
675 pub source_line: u32,
676 pub source_column: u32,
677 pub name: String,
678 pub type_name: String,
679 pub generic_param: String,
680 pub optional: bool,
681}
682
683#[derive(Debug, Clone, Serialize)]
684pub struct IRDataEdge {
685 pub node_type: &'static str,
686 pub source_line: u32,
687 pub source_column: u32,
688 pub source_step: String,
689 pub target_step: String,
690 pub type_name: String,
691}
692
693#[derive(Debug, Clone, Serialize)]
694pub struct IRStep {
695 pub node_type: &'static str,
696 pub source_line: u32,
697 pub source_column: u32,
698 pub name: String,
699 pub persona_ref: String,
700 pub given: String,
701 pub ask: String,
702 pub use_tool: Option<serde_json::Value>,
703 pub probe: Option<serde_json::Value>,
704 pub reason: Option<serde_json::Value>,
705 pub weave: Option<serde_json::Value>,
706 pub output_type: String,
707 pub confidence_floor: Option<f64>,
708 pub navigate_ref: String,
709 pub apply_ref: String,
710 pub body: Vec<serde_json::Value>,
711}
712
713#[derive(Debug, Clone, Serialize)]
714pub struct IRFlow {
715 pub node_type: &'static str,
716 pub source_line: u32,
717 pub source_column: u32,
718 pub name: String,
719 pub parameters: Vec<IRParameter>,
720 pub return_type_name: String,
721 pub return_type_generic: String,
722 pub return_type_optional: bool,
723 pub steps: Vec<IRFlowNode>,
724 pub edges: Vec<IRDataEdge>,
725 pub execution_levels: Vec<Vec<String>>,
726}
727
728#[derive(Debug, Serialize)]
731pub struct IRRun {
732 pub node_type: &'static str,
733 pub source_line: u32,
734 pub source_column: u32,
735 pub flow_name: String,
736 pub arguments: Vec<String>,
737 pub persona_name: String,
738 pub context_name: String,
739 pub anchor_names: Vec<String>,
740 pub on_failure: String,
741 pub on_failure_params: Vec<Vec<String>>,
742 pub output_to: String,
743 pub effort: String,
744 pub resolved_flow: Option<IRFlow>,
745 pub resolved_persona: Option<IRPersona>,
746 pub resolved_context: Option<IRContext>,
747 pub resolved_anchors: Vec<IRAnchor>,
748}
749
750#[derive(Debug, Clone, Serialize)]
753pub struct IRLambdaData {
754 pub node_type: &'static str,
755 pub source_line: u32,
756 pub source_column: u32,
757 pub name: String,
758 pub ontology: String, pub certainty: f64, pub temporal_frame_start: String, pub temporal_frame_end: String, pub provenance: String, pub derivation: String, }
765
766#[derive(Debug, Clone, Serialize)]
767pub struct IRLambdaDataApply {
768 pub node_type: &'static str,
769 pub source_line: u32,
770 pub source_column: u32,
771 pub lambda_data_name: String, pub target: String, pub output_type: String, }
775
776#[derive(Debug, Clone, Serialize)]
781#[serde(untagged)]
782pub enum IRFlowNode {
783 Step(IRStep),
784 Probe(IRProbe),
785 Reason(IRReasonStep),
786 Validate(IRValidateStep),
787 Refine(IRRefineStep),
788 Weave(IRWeaveStep),
789 UseTool(IRUseToolStep),
790 Remember(IRRememberStep),
791 Recall(IRRecallStep),
792 Conditional(IRConditional),
793 ForIn(IRForIn),
794 Let(IRLetBinding),
795 Return(IRReturnStep),
796 Break(IRBreakStep),
801 Continue(IRContinueStep),
805 LambdaDataApply(IRLambdaDataApply),
806 Par(IRParallelBlock),
807 Hibernate(IRHibernateStep),
808 Deliberate(IRDeliberateBlock),
809 Consensus(IRConsensusBlock),
810 Forge(IRForgeBlock),
811 Focus(IRFocusStep),
812 Associate(IRAssociateStep),
813 Aggregate(IRAggregateStep),
814 Explore(IRExploreStep),
815 Ingest(IRIngestStep),
816 ShieldApply(IRShieldApplyStep),
817 Stream(IRStreamBlock),
818 Navigate(IRNavigateStep),
819 Drill(IRDrillStep),
820 Trail(IRTrailStep),
821 Corroborate(IRCorroborateStep),
822 OtsApply(IROtsApplyStep),
823 MandateApply(IRMandateApplyStep),
824 ComputeApply(IRComputeApplyStep),
825 Listen(IRListenStep),
826 DaemonStep(IRDaemonStepNode),
827 Emit(IREmit),
829 Publish(IRPublish),
831 Discover(IRDiscover),
833 Persist(IRPersistStep),
834 Retrieve(IRRetrieveStep),
835 Mutate(IRMutateStep),
836 Purge(IRPurgeStep),
837 Transact(IRTransactBlock),
838}
839
840#[derive(Debug, Clone, Serialize)]
841pub struct IRProbe {
842 pub node_type: &'static str,
843 pub source_line: u32,
844 pub source_column: u32,
845 pub target: String,
846}
847
848#[derive(Debug, Clone, Serialize)]
849pub struct IRReasonStep {
850 pub node_type: &'static str,
851 pub source_line: u32,
852 pub source_column: u32,
853 pub strategy: String,
854 pub target: String,
855}
856
857#[derive(Debug, Clone, Serialize)]
858pub struct IRValidateStep {
859 pub node_type: &'static str,
860 pub source_line: u32,
861 pub source_column: u32,
862 pub target: String,
863 pub rule: String,
864}
865
866#[derive(Debug, Clone, Serialize)]
867pub struct IRRefineStep {
868 pub node_type: &'static str,
869 pub source_line: u32,
870 pub source_column: u32,
871 pub target: String,
872 pub strategy: String,
873}
874
875#[derive(Debug, Clone, Serialize)]
876pub struct IRWeaveStep {
877 pub node_type: &'static str,
878 pub source_line: u32,
879 pub source_column: u32,
880 pub sources: Vec<String>,
881 pub target: String,
882 pub format_type: String,
883 pub priority: Vec<String>,
884 pub style: String,
885}
886
887#[derive(Debug, Clone, Serialize)]
888pub struct IRUseToolStep {
889 pub node_type: &'static str,
890 pub source_line: u32,
891 pub source_column: u32,
892 pub tool_name: String,
893 pub argument: String,
894 pub named_args: Vec<IRNamedArg>,
899}
900
901#[derive(Debug, Clone, Serialize)]
902pub struct IRRememberStep {
903 pub node_type: &'static str,
904 pub source_line: u32,
905 pub source_column: u32,
906 pub expression: String,
907 pub memory_target: String,
908}
909
910#[derive(Debug, Clone, Serialize)]
911pub struct IRRecallStep {
912 pub node_type: &'static str,
913 pub source_line: u32,
914 pub source_column: u32,
915 pub query: String,
916 pub memory_source: String,
917}
918
919#[derive(Debug, Clone, Serialize)]
920pub struct IRConditional {
921 pub node_type: &'static str,
922 pub source_line: u32,
923 pub source_column: u32,
924 pub condition: String,
925 pub comparison_op: String,
926 pub comparison_value: String,
927 pub then_body: Vec<IRFlowNode>,
928 pub else_body: Vec<IRFlowNode>,
929 pub conditions: Vec<(String, String, String)>,
930 pub conjunctor: String,
931}
932
933#[derive(Debug, Clone, Serialize)]
934pub struct IRForIn {
935 pub node_type: &'static str,
936 pub source_line: u32,
937 pub source_column: u32,
938 pub variable: String,
939 pub iterable: String,
940 pub body: Vec<IRFlowNode>,
941}
942
943#[derive(Debug, Clone, Serialize)]
944pub struct IRLetBinding {
945 pub node_type: &'static str,
946 pub source_line: u32,
947 pub source_column: u32,
948 pub target: String,
949 pub value: String,
950 pub value_kind: String,
953}
954
955#[derive(Debug, Clone, Serialize)]
956pub struct IRReturnStep {
957 pub node_type: &'static str,
958 pub source_line: u32,
959 pub source_column: u32,
960 pub value_expr: String,
961}
962
963#[derive(Debug, Clone, Serialize)]
967pub struct IRBreakStep {
968 pub node_type: &'static str,
969 pub source_line: u32,
970 pub source_column: u32,
971}
972
973#[derive(Debug, Clone, Serialize)]
977pub struct IRContinueStep {
978 pub node_type: &'static str,
979 pub source_line: u32,
980 pub source_column: u32,
981}
982
983#[derive(Debug, Clone, Serialize)]
984pub struct IRParallelBlock {
985 pub node_type: &'static str,
986 pub source_line: u32,
987 pub source_column: u32,
988}
989
990#[derive(Debug, Clone, Serialize)]
991pub struct IRHibernateStep {
992 pub node_type: &'static str,
993 pub source_line: u32,
994 pub source_column: u32,
995 pub event_name: String,
996 pub timeout: String,
997}
998
999#[derive(Debug, Clone, Serialize)]
1000pub struct IRDeliberateBlock {
1001 pub node_type: &'static str,
1002 pub source_line: u32,
1003 pub source_column: u32,
1004}
1005
1006#[derive(Debug, Clone, Serialize)]
1007pub struct IRConsensusBlock {
1008 pub node_type: &'static str,
1009 pub source_line: u32,
1010 pub source_column: u32,
1011}
1012
1013#[derive(Debug, Clone, Serialize)]
1014pub struct IRForgeBlock {
1015 pub node_type: &'static str,
1016 pub source_line: u32,
1017 pub source_column: u32,
1018}
1019
1020#[derive(Debug, Clone, Serialize)]
1021pub struct IRFocusStep {
1022 pub node_type: &'static str,
1023 pub source_line: u32,
1024 pub source_column: u32,
1025 pub expression: String,
1026}
1027
1028#[derive(Debug, Clone, Serialize)]
1029pub struct IRAssociateStep {
1030 pub node_type: &'static str,
1031 pub source_line: u32,
1032 pub source_column: u32,
1033 pub left: String,
1034 pub right: String,
1035 pub using_field: String,
1036}
1037
1038#[derive(Debug, Clone, Serialize)]
1039pub struct IRAggregateStep {
1040 pub node_type: &'static str,
1041 pub source_line: u32,
1042 pub source_column: u32,
1043 pub target: String,
1044 pub group_by: Vec<String>,
1045 pub alias: String,
1046}
1047
1048#[derive(Debug, Clone, Serialize)]
1049pub struct IRExploreStep {
1050 pub node_type: &'static str,
1051 pub source_line: u32,
1052 pub source_column: u32,
1053 pub target: String,
1054 pub limit: Option<i64>,
1055}
1056
1057#[derive(Debug, Clone, Serialize)]
1058pub struct IRIngestStep {
1059 pub node_type: &'static str,
1060 pub source_line: u32,
1061 pub source_column: u32,
1062 pub source: String,
1063 pub target: String,
1064}
1065
1066#[derive(Debug, Clone, Serialize)]
1067pub struct IRShieldApplyStep {
1068 pub node_type: &'static str,
1069 pub source_line: u32,
1070 pub source_column: u32,
1071 pub shield_name: String,
1072 pub target: String,
1073 pub output_type: String,
1074}
1075
1076#[derive(Debug, Clone, Serialize)]
1077pub struct IRStreamBlock {
1078 pub node_type: &'static str,
1079 pub source_line: u32,
1080 pub source_column: u32,
1081}
1082
1083#[derive(Debug, Clone, Serialize)]
1084pub struct IRNavigateStep {
1085 pub node_type: &'static str,
1086 pub source_line: u32,
1087 pub source_column: u32,
1088 pub pix_ref: String,
1089 pub corpus_ref: String,
1090 pub query: String,
1091 pub trail_enabled: bool,
1092 pub output_name: String,
1093}
1094
1095#[derive(Debug, Clone, Serialize)]
1096pub struct IRDrillStep {
1097 pub node_type: &'static str,
1098 pub source_line: u32,
1099 pub source_column: u32,
1100 pub pix_ref: String,
1101 pub subtree_path: String,
1102 pub query: String,
1103 pub output_name: String,
1104}
1105
1106#[derive(Debug, Clone, Serialize)]
1107pub struct IRTrailStep {
1108 pub node_type: &'static str,
1109 pub source_line: u32,
1110 pub source_column: u32,
1111 pub navigate_ref: String,
1112}
1113
1114#[derive(Debug, Clone, Serialize)]
1115pub struct IRCorroborateStep {
1116 pub node_type: &'static str,
1117 pub source_line: u32,
1118 pub source_column: u32,
1119 pub navigate_ref: String,
1120 pub output_name: String,
1121}
1122
1123#[derive(Debug, Clone, Serialize)]
1124pub struct IROtsApplyStep {
1125 pub node_type: &'static str,
1126 pub source_line: u32,
1127 pub source_column: u32,
1128 pub ots_name: String,
1129 pub target: String,
1130 pub output_type: String,
1131}
1132
1133#[derive(Debug, Clone, Serialize)]
1134pub struct IRMandateApplyStep {
1135 pub node_type: &'static str,
1136 pub source_line: u32,
1137 pub source_column: u32,
1138 pub mandate_name: String,
1139 pub target: String,
1140 pub output_type: String,
1141}
1142
1143#[derive(Debug, Clone, Serialize)]
1144pub struct IRComputeApplyStep {
1145 pub node_type: &'static str,
1146 pub source_line: u32,
1147 pub source_column: u32,
1148 pub compute_name: String,
1149 pub arguments: Vec<String>,
1150 pub output_name: String,
1151}
1152
1153#[derive(Debug, Clone, Serialize)]
1154pub struct IRListenStep {
1155 pub node_type: &'static str,
1156 pub source_line: u32,
1157 pub source_column: u32,
1158 pub channel: String,
1159 pub channel_is_ref: bool,
1162 pub event_alias: String,
1163}
1164
1165#[derive(Debug, Clone, Serialize)]
1166pub struct IRDaemonStepNode {
1167 pub node_type: &'static str,
1168 pub source_line: u32,
1169 pub source_column: u32,
1170 pub daemon_ref: String,
1171}
1172
1173#[derive(Debug, Clone, Serialize)]
1174pub struct IRPersistStep {
1175 pub node_type: &'static str,
1176 pub source_line: u32,
1177 pub source_column: u32,
1178 pub store_name: String,
1179 pub fields: Vec<(String, String)>,
1183}
1184
1185#[derive(Debug, Clone, Serialize)]
1186pub struct IRRetrieveStep {
1187 pub node_type: &'static str,
1188 pub source_line: u32,
1189 pub source_column: u32,
1190 pub store_name: String,
1191 pub where_expr: String,
1192 pub alias: String,
1193}
1194
1195#[derive(Debug, Clone, Serialize)]
1196pub struct IRMutateStep {
1197 pub node_type: &'static str,
1198 pub source_line: u32,
1199 pub source_column: u32,
1200 pub store_name: String,
1201 pub where_expr: String,
1202 pub fields: Vec<(String, String)>,
1206}
1207
1208#[derive(Debug, Clone, Serialize)]
1209pub struct IRPurgeStep {
1210 pub node_type: &'static str,
1211 pub source_line: u32,
1212 pub source_column: u32,
1213 pub store_name: String,
1214 pub where_expr: String,
1215}
1216
1217#[derive(Debug, Clone, Serialize)]
1218pub struct IRTransactBlock {
1219 pub node_type: &'static str,
1220 pub source_line: u32,
1221 pub source_column: u32,
1222}
1223
1224#[derive(Debug, Clone, Serialize)]
1227pub struct IRAgent {
1228 pub node_type: &'static str,
1229 pub source_line: u32,
1230 pub source_column: u32,
1231 pub name: String,
1232 pub goal: String,
1233 pub tools: Vec<String>,
1234 pub memory_ref: String,
1235 pub strategy: String,
1236 pub on_stuck: String,
1237 pub shield_ref: String,
1238 pub max_iterations: Option<i64>,
1239 pub max_tokens: Option<i64>,
1240 pub max_time: String,
1241 pub max_cost: Option<f64>,
1242}
1243
1244#[derive(Debug, Clone, Serialize)]
1245pub struct IRShield {
1246 pub node_type: &'static str,
1247 pub source_line: u32,
1248 pub source_column: u32,
1249 pub name: String,
1250 pub scan: Vec<String>,
1251 pub strategy: String,
1252 pub on_breach: String,
1253 pub severity: String,
1254 pub quarantine: String,
1255 pub max_retries: i64,
1258 pub confidence_threshold: f64,
1259 pub allow_tools: Vec<String>,
1260 pub deny_tools: Vec<String>,
1261 pub sandbox: bool,
1262 pub redact: Vec<String>,
1263 pub log: String,
1264 pub deflect_message: String,
1265 #[serde(skip)]
1268 pub taint: String,
1269 pub compliance: Vec<String>,
1271}
1272
1273#[derive(Debug, Clone, Serialize)]
1274pub struct IRPix {
1275 pub node_type: &'static str,
1276 pub source_line: u32,
1277 pub source_column: u32,
1278 pub name: String,
1279 pub source: String,
1280 pub depth: Option<i64>,
1281 pub branching: Option<i64>,
1282 pub model: String,
1283}
1284
1285#[derive(Debug, Clone, Serialize)]
1286pub struct IRPsyche {
1287 pub node_type: &'static str,
1288 pub source_line: u32,
1289 pub source_column: u32,
1290 pub name: String,
1291 pub dimensions: Vec<String>,
1292 pub manifold_noise: Option<f64>,
1293 pub manifold_momentum: Option<f64>,
1294 pub safety_constraints: Vec<String>,
1295 pub quantum_enabled: Option<bool>,
1296 pub inference_mode: String,
1297}
1298
1299#[derive(Debug, Clone, Serialize)]
1300pub struct IRCorpus {
1301 pub node_type: &'static str,
1302 pub source_line: u32,
1303 pub source_column: u32,
1304 pub name: String,
1305 pub documents: Vec<String>,
1306 pub mcp_server: String,
1307 pub mcp_resource_uri: String,
1308}
1309
1310#[derive(Debug, Clone, Serialize)]
1311pub struct IRDataspace {
1312 pub node_type: &'static str,
1313 pub source_line: u32,
1314 pub source_column: u32,
1315 pub name: String,
1316}
1317
1318#[derive(Debug, Clone, Serialize)]
1319pub struct IROts {
1320 pub node_type: &'static str,
1321 pub source_line: u32,
1322 pub source_column: u32,
1323 pub name: String,
1324 pub teleology: String,
1325 pub homotopy_search: String,
1326 pub loss_function: String,
1327}
1328
1329#[derive(Debug, Clone, Serialize)]
1330pub struct IRMandate {
1331 pub node_type: &'static str,
1332 pub source_line: u32,
1333 pub source_column: u32,
1334 pub name: String,
1335 pub constraint: String,
1336 pub kp: Option<f64>,
1337 pub ki: Option<f64>,
1338 pub kd: Option<f64>,
1339 pub tolerance: Option<f64>,
1340 pub max_steps: Option<i64>,
1341 pub on_violation: String,
1342}
1343
1344#[derive(Debug, Clone, Serialize)]
1345pub struct IRCompute {
1346 pub node_type: &'static str,
1347 pub source_line: u32,
1348 pub source_column: u32,
1349 pub name: String,
1350 pub shield_ref: String,
1351}
1352
1353#[derive(Debug, Clone, Serialize)]
1354pub struct IRDaemon {
1355 pub node_type: &'static str,
1356 pub source_line: u32,
1357 pub source_column: u32,
1358 pub name: String,
1359 pub goal: String,
1360 pub tools: Vec<String>,
1361 pub memory_ref: String,
1362 pub strategy: String,
1363 pub on_stuck: String,
1364 pub shield_ref: String,
1365 pub max_tokens: Option<i64>,
1366 pub max_time: String,
1367 pub max_cost: Option<f64>,
1368}
1369
1370#[derive(Debug, Clone, Serialize)]
1378pub struct IRExtensionMember {
1379 pub name: String,
1380 #[serde(default, skip_serializing_if = "Option::is_none")]
1381 pub semantics: Option<String>,
1382 #[serde(default, skip_serializing_if = "Option::is_none")]
1383 pub default_confidence: Option<f64>,
1384}
1385
1386#[derive(Debug, Clone, Serialize)]
1393pub struct IRExtension {
1394 pub node_type: &'static str,
1395 pub source_line: u32,
1396 pub source_column: u32,
1397 pub name: String,
1398 pub category: String,
1399 pub members: Vec<IRExtensionMember>,
1400}
1401
1402#[derive(Debug, Clone, Serialize)]
1403pub struct IRAxonStore {
1404 pub node_type: &'static str,
1405 pub source_line: u32,
1406 pub source_column: u32,
1407 pub name: String,
1408 pub backend: String,
1409 pub connection: String,
1410 pub confidence_floor: Option<f64>,
1411 pub isolation: String,
1412 pub on_breach: String,
1413 pub capability: String,
1416 #[serde(default, skip_serializing_if = "Option::is_none")]
1422 pub column_schema: Option<IRStoreColumnSchema>,
1423}
1424
1425#[derive(Debug, Clone, Serialize)]
1429#[serde(tag = "form", rename_all = "snake_case")]
1430pub enum IRStoreColumnSchema {
1431 Inline { columns: Vec<IRStoreColumn> },
1432 ManifestRef { qualified_name: String },
1433 EnvVar { var_name: String },
1434}
1435
1436#[derive(Debug, Clone, Serialize)]
1440pub struct IRStoreColumn {
1441 pub name: String,
1442 pub col_type: String,
1443 #[serde(default, skip_serializing_if = "is_false")]
1444 pub primary_key: bool,
1445 #[serde(default, skip_serializing_if = "is_false")]
1446 pub auto_increment: bool,
1447 #[serde(default, skip_serializing_if = "is_false")]
1448 pub not_null: bool,
1449 #[serde(default, skip_serializing_if = "is_false")]
1450 pub unique: bool,
1451 #[serde(default, skip_serializing_if = "String::is_empty")]
1452 pub default_value: String,
1453 #[serde(default, skip_serializing_if = "is_false")]
1459 pub identity: bool,
1460}
1461
1462#[inline]
1463fn is_false(b: &bool) -> bool {
1464 !*b
1465}
1466
1467#[derive(Debug, Clone, Serialize)]
1468pub struct IRAxonEndpoint {
1469 pub node_type: &'static str,
1470 pub source_line: u32,
1471 pub source_column: u32,
1472 pub name: String,
1473 pub method: String,
1474 pub path: String,
1475 pub body_type: String,
1476 pub execute_flow: String,
1477 pub output_type: String,
1478 pub shield_ref: String,
1479 pub retries: i64,
1481 pub timeout: String,
1482 pub compliance: Vec<String>,
1484 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1493 pub path_params: Vec<String>,
1494 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1500 pub query_params: Vec<IRTypeField>,
1501 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1510 pub requires_capabilities: Vec<String>,
1511}
1512
1513#[derive(Debug, Clone, Serialize)]
1522pub struct IRChannel {
1523 pub node_type: &'static str,
1524 pub source_line: u32,
1525 pub source_column: u32,
1526 pub name: String,
1527 pub message: String, pub qos: String,
1529 pub lifetime: String,
1530 pub persistence: String,
1531 pub shield_ref: String,
1532}
1533
1534#[derive(Debug, Clone, Serialize)]
1539pub struct IRSocket {
1540 pub node_type: &'static str,
1541 pub source_line: u32,
1542 pub source_column: u32,
1543 pub name: String,
1544 pub protocol: String,
1545 pub backpressure_credit: Option<i64>,
1546 pub reconnect: bool,
1547 pub legal_basis: Option<String>,
1548}
1549
1550#[derive(Debug, Clone, Serialize)]
1556pub struct IREmit {
1557 pub node_type: &'static str,
1558 pub source_line: u32,
1559 pub source_column: u32,
1560 pub channel_ref: String,
1561 pub value_ref: String,
1562 pub value_is_channel: bool,
1563}
1564
1565#[derive(Debug, Clone, Serialize)]
1567pub struct IRPublish {
1568 pub node_type: &'static str,
1569 pub source_line: u32,
1570 pub source_column: u32,
1571 pub channel_ref: String,
1572 pub shield_ref: String,
1573}
1574
1575#[derive(Debug, Clone, Serialize)]
1577pub struct IRDiscover {
1578 pub node_type: &'static str,
1579 pub source_line: u32,
1580 pub source_column: u32,
1581 pub capability_ref: String,
1582 pub alias: String,
1583}