Clarify incomplete ss create repairs
ober
1934be84d3b514b61321c9e9b0684a2ddc697503
--- a/src/jcode/core/verified-run.ss +++ b/src/jcode/core/verified-run.ss @@ -4392,6 +4392,16 @@ (looks-like-complete-file? content) (ss-create-has-substantive-form? content))) +(def (incomplete-ss-create-repair-guidance path) + (string-append + "The content string itself must contain the actual implementation. " + "Do not send placeholder comments or notes such as \"full content next\", " + "\"complete implementation below\", or \"placeholder\"; those are still incomplete. " + "Next call must put the complete source in the tool arguments, for example " + "write(path=\"" + path + "\", content=<complete source file with imports, definitions, event handlers, and startup code>). ")) + (def meaningful-source-bytes-threshold 1000) (def tiny-rewrite-bytes-threshold 500) @@ -4452,6 +4462,7 @@ " cannot create " path ". " + (incomplete-ss-create-repair-guidance path) (ss-repair-instruction path) (or (rejected-draft-repeat-note path) "")) 'edit)) @@ -4841,6 +4852,7 @@ path ", but the staged result is still not a complete Jerboa .ss file. " "A missing .ss target needs imports plus substantive implementation forms such as def, define, lambda, let, or display before it can be promoted. " + (incomplete-ss-create-repair-guidance path) "The staged draft remains editable and was not written to disk. " "Repair it with line_edit, replace_range, replace_def, exact old_str replacement, or send complete corrected contents, then call verify.") tool)) --- a/test/run.ss +++ b/test/run.ss @@ -9688,6 +9688,19 @@ "still not a complete Jerboa .ss file")) #t] [else (loop (cdr ys))]))))) + (check-pred! "verified-run: .ss placeholder create names deferred-content trap" + (reverse tool-results) + (lambda (xs) + (let loop ([ys xs]) + (cond + [(null? ys) #f] + [(and (str-contains? (car ys) "[ToolRecoverableError]") + (str-contains? (car ys) "full content next") + (str-contains? (car ys) "complete implementation below") + (str-contains? (car ys) + "content string itself must contain the actual implementation")) + #t] + [else (loop (cdr ys))])))) (safe-delete-test-file! target-path)) (let* ([vr-dir "/tmp"]