Correct the rule behind a case
When a case shows that the rule which governed it is wrong, you say so in one sentence. RepoOps turns the sentence into a proposed change to that rule, shows it as a diff, backtests it against the cases your team already decided, and changes nothing until a person approves it.
Watch it
Transcript
The walkthrough is silent. These are its captions, in order. Every value it shows is illustrative.
- 0:00The case names the rule that governed it
- 0:06One sentence says what the rule gets wrong
- 0:12A number change is drafted without a model
- 0:18The backtest puts both rules over past cases
- 0:24A person approves. The decision joins the hash chain.
How to
A case whose Prevention section names a governing rule, or, on the desktop app, a lesson on the Lessons tab.
- Open the case's Prevention section and find Governing rule.
It names the rule that applied: the lesson the case's remedy points at, otherwise the newest prevention package written from the case, otherwise the case's own lesson draft. With none of these, the row says so and Correct this rule stays disabled until a lesson is drafted.
- Press Correct this rule and write what it gets wrong.
One sentence, such as our check only looks back 8 hours, these span 12; widen it to 16. The sentence is kept with the change as its rationale.
- Let RepoOps draft the wording, or write it yourself.
When the sentence changes a number the rule contains, RepoOps rewrites every field carrying that number without a model. Otherwise, or when the sentence names two numbers the rule both contains, it says why and opens the rule's fields under Write the corrected wording yourself. On the desktop app you can tick Ask the model to draft the wording, which uses your Anthropic key and the planner's daily call cap; on the hosted app that box is disabled and the reason is shown beside it. A corrected guard pattern must compile, or the proposal is refused. Press Propose the change.
- Read the diff.
Each proposal shows the rule as it stands and as corrected, word by word, with who proposed it, how the wording was drafted and a digest over the change. Proposals stay on the case, newest first, with a line on its timeline.
- Press Run the backtest.
It lists the past cases in the repository whose decision the corrected rule would change, and sets the rule as it stands beside the rule as corrected: how many cases each fires on, how often those were real incidents, and how well each separates real incidents from false positives. Each past case is predicted only from cases that opened before it. A resolved case counts as real, a false positive as clean, and an open case is left out.
- Approve or reject.
A person decides; an agent's approval is refused. An approval binds to the rule as it was when the correction was proposed, so if the rule has changed since, propose again. An approved lesson change is written to the lessons store and the lessons block every session reads; an approved package change becomes the package's next version as a draft, which takes its validation legs and a second reviewer, and is minted on the hosted case.
Use cases
A lookback window that is too short
- Situation
- A recurrence guard missed a defect because it looks back 8 hours and the sessions spanned 12.
- You do
- Write our check only looks back 8 hours, these span 12; widen it to 16, then run the backtest.
- You see
- The wording is drafted without a model, the diff changes 8 to 16 in each field that carries it, and the backtest names the past cases the change would have decided differently.
A lesson that keeps being missed, with no case
- Situation
- Rule adherence on the Memory page shows a lesson most checked sessions missed, and no case was ever opened.
- You do
- Press Correct this rule on the lesson's row and go through the same steps in the dialog.
- You see
- The proposal and the decision are kept in the repository's rule-corrections journal. With no past cases, the backtest shows the lesson's adherence record instead, and says the corrected text cannot be replayed over those sessions.
Expected outcome
Next step: The case has no lesson, package or lesson draft to correct. Draft the lesson first.
Next step: It needs ten leak-free predictions. Decide more cases, or approve on the diff alone.
Next step: Only a lesson's guard pattern decides a case; a change to the wording alone does not. That is expected for a wording fix.
Next step: Someone changed the rule after you proposed. Propose again against the rule as it stands.
What else to consider
Tune the rule engine directly
The anti-pattern rules are on the desktop app's Memory page: open the Lessons tab and find Anti-pattern rules. It lists every rule with its severity and source. A rule with tunable thresholds has a form; Save params validates the values against the rule's schema and stores them over the defaults. The Rule playground runs candidate thresholds against the data of the repository picked there when you press Test live, and Reset to saved puts them back. New rule, no code file builds a rule from bounded clauses (a field, an operator, a threshold), tests it live, and Create rule stores it as config/rules/custom/<id>.json; a custom rule can be edited, or deleted once you confirm with Delete it, and a built-in one cannot. The same actions are GET /api/rules, POST /api/rules/evaluate, POST /api/rules/<id>/params, POST /api/rules/custom and POST /api/rules/custom/evaluate. These edits take effect when saved, with no approval step.
The record
Every decision stays on the proposal with who decided, when, their note and what rolled out. It is also appended to a hash chain: on the desktop the repository's signed rule-corrections journal, on the hosted app a chain over the case's decisions. A rejection changes no rule and is recorded the same way.
Rules written in files
A rule in CLAUDE.md, AGENTS.md or the brain's process file has no Correct this rule button. Correct it by editing that file.
Cost
The number rewrite and the backtest make no model call. Only the desktop's optional model draft spends, on your own key.