iop/agent-ops/skills/common/finalize-task-routing/scripts/finalize-task-route.sh
toki deea59d035 feat: task routing, orchestration, quota probe, and skill updates
- add finalize-task-routing skill with policy and test scripts
- add execution target selection scripts and tests for orchestrate-agent-task-loop
- add quota probe adapter and CLI status for node app
- update plan, finalize-task-routing, and orchestration skill files
- add agent-task archive for runtime target selector
- update stream-evidence-gate-core milestone
2026-07-25 19:33:17 +09:00

70 lines
965 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
usage() {
printf '%s\n' \
'usage: finalize-task-route.sh <build|review> <local|cloud> <scope> <state> <blast> <evidence> <verification> [min-grade]' >&2
exit 2
}
if [[ $# -ne 7 && $# -ne 8 ]]; then
usage
fi
target=$1
lane=$2
scores=("${@:3:5}")
min_grade=${8-1}
case "$target" in
build)
prefix=PLAN
;;
review)
prefix=CODE_REVIEW
;;
*)
usage
;;
esac
case "$lane" in
local|cloud)
;;
*)
usage
;;
esac
case "$min_grade" in
1|2|3|4|5|6|7|8|9|10)
;;
*)
usage
;;
esac
sum=0
for score in "${scores[@]}"; do
case "$score" in
0|1|2)
sum=$((sum + score))
;;
*)
usage
;;
esac
done
if [[ $sum -lt 1 ]]; then
sum=1
fi
if [[ $sum -lt $min_grade ]]; then
sum=$min_grade
fi
printf 'target=%s\n' "$target"
printf 'lane=%s\n' "$lane"
printf 'grade=G%02d\n' "$sum"
printf 'filename=%s-%s-G%02d.md\n' "$prefix" "$lane" "$sum"