agent: add script healing capability - #2899
Draft
arrufat wants to merge 6 commits into
Draft
Conversation
arrufat
marked this pull request as ready for review
July 21, 2026 07:53
karlseguin
reviewed
Jul 22, 2026
karlseguin
left a comment
Collaborator
There was a problem hiding this comment.
Don't really understand, a few simple comments...feel free to ignore. Looks fine mechanically.
arrufat
marked this pull request as draft
July 24, 2026 14:23
arrufat
marked this pull request as ready for review
August 3, 2026 10:38
arrufat
marked this pull request as draft
August 3, 2026 10:51
arrufat
force-pushed
the
agent-self-heal
branch
from
August 3, 2026 11:09
0e8ac83 to
ddb85c0
Compare
A saved script can break or come back suspiciously empty after a site change. src/script/heal.zig is the deterministic core shared by both surfaces: classify a replay, raise suspicion on dry output, gate a revision's commit on curing the original finding, and atomically swap the validated script in with a refreshed // lp:baseline line. The CLI heals via --heal and the /load offer (model verdict + revision synthesis); the MCP server exposes replay and heal_commit tools so the client's own model drives diagnosis. Extract results feed a session baseline persisted on /save as evidence for later verdicts.
arrufat
force-pushed
the
agent-self-heal
branch
from
August 3, 2026 12:22
ddb85c0 to
7a55e91
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
--healCLI flag and interactive REPL prompt to automatically diagnose and repair failing scripts using the LLM. The agent attempts to fix the script, then validates the revision in a fresh session before overwriting the original file.