@wowok/agent-mcp 2.3.16 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/customer/index.d.ts +9 -0
  2. package/dist/customer/index.js +9 -0
  3. package/dist/customer/industry-risks.d.ts +4 -0
  4. package/dist/customer/industry-risks.js +45 -31
  5. package/dist/customer/order-monitor.js +57 -57
  6. package/dist/customer/order-strategy.js +89 -89
  7. package/dist/customer/post-purchase.js +97 -97
  8. package/dist/customer/reminder-system.js +26 -26
  9. package/dist/customer/risk-assessment.js +46 -46
  10. package/dist/customer/types.d.ts +4 -4
  11. package/dist/customer/types.js +4 -4
  12. package/dist/customer/user-preferences.d.ts +3 -0
  13. package/dist/customer/user-preferences.js +59 -50
  14. package/dist/experience/intent-distill.js +6 -6
  15. package/dist/experience/realtime-feedback.js +17 -0
  16. package/dist/index.js +360 -273
  17. package/dist/knowledge/acquisition-flywheel.d.ts +3 -0
  18. package/dist/knowledge/acquisition-flywheel.js +73 -64
  19. package/dist/knowledge/arbitration-trust.js +10 -10
  20. package/dist/knowledge/demand-matching.js +8 -8
  21. package/dist/knowledge/dynamic-pricing.js +18 -18
  22. package/dist/knowledge/flywheel-loop.js +11 -11
  23. package/dist/knowledge/glossary.js +22 -22
  24. package/dist/knowledge/guard-ledger.d.ts +19 -0
  25. package/dist/knowledge/guard-ledger.js +246 -0
  26. package/dist/knowledge/guard-lint.d.ts +76 -0
  27. package/dist/knowledge/guard-lint.js +590 -0
  28. package/dist/knowledge/guard-puzzle.d.ts +188 -0
  29. package/dist/knowledge/guard-puzzle.js +804 -0
  30. package/dist/knowledge/guard-risk.d.ts +67 -0
  31. package/dist/knowledge/guard-risk.js +1046 -0
  32. package/dist/knowledge/guard-templates.d.ts +37 -0
  33. package/dist/knowledge/guard-templates.js +329 -0
  34. package/dist/knowledge/guard-translation.d.ts +58 -0
  35. package/dist/knowledge/guard-translation.js +1118 -0
  36. package/dist/knowledge/index.d.ts +17 -0
  37. package/dist/knowledge/index.js +17 -0
  38. package/dist/knowledge/industry-evolution.js +29 -29
  39. package/dist/knowledge/industry-generalizer.js +52 -52
  40. package/dist/knowledge/industry-registry.d.ts +1 -2
  41. package/dist/knowledge/industry-registry.js +43 -36
  42. package/dist/knowledge/intent-metrics.js +67 -67
  43. package/dist/knowledge/process-model.js +80 -80
  44. package/dist/knowledge/reputation-rules.js +9 -9
  45. package/dist/knowledge/reward-templates.js +51 -51
  46. package/dist/knowledge/safety-rules.js +63 -2
  47. package/dist/knowledge/tool-constraints.js +17 -11
  48. package/dist/knowledge/trust-metrics.js +26 -26
  49. package/dist/safety/confirm-gate.d.ts +4 -2
  50. package/dist/safety/confirm-gate.js +48 -4
  51. package/dist/schema/call/allocation.d.ts +24 -14
  52. package/dist/schema/call/arbitration.d.ts +142 -132
  53. package/dist/schema/call/base.d.ts +901 -43
  54. package/dist/schema/call/base.js +77 -13
  55. package/dist/schema/call/bridge-handler.js +15 -2
  56. package/dist/schema/call/bridge.d.ts +795 -27
  57. package/dist/schema/call/bridge.js +37 -0
  58. package/dist/schema/call/contact.d.ts +10 -0
  59. package/dist/schema/call/demand.d.ts +94 -84
  60. package/dist/schema/call/guard.d.ts +229 -46
  61. package/dist/schema/call/guard.js +50 -0
  62. package/dist/schema/call/handler.js +46 -14
  63. package/dist/schema/call/machine.d.ts +158 -138
  64. package/dist/schema/call/order.d.ts +10 -0
  65. package/dist/schema/call/payment.d.ts +10 -0
  66. package/dist/schema/call/permission.d.ts +314 -304
  67. package/dist/schema/call/personal.d.ts +10 -0
  68. package/dist/schema/call/progress.d.ts +10 -0
  69. package/dist/schema/call/proof.d.ts +20 -0
  70. package/dist/schema/call/repository.d.ts +32 -22
  71. package/dist/schema/call/reward.d.ts +10 -0
  72. package/dist/schema/call/semantic.d.ts +9 -2
  73. package/dist/schema/call/semantic.js +617 -25
  74. package/dist/schema/call/service.d.ts +20 -10
  75. package/dist/schema/call/treasury.d.ts +10 -0
  76. package/dist/schema/config/index.d.ts +18 -0
  77. package/dist/schema/config/index.js +17 -0
  78. package/dist/schema/index.d.ts +6 -0
  79. package/dist/schema/index.js +5 -0
  80. package/dist/schema/local/index.d.ts +9 -9
  81. package/dist/schema/local/index.js +9 -0
  82. package/dist/schema/local/wip.d.ts +39 -19
  83. package/dist/schema/local/wip.js +5 -5
  84. package/dist/schema/messenger/index.d.ts +376 -55
  85. package/dist/schema/messenger/index.js +19 -19
  86. package/dist/schema/operations.d.ts +1881 -681
  87. package/dist/schema/operations.js +91 -96
  88. package/dist/schema/project/index.d.ts +21 -0
  89. package/dist/schema/project/index.js +32 -0
  90. package/dist/schema/query/index.d.ts +1074 -168
  91. package/dist/schema/query/index.js +8 -8
  92. package/dist/schema/schema-query/index.d.ts +33 -0
  93. package/dist/schema/schema-query/index.js +36 -0
  94. package/dist/schema/schema-version.d.ts +25 -0
  95. package/dist/schema/schema-version.js +76 -0
  96. package/dist/schema/trust/index.d.ts +407 -0
  97. package/dist/schema/trust/index.js +113 -0
  98. package/dist/schema/utils/guard-parser.js +4 -4
  99. package/dist/schema/utils/node-parser.js +14 -14
  100. package/dist/schemas/bridge_operation.output.json +233 -9
  101. package/dist/schemas/bridge_operation.schema.json +67 -8
  102. package/dist/schemas/config_operation.output.json +18 -0
  103. package/dist/schemas/config_operation.schema.json +34 -0
  104. package/dist/schemas/guard-node-schema.json +82 -0
  105. package/dist/schemas/guard2file.schema.json +8 -0
  106. package/dist/schemas/index.json +19 -1
  107. package/dist/schemas/machineNode2file.schema.json +8 -0
  108. package/dist/schemas/messenger_operation.output.json +236 -10
  109. package/dist/schemas/onchain_events.output.json +718 -0
  110. package/dist/schemas/onchain_operations.output.json +286 -11
  111. package/dist/schemas/onchain_operations.schema.json +19 -16
  112. package/dist/schemas/onchain_operations_allocation.schema.json +8 -0
  113. package/dist/schemas/onchain_operations_arbitration.schema.json +8 -0
  114. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  115. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  116. package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -0
  117. package/dist/schemas/onchain_operations_guard.schema.json +11 -16
  118. package/dist/schemas/onchain_operations_machine.schema.json +8 -0
  119. package/dist/schemas/onchain_operations_order.schema.json +8 -0
  120. package/dist/schemas/onchain_operations_payment.schema.json +8 -0
  121. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  122. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  123. package/dist/schemas/onchain_operations_progress.schema.json +8 -0
  124. package/dist/schemas/onchain_operations_repository.schema.json +8 -0
  125. package/dist/schemas/onchain_operations_reward.schema.json +8 -0
  126. package/dist/schemas/onchain_operations_service.schema.json +8 -0
  127. package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
  128. package/dist/schemas/onchain_table_data.output.json +718 -0
  129. package/dist/schemas/project_operation.output.json +18 -0
  130. package/dist/schemas/project_operation.schema.json +42 -0
  131. package/dist/schemas/query_toolkit.schema.json +360 -368
  132. package/dist/schemas/schema_query.schema.json +6 -3
  133. package/dist/schemas/trust_score.output.json +327 -0
  134. package/dist/schemas/trust_score.schema.json +46 -0
  135. package/dist/schemas/wip_file.output.json +24 -1
  136. package/package.json +2 -2
