Skip to Content
Tares

How can an AI SRE see which recent commits touch the service behind slow database queries?

Tares watches every commit to the chosen branch of each source repository and wakes an agent that keeps a context repository current. Add the repository of the service behind your slow database queries as a source, and its commits arrive as events on that repository’s timeline. The first look run covers the last seven days of commits per source repository, so recent changes are there from the moment you start.

How it works

The Shared code context project in Tares handles the data side and runs the agent. It creates these pieces:

  • One commits source per repository. Each source follows one branch, the default branch unless you change it, and polls every 60 seconds with the same token.
  • One timeline per repository. Each commit is an event with labels such as repo, sha, title, author and branch. By default each new commit also carries its changed files in the payload.
  • A trigger on every commit to the chosen branch. It batches commits per repository, so a busy day becomes one run per repository per five minutes.
  • An agent. When the trigger fires, the agent calls github__get_commit for each commit in the attached timeline and reads the diff. It decides whether the change alters interfaces, configuration, data schemas, runtime behaviour or dependencies between repositories. Refactors, tests, formatting and version bumps that change no behaviour are skipped.

When a change matters, the agent reads the context page that covers it, corrects statements the change made false, and adds what is new with the commit’s short sha next to each claim. It opens a pull request in the context repository, or commits straight to the branch if you chose that. It then records a finding on the repository’s timeline: what changed and the pull request link, or “no update needed” and why.

First look on start is on by default. It runs the agent once per source repository over the last seven days of commits, so the context repository starts current instead of waiting for the next commit.

For how the GitHub source, credential and events work, see GitHub.

Set it up

Follow the Keep shared code context current guide. In short:

  1. Start Tares locally and set an Anthropic API key under Settings > Model providers or as ANTHROPIC_API_KEY.
tares up
  1. Create a GitHub fine-grained personal access token. Pick the source repositories and the context repository. Set Contents to Read and write, Pull requests to Read and write, and Metadata to read-only. With Pull requests at read-only the agent can push its branch but the pull request fails.
  2. Open Projects, pick Shared code context and click Set up. Choose or add the token. Test shows the GitHub login it belongs to.
  3. Tick the source repositories, up to 50. Include the repository of the service behind your slow database queries. Change the branch if it is not the default.
  4. Pick the context repository, the branch pull requests target and the path where the pages live. Choose between keeping existing pages and updating them in place, or one page per source repository plus an index. Then choose whether the agent opens pull requests (recommended) or commits to the branch.
  5. Review the trigger, the model and the round budget (12 by default). Leave First look on start on and click Start.

Each commits source is an ordinary source object. This is the shape of one repository source on the personal token path:

- name: checkout-api connector: github poll: 2m config: repo: acme/checkout-api credential: github labels: - { name: repo, field: repo, primary: true }

The project sets the sources up for you. Push a commit to a source repository and, within a minute, the source ingests it, the trigger fires for that repository and the agent runs.

What you get

  • Recent commits per service. Each source repository has its own timeline, so the commits for the service behind slow database queries sit together, newest changes included.
  • A seven day starting point. The first look run covers the last seven days of commits per source repository.
  • Context that follows the code. The agent updates the pages that cover each meaningful change, and the short sha next to each claim ties it to the commit that caused it.
  • A record of every conclusion. The project page shows each change under What the agents found, with the pull request or “no update needed”. Activity shows every run with its status and result, and runs marked first look are the ones from Start.
  • Review before anything lands. With pull requests, a person merges the agent’s change to the context repository.

To see which commits touch a service, check the repository’s timeline and the context pages. To learn how an AI SRE is set up in Tares, start with that guide.

When something else fits

  • If you want pull request, review, issue, release and CI run events as well as commits, connect the GitHub App as described in GitHub. With the App, commits arrive as push events as they happen.
  • If your context pages are already current, or you want to save model spend, turn off First look on start. The trigger still handles every later commit.
  • A project takes up to 50 source repositories. For more, split them across projects.

Still stuck? Get help

Last updated on