ARTICLE

The best loop finds nothing to fix

Chandler_Mayo_ProfilePicture

Chandler Mayo

ยท26 Nov 2026ยท12 min read

TL;DR: In Part 1, you built a check that runs on every change to a CLI's docs. In Part 2, you wrote a loop that sweeps for drift every week and opens a pull request to fix it. In this post, you'll connect the two: use what the sweep found to work out where the check fell short, run both halves of it on every pull request, and make them blocking, which turns the check into a gate. Then you'll run the sweep one more time and watch it come back empty, which is exactly what a good loop should do most weeks. That's what makes it a loop instead of a cron job.

This post picks up where Part 2 left off, with the check and the weekly loop set up in your tally repo. If you haven't built those yet, start with Part 1.

Step 1: Ask why the gate missed it

Every time the loop finds something, ask yourself one question: why didn't the check catch it first? That question is what turns a scheduled job into a loop that actually gets better. The loop doesn't rewrite its own rules. You do, using what each run shows you, and that's what makes the next run better. The pull request the loop opened tells you what drifted. The commit that caused it tells you how that change got past the gate.

This time, we planted the answer. The undo drift reached main because neither half of the check ran on it: the test and the verifier only ran on your laptop, and the verifier only warned. Both were deliberate. You kept the check local while you built it, and started at warn so you could watch the verifier fail and pass before trusting it to block anything. On a real project, finding the answer is the real work, and it won't always be this tidy. Here, the fix is clear: run both checks on every pull request, then make them block.

Step 2: Run the check on every pull request

Here's where it fits. In the diagram from Part 1, this step puts the check, box 2, on every pull request: yours, and the ones the loop opens. The test runs in GitHub Actions, and the verifier runs through the Tessl Reviewer app.

Run the test in GitHub Actions

Start with the test. Add .github/workflows/test.yml:

1name: tests
2on: pull_request
3
4jobs:
5  test:
6    runs-on: ubuntu-latest
7    steps:
8      - uses: actions/checkout@v4
9      - uses: actions/setup-node@v4
10        with:
11          node-version: 22
12      - run: npm test

Commit it and push it to main:

1# Run the docs test on every pull request
2git add -A && git commit -m "Run tests on pull requests" && git push

GitHub now runs npm test on every pull request, and lists it as a check called tests / test. If undo had come in through a pull request, this check alone would have failed it.

Run the verifier with Verify PRs

The quickest way to run the verifier is the Tessl Reviewer GitHub App. One thing to know first: the app does two separate jobs. Code Review reads your pull requests and leaves a review comment from tessl-reviewer. Verify PRs runs the verifiers in your tessl.json and reports the result as a check. This step is about Verify PRs. It needs no workflow file and no stored token, but you'll need to be an admin of your Tessl organization to turn it on:

  1. Sign in to tessl.io, pick your organization, and open Reviewer in the sidebar.
  2. Open the Verify PRs tab. If the app isn't installed yet, select Connect GitHub and give it access to your tally repo.
  3. Select Turn on next to tally, switch on Turn on for this repository, and select Save settings.

Check the title of the panel before you save: it should say Verify PRs settings. Code Review has its own settings panel with the same Turn on for this repository switch, and the two are easy to mix up. Turning on Code Review doesn't turn on Verify PRs.

From now on, the verifier runs whenever a pull request opens or gets new commits, and you can rerun it any time by commenting @tessl-verify on the pull request. The result doesn't show up as a comment. Look for a check in the checks section at the bottom of the pull request, or under its Checks tab. GitHub lists it as Tessl Reviewer / Tessl Verify, because it runs under the Reviewer app.

Want to see both checks in action? Open a pull request that renames a command without touching the README:

1# Rename reset to clear, without touching the README
2git checkout -b rename-clear
3sed -i.bak 's/  reset:/  clear:/' bin/tally.js && rm bin/tally.js.bak
4git commit -am "rename reset to clear"
5
6# Push the branch and open a pull request
7git push -u origin rename-clear
8gh pr create --fill

After a minute or so, you'll see two checks on the pull request. tests / test fails, because the README still documents reset and the CLI no longer has it. That's the check you just added doing its job. Now open the Tessl Verify check's details. You'll see Tessl Verify passed with 1 warning, a table with your docs-sync#cli-docs-sync verifier counted under Fail, and a finding saying the command was renamed from reset to clear without a README update.

Both checks caught this one, because a rename changes a command's name as well as its meaning. The verifier earns its place on the changes the test can't see, like the description change you made in Part 1.

A failure that still passes can look odd the first time. The verifier itself failed, but because its level is warn, the check only raises a warning. That changes in a moment, when you switch it to error.

If you also have Code Review turned on, you'll see a comment from tessl-reviewer flagging the same rename. That's Code Review doing its own job, but it isn't the verifier. If there's no Tessl Verify check at all, or commenting @tessl-verify gets the reply "Tessl Verify is not enabled for this repository", Verify PRs isn't switched on for this repo yet. Also make sure the tessl.json with your verify block is on main, because the check is skipped when it can't find any verifiers.

