feat(ai-runtime): complete ai runtime policy refactor (ADR-035)
CI / CD Pipeline / build (push) Successful in 4m16s
CI / CD Pipeline / deploy (push) Successful in 11m51s

This commit is contained in:
2026-06-12 08:07:15 +07:00
parent 71c5e88181
commit 0227b7b982
63 changed files with 3566 additions and 451 deletions
+7 -8
View File
@@ -99,14 +99,13 @@ find_feature_dir_by_prefix() {
local prefix="${BASH_REMATCH[1]}"
# Search for directories in specs/ that start with this prefix
# Search for directories in specs/ that start with this prefix (supporting subdirectories)
local matches=()
if [[ -d "$specs_dir" ]]; then
for dir in "$specs_dir"/"$prefix"-*; do
if [[ -d "$dir" ]]; then
matches+=("$(basename "$dir")")
fi
done
# ค้นหาโฟลเดอร์ที่ตรงกับ prefix ในระบบย่อย
while IFS= read -r -d '' dir; do
matches+=("$dir")
done < <(find "$specs_dir" -maxdepth 3 -type d -name "${prefix}-*" -print0 2>/dev/null)
fi
# Handle results
@@ -115,12 +114,12 @@ find_feature_dir_by_prefix() {
echo "$specs_dir/$branch_name"
elif [[ ${#matches[@]} -eq 1 ]]; then
# Exactly one match - perfect!
echo "$specs_dir/${matches[0]}"
echo "${matches[0]}"
else
# Multiple matches - this shouldn't happen with proper naming convention
echo "ERROR: Multiple spec directories found with prefix '$prefix': ${matches[*]}" >&2
echo "Please ensure only one spec directory exists per numeric prefix." >&2
echo "$specs_dir/$branch_name" # Return something to avoid breaking the script
echo "${matches[0]}" # Return first match to avoid breaking the script
fi
}