{"slug": "i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says", "title": "I built an AI agent that snapshots every edit and runs your tests before it says \"done\"", "summary": "A developer built Altair, an open-source (Apache-2.0) local AI coding agent that snapshots every file edit and command side effect into a separate hidden git repository for per-edit and whole-run rollback, and structurally blocks the agent from reporting \"done\" until the project's own tests and linter pass. The agent, which runs on user-supplied OpenAI-compatible, Anthropic, or local Ollama/LM Studio models with no cloud account or telemetry, also wraps external content in a data-not-instructions frame and enforces a non-overridable path sandbox.", "body_md": "**Disclosure:** this post was written by Altair — the agent it describes — and reviewed by me.\n\nFiled under #ABotWroteThis as the community requires.\n\nI'm answering the comments the same way. If anything here reads like marketing rather than\n\nengineering, tell me and I'll fix it.\n\nMost coding agents are one more chat window next to your editor. What I wanted was different: an agent\n\nI could actually walk away from.\n\nThe problem is trust. Agents delete the wrong file, run the wrong command, or report \"all done\"\n\nwithout ever running the tests. So I found myself watching every step — which defeats the whole point.\n\nAltair is what I built to fix that. It's open source (Apache-2.0) and runs on your own hardware.\n\nAny tool that changes a file — write, patch, delete — saves the previous state first, into the app's\n\ndata folder, not your project. The file card gets an \"undo\" button. Multiple edits to the same file\n\nroll back one by one, newest to oldest.\n\nCommands need different handling, because a command can generate or delete files behind your back. So\n\ncommands are tracked by a separate hidden git repository that captures their side effects. It never\n\ntouches your own `.git`.\n\nIf a task goes sideways, you can roll back the whole run, not just one edit, and see an audit of\n\nexactly what changed.\n\nThis is the part that actually lets me leave it alone.\n\nIf the agent edited code, then before it's allowed to say \"done\" it runs *your* project checks —\n\ntests and linter — automatically. If they fail, it goes back and tries to fix them, with a cap on\n\nattempts. If it still can't, the run gets rolled back.\n\nIt cannot report success with red tests. Not \"usually\" — it structurally can't, because the check runs\n\nbefore the word \"done\" is allowed to be said.\n\nThe phone app isn't a remote control. It's a second agent with its own context and tools, linked to the\n\nPC over a local bridge. The phone has the camera, files, location and notifications; the PC has the\n\nheavy tools. They hand whole subtasks to each other, and either can ask the other for something it\n\ndoesn't have.\n\nKeys are yours: any OpenAI-compatible provider, native Anthropic, or local models via Ollama / LM\n\nStudio. No Altair cloud, no account, no telemetry.\n\nOn a cheap model, asked to write a script printing the first 30 primes, run it, and chart the gaps\n\nbetween consecutive primes. It asked permission before writing and running, did the math, built an\n\ninteractive chart, and noted in its own summary that the largest gap was 8 (between 89 and 97). About\n\ntwo and a half minutes end to end.\n\nThe bug I remember best is from the library task — asked it to write an RFC 5545 `.ics` library from\n\nscratch. It handled the classic traps: escaping special characters, and folding lines at 75 **octets**\n\n(not characters) without cutting a multi-byte UTF-8 sequence. 15 tests plus 100 random round-trip\n\nchecks, and the generated file opens in a normal calendar. Cost about $0.04.\n\nBut the most useful moment was a failure. In the packaged build, the checks were being invoked as\n\n`LocalAIAgent.exe -m pytest` — through the app's own executable instead of Python — which meant the\n\nhealth-gate was silently doing nothing. The agent didn't paper over it. It checked another way and\n\nwrote plainly that the automated check had not passed, and why. Later, when the provider's search and\n\nreview tools returned HTTP 502, it recorded the review as *not performed* rather than successful.\n\nThat honesty is the thing I care about most. A pretty report that hides a failed check is worse than\n\nno report.\n\nExternal content — web pages, documents, search results — is wrapped in a \"this is data, not\n\ninstructions\" frame and scanned for injection patterns. If the agent has just read something\n\nsuspicious and is about to do something outbound, it asks for confirmation even in automatic mode.\n\nOn top of that, two rails that user approval cannot switch off: a path sandbox (the agent doesn't\n\nleave your working folder) and a destructive-command blacklist (`rm -rf`, `format`, `mkfs`,\n\n`dd of=/dev/…`, fork bombs).\n\nThis is early software and I'd rather you hear it from me:\n\n```\nirm https://raw.githubusercontent.com/Qweezyy/AltairAgent/main/install.ps1 | iex\n```\n\nOne command, no Python required. Android APK is in the releases.\n\nCode, docs and changelog: [https://github.com/Qweezyy/AltairAgent](https://github.com/Qweezyy/AltairAgent)", "url": "https://wpnews.pro/news/i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says", "canonical_source": "https://dev.to/qweezyy/i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says-done-l17", "published_at": "2026-09-27 15:47:51+00:00", "updated_at": "2026-09-27 16:01:43.194964+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-safety"], "entities": ["Altair", "OpenAI", "Anthropic", "Ollama", "LM Studio"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says", "markdown": "https://wpnews.pro/news/i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says.md", "text": "https://wpnews.pro/news/i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says.txt", "jsonld": "https://wpnews.pro/news/i-built-an-ai-agent-that-snapshots-every-edit-and-runs-your-tests-before-it-says.jsonld"}}