← Back to task

Commit 2ce42f8e

commit 2ce42f8ea6bb6ee049e01cbd5a08c856b663c23b
Author: Coder Agent <coder@agents.omni>
Date:   Wed Feb 11 17:45:09 2026

    Add shell-level build verification gate before dev auto-promotes to review
    
    Problem: The dev agent might have committed code that doesn't build, but
    was auto-promoted to review because a commit SHA appeared.
    
    Solution: After agentd dev run completes and produces a new commit:
    1. Extract taskNamespace from task JSON
    2. If namespace is set, run 'bild <namespace>' in workspace
    3. Only promote to review if bild passes
    4. On build failure, add task comment with output and leave status
       as in-progress for retry loop to handle
    5. If namespace not set, skip verification (log message)
    
    This enforces build quality before review stage.
    
    Task-Id: t-587.3

diff --git a/Omni/Ide/dev-review-release.sh b/Omni/Ide/dev-review-release.sh
index 6b7c8b67..20f623e2 100755
--- a/Omni/Ide/dev-review-release.sh
+++ b/Omni/Ide/dev-review-release.sh
@@ -654,10 +654,41 @@ run_single_task() {
 
   if [[ "$role" == "dev" && ("$new_status" == "Open" || "$new_status" == "InProgress") ]]; then
     if [[ "$dev_changed_commit" == "true" ]]; then
-      log "Dev run succeeded with commit change and status=$new_status; promoting $tid to review"
-      task update "$tid" review --json >/dev/null || true
-      task comment "$tid" "Automation (dev) promoted task to review after successful run $run_name." --json >/dev/null || true
-      new_status="$(current_task_status "$tid")"
+      # Extract namespace from task JSON
+      local task_namespace
+      task_namespace="$(task show "$tid" --json | jq -r '.taskNamespace // ""')"
+      
+      # Run build verification if namespace is set
+      local build_passed="true"
+      if [[ -n "$task_namespace" ]]; then
+        log "Running build verification for namespace: $task_namespace"
+        local build_output
+        if build_output=$(cd "$workspace" && bild "$task_namespace" 2>&1); then
+          log "Build verification passed for $task_namespace"
+        else
+          build_passed="false"
+          log "Build verification FAILED for $task_namespace"
+          task comment "$tid" "Automation (dev) build verification failed for $task_namespace. Output:
+
+\`\`\`
+$build_output
+\`\`\`
+
+Status left at $new_status for retry." --json >/dev/null || true
+        fi
+      else
+        log "No namespace set for $tid, skipping build verification"
+      fi
+      
+      # Only promote to review if build passed
+      if [[ "$build_passed" == "true" ]]; then
+        log "Dev run succeeded with commit change and status=$new_status; promoting $tid to review"
+        task update "$tid" review --json >/dev/null || true
+        task comment "$tid" "Automation (dev) promoted task to review after successful run $run_name." --json >/dev/null || true
+        new_status="$(current_task_status "$tid")"
+      else
+        log "Build verification failed; leaving status as $new_status"
+      fi
     else
       log "Dev run did not produce a commit change; leaving status as $new_status"
       task comment "$tid" "Automation (dev) run $run_name made no commit change; status left at $new_status." --json >/dev/null || true