(goal, target, status)
| 182 | } |
| 183 | |
| 184 | function commandsForGoal(goal, target, status) { |
| 185 | const commandTargetPath = formatCommandPath(target.path); |
| 186 | const commandConfigPath = formatCommandPath(benchmarkConfigPath(target)); |
| 187 | const commandUsagePath = formatCommandPath(usageLogPath(target)); |
| 188 | |
| 189 | if (goal === "analysis") { |
| 190 | if (!status.hasBenchmarkConfig) { |
| 191 | return [ |
| 192 | `plugin-eval analyze ${commandTargetPath} --format markdown`, |
| 193 | `plugin-eval init-benchmark ${commandTargetPath}`, |
| 194 | `plugin-eval benchmark ${commandTargetPath} --config ${commandConfigPath}`, |
| 195 | ]; |
| 196 | } |
| 197 | |
| 198 | if (!status.hasUsageLog) { |
| 199 | return [ |
| 200 | `plugin-eval analyze ${commandTargetPath} --format markdown`, |
| 201 | `plugin-eval benchmark ${commandTargetPath} --config ${commandConfigPath}`, |
| 202 | ]; |
| 203 | } |
| 204 | |
| 205 | return [ |
| 206 | `plugin-eval analyze ${commandTargetPath} --observed-usage ${commandUsagePath} --format markdown`, |
| 207 | `plugin-eval measurement-plan ${commandTargetPath} --observed-usage ${commandUsagePath} --format markdown`, |
| 208 | ]; |
| 209 | } |
| 210 | |
| 211 | if (goal === "evaluate") { |
| 212 | return [`plugin-eval analyze ${commandTargetPath} --format markdown`]; |
| 213 | } |
| 214 | |
| 215 | if (goal === "budget") { |
| 216 | return [`plugin-eval explain-budget ${commandTargetPath} --format markdown`]; |
| 217 | } |
| 218 | |
| 219 | if (goal === "measure") { |
| 220 | if (!status.hasBenchmarkConfig) { |
| 221 | return [ |
| 222 | `plugin-eval init-benchmark ${commandTargetPath}`, |
| 223 | `plugin-eval benchmark ${commandTargetPath} --config ${commandConfigPath}`, |
| 224 | `plugin-eval analyze ${commandTargetPath} --observed-usage ${commandUsagePath} --format markdown`, |
| 225 | ]; |
| 226 | } |
| 227 | |
| 228 | if (!status.hasUsageLog) { |
| 229 | return [ |
| 230 | `plugin-eval benchmark ${commandTargetPath} --config ${commandConfigPath}`, |
| 231 | `plugin-eval analyze ${commandTargetPath} --observed-usage ${commandUsagePath} --format markdown`, |
| 232 | ]; |
| 233 | } |
| 234 | |
| 235 | return [ |
| 236 | `plugin-eval analyze ${commandTargetPath} --observed-usage ${commandUsagePath} --format markdown`, |
| 237 | `plugin-eval measurement-plan ${commandTargetPath} --observed-usage ${commandUsagePath} --format markdown`, |
| 238 | ]; |
| 239 | } |
| 240 | |
| 241 | if (goal === "benchmark") { |
no test coverage detected