@@ -77,44 +77,47 @@ steps:
7777 # Bootstrap: create programs directory and template if missing
7878 if not os.path.isdir(programs_dir):
7979 os.makedirs(programs_dir, exist_ok=True)
80+ bt = chr(96) # backtick — avoid literal backticks that break gh-aw compiler
81+ template = "\n".join([
82+ "<!-- AUTOLOOP:UNCONFIGURED -->",
83+ "<!-- Remove the line above once you have filled in your program. -->",
84+ "<!-- Autoloop will NOT run until you do. -->",
85+ "",
86+ "# Autoloop Program",
87+ "",
88+ "<!-- Rename this file to something meaningful (e.g. training.md, coverage.md).",
89+ " The filename (minus .md) becomes the program name used in issues, PRs,",
90+ " and slash commands. Want multiple loops? Add more .md files here. -->",
91+ "",
92+ "## Goal",
93+ "",
94+ "<!-- Describe what you want to optimize. Be specific about what 'better' means. -->",
95+ "",
96+ "REPLACE THIS with your optimization goal.",
97+ "",
98+ "## Target",
99+ "",
100+ "<!-- List files Autoloop may modify. Everything else is off-limits. -->",
101+ "",
102+ "Only modify these files:",
103+ f"- {bt}REPLACE_WITH_FILE{bt} -- (describe what this file does)",
104+ "",
105+ "Do NOT modify:",
106+ "- (list files that must not be touched)",
107+ "",
108+ "## Evaluation",
109+ "",
110+ "<!-- Provide a command and the metric to extract. -->",
111+ "",
112+ f"{bt}{bt}{bt}bash",
113+ "REPLACE_WITH_YOUR_EVALUATION_COMMAND",
114+ f"{bt}{bt}{bt}",
115+ "",
116+ f"The metric is {bt}REPLACE_WITH_METRIC_NAME{bt}. **Lower/Higher is better.** (pick one)",
117+ "",
118+ ])
80119 with open(template_file, "w") as f:
81- f.write("""\
82- <!-- AUTOLOOP:UNCONFIGURED -->
83- <!-- Remove the line above once you have filled in your program. -->
84- <!-- Autoloop will NOT run until you do. -->
85-
86- # Autoloop Program
87-
88- <!-- Rename this file to something meaningful (e.g. training.md, coverage.md).
89- The filename (minus .md) becomes the program name used in issues, PRs,
90- and slash commands. Want multiple loops? Add more .md files here. -->
91-
92- # # Goal
93-
94- <!-- Describe what you want to optimize. Be specific about what "better" means. -->
95-
96- REPLACE THIS with your optimization goal.
97-
98- # # Target
99-
100- <!-- List files Autoloop may modify. Everything else is off-limits. -->
101-
102- Only modify these files :
103- - ` REPLACE_WITH_FILE` — (describe what this file does)
104-
105- Do NOT modify :
106- - (list files that must not be touched)
107-
108- # # Evaluation
109-
110- <!-- Provide a command and the metric to extract. -->
111-
112- ` ` ` bash
113- REPLACE_WITH_YOUR_EVALUATION_COMMAND
114- ` ` `
115-
116- The metric is `REPLACE_WITH_METRIC_NAME`. **Lower/Higher is better.** (pick one)
117- " " " )
120+ f.write(template)
118121 # Commit the template so the user can see and edit it
119122 os.system(f'git add "{template_file}"')
120123 os.system('git commit -m "[Autoloop] Bootstrap: add program template for configuration"')
0 commit comments