Product
Platform overview Tomosu engine (open source) Tomosu Cloud Reliability rules
Solutions
Prevent outages before merge Reliability Radar Fix safety For developers For SRE and platform teams
Developers
Quickstart Documentation Contribute a rule
Resources
Blog Case studies Learn FAQ News
Company
Pricing About Contact Join the Waitlist
Theme

Accept or reject a fix

Every Tomosu finding that carries a code change offers two actions: Accept and Reject. Accept writes the drop-in fix into your code, or opens a pull request as you when you are signed in. Reject dismisses the finding for that code, with a reason. Nothing reaches your code until someone accepts.

  • Terminal: tomosu fix accept / fix reject
  • Console: Findings → a finding → Your decision
  • Updated

What do Accept and Reject do?

Accept applies a finding’s fix; Reject dismisses the finding. Both are recorded against the rule that raised it, so the rule’s track record reflects what your team actually did.

ActionWhenWhat happens
AcceptNot signed in to a code hostThe terminal writes the change into your checkout. The console shows the change and a Download patch link.
AcceptSigned in with GitHub, GitLab or BitbucketA pull or merge request with the fix, opened as you. On GitHub it merges once your required checks pass.
RejectAny timeThe finding is hidden for that code. It comes back only if the code changes. The reason is kept with the decision.

A finding without a code change has no fix to apply: Accept then means you will follow the written guidance.

How does Accept work?

A fix is the rule’s own drop-in change, prepared before you see it. Tomosu checks each one for four things and shows the result on the finding:

  • it only adds code: nothing is removed or rewritten;
  • the file still parses, with any imports it needs;
  • function names, parameters and decorators are unchanged;
  • the rule no longer matches the changed code.

Every changed line carries a marker such as # tomosu: 01.external-call-timeouts, so you can find the change later. The fix stays unverified until your build and tests run with it.

Finding witha drop-in fix Your decision Acceptchange or patch Accept, signed inpull request as you Your buildand tests Reject + reasonhidden for this code Back only ifthe code changes Every decision is recorded with the rule id.
What happens after each decision.

How do I accept or reject a fix?

Use whichever you prefer: both record the same decision. The examples use the demo shop that ships with the engine (Quickstart) and the engine’s console at http://localhost:7600.

  1. Find the finding’s id

    List the open findings of a running engine, or scan a folder on your computer with tomosu scan .. Every finding starts with its id.

    $ tomosu findings --engine http://localhost:7600
    Critical pre-merge+runtime  f-4825b704faab  Retry repeats payments or other one-time actions  demo/shop app.py:72
    Critical pre-merge+runtime  f-68c4383f682d  External call timeouts  demo/shop app.py:74
    Critical pre-merge+runtime  f-4d16d40f4786  External call timeouts  demo/shop app.py:87
    Critical pre-merge+runtime  f-362e8a463edc  OpenAI rate limit: retry ignores server delay  demo/shop app.py:127
    Critical pre-merge+runtime  f-59b39e4aaf1c  N+1 query detection  demo/shop app.py:97
    Critical pre-merge+runtime  f-86d6f0692508  Model call without an explicit timeout  demo/shop app.py:129
    …
    30 finding(s)
  2. Preview the change

    --dry-run prints the change and writes nothing.

    $ tomosu fix accept f-68c4383f682d --repo demo/shop --dry-run
    --- a/app.py
    +++ b/app.py
    @@ -71,7 +71,7 @@
         log.info("checkout started for %s items", len(order.get("items", [])))
         for attempt in range(3):
             try:
    -            resp = requests.post(PAYMENTS + "/charge", json=order)
    +            resp = requests.post(PAYMENTS + "/charge", json=order, timeout=(3.05, 10))  # tomosu: 01.external-call-timeouts
                 resp.raise_for_status()
                 return {"status": "paid", "attempts": attempt + 1}
             except requests.RequestException:
    
    (dry run: nothing written)
  3. Accept it

    Run it in your checkout. With --engine the decision is also recorded in the running engine, so the console shows it. Add --pr to open a pull request instead of changing your checkout.

    $ tomosu fix accept f-68c4383f682d --repo demo/shop --engine http://localhost:7600 --token $TOMOSU_UI_TOKEN
    … (the same change as the preview) …
    
    applied to app.py; review it, run your tests, then commit (the change is unverified until they pass)
    f-68c4383f682d accepted (recorded here and in the engine)
  4. Or reject it, with a reason

    $ tomosu fix reject f-8ff98b471ff3 --reason handled-elsewhere --repo demo/shop --engine http://localhost:7600 --token $TOMOSU_UI_TOKEN
    f-8ff98b471ff3 rejected; it will not be shown again unless the code changes (recorded here and in the engine)

Decisions sent to an engine need either a key (--token, or a key from tomosu keys create) or a signed-in terminal: run tomosu login github --engine http://localhost:7600 once and every command acts as you.

What do I see afterwards?

An accepted finding moves to the Accepted tab of Findings, a rejected one to Rejected. This holds wherever the decision was made: the finding below was accepted from the terminal with --engine.

The Accepted tab of Findings showing one finding, External call timeouts in app.py line 74, with an Accepted badge; 16 findings remain open and one is rejected.
Findings → Accepted, after accepting from the terminal.

In your checkout, review the change, run your tests, then commit it. With a pull request, your repository’s own checks decide when it merges.

Which options do the commands take?

OptionWhat it does
--dry-runShow the change without writing it.
--prOpen the fix as a pull or merge request as you, instead of changing your checkout. GitHub needs tomosu login github; GitHub, GitLab and Bitbucket also work through --engine after tomosu login <host> --engine URL.
--engine URLRecord the decision in a running engine too.
--tokenThe engine’s start-up key or an access key (also TOMOSU_UI_TOKEN).
--repo NAMEThe repository name to record, so ids match the engine’s (default: the engine’s, else your git origin).
--reasonFor fix reject: one of the reasons below.
--noteA note kept with the decision. It is never sent anywhere.
--no-modelDo not ask your model for a fix when the rules have none.
--yesWrite a fix drafted by your model without asking, after you have reviewed it.

For many findings at once, use tomosu fix accept-all or reject-all --repo R, or Accept all and Reject all on Findings with one repository selected.

Which reasons can I give when I reject?

--reasonConsoleUse it when
not-applicableNot applicable hereThe rule is right in general but not for this code.
handled-elsewhereHandled elsewhereSomething else already covers it, such as a proxy timeout or a wrapper.
fix-wrongThe fix is wrongThe problem is real but the proposed change is not.
false-positiveFalse positive: the code is fineThe rule matched code that has no problem.
otherOtherNone of the above.

After you reject a finding for any reason but Other, its page offers to contribute it, so the rule can be made more precise.

What if something goes wrong?

“no finding … in .; ids change when the code they point at changes”

A finding’s id depends on the code and the repository name. Run tomosu scan . again for the current ids, and pass --repo with the engine’s repository name so the ids match the console’s.

The console has no Accept button

The console is view-only until you sign in or unlock it with a key. A finding without a code change shows Accept for the guidance only.

Accept did not open a pull request

A pull request needs a sign-in with the code host: tomosu login github, or tomosu login github|gitlab|bitbucket --engine URL for the engine. In the console, sign in with GitHub, GitLab or Bitbucket.