Leave this pull request open. You'll use it again in a moment.

Step 3: Turn the check into a gate

Now that you've watched the verifier fail and pass when it should, give it some teeth. Change its level in tessl.json:

1"level": "error"

Commit and push the change to main, then bring it into your test pull request so the check runs again:

1# Commit the stricter level on main and push it
2git checkout main
3git commit -am "Make docs-sync verifier blocking"
4git push
5
6# Bring the change into the test pull request so the check runs again
7git checkout rename-clear && git merge main && git push

This time Tessl Verify fails, because the same finding is now at error level.

Optional: make the check required

A failing check flags the problem, but GitHub still lets someone merge past it. To block the merge outright, make the check required. Branch protection on a private repo needs a paid GitHub plan, so on a free account, either make the repo public or skip this step: the failing check still flags the problem. In your GitHub repo, open Settings, then Branches, and add a branch protection rule for main. Turn on Require status checks to pass before merging, search for Tessl Verify and select it, then do the same for test, the job from your workflow. While you're there, turn on Require a pull request before merging too. That's what stops a change like undo being pushed straight to main, where no check ever sees it. Then save the rule.

Your test pull request should now show that it can't be merged until the check passes.

If you'd rather run the verifier from your own GitHub Actions workflow, Verify agent changes in CI has a ready-made job. It needs a Tessl API key stored as a TESSL_TOKEN secret.

Step 4: Close the loop

Whether or not you made the check required, you don't actually want that rename, so close it:

1# Close the test pull request and delete its branch
2gh pr close rename-clear --delete-branch
3
4# Go back to main
5git checkout main

Now, the next time someone adds a command without documenting it, the test fails on the pull request. The next time someone changes what a command does without updating the README, the verifier does. Either way, the drift is caught before it merges, and the weekly sweep has less to clean up. The sweep found a weakness in the gate, and you closed it. That's the loop getting better.

Run the sweep one more time

There's one last thing to check, and it's the one this post is named after. Trigger the loop again, the same way you did in Part 2:

1# Start a run now instead of waiting for Monday
2tessl schedule trigger <id>
3
4# Check its status until it says Completed
5tessl schedule runs <id>

When the run is Completed, run gh pr list. There's no new pull request, because there was nothing to fix.

To see it from the loop's side, copy the newest run's ID from tessl schedule runs and look at it:

1# Show what the run concluded
2tessl launch view <run id>

The run from Part 2 that opened a pull request says Outcome: succeeded. This one says Outcome: no_action: the loop looked, and found nothing to fix.

That empty result is worth more than it looks, and it only means something because of Part 2. You've watched this same loop find real drift and open a pull request for it, so you know it's actually looking. When a loop you trust comes back empty, the gate caught the problem first. That's what most weeks should look like: a loop that finds something every single time would be harder to trust, not easier.

It works the other way round too. If the sweep misses drift you can see with your own eyes, the fix usually lives in the loop's skill: tell it which docs to check, and what to compare them with. Either way, every run teaches you something that makes the next one better.

What's next

You've built your first loop: a gate that checks every change, and a weekly sweep that catches whatever gets past it. Better still, the two talk to each other, because what the sweep finds tells you where to tighten the gate. Feedback loop engineering goes deeper on why that pairing matters.

Everything that makes this work, from the test and the verifier to the loop's skill and its schedule, is a file in your repo that your team can read, review and change.

One loop isn't a factory, but it's how every factory starts. When you're ready for the next one, Tessl Agent can pick out the chores worth automating and set them up for you.

Run it on your own repo

You've watched the loop work on tally. Now point it at a project you care about: copy across the test, the verifier, the docs-sync plugin and the schedules block, change the include paths and the skill's instructions to match your own code and docs, and trigger the first run by hand. Read what it opens closely, and tighten the gate based on what it finds. That's your first real loop.

COPY & SHARE

Chandler_Mayo_ProfilePicture

Chandler Mayo

Chandler Mayo is a Developer Advocate at Tessl. He works with developer communities to make Tessl easier to understand, adopt, and build with, and brings what he hears from developers back to the product team.

READING

ยท

0%

COPY & SHARE

Chandler_Mayo_ProfilePicture

Chandler Mayo

Chandler Mayo is a Developer Advocate at Tessl. He works with developer communities to make Tessl easier to understand, adopt, and build with, and brings what he hears from developers back to the product team.

YOUR NEXT READ

Stop your docs drifting from your code: catch it on every change

TL;DR: A loop is an agent process that does one job, with a defined input and output, in an environment you control. A docs-sync loop, for example, compares a CLI's README with its code and opens a...

Chandler_Mayo_ProfilePicture

Chandler Mayo

ยท19 Nov 2026ยท14 min read