@@ -503,6 +503,724 @@
503
503
  "description": "Event query result containing list of events and pagination info, or null if no data found"
504
504
  },
505
505
  "semantic": {
506
+ "type": "object",
507
+ "properties": {
508
+ "intent": {
509
+ "type": "string",
510
+ "description": "Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"
511
+ },
512
+ "status": {
513
+ "type": "string",
514
+ "enum": [
515
+ "success",
516
+ "partial",
517
+ "failed",
518
+ "pending_input"
519
+ ],
520
+ "description": "Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"
521
+ },
522
+ "summary": {
523
+ "type": "string",
524
+ "description": "One-sentence human-readable summary of what happened. AI should read this first. Example: 'Successfully published Service my-shop with Machine bound'"
525
+ },
526
+ "created": {
527
+ "type": "array",
528
+ "items": {
529
+ "type": "object",
530
+ "properties": {
531
+ "id": {
532
+ "type": "string",
533
+ "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
534
+ },
535
+ "name": {
536
+ "type": [
537
+ "string",
538
+ "null"
539
+ ],
540
+ "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null"
541
+ },
542
+ "role": {
543
+ "type": "string",
544
+ "enum": [
545
+ "Permission",
546
+ "Guard",
547
+ "Machine",
548
+ "Progress",
549
+ "Service",
550
+ "Order",
551
+ "Allocation",
552
+ "Arbitration",
553
+ "ArbCase",
554
+ "Messenger",
555
+ "Contact",
556
+ "Demand",
557
+ "Reward",
558
+ "Personal",
559
+ "Repository",
560
+ "Treasury",
561
+ "Discount",
562
+ "Other"
563
+ ],
564
+ "description": "Business role of the object in the dependency graph. Constraint: enum of 18 values. Relation: derived from objectType last segment; drives Plan/Verify Loop positioning. Example: 'Service'"
565
+ },
566
+ "relation": {
567
+ "type": "object",
568
+ "properties": {
569
+ "parent": {
570
+ "type": [
571
+ "string",
572
+ "null"
573
+ ],
574
+ "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null"
575
+ },
576
+ "relation_type": {
577
+ "type": "string",
578
+ "enum": [
579
+ "machine_of",
580
+ "guard_of",
581
+ "allocator_of",
582
+ "permission_of",
583
+ "progress_of",
584
+ "allocation_of",
585
+ "arb_of",
586
+ "other"
587
+ ],
588
+ "description": "How this object relates to its parent. Example: 'machine_of'"
589
+ }
590
+ },
591
+ "additionalProperties": false,
592
+ "description": "Relationship to another object in the dependency graph"
593
+ },
594
+ "immutable": {
595
+ "type": "boolean",
596
+ "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true"
597
+ }
598
+ },
599
+ "required": [
600
+ "id",
601
+ "role"
602
+ ],
603
+ "additionalProperties": false,
604
+ "description": "An object tagged with its business role and relationship within the object dependency graph"
605
+ },
606
+ "description": "Objects newly created in this operation, tagged with roles"
607
+ },
608
+ "modified": {
609
+ "type": "array",
610
+ "items": {
611
+ "$ref": "#/definitions/onchain_events/properties/semantic/properties/created/items"
612
+ },
613
+ "description": "Objects mutated in this operation, tagged with roles"
614
+ },
615
+ "released": {
616
+ "type": "array",
617
+ "items": {
618
+ "type": "object",
619
+ "properties": {
620
+ "amount": {
621
+ "type": "string",
622
+ "description": "Amount change as stringified integer (smallest unit). Negative=spend, positive=receive. Example: '-10000000000'"
623
+ },
624
+ "coinType": {
625
+ "type": "string",
626
+ "description": "Coin type tag (format: {address}::{module}::{struct}). Example: '0x2::wow::WOW'"
627
+ },
628
+ "role": {
629
+ "type": "string",
630
+ "enum": [
631
+ "payment",
632
+ "refund",
633
+ "change",
634
+ "compensation",
635
+ "reward",
636
+ "gas",
637
+ "deposit",
638
+ "release",
639
+ "other"
640
+ ],
641
+ "description": "Business role of this fund movement. Constraint: enum of 9 values. Relation: derived from operation context. Example: 'payment'"
642
+ },
643
+ "from": {
644
+ "type": [
645
+ "string",
646
+ "null"
647
+ ],
648
+ "description": "Sender address if known. Example: '0xabc...' or null"
649
+ },
650
+ "to": {
651
+ "type": [
652
+ "string",
653
+ "null"
654
+ ],
655
+ "description": "Recipient address if known. Example: '0xdef...' or null"
656
+ }
657
+ },
658
+ "required": [
659
+ "amount",
660
+ "coinType",
661
+ "role"
662
+ ],
663
+ "additionalProperties": false,
664
+ "description": "A fund movement tagged with its business role"
665
+ },
666
+ "description": "Fund movements in this operation, tagged with roles"
667
+ },
668
+ "events": {
669
+ "type": "array",
670
+ "items": {
671
+ "type": "object",
672
+ "properties": {
673
+ "event_type": {
674
+ "type": "string",
675
+ "description": "Raw on-chain event type tag. Example: '0x2::service::ServicePublishedEvent'"
676
+ },
677
+ "business_meaning": {
678
+ "type": "string",
679
+ "description": "Human-readable business meaning. Example: 'Service has been published and is now immutable'"
680
+ },
681
+ "category": {
682
+ "type": "string",
683
+ "enum": [
684
+ "lifecycle",
685
+ "state_change",
686
+ "fund_flow",
687
+ "permission",
688
+ "guard",
689
+ "other"
690
+ ],
691
+ "description": "Business category. Constraint: enum of 6 values. Example: 'lifecycle'"
692
+ },
693
+ "related_object": {
694
+ "type": "string",
695
+ "description": "Object ID the event relates to, if extractable. Example: '0x123...'"
696
+ },
697
+ "side_effect": {
698
+ "type": "string",
699
+ "description": "Side effect description for AI. Example: 'Customers can now place orders against this Service'"
700
+ }
701
+ },
702
+ "required": [
703
+ "event_type",
704
+ "business_meaning",
705
+ "category"
706
+ ],
707
+ "additionalProperties": false,
708
+ "description": "An on-chain event annotated with business semantics"
709
+ },
710
+ "description": "On-chain events annotated with business semantics (S-8)"
711
+ },
712
+ "next_actions": {
713
+ "type": "array",
714
+ "items": {
715
+ "type": "object",
716
+ "properties": {
717
+ "action": {
718
+ "type": "string",
719
+ "description": "Recommended next action. Example: 'add sales products'"
720
+ },
721
+ "reason": {
722
+ "type": "string",
723
+ "description": "Why this action is recommended. Example: 'Service has no products; customers cannot order'"
724
+ },
725
+ "tool": {
726
+ "type": "string",
727
+ "description": "MCP tool to use, if applicable. Example: 'onchain_operations'"
728
+ },
729
+ "prerequisite": {
730
+ "type": "string",
731
+ "description": "Condition that must hold before this action. Example: 'Service must be created first'"
732
+ },
733
+ "priority": {
734
+ "type": "string",
735
+ "enum": [
736
+ "required",
737
+ "recommended",
738
+ "optional"
739
+ ],
740
+ "description": "Priority. Constraint: enum. Example: 'required'"
741
+ }
742
+ },
743
+ "required": [
744
+ "action",
745
+ "reason",
746
+ "priority"
747
+ ],
748
+ "additionalProperties": false,
749
+ "description": "A recommended next action with priority and rationale"
750
+ },
751
+ "description": "Recommended next actions to drive the workflow forward"
752
+ },
753
+ "warnings": {
754
+ "type": "array",
755
+ "items": {
756
+ "type": "string"
757
+ },
758
+ "description": "Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'"
759
+ },
760
+ "experience": {
761
+ "type": "object",
762
+ "properties": {
763
+ "advice": {
764
+ "type": "string",
765
+ "description": "Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'"
766
+ },
767
+ "avoid": {
768
+ "type": "array",
769
+ "items": {
770
+ "type": "string"
771
+ },
772
+ "description": "Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']"
773
+ },
774
+ "relevance": {
775
+ "type": "number",
776
+ "minimum": 0,
777
+ "maximum": 1,
778
+ "description": "Relevance score 0-1 of the matched experience. Example: 0.85"
779
+ },
780
+ "matched_scenario": {
781
+ "type": "string",
782
+ "description": "Matched historical scenario. Example: 'publish_service_freelance'"
783
+ }
784
+ },
785
+ "additionalProperties": false,
786
+ "description": "Experience layer feedback from past operations (Phase 2 Topic 2)"
787
+ },
788
+ "service_status": {
789
+ "type": "object",
790
+ "properties": {
791
+ "active": {
792
+ "type": "array",
793
+ "items": {
794
+ "type": "string"
795
+ },
796
+ "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
797
+ },
798
+ "inactive": {
799
+ "type": "array",
800
+ "items": {
801
+ "type": "string"
802
+ },
803
+ "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']"
804
+ }
805
+ },
806
+ "required": [
807
+ "active"
808
+ ],
809
+ "additionalProperties": false,
810
+ "description": "Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response."
811
+ },
812
+ "customer_advice": {
813
+ "type": "object",
814
+ "properties": {
815
+ "risk_score": {
816
+ "type": "number",
817
+ "minimum": 0,
818
+ "maximum": 100,
819
+ "description": "Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75"
820
+ },
821
+ "risk_level": {
822
+ "type": "string",
823
+ "enum": [
824
+ "low",
825
+ "medium_low",
826
+ "medium_high",
827
+ "high"
828
+ ],
829
+ "description": "Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'"
830
+ },
831
+ "recommendations": {
832
+ "type": "array",
833
+ "items": {
834
+ "type": "string"
835
+ },
836
+ "description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
837
+ },
838
+ "reminders": {
839
+ "type": "array",
840
+ "items": {
841
+ "type": "object",
842
+ "properties": {
843
+ "id": {
844
+ "type": "string",
845
+ "description": "Reminder rule id. Example: 'high_risk_score'"
846
+ },
847
+ "stage": {
848
+ "type": "string",
849
+ "enum": [
850
+ "browse",
851
+ "evaluate",
852
+ "preorder",
853
+ "in_progress",
854
+ "complete",
855
+ "after_sale"
856
+ ],
857
+ "description": "Order lifecycle stage when this reminder fires. Example: 'evaluate'"
858
+ },
859
+ "priority": {
860
+ "type": "string",
861
+ "enum": [
862
+ "required",
863
+ "recommended",
864
+ "info",
865
+ "reminder"
866
+ ],
867
+ "description": "Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"
868
+ },
869
+ "message": {
870
+ "type": "string",
871
+ "description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
872
+ },
873
+ "action": {
874
+ "type": "string",
875
+ "description": "Suggested next action. Example: 'require merchant to bind Arbitration before ordering'"
876
+ }
877
+ },
878
+ "required": [
879
+ "id",
880
+ "stage",
881
+ "priority",
882
+ "message"
883
+ ],
884
+ "additionalProperties": false,
885
+ "description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
886
+ },
887
+ "description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
888
+ },
889
+ "preference_match": {
890
+ "type": "object",
891
+ "properties": {
892
+ "score": {
893
+ "type": "number",
894
+ "minimum": 0,
895
+ "maximum": 100,
896
+ "description": "Match score 0-100 (higher = better fit). Example: 75"
897
+ },
898
+ "matches": {
899
+ "type": "array",
900
+ "items": {
901
+ "type": "string"
902
+ },
903
+ "description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
904
+ },
905
+ "mismatches": {
906
+ "type": "array",
907
+ "items": {
908
+ "type": "string"
909
+ },
910
+ "description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
911
+ }
912
+ },
913
+ "required": [
914
+ "score",
915
+ "matches",
916
+ "mismatches"
917
+ ],
918
+ "additionalProperties": false,
919
+ "description": "Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}"
920
+ }
921
+ },
922
+ "required": [
923
+ "recommendations",
924
+ "reminders"
925
+ ],
926
+ "additionalProperties": false,
927
+ "description": "Buyer-side advice (Phase 3 C-3.3). Populated when customer_intelligence service is enabled AND operation is order/query on a Service. Contains risk_score, recommendations, reminders, and preference_match."
928
+ },
929
+ "evolution_context": {
930
+ "type": "object",
931
+ "properties": {
932
+ "industry_signal": {
933
+ "type": "string",
934
+ "description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'"
935
+ },
936
+ "evolution_advice": {
937
+ "type": "string",
938
+ "description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'"
939
+ },
940
+ "confidence": {
941
+ "type": "number",
942
+ "minimum": 0,
943
+ "maximum": 1,
944
+ "description": "Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"
945
+ },
946
+ "health_score": {
947
+ "type": "number",
948
+ "minimum": 0,
949
+ "maximum": 100,
950
+ "description": "Industry health score 0-100 if available. Example: 82"
951
+ },
952
+ "pending_suggestions": {
953
+ "type": "integer",
954
+ "minimum": 0,
955
+ "description": "Count of pending industry update suggestions (filtered by role if role is set). Example: 3"
956
+ },
957
+ "intent": {
958
+ "type": "string",
959
+ "enum": [
960
+ "default",
961
+ "growth",
962
+ "retention",
963
+ "compliance",
964
+ "efficiency",
965
+ "trust_building",
966
+ "custom"
967
+ ],
968
+ "description": "Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'"
969
+ },
970
+ "role_advice": {
971
+ "type": "array",
972
+ "items": {
973
+ "type": "string"
974
+ },
975
+ "description": "Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']"
976
+ },
977
+ "role": {
978
+ "type": "string",
979
+ "enum": [
980
+ "user",
981
+ "merchant",
982
+ "arbitrator"
983
+ ],
984
+ "description": "Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'"
985
+ }
986
+ },
987
+ "required": [
988
+ "confidence"
989
+ ],
990
+ "additionalProperties": false,
991
+ "description": "Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice."
992
+ },
993
+ "guard_advice": {
994
+ "type": "object",
995
+ "properties": {
996
+ "current_round": {
997
+ "type": "string",
998
+ "enum": [
999
+ "R1",
1000
+ "R2",
1001
+ "R3",
1002
+ "R4",
1003
+ "R5",
1004
+ "R6",
1005
+ "R7",
1006
+ "R8",
1007
+ "R9",
1008
+ "R10"
1009
+ ],
1010
+ "description": "Current R1-R10 dialogue round. R1=intent, R2=table, R3=tree, R4=rely, R5=binding, R6=review, R7=CREATE, R8=test, R9=bind, R10=verify. Example: 'R3'"
1011
+ },
1012
+ "puzzle_status": {
1013
+ "type": "object",
1014
+ "properties": {
1015
+ "intent": {
1016
+ "type": "boolean",
1017
+ "description": "Intent dimension complete (action + rule + failure conditions)"
1018
+ },
1019
+ "binding": {
1020
+ "type": "boolean",
1021
+ "description": "Binding dimension complete (host object + field + circular ref)"
1022
+ },
1023
+ "data": {
1024
+ "type": "boolean",
1025
+ "description": "Data dimension complete (table entries + witnesses)"
1026
+ },
1027
+ "query": {
1028
+ "type": "boolean",
1029
+ "description": "Query dimension complete (query instructions if needed)"
1030
+ },
1031
+ "logic": {
1032
+ "type": "boolean",
1033
+ "description": "Logic dimension complete (root node returns Bool)"
1034
+ },
1035
+ "constraints": {
1036
+ "type": "boolean",
1037
+ "description": "Constraints dimension complete (10 Pitfalls checked)"
1038
+ }
1039
+ },
1040
+ "required": [
1041
+ "intent",
1042
+ "binding",
1043
+ "data",
1044
+ "query",
1045
+ "logic",
1046
+ "constraints"
1047
+ ],
1048
+ "additionalProperties": false,
1049
+ "description": "Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE."
1050
+ },
1051
+ "matched_scene": {
1052
+ "type": "string",
1053
+ "description": "Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'"
1054
+ },
1055
+ "scene_description": {
1056
+ "type": "string",
1057
+ "description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"
1058
+ },
1059
+ "scene_constraints": {
1060
+ "type": "array",
1061
+ "items": {
1062
+ "type": "string"
1063
+ },
1064
+ "description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"
1065
+ },
1066
+ "suggested_patterns": {
1067
+ "type": "array",
1068
+ "items": {
1069
+ "type": "string"
1070
+ },
1071
+ "description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"
1072
+ },
1073
+ "available_queries": {
1074
+ "type": "array",
1075
+ "items": {
1076
+ "type": "object",
1077
+ "properties": {
1078
+ "id": {
1079
+ "type": "integer",
1080
+ "description": "Query instruction ID. Example: 1253"
1081
+ },
1082
+ "name": {
1083
+ "type": "string",
1084
+ "description": "Query instruction name. Example: 'progress.current_node_name'"
1085
+ },
1086
+ "objectType": {
1087
+ "type": "string",
1088
+ "description": "Target object type. Example: 'Progress'"
1089
+ },
1090
+ "returnType": {
1091
+ "type": "string",
1092
+ "description": "Return value type. Example: 'String'"
1093
+ },
1094
+ "description": {
1095
+ "type": "string",
1096
+ "description": "Query description"
1097
+ }
1098
+ },
1099
+ "required": [
1100
+ "id",
1101
+ "name",
1102
+ "objectType",
1103
+ "returnType"
1104
+ ],
1105
+ "additionalProperties": false,
1106
+ "description": "A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries)."
1107
+ },
1108
+ "description": "Available query instructions for the current context (subset of 375 GUARDQUERY entries)"
1109
+ },
1110
+ "risk_warnings": {
1111
+ "type": "array",
1112
+ "items": {
1113
+ "type": "string"
1114
+ },
1115
+ "description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"
1116
+ },
1117
+ "pending_questions": {
1118
+ "type": "array",
1119
+ "items": {
1120
+ "type": "string"
1121
+ },
1122
+ "description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"
1123
+ },
1124
+ "confirmation_text": {
1125
+ "type": "string",
1126
+ "description": "Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE."
1127
+ },
1128
+ "test_result": {
1129
+ "type": "object",
1130
+ "properties": {
1131
+ "status": {
1132
+ "type": "string",
1133
+ "enum": [
1134
+ "pass",
1135
+ "fail",
1136
+ "not_tested"
1137
+ ]
1138
+ },
1139
+ "failure_node": {
1140
+ "type": "string",
1141
+ "description": "Node that caused failure (if fail)"
1142
+ },
1143
+ "passport_id": {
1144
+ "type": "string",
1145
+ "description": "Generated Passport ID (if pass)"
1146
+ }
1147
+ },
1148
+ "required": [
1149
+ "status"
1150
+ ],
1151
+ "additionalProperties": false,
1152
+ "description": "gen_passport static test result. Must pass before CREATE."
1153
+ },
1154
+ "risk_assessment": {
1155
+ "type": "object",
1156
+ "properties": {
1157
+ "overall_risk": {
1158
+ "type": "string",
1159
+ "enum": [
1160
+ "critical",
1161
+ "high",
1162
+ "medium",
1163
+ "low",
1164
+ "info"
1165
+ ],
1166
+ "description": "Overall risk level (highest from all risks)"
1167
+ },
1168
+ "risk_count": {
1169
+ "type": "integer",
1170
+ "description": "Total number of detected risks"
1171
+ },
1172
+ "critical_count": {
1173
+ "type": "integer",
1174
+ "description": "Number of critical risks"
1175
+ },
1176
+ "high_count": {
1177
+ "type": "integer",
1178
+ "description": "Number of high risks"
1179
+ },
1180
+ "needs_human_review": {
1181
+ "type": "boolean",
1182
+ "description": "Whether human review is required (critical or 2+ high risks)"
1183
+ },
1184
+ "top_risks": {
1185
+ "type": "array",
1186
+ "items": {
1187
+ "type": "string"
1188
+ },
1189
+ "description": "Top risk titles (critical and high, max 3)"
1190
+ },
1191
+ "stakeholder_advice": {
1192
+ "type": "object",
1193
+ "additionalProperties": {
1194
+ "type": "array",
1195
+ "items": {
1196
+ "type": "string"
1197
+ }
1198
+ },
1199
+ "description": "Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list"
1200
+ }
1201
+ },
1202
+ "required": [
1203
+ "overall_risk",
1204
+ "risk_count",
1205
+ "critical_count",
1206
+ "high_count",
1207
+ "needs_human_review",
1208
+ "top_risks"
1209
+ ],
1210
+ "additionalProperties": false,
1211
+ "description": "Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax."
1212
+ }
1213
+ },
1214
+ "additionalProperties": false,
1215
+ "description": "Phase 5 Guard capability advice (populated when user intent involves Guard). Provides puzzle status, scene matching, suggested patterns, available queries, risk warnings, and confirmation text. AI uses this to guide Guard design dialogue (R1-R10)."
1216
+ }
1217
+ },
1218
+ "required": [
1219
+ "intent",
1220
+ "status",
1221
+ "summary"
1222
+ ],
1223
+ "additionalProperties": false,
506
1224
  "description": "Business semantic summary for the event query"
507
1225
  }
508
1226
  },