TenantAtlas/specs/115-baseline-operability-alerts/contracts/baseline-alert-events.openapi.yaml
ahmido fdfb781144 feat(115): baseline operability + alerts (#140)
Implements Spec 115 (Baseline Operability & Alert Integration).

Key changes
- Baseline compare: safe auto-close of stale baseline findings (gated on successful/complete compares)
- Baseline alerts: `baseline_high_drift` + `baseline_compare_failed` with dedupe/cooldown semantics
- Workspace settings: baseline severity mapping + minimum severity threshold + auto-close toggle
- Baseline Compare UX: shared stats layer + landing/widget consistency

Notes
- Livewire v4 / Filament v5 compatible.
- Destructive-like actions require confirmation (no new destructive actions added here).

Tests
- `vendor/bin/sail artisan test --compact tests/Feature/Baselines/ tests/Feature/Alerts/`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #140
2026-03-01 02:26:47 +00:00

71 lines
2.0 KiB
YAML

openapi: 3.1.0
info:
title: TenantPilot Baseline Alert Events
version: 1.0.0
description: |
Domain contract for baseline-related alert events produced during alerts evaluation.
This repo dispatches events internally (not a public HTTP API).
paths: {}
components:
schemas:
AlertEventBase:
type: object
required: [event_type, tenant_id, severity, fingerprint_key, title, body, metadata]
properties:
event_type:
type: string
tenant_id:
type: integer
minimum: 1
severity:
type: string
enum: [low, medium, high, critical]
fingerprint_key:
type: string
minLength: 1
title:
type: string
body:
type: string
metadata:
type: object
additionalProperties: true
BaselineHighDriftEvent:
allOf:
- $ref: '#/components/schemas/AlertEventBase'
- type: object
properties:
event_type:
const: baseline_high_drift
metadata:
type: object
required: [finding_id, finding_fingerprint, change_type]
properties:
finding_id:
type: integer
minimum: 1
finding_fingerprint:
type: string
minLength: 1
change_type:
type: string
enum: [missing_policy, different_version, unexpected_policy]
BaselineCompareFailedEvent:
allOf:
- $ref: '#/components/schemas/AlertEventBase'
- type: object
properties:
event_type:
const: baseline_compare_failed
severity:
const: high
metadata:
type: object
required: [operation_run_id]
properties:
operation_run_id:
type: integer
minimum: 1