Feat/operator alerts (#1635)

* feat(state): durable operator alerts owned by the State Store

Alerts dedup on org+kind+subject, resolve themselves when a condition
clears, and are raised, resolved, dismissed and listed through the state
contract. Task transitions raise needs-human and failed alerts in the same
transaction; the store checks service health and prunes closed alerts.
Each raise and resolve queues a webhook delivery whose attempts are kept.

* feat(notify): deliver operator alerts to the webhook; raise config and release alerts

notify.webhook now receives raised and resolved alerts above a severity
threshold with HMAC-signed payloads, bounded retry and every attempt recorded
on the alert. archied raises model alias, provider and credential-binding
alerts from the effective configuration, an update alert from the release
channel, and a credential-rejected alert from the egress resolver. The
dashboard API lists and dismisses the caller's org's alerts.

* feat(ui): alert bell in the top bar and webhook alert settings

The bell lists the org's open alerts by severity with dismiss and a link per
alert, and refreshes from the event stream. The task settings page gains the
webhook severity threshold and signing secret. ui/dist rebuilt.
This commit is contained in:
sam authored and GitHub committed 2026-10-12 03:30:46 +11:00
1 parent f34f60f9c7
commit 8a3ba32c5a
43 files changed
+4671 -465

No files matched your search

+21 -2
View File
@@ -3,7 +3,9 @@ import ApplyStatusRows from "./ApplyStatusRows.vue";
import { computed, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { Button } from "@/components/ui/button";
import {Input} from "@/components/ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import PageHeader from "@/base/PageHeader.vue";
import { DurationInput, formatGoDuration, parseGoDuration } from "@/components/ui/duration-input";
import {
@@ -17,6 +19,7 @@ import { SettingRow } from "@/components/ui/setting-row";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
import SecretRefField from "./SecretRefField.vue";
const POLICY="task-policy";
const KIND = "workflow-execution-settings";
@@ -33,7 +36,7 @@ const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
const resources = computed(() => resourcesForPage(catalog.value, "tasks"));
const policy=computed(()=>store.drafts[POLICY]?.value as {diff_cap_lines:number;notify_webhook:string}|undefined);
const policy=computed(()=>store.drafts[POLICY]?.value as {diff_cap_lines:number;notify_webhook:string;notify_min_severity:string;notify_secret:{engine:string;key:string}}|undefined);
const limits = computed(() => store.drafts[KIND]?.value as ExecutionSettings | undefined);
const error = computed(() => store.pageErrorFor(KIND));
@@ -66,9 +69,25 @@ const taskRuntime = seconds("max_task_runtime_seconds");
<SettingRow label="Maximum changed lines" hint="Applied to new tasks. 0 disables the limit." for="task-diff-cap">
<div class="flex flex-wrap items-center gap-3"><Input id="task-diff-cap" v-model.number="policy.diff_cap_lines" type="number" min="0" class="max-w-40" /><DraftHint :kind="POLICY" path="diff_cap_lines" /></div>
</SettingRow>
<SettingRow label="Notification webhook" hint="Applied to new tasks. Empty disables notifications." for="task-notify">
<SettingRow label="Alert webhook" hint="Receives each raised and resolved alert. Empty disables." for="task-notify">
<div class="flex flex-wrap items-center gap-3"><Input id="task-notify" v-model="policy.notify_webhook" type="url" class="max-w-md" /><DraftHint :kind="POLICY" path="notify_webhook" /></div>
</SettingRow>
<SettingRow label="Webhook severity" hint="The lowest severity delivered.">
<div class="flex flex-wrap items-center gap-3">
<Select :model-value="policy.notify_min_severity || 'warning'" @update:model-value="policy.notify_min_severity = String($event)">
<SelectTrigger class="w-40" aria-label="Webhook severity"><SelectValue /></SelectTrigger>
<SelectContent>
<SelectItem value="info">Info</SelectItem>
<SelectItem value="warning">Warning</SelectItem>
<SelectItem value="action">Needs you</SelectItem>
</SelectContent>
</Select>
<DraftHint :kind="POLICY" path="notify_min_severity" />
</div>
</SettingRow>
<SettingRow label="Webhook signing secret" hint="Signs each payload in X-Archie-Signature. Not set sends unsigned.">
<div class="flex flex-wrap items-center gap-3"><SecretRefField v-if="policy.notify_secret" v-model="policy.notify_secret" id-prefix="task-notify-secret" /><Button v-else variant="outline" size="sm" @click="policy.notify_secret = { engine: '', key: '' }">Set reference</Button><DraftHint :kind="POLICY" path="notify_secret" /></div>
</SettingRow>
</template>
<template v-if="limits">
<SettingRow label="Task time limit" for="te-task" hint="Parked after this. 0 disables.">