1313 ISSUE_FIX_GOAL_CANDIDATE_DISCOVERY_COMMAND_TEMPLATE ,
1414 build_issue_fix_goal_command_templates ,
1515)
16+ from .control_plane .effect_program import effect_program_from_ordered_steps
1617from .host_loop_activation import (
1718 agent_type_for_host_surface ,
1819 build_host_loop_activation_packet ,
@@ -1787,48 +1788,47 @@ def actionable_shell_command(value: Any) -> str:
17871788 commands = commands if isinstance (commands , dict ) else {}
17881789 selected_route = transaction .get ("selected_capability_route" )
17891790 selected_route = selected_route if isinstance (selected_route , dict ) else {}
1790- steps = transaction .get ("ordered_steps" )
1791- steps = steps if isinstance (steps , list ) else []
1791+ ordered_steps = transaction .get ("ordered_steps" )
1792+ ordered_steps = ordered_steps if isinstance (ordered_steps , list ) else []
1793+ program = effect_program_from_ordered_steps (ordered_steps )
17921794 step_lines : list [str ] = []
1793- for index , step in enumerate (steps , start = 1 ):
1794- if not isinstance (step , dict ):
1795- continue
1795+ for index , step in enumerate (program .steps , start = 1 ):
1796+ raw_step = step .raw
17961797 command = (
1797- step .get ("command" )
1798- or step .get ("command_template" )
1799- or step .get ("command_source" )
1800- or step .get ("prompt" )
1798+ step .command
1799+ or raw_step .get ("command_source" )
1800+ or raw_step .get ("prompt" )
18011801 )
1802- if step .get ( " kind" ) == "capability_guard" :
1802+ if step .kind == "capability_guard" :
18031803 entry_key = str (selected_route .get ("entry_command_key" ) or "" )
18041804 admission_key = str (selected_route .get ("admission_command_key" ) or "" )
18051805 entry_command = commands .get (entry_key )
18061806 admission_command = commands .get (admission_key )
1807- discovery_command = step .get ("candidate_discovery_command_template" )
1807+ discovery_command = raw_step .get ("candidate_discovery_command_template" )
18081808 authority = (
18091809 "open public issue; source clues are evidence only"
1810- if step .get ("candidate_authority" ) == "public_open_tracker_issue"
1811- else step .get ("candidate_authority" )
1810+ if raw_step .get ("candidate_authority" ) == "public_open_tracker_issue"
1811+ else raw_step .get ("candidate_authority" )
18121812 )
18131813 step_lines .extend (
18141814 [
1815- f"{ index } . `{ step .get ( 'id' ) } ` ({ step .get ( ' kind' ) } )" ,
1815+ f"{ index } . `{ step .step_id } ` ({ step .kind } )" ,
18161816 f" - authority: { authority } " ,
18171817 ]
18181818 )
18191819 if discovery_command :
18201820 step_lines .append (
18211821 f" - discover: `{ str (discovery_command ).splitlines ()[0 ]} `"
18221822 )
1823- preflight = step .get ("candidate_preflight" )
1823+ preflight = raw_step .get ("candidate_preflight" )
18241824 if isinstance (preflight , dict ):
18251825 required_evidence = " + " .join (
18261826 str (field )
18271827 for field in preflight .get ("required_evidence_fields" ) or []
18281828 )
18291829 step_lines .append (
18301830 " - preflight: refresh "
1831- f"{ step .get ('authority_refresh_required' )} ; "
1831+ f"{ raw_step .get ('authority_refresh_required' )} ; "
18321832 f"provide { required_evidence } ; "
18331833 f"{ preflight .get ('decision_rule' )} "
18341834 )
@@ -1839,12 +1839,12 @@ def actionable_shell_command(value: Any) -> str:
18391839 ]
18401840 )
18411841 continue
1842- step_label = f"{ index } . `{ step .get ( 'id' ) } ` ({ step .get ( ' kind' ) } ): "
1843- step_lines .append (step_label + str (step .get ( " purpose" ) ))
1842+ step_label = f"{ index } . `{ step .step_id } ` ({ step .kind } ): "
1843+ step_lines .append (step_label + str (step .purpose ))
18441844 if command :
18451845 rendered_command = (
18461846 actionable_shell_command (command )
1847- if step .get ( "id" ) == "connect_if_needed"
1847+ if step .step_id == "connect_if_needed"
18481848 else str (command ).splitlines ()[0 ]
18491849 )
18501850 step_lines .append (f" - command/source: `{ rendered_command } `" )
0 commit comments