refactor(agent): vérification JS via _verify_written (déjà auto après écriture)

L'auto-check séparé dans la boucle agent doublonnait _verify_written et
signalait à tort les fichiers écrits par morceaux (mode append).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Opus 4.8 committed 2026-07-18 17:04:47 +02:00
1 parent c92e4d4a13
commit d19624b46b
2 files changed
+9 -30

No files matched your search

+9
View File
@@ -103,6 +103,15 @@ def _verify_written(target: str) -> str | None:
problems = check_html(target)
if problems:
return " ; ".join(problems)
elif ext in (".js", ".mjs"):
node = shutil.which("node")
if node:
proc = subprocess.run(
[node, "--check", target], capture_output=True, text=True,
timeout=15,
)
if proc.returncode != 0:
return (proc.stderr or proc.stdout)[:300]
except SyntaxError as exc:
return f"SyntaxError ligne {exc.lineno}: {exc.msg}"
except ValueError as exc: