Skip to content

agent: add script healing capability - #2899

Draft
arrufat wants to merge 6 commits into
mainfrom
agent-self-heal
Draft

agent: add script healing capability#2899
arrufat wants to merge 6 commits into
mainfrom
agent-self-heal

Conversation

@arrufat

@arrufat arrufat commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a --heal CLI 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.

@arrufat
arrufat marked this pull request as ready for review July 21, 2026 07:53

@karlseguin karlseguin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really understand, a few simple comments...feel free to ignore. Looks fine mechanically.

Comment thread src/agent/Agent.zig Outdated
Comment thread src/agent/Agent.zig Outdated
Comment thread src/agent/Agent.zig Outdated
@arrufat
arrufat marked this pull request as draft July 24, 2026 14:23
@arrufat
arrufat marked this pull request as ready for review August 3, 2026 10:38
@arrufat
arrufat marked this pull request as draft August 3, 2026 10:51
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants