Fixes and verification
How an approved plan becomes a tested fix, what each check proves, and when the safety gate asks for a second approver.
Once a code owner approves a fix plan, Mendloop writes the fix, proves it, and opens a pull request. Each attempt at that is a fix run. Nothing is pushed unless the checks pass and the approval is on record.
What happens in a fix run#
- Preconditions. A recorded, approved approval for the issue, no other fix running for it, a project mapped to a repository, and no safety switch on. Without the approval the run is refused.
- Base. The default branch head. The branch name comes from the GitHub connection's branch template.
- Fixer (
strongesttier). It reads the approved plan, the root cause and the files at the base commit, can read more code, and answers with edits. The change must add a regression test. - Verification. The ladder of checks below.
- Self-correction. A failed attempt goes back to the fixer with the scrubbed check output. At most 3 attempts; then the run fails and nothing is pushed.
- Safety gate. Size, secrets, risky paths, weakened tests and new network calls (below).
- Pull request, with the root cause, a checks table and the regression test. See Pull requests.
A fix usually takes 3 to 6 minutes: about a minute for the fixer, then the checks. Statuses go queued → fixing → verifying → gated → ready → pr open, or failed. A run that verified but couldn't open its pull request (a switch was turned on, a protected branch) stays ready with the reason.
Watching a fix#
The war room and the issue page show a "Writing the fix" card: what it is doing now ("Attempt 2 of 3 · running Build check"), the time since it started, the six checks of the attempt in flight and a link to the step log. The lifecycle moves to Fix, then PR when the pull request opens, then Merged. If the fix fails, the card says why.
If the worker restarts mid-fix (a deploy, for example), the fix resumes: recorded attempts are kept, a verified fix goes straight to its pull request, and there is still only one pull request.
The checks#
Verification is a ladder; the first check that fails stops it, and the rest show as skipped.
| Check | What it proves |
|---|---|
| Syntax | The changed files parse |
| Build | Dependencies install and the project builds |
| Lint | The changed files pass the repository's linter |
| Regression on base | The new regression test fails without the fix |
| Regression on the fix | The regression test passes with the fix |
| Related tests | Existing tests touching the changed files still pass |
"Regression on base" shows passed when the test failed on the base commit, because that's what it must do. If the test passes without the fix, it shows failed: the test doesn't reproduce the bug. When both regression checks pass, the run says Regression proven.
Each check shows the command, the duration, a plain sentence, and the last 4 KB of output with secrets masked.
Where the checks run#
| Setting | Where | What it can't do |
|---|---|---|
SANDBOX_DRIVER=ci-only (default) |
Mendloop pushes the fix branch and your repository's own CI runs the checks, for up to 45 minutes. | CI only runs the fix branch, so "Regression on base" is skipped and the pull request opens as a draft for a reviewer to check the test. |
SANDBOX_DRIVER=docker |
The whole ladder runs in a throwaway, offline container on your server. See Sandbox. | Needs Docker. If the daemon can't be reached, Mendloop falls back to ci-only and logs why. |
With ci-only, the fix branch is pushed only after the recorded approval, with a write token for that one repository, after the kill and read-only switches are checked; the default and protected branches are always refused. If no CI starts within 5 minutes, the Build check says so: the repository may not run CI on branch pushes. An organization policy can force ci-only.
Supported toolchains#
- Python: pip installs the project (or
requirements*.txt) plus pytest; ruff when configured. - JavaScript / TypeScript: npm, pnpm, yarn or bun; the
buildscript ortsc --noEmit; vitest, jest, mocha, thetestscript, ornode --test. - Go:
go build,go vet,go test.
The safety gate#
Before a fix becomes a pull request, its diff goes through the safety gate. The gate never rejects a fix and never asks a model anything. If anything in the diff deserves a second look, the pull request opens as a draft and needs a second approver (two different people). A clean diff goes through with the normal approval. The same diff and policy always give the same answer.
| Check | Triggers when |
|---|---|
| Size | More than 10 files, or more than 300 changed lines. Lockfiles don't count. |
| Secrets | An added line looks like a credential: a known token format (AWS, GitHub, GitLab, Slack, sk_live_-style keys, Anthropic, OpenAI, Google, JWTs, bearer tokens), a PEM private key, a password inside a URL, or a random-looking value assigned to a name like api_key or password. |
| Risky paths | A changed file matches auth/, payments/, billing/, migrations/, *.sql, infra/, *.tf, Dockerfiles, docker-compose*.yml, .github/workflows/, .gitlab-ci.yml, CODEOWNERS, lockfiles, or your own risky paths. |
| Deleted or weakened tests | A test file is deleted, test cases are removed with no replacement, more assertions are removed than added, or a skip marker is added (@pytest.mark.skip, it.skip, xit, @Ignore, @Disabled, t.Skip, XCTSkip). |
| New network calls | An added line brings in an HTTP client or socket, or a hard-coded URL to a domain that isn't already in the code being replaced. |
| Regression not proven | The regression test couldn't be shown to fail on base. |
The approval request shows one flag per kind of finding, for example Possible secret added: src/config.py:12.
A secret finding names the file, line and kind of credential, never the value.
Not flagged, on purpose: renamed or moved tests; edits to lines that already made the same call; URLs in
comments, docs and tests; localhost, single-label hosts such as http://db:5432 and reserved names
(*.test, *.example, *.internal, example.com); lockfile-only churn (though lockfiles still count as a
risky path); and placeholders such as os.environ["API_KEY"], "${CLIENT_SECRET}" or "changeme". Secrets in
test files are still reported.
Gate settings#
The gate reads the organization's policy (Settings → Policies and safety). Everything is optional:
approval:
risky_paths: ["**/checkout/**"] # always added to the gate's risky paths
fix_gate:
max_files: 10
max_changed_lines: 300
risky_paths: [...] # replaces the gate's default risky paths
extra_risky_paths: [...] # added to them
generated_paths: [...] # left out of size, secret and network checks (lockfiles by default)
allowed_domains: [api.acme.dev] # domains (and subdomains) that are never "new"
disabled_checks: [size] # any of size, risky_path, tests_weakened, networkThe secret check can't be turned off. Bad values (a negative limit, a string where a list belongs, an invalid glob) fall back to the defaults, so a typo never weakens the gate.
Privacy#
Code, check output and CI logs go to the model as data, and every prompt is redacted. CI logs and check output are scrubbed before they are stored. Secrets never reach a model or a log.