Repository navigation
feat(ai): one AI rule per incident or alert - investigation rules and auto remediation rules merged - #5221
Merged
Conversation
…ve into the auto remediation rules' table Investigation rules and auto remediation rules had the same conditions in two tables. An AI rule now says once which incidents (or alerts) it matches, whether OneUptime AI investigates them (right away or after a wait) and whether - and how - it fixes them. It lives in the AutoRemediationRule table (its ids, route, permissions and fixes carry on), shown as AI Rule: - AutoRemediationRule gains investigates (off by default, so an older API client's rule keeps only fixing), onlyIfOpenAfterMinutes and fixes (on by default); Types/AI/AiRule is the one reading, AiRuleCriteria the trigger-fit check the investigation rule service had; - the investigation side reads the AI rules that investigate, the fixing side and the pull requests the rules that fix; a rule set to only investigate stops its in-flight unattended fixes; a new decision reason says when the rules that matched do not fix; - AIInvestigationRule's model, service and API are gone; its route answers 410 Gone with what to use instead (RetiredApiRoute); - AddAiRuleInvestigation adds the columns, and MergeInvestigationRulesIntoAiRules moves every investigation rule in without changing what any project's AI does: same-condition pairs become one rule, the rest copies that only investigate, and two added rules keep every incident investigated (or fixed) where a lane relied on having no rule of a kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Postgres MergeInvestigationRulesIntoAiRulesPostgres seeds sixteen projects - each kind of rule alone (fixing on and off), pairs and near pairs (different servers, conditions, on/off state), name order, criteria that decide alone, both kinds of signal, a deleted rule and project - runs both migrations and checks each rule's new shape, then tries 36 incidents and alerts per lane with the real matcher and the server's decisions: investigated or not, wait, LLM provider, MCP servers, repositories, the rules that fix it and both pull requests are the same before and after. up() again changes nothing, down() gives the rules back, and up() after down() gives the same rules. down() deletes the taken-back rules' lists itself instead of leaning on the keys' cascade, and rules of deleted projects are left fixing only (no rule is added to them). MergeInvestigationRulesIntoAiRulesMigration pins the statements, their order, registration and what each may touch. The Postgres suite runs in the schema drift workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e incident and alert AI settings Incidents (and Alerts) -> AI -> Settings -> More settings holds one table of AI rules where it held Investigation rules and Auto remediation rules: - a rule asks Match, then Investigate (right away, or only if still open after a wait), then Fix (Don't fix, Ask before fixing, Fix without asking) and its name; More fields holds the runbooks, Run them every time, the LLM provider, the Runner, the MCP servers and code repositories (the investigation's too) and the two pull requests, each shown only where it does something; - the table's columns are Name, Investigates, Fix and Status; - a rule that only fixes (an auto remediation rule from before the merge, or one an older API client made) says so on its Investigate step, with Investigate too; an older rule keeps Fix like a new rule; - the Remediation card, the AI card's reasons, the AI insights and the wait notice say AI rule, and a rule that matched and only investigates is named; server-written feed texts and permissions say AI rule too. The API reference names the resource AI Rule; its tag carries the former name (x-former-names, TableMetadata.formerSingularName), and the Terraform provider keeps oneuptime_auto_remediation_rule as a deprecated alias of oneuptime_ai_rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le kinds left go The AI rules' card, form, table, Remediation card lines, AI insights and wait notice in every Dashboard language, worded with each language's own terms for investigating, fixing and the rule (KI-Regel, Règle IA, Regla de IA, AI ルール ...). The 38 strings only the investigation and auto remediation rule tables used are dropped from all 17 files, and the approval card the Fix question replaced goes from AutoRemediationRuleCopy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t check - AutoRemediationRuleService judges a new rule's shape (investigates, fixes), wait and conditions after the project reference check, as the investigation rule service did: a foreign id gets the same answer as a missing one, before anything about the rule itself is said. - The AI rule form's More fields starts on Code Repositories, the one field every rule shows, so the fold no longer closes when the Fix answer above it changes (the form keys a fold by its first field on screen). - The table's Fix column and its export say the same answer: an older rule that has OneUptime AI pick a runbook asks first (getShownAiRuleFix). The Fix answer writes its columns with getAiRuleFixColumns; duplicates gone. - The AI rules card keeps "pull requests included" (with no rule, fixing opens them), in all 17 languages. - Permission titles in the resource and cluster column descriptions say Edit AI Rule; a fix's columns are named AI Rule and AI Rule ID (16 translations); the fix switches and decision entries say AI rules. - Puts back the API Keys sentence the locale clean-up wrongly dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…engine, runners - AiRulesTable: the Match, Investigate and Fix steps, the note and "Investigate too" of a rule that only fixes, the Fix question's three answers and the columns they write, a rule that does neither refused, More fields (first field shown for every kind of rule), the Investigates and Fix columns, the count - for incidents and alerts. Replaces the two rule tables' suites. - AiRule, AiRuleCopy, AiRuleCriteria (renamed), AiRulesInLocale (every new sentence in 16 languages; the retired ones gone). - AutoRemediationRuleAiRuleChecks: shape, wait and conditions on create and update, judged with the stored columns - the investigation rule service's suite, carried over. - Engine: a signal that matches only rules that do not fix is not fixed, and its card names the rule (MatchedRulesDoNotFix); pull requests, the plan, execution and MCP runners stop for a rule set to only investigate. - InvestigationRules and its allowances read only rules that investigate. - The rest follow the names: AI rules, Edit AI Rule, the model's columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ays its fix - The AI rules table says what a rule does in one column, "Investigates and fixes": when it investigates (or that it doesn't), and under it whether and how it fixes. With an Investigates and a Fix column, Status went under the row's buttons at 1280px beside the side menu - in German by about 130px. "Investigates and fixes" in 16 languages. - A new rule's create always says its Fix answer's two columns (fixes, executionMode), also when it is saved on the answer it opened on, asking first - not left to the server's defaults. - "Fix like a new rule" moves the Fix answer to asking first with the columns it writes: an older rule that picks a runbook kept the answer it opened on (without asking) while the question was hidden. - The fix switches' API descriptions say "AI Rule". - The AI settings page suites read the AI rules card, first under More settings; two test patterns are made linear (recheck: all 18 new patterns on the branch safe). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed either kind of rule, and an upgrade note - AI SRE, "Which incidents are investigated and fixed": what no rule and rules mean for investigating and fixing, a rule's three steps (Match, Investigate, Fix - Don't fix, Ask before fixing, Fix without asking), the rule that only fixes and Investigate too, More fields in the form's order, several matching rules, and a paragraph on the API and Terraform (AutoRemediationRule, investigates / fixes / onlyIfOpenAfterMinutes, oneuptime_ai_rule and its deprecated alias, the old route's 410). The provider, the wait, RCA first, the Remediation card (only rules that don't fix matched), cost controls and troubleshooting follow. - Incident settings (one more table, not two; nine rules, not ten), run rules now, external MCP servers (the Fix answer, not Approval), LLM providers, API reference, declaring incidents, postmortems, runbooks, Infrastructure AI agents, Kubernetes agent and Code: AI rules, and the permission's title, Edit AI Rule. - Upgrading, 13 -> 14: "Investigation rules and auto remediation rules are now AI rules" - what the upgrade does to each kind of rule, the rules it adds and when, the API, Terraform and the retired route, and the renamed permissions. The Kubernetes agent note names Edit AI Rule. - The Runner, host AI agent and Kubernetes agent chart READMEs follow. - Anchors localized; docs:check-anchors clean. The docs suites follow the new words; the upgrade guide's lists know the former labels and the rules the upgrade adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s that only fix, the table at 1280px - The fixture holds one AI rules table: the investigation rules as the upgrade copies them (investigate, fix nothing), and the auto remediation rules - the one merged with an investigation rule investigates, the rest only fix. - AutoRemediationRules.spec: Match, Investigate and Fix; Don't fix and an answer taken back; More fields in its order (repositories, MCP servers, provider, runbooks, Runner, pull requests); rules that only fix, with Investigate too, and Don't fix refused for them; MCP servers and the provider for a rule that doesn't fix or only runs its runbooks every time; the AI card and the rule dialog at 1280px and 390px, light and dark, fixing or not. - InvestigationRules.spec: the Investigate step, its wait stopped on the step, the one column fitting its card at 1280px beside the side menu in English and German. - PostmortemRules.spec: the More settings cards in their order. - The deployed pull request spec writes rules that only investigate, and checks an older client's rule and the old route's 410. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master added two migrations at 1806600000000 and 1806700000000, so the AI rule migrations move after them: AddAiRuleInvestigation1806800000000 and MergeInvestigationRulesIntoAiRules1806810000000 (files, classes, names and tests renumbered). The Dashboard locales are master's files with the branch's added, changed and removed keys applied on top; no key was changed on both sides. i18n extract finds nothing new, and i18n check and validate pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ixing on A project whose investigation rules decided what was investigated, with no auto remediation rule and fixing off, gets no rule that fixes from the upgrade. Turning fixing on there later fixes only what a rule that fixes matches, so the note says to add one first. In 17 languages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…s true of every rule, focus after a note's button UI review of the AI rules table and dialog (Incidents and Alerts > AI > Settings > More settings): - The table's fix pill says "Asks before fixing" and "Fixes without asking" (with "Doesn't fix"): under "Right away" in the column "Investigates and fixes", the auto remediation rules' "Asks first" read as asking before the investigation. The pill wraps rather than cut a longer language's words short. 16 languages. - The card's line names a rule's three steps in order - which incidents, when, and how each is fixed - in 205 characters (it was 224, past the 210 ShortDescriptionsGuard holds a card's line to; the guard cannot read it through the lane's index, so AiRuleCopy's tests hold it now). Translations kept: the meaning is the same. - Code Repositories and MCP Servers under More fields have one line true of every rule: a Don't fix rule's form said OneUptime AI would "open pull requests in them". 16 languages. - The Description field draws no "Description of this AI rule." line. - The Remediation card says "With rules set up, OneUptime AI fixes only what matches a rule that fixes." (was "only what a rule that fixes matches is fixed"). Translations kept. - "Investigate too" and "Fix like a new rule" take their note away; from the keyboard, focus fell back to the page. It now goes to the answer of the question that takes the note's place (FocusWhenDrawn). Tests: AiRuleCopy, AiRulesTable, AiRulesInLocale, RemediationDecisionLines, the new FocusWhenDrawn suite, and the offline AutoRemediationRules and InvestigationRules specs (keyboard focus, every pill whole at 1280px in English and German). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master took 1806800000000 (AddNetworkDeviceDiscoveredDetails), so the AI rule migrations move past it: AddAiRuleInvestigation1806900000000 and MergeInvestigationRulesIntoAiRules1806910000000, after it in Index.ts and in the tests that name them. The locale files merged key by key: master's 29 new keys and this branch's changes, none changed on both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master's Microsoft Teams sign-in change (#5220); no conflicts, no new migration or locale keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
simlarsen
pushed a commit
that referenced
this pull request
Oct 24, 2026
#5221 made investigation rules and auto remediation rules one AI rule, and the AI card's waiting line says so: "An AI rule makes OneUptime AI wait 10 minutes, so incidents resolved by then are not investigated." The EventOverview browser suite still expected "An investigation rule makes ...", and failed three of its wait checks (issue #5074) in Dashboard Offline UI (1) on the 14.0.88 release gate. Its three expected sentences now read as the card does (InvestigationWaitingState). Test only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simlarsen
pushed a commit
that referenced
this pull request
Oct 24, 2026
…it', as it has since #5221 #5221 moved investigation rules into the AI rules and changed the waiting card's sentence to match, but left the offline Event Overview suite's three expectations of the old one. They fail on master. Fixed here because this branch runs that suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The question, and the answer
Yes. This PR merges them, for incidents and for alerts. The reasons:
What changes on the AI settings page
Incidents → AI → Settings → More settings (and the same page for Alerts) now has one AI rules table. Before, it had Investigation rules and Auto remediation rules.
Migration: no project's AI behaves differently
AddAiRuleInvestigationadds three columns to the auto remediation rules' table:investigates(default false),fixes(default true) andonlyIfOpenAfterMinutes.MergeInvestigationRulesIntoAiRulesthen works through each project, for incidents and for alerts separately:It is safe to stop and run again:
down()removes whatup()added.How it is tested: a Postgres suite seeds sixteen projects. They cover every combination of rules, pairs and near-pairs, incidents and alerts, fixing on and off, and deleted rules and projects. For 36 incidents and 36 alerts per project, it uses the real matcher to check that these are the same before and after: what is investigated, the wait, the LLM provider, MCP servers and repositories, the rules that fix, and both pull requests. It also runs
up()twice, thendown(), thenup()again.API, Terraform and MCP
AutoRemediationRuleat/api/auto-remediation-rule, with the same route, ids and permissions. It has new fieldsinvestigatesandfixes, which default tofalseandtrue, so a client written before this change still creates rules that only fix. It also hasonlyIfOpenAfterMinutes.oneuptime_ai_rule.oneuptime_auto_remediation_rulestays as a deprecated alias (from the model'sformerSingularNameand the tag'sx-former-names), and amovedblock switches over without replacing anything./api/ai-investigation-ruleanswers 410 Gone. The message names/api/auto-remediation-rule,oneuptime_ai_ruleandinvestigates: true, fixes: false.oneuptime_investigation_ruleis gone.Docs (17 languages)
docs:localize-anchors), anddocs:check-anchorsis clean.Tests
Common (jest):
Postgres: MergeInvestigationRulesIntoAiRulesPostgres (described above) runs in the schema drift workflow. MergeInvestigationRulesIntoAiRulesMigration pins the statements.
Offline browser (Playwright, real Chromium): the
AutoRemediationRulessuite (68 tests) and theInvestigationRulessuite (10) are rewritten for the AI rule. They cover:PostmortemRules(26) covers the card order. All 104 pass.App: the docs suites (labels in every language, anchors, the upgrade note's shape, permission names) and the AI settings page suites.
Mutation checks: each of these breaks was caught by its suite:
investigates: true;Not run here
packages/E2E/Tests/Dashboard/AutoRemediationRulePullRequests.spec.tsneeds a deployed stack. It is updated for the 410 route and forinvestigates/fixes, and it type-checks.UI review
What I looked at. The real pages and dialogs, bundled from this branch in Chromium with the Dashboard's Tailwind runtime, theme and Inter, beside the real side menu (
layout=page): at 1280px, and at 1024, 768 and 390px; light and dark; English, German, Russian and Japanese; no rules, rules of every kind (the four that were auto remediation rules, the two that were investigation rules), a full table of nine, and a viewer.What I changed, and why.
AI_LANE_RULES_COPY[props.lane], so AiRuleCopy's tests now hold the line to the limit. The translations already said this, so they are kept under the new key. "Pull requests included" stays, as AISettingsSwitchesFirst requires.Components/AISettings/FocusWhenDrawn.Tests added or changed.
Common/Tests/App/Dashboard/FocusWhenDrawn.test.ts(new):AiRuleCopy.test.ts:AiRulesTable.test.tsx:AiRulesInLocale.test.ts: the new sentences in 16 languages, and the replaced ones retired from every locale.RemediationDecisionLines.test.ts: the new sentence.AutoRemediationRules.spec.ts:InvestigationRules.spec.ts: at 1280px, with rules that fix and rules that don't, every pill is drawn whole and Status stays in sight, in English and in German.Merged master twice. Master's
AddNetworkDeviceDiscoveredDetailstook 1806800000000, so this PR's migrations are nowAddAiRuleInvestigation1806900000000andMergeInvestigationRulesIntoAiRules1806910000000, after it in Index.ts and in the tests that name them. The locale files were merged key by key: master's 29 new keys plus this branch's, with no key changed on both sides.Verification after the last merge.
compile-tests, Dashboardtsc, Appcompileand E2Ecompileall pass.--listFilesshows nothing outside each package and Common.Locale(40 suites);Guard, plus UpdateChecksReadHeldRows, DeleteChecksReadHeldRows, HookWritesCallersMayMake, ListOrderColumnModels and PermissionCatalogueCoverage (167 suites).Locale;Left alone on purpose, or for later.
down(), is a risk. The older code reads every enabled AutoRemediationRule as one that fixes. The copied investigation rules and Investigate every incident would then propose fixes, asking first, while fixing is on.🤖 Generated with Claude Code