mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
87 lines
4.4 KiB
TypeScript
87 lines
4.4 KiB
TypeScript
import { IconInfo } from '@hanzo/icons'
|
||
import { Checkbox, SegmentedButton, Tooltip } from '@hanzo/elements'
|
||
|
||
import { AlertFormType } from 'products/alerts/frontend/logic/alertFormLogic'
|
||
|
||
interface InvestigationAgentSettingsProps {
|
||
alertForm: AlertFormType
|
||
onSetAlertFormValue: <K extends keyof AlertFormType>(key: K, value: AlertFormType[K]) => void
|
||
}
|
||
|
||
export function InvestigationAgentSettings({
|
||
alertForm,
|
||
onSetAlertFormValue,
|
||
}: InvestigationAgentSettingsProps): JSX.Element {
|
||
return (
|
||
<div className="deprecated-space-y-2">
|
||
<div className="flex items-center gap-1">
|
||
<h4 className="m-0">Investigation agent</h4>
|
||
<Tooltip
|
||
title="An optional AI agent that investigates anomaly fires against this insight's own data. It runs read-only InsightsQL queries, looks at the metric chart, and writes its findings to a notebook linked from the alert history. You can also have it gate notifications so false positives don't page you."
|
||
placement="right"
|
||
delayMs={0}
|
||
>
|
||
<IconInfo />
|
||
</Tooltip>
|
||
</div>
|
||
<div className="flex flex-wrap items-center gap-x-6 gap-y-2">
|
||
<Checkbox
|
||
data-attr="alertForm-investigation-agent-enabled"
|
||
checked={!!alertForm.investigation_agent_enabled}
|
||
onChange={(checked) => onSetAlertFormValue('investigation_agent_enabled', checked)}
|
||
label={
|
||
<span className="flex items-center gap-1">
|
||
Run investigation agent when this alert fires
|
||
<Tooltip
|
||
title="On the transition to firing, an agent validates the anomaly with read-only queries, writes a notebook with its findings, and links it from the alert check history. Runs once per transition."
|
||
placement="right"
|
||
delayMs={0}
|
||
>
|
||
<IconInfo />
|
||
</Tooltip>
|
||
</span>
|
||
}
|
||
/>
|
||
<Checkbox
|
||
data-attr="alertForm-investigation-gates-notifications"
|
||
checked={!!alertForm.investigation_gates_notifications}
|
||
onChange={(checked) => onSetAlertFormValue('investigation_gates_notifications', checked)}
|
||
disabledReason={
|
||
!alertForm.investigation_agent_enabled ? 'Enable the investigation agent first' : undefined
|
||
}
|
||
label={
|
||
<span className="flex items-center gap-1">
|
||
Wait for the verdict before notifying
|
||
<Tooltip
|
||
title="Notifications are delayed ~30–90s while the agent investigates. False-positive verdicts are suppressed. A safety-net task force-fires after a few minutes if the investigation stalls, so real fires can't be silently missed."
|
||
placement="right"
|
||
delayMs={0}
|
||
>
|
||
<IconInfo />
|
||
</Tooltip>
|
||
</span>
|
||
}
|
||
/>
|
||
</div>
|
||
{alertForm.investigation_agent_enabled && alertForm.investigation_gates_notifications && (
|
||
<div className="flex flex-wrap items-center gap-2 text-sm text-secondary">
|
||
<span>On inconclusive verdict</span>
|
||
<SegmentedButton
|
||
size="xsmall"
|
||
value={alertForm.investigation_inconclusive_action ?? 'notify'}
|
||
onChange={(value) => onSetAlertFormValue('investigation_inconclusive_action', value)}
|
||
options={[
|
||
{
|
||
value: 'notify',
|
||
label: 'Notify',
|
||
tooltip: 'Safe default because an unsure agent is itself signal.',
|
||
},
|
||
{ value: 'suppress', label: 'Suppress', tooltip: 'Only notify on true positives.' },
|
||
]}
|
||
/>
|
||
</div>
|
||
)}
|
||
</div>
|
||
)
|
||
}
|