Give local verified runs more text retries

ober

31d9bdd819ac04bbbc3896a1759b3a88583f2e9d

diff --git a/src/jcode/core/verified-run.ss b/src/jcode/core/verified-run.ss
index be295b0..c5ada51 100644
--- a/src/jcode/core/verified-run.ss
+++ b/src/jcode/core/verified-run.ss
@@ -403,6 +403,7 @@
 (def remote-pre-edit-navigation-limit 10)
 (def remote-force-first-edit-inspection-count 6)
 (def local-force-first-edit-inspection-count 5)
+(def local-verified-text-response-retries 6)
 
 (def (pre-edit-inspection-total)
   (+ (current-pre-edit-inspection-count)
@@ -6503,6 +6504,10 @@
 	         (ropt (list (cons 'max-iterations
 	                           (or (opt-get o 'max-iterations)
 	                               default-verified-max-iterations))
+	                     (cons 'max-retries-per-step
+	                           (or (opt-get o 'max-retries-per-step)
+	                               (and local-model?
+	                                    local-verified-text-response-retries)))
 	                     (cons 'max-tool-errors
 	                           (or (opt-get o 'max-tool-errors)
 	                               default-verified-max-tool-errors))
diff --git a/test/run.ss b/test/run.ss
index 1eec8ab..ded8b65 100644
--- a/test/run.ss
+++ b/test/run.ss
@@ -2632,6 +2632,39 @@
 (check! "verified-run: default iteration budget supports long repairs"
         default-verified-max-iterations 72)
 
+(let* ([vr-dir "/tmp"]
+       [target "jcode-local-text-retry-budget.txt"]
+       [target-path (string-append vr-dir "/" target)])
+  (safe-delete-test-file! target-path)
+  (let* ([resp
+           (scripted-responder
+             (list
+               (make-text-response "wrong hidden read 1")
+               (make-text-response "wrong hidden read 2")
+               (make-text-response "wrong hidden read 3")
+               (make-text-response "wrong hidden read 4")
+               (make-text-response "wrong hidden read 5")
+               (list (make-wtool-call "write"
+                       (list (cons "path" target)
+                             (cons "content" "correct")) #f))
+               (list (make-wtool-call "verify" '() #f))))]
+         [result
+           (verified-run resp "write after repeated local prose retries"
+             (list
+               (cons 'cwd vr-dir)
+               (cons 'verify-command
+                     (string-append "grep -q correct " target))
+               (cons 'write-scope (parse-write-scope target))
+               (cons 'local-model? #t)
+               (cons 'max-iterations 12)))])
+    (check! "verified-run: local text retries allow fifth bad response"
+            result "VERIFIED: exit 0\n")
+    (check! "verified-run: local text retry eventually writes file"
+            (call-with-input-file target-path
+              (lambda (i) (get-string-all i)))
+            "correct"))
+  (safe-delete-test-file! target-path))
+
 ;; The verify-gate/best-of-k tests above use mock callables. This one drives the
 ;; live-model bridge's genuinely new code — do-edit (real write-file-string),
 ;; run-verify-command (real /bin/sh shell-out → exit-code → pass?), and