AIFACTORY-FEAT-067: AlertRuleService: complete delivery¶
Generated from the architecture model
This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.
A design artefact, not a tracker
This backlog is generated from model/backlog/ and validated against the architecture model. No work item exists in any tracker, and no item carries a date, an estimate or an assignee (ADR-0029).
Epic Observability (PF-13) · Increment I4 Trust and accountability · State elaborated · Route backend-developer · Build order 130 of 185 (Factory code)
AlertRuleService is the service of bounded context BC-21 (Operations). Alert rules over SLO breaches, host health, uncertain tool effects, audit findings and metric conditions, with deduplication, severity, acknowledgement and routing to the Studio, chat and email connectors and, later, incidents (BC-21). Its own repository is ConnectSoft.AI.SoftwareFactory.AlertRuleService.
| Delivers | AlertRuleService (complete) |
| Stubs | — |
| Realizes | adrs: ADR-0018 |
| Requirements | FR-10, FUX-04, NFR-10, NFR-17, XL-06, XL-16 |
| Depends on | — |
| Sources | model/services/observability/AlertRuleService.yaml |
Scenarios to trace (8, catalog): SCN-AlertRuleService-001 ✓, SCN-AlertRuleService-002 ✓, SCN-AlertRuleService-003 ✓, SCN-AlertRuleService-004 ✓, SCN-AlertRuleService-005 ✓, SCN-AlertRuleService-006 ✓, SCN-AlertRuleService-007 ✓, SCN-AlertRuleService-008 ✓
AIFACTORY-US-087: AlertRuleService serves its scope end to end¶
behavior · persona operator
As an operator, I want AlertRuleService in place as the one owner of alert rules and alert instances, with deduplication, severity, acknowledgement and routing to the Studio and, later, to chat and email connectors, so that every other service reaches alert state through the contract of AlertRuleService and none keeps a copy of it.
This is the integration PBI of the feature. AlertRuleService is the service of bounded context BC-21 (Operations) and the one place an operator is told that something needs them. It owns two aggregates in alert-rule-sql: AlertRule, a rule with a source kind, a condition, a severity, a deduplication key template, routes and suppression windows, and AlertInstance, one fired alert with its deduplication key, severity, source reference, state, acknowledgement and resolution. Callers reach its five REST operations through the route GW-03 of the gateway ObservabilityHost, which forwards the user token (D117), under the scopes factory.operations.read, factory.operations.operate and factory.operations.admin; every query runs under the tenant row filter, and an alert of another tenant is answered 404, the same answer as for an id that does not exist (ADR-0015, D113). The behaviour is delivered by the behaviour PBIs of this feature: rules are set and listed (AIFACTORY-US-1116), alerts fire deduplicated from the operations sources (AIFACTORY-US-1117), from metric conditions (AIFACTORY-US-1118) and from the delivery and runtime sources (AIFACTORY-US-1119), an operator lists, acknowledges and resolves them (AIFACTORY-US-1120), the Notifier delivers them (AIFACTORY-US-1121) and the retention and deletion orders of RetentionResidencyService are applied (AIFACTORY-US-1122). Every state change and its outbox record commit in one transaction and the three events leave through the outbox of the alert-rule messaging profile under the canonical envelope (ADR-0012, ADR-0014, ADR-0028). Of the 17 consumed events of the model, three come from producers of later increments: DeliveryFailed of ConnectorRegistryService arrives with feature connector-registry-service-complete in I5, and IncidentOpened of FleetIncidentService and RolloutHalted of FleetRolloutService arrive in I7; this feature registers no handler for them, and which feature registers them is reported to the owner. Telemetry follows the conventions of feature component-observability-factory-conventions, taken by the version pin of its packages and never forked. Repository: ConnectSoft.AI.SoftwareFactory.AlertRuleService, created by the repository checklist of feature repository-and-pipeline-conventions from the base template with the Factory profile.
Acceptance criteria
| AC1 | Given the repository ConnectSoft.AI.SoftwareFactory.AlertRuleService, whose first commit is the unchanged output of dotnet new connectsoft-base -n ConnectSoft.AI.SoftwareFactory.AlertRuleService --UseFactoryProfile true from the pinned template package, when its pipeline runs with the work of this feature, then no second scaffold was run, the solution builds, the unit and acceptance tests pass and a container image is published (ADR-0028). |
| AC2 | Given the acceptance suites of AIFACTORY-US-1116 to AIFACTORY-US-1122, when they run in the pipeline, then each of the eight scenarios of AlertRuleService has a passing test that names its id, and a filter that discovers no test counts as a failure (model/scenarios/AlertRuleService.yaml). |
| AC3 | Given alerts and rules of two tenants, when any of AlertRuleService/ListAlerts, AlertRuleService/ListAlertRules, AlertRuleService/AcknowledgeAlert, AlertRuleService/ResolveAlert or AlertRuleService/SetAlertRule is called by a member of one tenant, then only the rows of that tenant are read or written, and an alert of the other tenant addressed by id is answered 404, the same answer as for an id that does not exist (ADR-0015). |
| AC4 | Given the outbox and the inbox of the alert-rule messaging profile after the acceptance suites, when their records are read, then AlertRuleService/AlertRuleChanged, AlertRuleService/AlertFired and AlertRuleService/AlertResolved were each written in the transaction of the state change they announce and published under the canonical envelope, and every consumed event was handled once per event id (ADR-0012, ADR-0014). |
| AC5 | Given the service starts, when liveness and readiness are probed, then readiness reports alert-rule-sql and the messaging transport with the ready tag, the telemetry conformance test of the pinned observability packages passes with connectsoft.factory.alerts.fired tagged with tenant, source kind and severity, connectsoft.factory.alerts.open and connectsoft.factory.alerts.time_to_acknowledge tagged with tenant and severity, and connectsoft.factory.alerts.inbox_lag tagged with service, as model/services/observability/AlertRuleService.yaml declares, and no rule condition, source payload or receipt content appears in a metric, an activity or a log record (ADR-0018). |
| Traces: services | AlertRuleService, ObservabilityHost |
| Traces: aggregates | AlertRuleService/AlertRule, AlertRuleService/AlertInstance |
| Traces: apis | AlertRuleService/ListAlerts, AlertRuleService/AcknowledgeAlert, AlertRuleService/ResolveAlert, AlertRuleService/ListAlertRules, AlertRuleService/SetAlertRule |
| Traces: events | AlertRuleService/AlertRuleChanged, AlertRuleService/AlertFired, AlertRuleService/AlertResolved |
| Traces: adrs | ADR-0012, ADR-0014, ADR-0015, ADR-0018, ADR-0028 |
| Traces: requirements | FR-10, FUX-04, XL-06, XL-16 |
| Relates: screens | alerts |
| Relates: nfrs | NFR-10, NFR-17 |
| Depends on | AIFACTORY-US-1116, AIFACTORY-US-1117, AIFACTORY-US-1118, AIFACTORY-US-1119, AIFACTORY-US-1120, AIFACTORY-US-1121, AIFACTORY-US-1122, feature:observability-host, feature:repository-and-pipeline-conventions, feature:component-base-template-factory-profile, feature:contracts-package, feature:component-observability-factory-conventions |
| Sources | model/services/observability/AlertRuleService.yaml, model/scenarios/AlertRuleService.yaml, docs/planes/trust-operations/observability/services/alert-rule-service/index.md#purpose-and-responsibilities, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-472 Create the repository ConnectSoft.AI.SoftwareFactory.AlertRuleService and scaffold it from the ConnectSoft.BaseTemplate template with the Factory profile |
implementation | The repository exists by the repository checklist of feature repository-and-pipeline-conventions, the output of dotnet new connectsoft-base -n ConnectSoft.AI.SoftwareFactory.AlertRuleService --UseFactoryProfile true from the pinned template package is committed unchanged with the messaging service name alert-rule, the repository records the template version, the solution builds and the template tests pass in the repository pipeline, which publishes the container image. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-473 Domain model: AlertRule, AlertInstance |
implementation | The aggregates hold the fields, the invariants and the four modelled transitions of AlertState (Fired to Acknowledged, Fired to Resolved, Acknowledged to Resolved, Fired to Suppressed); unit tests cover every invariant and every transition and refuse every transition the model does not list. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-474 Persistence in alert-rule-sql: AlertRules, AlertInstances |
implementation | Mappings and migrations for the two modelled tables with the tenant filter, the unique index on tenant and name and the open-deduplication index; mapping tests run against an isolated test database, never a shared one. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-475 API hosting skeleton: the 5 REST operations with scope enforcement and problem responses |
implementation | ListAlerts, AcknowledgeAlert, ResolveAlert, ListAlertRules and SetAlertRule are hosted with JWT validation of the token the gateway forwards, scope enforcement per route, problem responses for every modelled refusal code and the OpenAPI document; the behaviour of each operation is delivered by AIFACTORY-US-1116 and AIFACTORY-US-1120, not here. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-476 Messaging skeleton: outbox and inbox of the alert-rule profile for 3 published and 14 consumed events |
implementation | The outbox writer enlists in the transaction of each state change and the dispatcher publishes AlertRuleChanged, AlertFired and AlertResolved under the canonical envelope; the inbox registers the 14 consumed events whose producers are delivered by I4 with idempotency on the event id; DeliveryFailed, IncidentOpened and RolloutHalted are not registered; what each handler does is delivered by the behaviour PBIs of this feature. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-477 Worker hosting skeleton: triggers, partitioning and retry policies of MetricRuleEvaluator and Notifier |
implementation | The two workers are hosted with their modelled triggers (a schedule every minute, the AlertFired event), retry policies, partitioning by tenant and idempotency keys (ruleId plus minute, alertId plus route), and a duplicate trigger has no second effect; what each worker does is delivered by AIFACTORY-US-1118 and AIFACTORY-US-1121. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-478 Security, tenancy and telemetry of AlertRuleService |
implementation | The three scopes and four roles of the model are enforced, every query is tenant-filtered, the messaging transport secret comes from a secret reference, the host makes the one call of the registration of the pinned observability packages, creates the four modelled metrics through its instrument helper and references the conformance test package from its architecture tests. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-768 Verify alert-rule-service-serves-its-scope by running the declared command |
verification | Run dotnet build -c Release and dotnet test -c Release --no-build in the pipeline of ConnectSoft.AI.SoftwareFactory.AlertRuleService, then dotnet test -c Release --filter "Category=Acceptance&Scenario~SCN-AlertRuleService"; a filter that discovers no test counts as a failure; they pass and prove AC1 to AC5 of AIFACTORY-US-087, with a test for each of SCN-AlertRuleService-001 to SCN-AlertRuleService-008. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1116: Set a tenant alert rule with its routes and list the rules in scope¶
behavior · persona workspace-admin
As a workspace admin, I want to create, change and deactivate the alert rules of my tenant and see every rule that applies to it, so that the alerts my operators receive follow rules I can read and change, beside the platform rules that are always on.
A Workspace admin or a Platform admin whose scope carries factory.operations.admin creates or changes a rule of the trusted tenant through AlertRuleService/SetAlertRule, a PUT on /factory/alert-rules/{name}. The body carries the source kind (AlertSourceKind), the condition, an event filter or a metric threshold with a duration, the severity (AlertSeverity), the deduplication key template, the routes and the optional suppression windows, and whether the rule is active. The rule is addressed by its name within the tenant of the token, which the unique index on tenant and name enforces, so a PUT never reaches a rule of another tenant: the same name in another tenant is another rule. A new name creates the rule, a known name changes it, and a body that sets active false deactivates it; each of these writes the AlertRule and its AlertRuleChanged outbox record with ruleId, tenantId, name and active in one transaction and answers 200. The operation is naturally idempotent: a repeat with the same body changes nothing and publishes nothing. Two invariants of the model refuse a write: a route to an external channel names a connector of the Integration platform with the tenant connection and never a raw webhook, and the platform rules for host health, chain validity and uncertain effects stay active and cannot be deleted per tenant. The model lists only 200 and 403 for this operation, so the status of these two refusals is reported to the owner; they write nothing and publish nothing. A caller without the scope is refused with 403. A caller whose scope carries factory.operations.read lists the rules of its tenant through AlertRuleService/ListAlertRules, read under the tenant row filter; a caller without the scope is refused with 403. StudioBff and AuditService consume AlertRuleChanged in their own PBIs.
Acceptance criteria
| AC1 | Given a caller with factory.operations.admin and a valid rule body for a name unknown in the trusted tenant, when AlertRuleService/SetAlertRule is called, then the response is 200, one AlertRuleService/AlertRule row exists for the tenant and the name with the source kind, condition, severity, deduplication key template, routes and suppression of the body, and the AlertRuleService/AlertRuleChanged outbox record is written in the same transaction; a second call with a changed severity changes the row and writes a second record, a call with active false deactivates it, and a repeat of the same body changes nothing and writes no record (SCN-AlertRuleService-005). |
| AC2 | Given a caller without factory.operations.admin, or a body with a route to an external channel that names no connector, or a body that deactivates a platform rule, when AlertRuleService/SetAlertRule is called, then the first is refused with 403 and the other two with a problem response, and in each case no row is written and nothing is published; given a rule with the same name in another tenant, then the call of the first tenant creates its own rule and leaves the other untouched (SCN-AlertRuleService-005, ADR-0015). |
| AC3 | Given rules of two tenants, when AlertRuleService/ListAlertRules is called with factory.operations.read, then the response is 200 with the rules of the trusted tenant only, each with name, source kind, severity, routes and whether it is active, and nothing is written; a caller without the scope is refused with 403 (SCN-AlertRuleService-004, ADR-0015). |
| AC4 | Given a rule was created, changed or deactivated, when the outbox dispatcher publishes AlertRuleService/AlertRuleChanged on operations.alerts.v1.alert-rule-changed, then the event is sent under the canonical envelope with ruleId, tenantId, name and active, and a transport outage is retried with backoff so the event is neither lost nor duplicated under its event id (SCN-AlertRuleService-006, ADR-0012). |
| Traces: services | AlertRuleService |
| Traces: aggregates | AlertRuleService/AlertRule |
| Traces: apis | AlertRuleService/SetAlertRule, AlertRuleService/ListAlertRules |
| Traces: events | AlertRuleService/AlertRuleChanged |
| Traces: adrs | ADR-0012, ADR-0014, ADR-0015 |
| Traces: requirements | FR-10, FUX-04 |
| Traces: scenarios | SCN-AlertRuleService-004, SCN-AlertRuleService-005, SCN-AlertRuleService-006 |
| Relates: screens | alerts |
| Sources | model/services/observability/AlertRuleService.yaml, docs/planes/trust-operations/observability/services/alert-rule-service/index.md#apis |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-4471 SetAlertRule and ListAlertRules with the rule invariants and the AlertRuleChanged outbox record |
implementation | SetAlertRule creates, changes or deactivates the rule of the trusted tenant addressed by name, writes the AlertRule and its AlertRuleChanged outbox record in one transaction, changes and publishes nothing on a repeat of the same body, refuses a route to an external channel that names no connector and the deactivation of a platform rule with a problem response, and answers 403 without the scope; ListAlertRules returns the rules of the tenant under the row filter and answers 403 without the scope. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4472 Contract of the rule body and of the AlertRuleChanged event |
contract | The OpenAPI document describes the rule body of SetAlertRule and the rule list of ListAlertRules with the AlertSourceKind and AlertSeverity values of model/services/observability/AlertRuleService.yaml, and the contracts package carries AlertRuleChanged with ruleId, tenantId, name and active on its modelled topic. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4473 Verify alert-rules-set-and-listed through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&(Scenario=SCN-AlertRuleService-004\|Scenario=SCN-AlertRuleService-005\|Scenario=SCN-AlertRuleService-006)"; a zero-match filter counts as a failure; the tests prove AC1 to AC4 of AIFACTORY-US-1116 over a two-tenant fixture, including the repeat that publishes nothing, the two invariant refusals and the payload of AlertRuleChanged; consumer handling is proven by the suites of StudioBff and AuditService. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1117: Fire one deduplicated alert from an SLO breach, a health change, an uncertain tool effect or an audit finding, and resolve it on recovery¶
behavior · persona operator
As an operator, I want one alert per problem, however often its source reports it, and the alert closed when the source recovers, so that I am told once that something needs me and the list of open alerts shows what is still wrong.
Five inbox handlers turn the events of the operations sources into alert instances, each idempotent on the event id. FireFromSlo handles SloBreached of SloService (a breach or a fast burn), FireFromHealth handles ServiceHealthChanged of SloService (a host degradation), FireFromUncertain handles ToolEffectUncertain of ToolAdapterService (an effect that needs an operator), and FireFromFinding handles FindingRaised of AuditService (findings of severity High and Critical). Each handler selects the active rules of the tenant of the event whose source kind and condition match it, the platform rules among them, computes the deduplication key from the key template of the rule and the event, and keeps the source reference: the SLO id, the host id, the invocation id or the finding id. When no instance with that key is Fired or Acknowledged, it writes a new AlertInstance in state Fired with the severity of the rule and firedAt, and writes AlertFired with alertId, tenantId, ruleId, severity, sourceRef and dedupKey in the same transaction; when one is open, it fires nothing and counts the occurrence on it (the invariant of the model, whose occurrence count has no field in the model and is reported as a correction). Within the suppression after a resolution, Observability:Alerts:DefaultSuppressionMinutes unless the rule names its own, an event for the same key opens no instance; a Fired instance whose rule enters a suppression window moves to Suppressed through the trigger SuppressionWindow and is not delivered. Resolution is automatic on the recovery event of the source: ResolveFromSlo handles SloRecovered and moves the open instance of that SLO from Fired or Acknowledged to Resolved through SourceRecovered or SourceRecoveredOrManual, sets resolvedAt and writes AlertResolved without resolvedBy, which is optional. The model gives health no resolve handler: FireFromHealth has the purpose of host health degradations only, so this PBI applies the invariant that resolution is automatic on the recovery event of the source through FireFromHealth itself, and a ServiceHealthChanged whose toState is Healthy resolves the open health instance of that host the same way; the owner is asked to confirm this reading. The handlers of the SloService events are built against the event contract of model/services/observability/SloService.yaml, because feature slo-service depends on this one; the breach that raises one alert end to end is proven by AIFACTORY-US-044. connectsoft.factory.alerts.fired counts by tenant, source kind and severity and connectsoft.factory.alerts.open moves with every open and close. StudioBff, StudioNotificationService and StudioRealtimeGateway consume AlertFired in their own PBIs and FleetIncidentService in I7; DashboardService declares the handler ProjectAlertInstance, which feature dashboard-service does not register while the owner decides the projections the model does not hold.
Acceptance criteria
| AC1 | Given an active rule for uncertain effects in a tenant and ToolAdapterService/ToolEffectUncertain of that tenant, when FireFromUncertain handles it, then one AlertRuleService/AlertInstance in state Fired exists with the deduplication key of the template, the severity of the rule and the invocation id as sourceRef, and the AlertRuleService/AlertFired outbox record is written in the same transaction; a redelivery of the same event id writes nothing (SCN-AlertRuleService-007). |
| AC2 | Given an open instance for a deduplication key, when a further event of the same source yields the same key, as a repeated breach of the same SLO through FireFromSlo or a repeated AuditService/FindingRaised through FireFromFinding, then no second instance and no second AlertRuleService/AlertFired are written and the occurrence is counted on the open instance; a finding below High fires nothing; within the suppression after a resolution an event for that key opens no instance, and a Fired instance whose rule enters a suppression window moves to Suppressed (model/services/observability/AlertRuleService.yaml). |
| AC3 | Given an open instance fired by a breach, when ResolveFromSlo handles the recovery event of the same SLO, then the instance moves to Resolved from Fired or from Acknowledged with resolvedAt set and the AlertRuleService/AlertResolved outbox record is written without resolvedBy; given a health instance, a ServiceHealthChanged of that host with toState Healthy, handled by FireFromHealth under the resolution invariant, resolves it the same way (model/services/observability/SloService.yaml). |
| AC4 | Given an instance fired, when the outbox dispatcher publishes AlertRuleService/AlertFired on operations.alerts.v1.alert-fired, then the event is sent under the canonical envelope with alertId, tenantId, ruleId, severity, sourceRef and dedupKey, and a transport outage is retried with backoff so the event is neither lost nor duplicated under its event id (SCN-AlertRuleService-007, ADR-0012). |
| Traces: services | AlertRuleService, ToolAdapterService, AuditService |
| Traces: aggregates | AlertRuleService/AlertRule, AlertRuleService/AlertInstance |
| Traces: events | AlertRuleService/AlertFired, AlertRuleService/AlertResolved, ToolAdapterService/ToolEffectUncertain, AuditService/FindingRaised |
| Traces: adrs | ADR-0012, ADR-0014 |
| Traces: requirements | FR-10, XL-06 |
| Traces: scenarios | SCN-AlertRuleService-007 |
| Relates: screens | alerts |
| Depends on | AIFACTORY-US-1116, feature:tool-adapter-service, feature:audit-service-complete |
| Sources | model/services/observability/AlertRuleService.yaml, model/services/observability/SloService.yaml, docs/planes/trust-operations/observability/services/alert-rule-service/index.md#sagas-and-long-running-flows |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-547 Alert rules with deduplication and suppression |
implementation | A rule matcher selects the active rules of the tenant by source kind and condition, computes the deduplication key from the template, opens one AlertInstance per key while none is Fired or Acknowledged, counts a repeated occurrence on the open instance, opens nothing within the suppression after a resolution and moves a Fired instance to Suppressed when its rule enters a suppression window. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4474 Inbox handlers FireFromSlo, ResolveFromSlo, FireFromHealth, FireFromUncertain and FireFromFinding |
implementation | Each handler maps its event to the source kind and the source reference, fires through the rule matcher or resolves the open instance of the source through SourceRecovered or SourceRecoveredOrManual, writes AlertFired or AlertResolved in the transaction of the change, fires nothing for a finding below High, is idempotent on the event id and moves connectsoft.factory.alerts.fired and connectsoft.factory.alerts.open. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4475 Source events built from the pinned contracts package for the firing suite |
fixture | A fixture builds SloBreached, SloRecovered and ServiceHealthChanged from the contract of model/services/observability/SloService.yaml, ToolEffectUncertain and FindingRaised from the pinned contracts package, and delivers each once and twice under the same event id. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4476 Verify alerts-fire-deduplicated-from-operations-sources through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&Scenario=SCN-AlertRuleService-007"; a zero-match filter counts as a failure; the tests prove AC1 to AC4 of AIFACTORY-US-1117: one instance per key, the counted repeat, the suppression, the automatic resolution and the publication and payload of AlertFired; consumer handling is proven by the suites of the consumers. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1118: Evaluate metric-threshold rules every minute against the telemetry backend and fire or resolve their alerts¶
behavior · persona operator
As an operator, I want rules on metric conditions evaluated on a schedule against the telemetry backend, so that a condition no event announces still reaches me as an alert and closes when it clears.
The MetricRuleEvaluator worker runs every minute and evaluates the active rules of source kind Metric, partitioned by tenant with at most four in parallel. For each rule it queries the telemetry backend (ext-otel-backend, sync HTTP, required, degrade) with the metric threshold and the duration of the condition. When the condition holds for its duration, it fires through the rule matcher of AIFACTORY-US-1117: one AlertInstance per deduplication key, the metric query as sourceRef, and AlertFired written in the same transaction. When the condition no longer holds, it resolves the open instance of that rule and key through SourceRecovered or SourceRecoveredOrManual and writes AlertResolved without resolvedBy. The worker is idempotent on the rule id and the minute, so a duplicate trigger in the same minute evaluates nothing twice. A query that fails is attempted twice in all with the modelled fixed backoff of 30 seconds; when the backend stays unavailable, the rule is skipped for that minute, no instance is fired or resolved from a missing value, the failure is logged with the rule id and without content, and the next minute evaluates again. The rule conditions and the query results never enter a metric, an activity or a log record.
Acceptance criteria
| AC1 | Given an active rule of source kind Metric whose threshold holds for its duration in the fake telemetry backend, when MetricRuleEvaluator runs, then one AlertRuleService/AlertInstance in state Fired exists with the metric query as sourceRef and the AlertRuleService/AlertFired outbox record is written in the same transaction; a second run while the condition holds fires nothing more (model/services/observability/AlertRuleService.yaml). |
| AC2 | Given the condition of that rule no longer holds, when MetricRuleEvaluator runs, then the open instance moves to Resolved with resolvedAt set and the AlertRuleService/AlertResolved outbox record is written without resolvedBy; a duplicate trigger in the same minute changes nothing (model/services/observability/AlertRuleService.yaml). |
| AC3 | Given the telemetry backend answers errors, when MetricRuleEvaluator runs, then each query is attempted twice in all with the modelled fixed backoff, the rule is skipped for that minute without firing or resolving any AlertRuleService/AlertInstance, the failure is logged with the rule id and without the condition or any value, and the next run evaluates the rule again once the backend answers (ADR-0018). |
| Traces: services | AlertRuleService |
| Traces: aggregates | AlertRuleService/AlertInstance |
| Traces: events | AlertRuleService/AlertFired, AlertRuleService/AlertResolved |
| Traces: adrs | ADR-0018 |
| Traces: requirements | FR-10 |
| Depends on | AIFACTORY-US-1117 |
| Sources | model/services/observability/AlertRuleService.yaml, docs/planes/trust-operations/observability/services/alert-rule-service/index.md#workers-and-jobs |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-4477 MetricRuleEvaluator against the telemetry backend |
implementation | The worker evaluates the active Metric rules every minute per tenant through a typed client of the telemetry backend, fires or resolves through the rule matcher, is idempotent on the rule id and the minute, attempts a failed query twice in all with a 30 second backoff and skips the rule for the minute when the backend stays unavailable, logging the rule id without content. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4478 Fake telemetry backend for the metric rule suite |
fixture | A fake of the query endpoint of the telemetry backend answers configured series per query, can hold a value above a threshold for a duration, and can answer errors, so that the suite drives the condition and the outage. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4479 Verify metric-rules-evaluated-every-minute through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&Feature=MetricRules"; a zero-match filter counts as a failure; the tests prove AC1 to AC3 of AIFACTORY-US-1118 against the fake telemetry backend, including the duplicate trigger and the outage that fires and resolves nothing. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1119: Consume the promotion, worker pool, provisioning and drift events once each and fire their alerts once their source kinds are modelled¶
behavior · persona operator
As an operator, I want failed promotions and provisioning runs, worker pool trouble and drift of a release or an environment to reach me through the same alert rules, so that delivery and runtime problems are deduplicated, acknowledged and resolved like every other alert.
Six inbox handlers bind the delivery and runtime platforms of the earlier increments to the rules, each idempotent on the event id and each firing through the rule matcher of AIFACTORY-US-1117. Each maps its event to a source reference from its payload: FireFromPromotion takes promotionId of PromotionFailed of EnvironmentPromotionService and ResolveFromPromotion takes promotionId of RollbackCompleted, FireFromCapacity takes poolId of WorkerPoolStateChanged of ExecutionCapacityService, FireFromProvisioning takes provisioningRunId of ProvisioningFailed of IaCProvisioningService, and FireFromDrift takes targetReleaseId of DriftDetected of QualityScoreService and findingId of RuntimeDriftDetected of RuntimeEnvironmentService. The model gives AlertSourceKind the values Slo, Health, UncertainEffect, Finding, Metric and DeliveryFailure only, so no rule can name a promotion, capacity, provisioning, quality drift or runtime drift source. What I4 delivers and proves is therefore the idempotent no-fire path: each handler maps the event, selects the active rules of the tenant whose source kind matches its producer, finds none, records the event once per event id in the inbox and fires nothing, and a redelivery changes nothing. The firing and the resolution that the model purposes describe, an alert on a failed promotion resolved on the rollback, an alert on a pool state resolved when the pool leaves it, and the alerts on failed provisioning, quality drift and runtime drift, wait on the owner correction of AlertSourceKind in model/services/observability/AlertRuleService.yaml; their criteria below are marked as waiting on it, and their tests are listed and skipped with that reason until the correction is made. DeliveryFailed, IncidentOpened and RolloutHalted are not handled here because their producers arrive in I5 and I7.
Acceptance criteria
| AC1 | Given an active rule of every modelled source kind in a tenant and EnvironmentPromotionService/PromotionFailed, EnvironmentPromotionService/RollbackCompleted, ExecutionCapacityService/WorkerPoolStateChanged, IaCProvisioningService/ProvisioningFailed, QualityScoreService/DriftDetected and RuntimeEnvironmentService/RuntimeDriftDetected of that tenant, when their handlers consume them, then each event is recorded in the inbox once per event id with the source reference mapped from its payload, no rule matches, no AlertRuleService/AlertInstance is written and no AlertRuleService/AlertFired or AlertRuleService/AlertResolved is published, and a redelivery of the same event id changes nothing (model/services/observability/AlertRuleService.yaml). |
| AC2 | Waiting on the owner correction of AlertSourceKind: given an active rule bound to failed promotions and EnvironmentPromotionService/PromotionFailed of that tenant, when FireFromPromotion handles it, then one AlertRuleService/AlertInstance in state Fired exists with the promotion id as sourceRef and the AlertRuleService/AlertFired outbox record is written; when EnvironmentPromotionService/RollbackCompleted of the same promotion is handled by ResolveFromPromotion, then the instance moves to Resolved and AlertRuleService/AlertResolved is written (model/services/observability/AlertRuleService.yaml). |
| AC3 | Waiting on the owner correction of AlertSourceKind: given a rule bound to the state of a worker pool, when FireFromCapacity handles ExecutionCapacityService/WorkerPoolStateChanged into a state the rule names, then an instance fires with the pool id as sourceRef, and when a later change of the same pool leaves that state, then the open instance is resolved (model/services/runtime-cloud/ExecutionCapacityService.yaml). |
| AC4 | Waiting on the owner correction of AlertSourceKind: given rules bound to failed provisioning, quality drift and runtime drift, when IaCProvisioningService/ProvisioningFailed, QualityScoreService/DriftDetected and RuntimeEnvironmentService/RuntimeDriftDetected are handled, then each fires one deduplicated instance with the provisioning run id, the release id and the drift finding id as sourceRef, and a repeated event with the same key counts an occurrence and fires nothing more (model/services/observability/AlertRuleService.yaml). |
| Traces: services | AlertRuleService, EnvironmentPromotionService, ExecutionCapacityService, IaCProvisioningService, QualityScoreService, RuntimeEnvironmentService |
| Traces: aggregates | AlertRuleService/AlertInstance |
| Traces: events | AlertRuleService/AlertFired, AlertRuleService/AlertResolved, EnvironmentPromotionService/PromotionFailed, EnvironmentPromotionService/RollbackCompleted, ExecutionCapacityService/WorkerPoolStateChanged, IaCProvisioningService/ProvisioningFailed, QualityScoreService/DriftDetected, RuntimeEnvironmentService/RuntimeDriftDetected |
| Traces: adrs | ADR-0012 |
| Traces: requirements | FR-10, XL-06 |
| Depends on | AIFACTORY-US-1117, feature:environment-promotion-service, feature:execution-capacity-service-complete, feature:ia-cprovisioning-service, feature:quality-score-service-complete, feature:runtime-environment-service |
| Sources | model/services/observability/AlertRuleService.yaml, model/services/runtime-cloud/ExecutionCapacityService.yaml |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-4480 Inbox handlers FireFromPromotion, ResolveFromPromotion, FireFromCapacity, FireFromProvisioning and FireFromDrift |
implementation | Each handler maps its event to the source reference of its payload (promotionId for PromotionFailed and RollbackCompleted, poolId for WorkerPoolStateChanged, provisioningRunId for ProvisioningFailed, targetReleaseId for DriftDetected, findingId for RuntimeDriftDetected), selects the active rules of the tenant whose source kind matches its producer through the rule matcher, records the event once per event id in the inbox, and on no match writes no AlertInstance and publishes nothing; a redelivered event id changes nothing. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4481 Verify alerts-fire-from-delivery-and-runtime-sources through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&Feature=DeliveryAndRuntimeSources"; a zero-match filter counts as a failure; the tests prove AC1 of AIFACTORY-US-1119 with the six events built from the pinned contracts package against rules of every modelled source kind, including the redelivered event id that changes nothing; the tests of AC2 to AC4 are present in the suite, each skipped with the reason that names the owner correction of AlertSourceKind, so that none of them is silently absent. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1120: List the alerts of my tenant, acknowledge one and resolve it by hand with a reason¶
behavior · persona operator
As an operator, I want to see the alerts of my tenant by state and severity, acknowledge the one I take and resolve it with a reason when it is handled, so that everyone sees who owns an alert and why it was closed.
A caller whose scope carries factory.operations.read lists the alert instances of the trusted tenant through AlertRuleService/ListAlerts, filtered by state and severity, each with its rule, deduplication key, source reference, firedAt, acknowledgement, resolution and the deliveries recorded per route; the read runs under the tenant row filter and writes nothing. An Operator whose scope carries factory.operations.operate acknowledges an alert through AlertRuleService/AcknowledgeAlert on /factory/alerts/{alertId}/acknowledge: a Fired instance moves to Acknowledged through the trigger Acknowledge, acknowledgedBy takes the caller of the token, and connectsoft.factory.alerts.time_to_acknowledge records the time since firedAt; the model gives the command no result event, so an acknowledgement publishes nothing. The same Operator resolves an alert by hand through AlertRuleService/ResolveAlert with a reason: an Acknowledged instance moves to Resolved through SourceRecoveredOrManual, resolvedAt is set and AlertResolved with alertId, tenantId and resolvedBy, the caller, is written in the same transaction. The model has no manual transition from Fired, so a Fired alert is acknowledged first, and the reason has no field in AlertInstance, which is reported as a correction of the model. Both operations are naturally idempotent: acknowledging an Acknowledged alert and resolving a Resolved one return 200 and change nothing. An alert that is Resolved or Suppressed has no Acknowledge transition and a Fired or Suppressed alert has no manual Resolve transition; the model lists 200, 403 and 404 only, so the status of these refusals is reported to the owner, and they change nothing. A caller without the scope is refused with 403; an alert of another tenant is answered 404, the same answer as for an id that does not exist (ADR-0015, D113). StudioBff and StudioRealtimeGateway consume AlertResolved in their own PBIs; DashboardService declares the handler ProjectAlertInstance, which feature dashboard-service does not register while the owner decides the projections the model does not hold.
Acceptance criteria
| AC1 | Given open and resolved alerts of two tenants and of several severities, when AlertRuleService/ListAlerts is called with factory.operations.read and a state and severity filter, then the response is 200 with the instances of the trusted tenant that match, each with rule, key, source reference, state, acknowledgement and deliveries, and nothing is written; a caller without the scope is refused with 403 (SCN-AlertRuleService-001, ADR-0015). |
| AC2 | Given a Fired alert of my tenant, when AlertRuleService/AcknowledgeAlert is called with factory.operations.operate, then the response is 200, the AlertRuleService/AlertInstance is Acknowledged with acknowledgedBy set to the caller, the time to acknowledge is recorded and no event is published; a repeat returns 200 and changes nothing (SCN-AlertRuleService-002). |
| AC3 | Given an Acknowledged alert of my tenant, when AlertRuleService/ResolveAlert is called with a reason, then the response is 200, the instance is Resolved with resolvedAt set and the AlertRuleService/AlertResolved outbox record with resolvedBy is written in the same transaction; given a Fired or Suppressed alert asked to resolve, or a Resolved or Suppressed alert asked to acknowledge, then nothing changes and nothing is published (status code open, see open_questions) (SCN-AlertRuleService-003). |
| AC4 | Given a caller without factory.operations.operate, an alert id of another tenant or an id that does not exist, when AlertRuleService/AcknowledgeAlert or AlertRuleService/ResolveAlert is called, then the response is 403 for the missing scope and 404 for the foreign and the unknown id alike, with a problem response and no state change (SCN-AlertRuleService-002, SCN-AlertRuleService-003, ADR-0015). |
| AC5 | Given an alert was resolved by hand or automatically, when the outbox dispatcher publishes AlertRuleService/AlertResolved on operations.alerts.v1.alert-resolved, then the event is sent under the canonical envelope with alertId, tenantId and, for a manual resolution, resolvedBy, and a transport outage is retried with backoff so the event is neither lost nor duplicated under its event id (SCN-AlertRuleService-008, ADR-0012). |
| Traces: services | AlertRuleService |
| Traces: aggregates | AlertRuleService/AlertInstance |
| Traces: apis | AlertRuleService/ListAlerts, AlertRuleService/AcknowledgeAlert, AlertRuleService/ResolveAlert |
| Traces: events | AlertRuleService/AlertResolved |
| Traces: adrs | ADR-0012, ADR-0014, ADR-0015 |
| Traces: requirements | FR-10, FUX-04 |
| Traces: scenarios | SCN-AlertRuleService-001, SCN-AlertRuleService-002, SCN-AlertRuleService-003, SCN-AlertRuleService-008 |
| Relates: screens | alerts |
| Depends on | AIFACTORY-US-1117 |
| Sources | model/services/observability/AlertRuleService.yaml, docs/planes/trust-operations/observability/services/alert-rule-service/index.md#apis |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-4482 ListAlerts, AcknowledgeAlert and ResolveAlert with the AlertState transitions |
implementation | ListAlerts returns the instances of the trusted tenant filtered by state and severity; AcknowledgeAlert applies Acknowledge to a Fired instance with acknowledgedBy and records connectsoft.factory.alerts.time_to_acknowledge without publishing; ResolveAlert applies SourceRecoveredOrManual to an Acknowledged instance with resolvedAt and writes AlertResolved with resolvedBy in the same transaction; repeats change nothing, an unmodelled transition changes nothing, a missing scope is 403 and a foreign or unknown id is 404. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4483 Contract of the alert list, the resolve body and the AlertResolved event |
contract | The OpenAPI document describes the alert list of ListAlerts with its state and severity filters and the resolve body with its reason, and the contracts package carries AlertResolved with alertId, tenantId and the optional resolvedBy on its modelled topic. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4484 Verify operator-lists-acknowledges-and-resolves-alerts through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&(Scenario=SCN-AlertRuleService-001\|Scenario=SCN-AlertRuleService-002\|Scenario=SCN-AlertRuleService-003\|Scenario=SCN-AlertRuleService-008)"; a zero-match filter counts as a failure; the tests prove AC1 to AC5 of AIFACTORY-US-1120 over a two-tenant fixture, including the 404 for a foreign alert, the unmodelled transitions that change nothing and the payload of AlertResolved. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1121: Deliver a fired alert on every route of its rule and record a receipt per route¶
behavior · persona operator
As an operator, I want every fired alert delivered to the Studio and to the channels its rule names, with a record of what was delivered, so that I am reached even when an external channel is down and I can see which delivery failed.
The Notifier worker is triggered by AlertFired of this service and delivers the fired instance on each route of its rule, idempotent on the alert id and the route, partitioned by tenant with at most four in parallel. The Studio route is the required dependency on StudioNotificationService, which consumes AlertFired through its handler NotifyOperators and queues the notification for the operators in scope; the Notifier records that route as delivered in notifications of the instance. Chat and email routes go through a connector of the Integration platform with the external action class and the tenant connection, never a raw webhook, over the optional gRPC dependency on ConnectorRegistryService with the failure mode degrade. That delivery, Connectors.Deliver, is hosted only by feature connector-registry-service-complete in I5, and it asks for a policy decision for which policy-decision-v1 has no fitting action kind; both are reported to the owner and no action kind is borrowed (D129). Until then a chat or email route is the modelled failure mode of a notification channel that is down: the Notifier attempts it five times in all with the modelled exponential backoff from 30 seconds, then records the failure in the receipt of that route, while the Studio notification is always delivered. A Suppressed instance is not delivered. Each receipt names the route, the outcome and the time, and no alert content beyond the references reaches a log record.
Acceptance criteria
| AC1 | Given an AlertRuleService/AlertFired of an instance whose rule routes to the Studio, when the Notifier runs, then the Studio route is recorded as delivered in notifications of the AlertRuleService/AlertInstance, the notification itself being queued by StudioNotificationService from the same event, and a duplicate trigger for the same alert and route records nothing twice (model/services/observability/AlertRuleService.yaml). |
| AC2 | Given a rule that routes to the Studio and to a chat connector and a connector delivery that fails, as before feature connector-registry-service-complete hosts it, when the Notifier runs, then the chat route is attempted five times in all with the modelled exponential backoff and its receipt records the failure, the Studio route is recorded as delivered, and no other route of the instance is held back (docs/planes/trust-operations/observability/services/alert-rule-service/index.md). |
| AC3 | Given an instance that moved to Suppressed before delivery, when the Notifier is triggered for its AlertRuleService/AlertFired, then no route is delivered and the receipts record the suppression; no receipt and no log record carries more than the alert id, the route and the outcome (ADR-0018). |
| Traces: services | AlertRuleService, StudioNotificationService, ConnectorRegistryService |
| Traces: aggregates | AlertRuleService/AlertInstance |
| Traces: events | AlertRuleService/AlertFired |
| Traces: adrs | ADR-0018 |
| Traces: requirements | FUX-04, XL-16 |
| Depends on | AIFACTORY-US-1117, feature:studio-notification-service |
| Sources | model/services/observability/AlertRuleService.yaml, docs/planes/trust-operations/observability/services/alert-rule-service/index.md#failure-and-recovery |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-4485 Notifier with receipts per route and the degraded connector routes |
implementation | The Notifier records the Studio route of a fired instance as delivered, attempts chat and email routes through a typed gRPC client of the connector delivery with exponential retries from 30 seconds over five attempts and records the failure in the receipt of the route when they fail, skips a Suppressed instance, is idempotent on alert id plus route and writes no alert content beyond references to a log record. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4486 Verify fired-alerts-delivered-with-receipts through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&Feature=Notifier"; a zero-match filter counts as a failure; the tests prove AC1 to AC3 of AIFACTORY-US-1121 with a fake connector delivery that answers UNIMPLEMENTED and UNAVAILABLE, including the duplicate trigger and the suppressed instance. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-US-1122: Apply retention rules, legal holds and deletion orders to the alert rules and alert instances of a tenant¶
behavior · persona workspace-admin
As a workspace admin, I want the alert data of my tenant kept no longer than my retention rule, held when a legal hold says so and deleted on order, so that alerting follows the same data governance as every other store of the Factory.
Three inbox handlers apply the orders of RetentionResidencyService to alert-rule-sql, each idempotent on the event id. ApplyRetentionRule handles RetentionRuleChanged and applies the effective retention period of the rule to the records of the store class of the rule; the model keeps alert instances 13 months, and a tenant rule may only shorten that, so instances resolved longer ago than the effective period are deleted by the retention job of the service. ApplyLegalHold handles LegalHoldChanged and suspends deletion and retention expiry for the held scope while the hold is active, and resumes them when it is lifted. ExecuteDeletionOrder handles DeletionOrderIssued: for an order of tenant scope it deletes every row of the tenant in AlertRules and AlertInstances; an order of project scope finds no rows, because alert rules and instances carry no project in the model, and its receipt says so; a run purge finds no rows, because alert rules and instances carry no run, and is acknowledged through RetentionResidencyService/AcknowledgeOrderTask with a receipt that says so; a held scope is not deleted and the receipt names the hold. The handler then acknowledges its task through RetentionResidencyService/AcknowledgeOrderTask with the workload token of the service, which holds factory.data.acknowledge, and a receipt that names the order, the service, the tables and the row counts. A redelivered order deletes nothing more and acknowledges with the same receipt; an answer 403 or 404 of the acknowledgement or a failure before it leaves the task unacknowledged, is logged with the order id and is retried by the inbox. Platform rules are not deleted by a tenant order.
Acceptance criteria
| AC1 | Given RetentionResidencyService/DeletionOrderIssued of tenant scope for one of two tenants, when ExecuteDeletionOrder handles it, then every row of that tenant in AlertRules and AlertInstances is deleted, the rows of the other tenant and the platform rules are untouched, and the task is acknowledged through RetentionResidencyService/AcknowledgeOrderTask with a receipt that names the order, the service, the tables and the row counts; a redelivered order deletes nothing more and acknowledges with the same receipt (ADR-0019, XL-14). |
| AC2 | Given an order of project scope, when ExecuteDeletionOrder handles it, then nothing is deleted and the receipt states that the tables of the service carry no project; given a run purge, then it finds no rows, because alert rules and instances carry no run, and is acknowledged through RetentionResidencyService/AcknowledgeOrderTask with a receipt that says so; given an acknowledgement answered 403 or 404, then the task stays unacknowledged, the failure is logged with the order id and the inbox retries it (model/services/data-event/RetentionResidencyService.yaml). |
| AC3 | Given RetentionResidencyService/RetentionRuleChanged that shortens the retention of the store class of alert-rule-sql for a tenant and RetentionResidencyService/LegalHoldChanged that holds that tenant, when the retention job runs, then no instance of the held tenant is deleted, and once a further RetentionResidencyService/LegalHoldChanged lifts the hold, the instances resolved longer ago than the effective period are deleted (ADR-0019). |
| Traces: services | AlertRuleService, RetentionResidencyService |
| Traces: aggregates | AlertRuleService/AlertRule, AlertRuleService/AlertInstance |
| Traces: apis | RetentionResidencyService/AcknowledgeOrderTask |
| Traces: events | RetentionResidencyService/RetentionRuleChanged, RetentionResidencyService/LegalHoldChanged, RetentionResidencyService/DeletionOrderIssued |
| Traces: adrs | ADR-0019 |
| Traces: requirements | XL-14 |
| Depends on | AIFACTORY-US-1116, feature:retention-residency-service |
| Sources | model/services/observability/AlertRuleService.yaml, model/services/data-event/RetentionResidencyService.yaml, docs/architecture/adr/0019-data-governance.md |
Tasks
| Task | Kind | Expected output | Repository |
|---|---|---|---|
AIFACTORY-TASK-4487 ApplyRetentionRule, ApplyLegalHold and ExecuteDeletionOrder with the acknowledgement of the order task |
implementation | The three handlers apply the effective retention period through a retention job of the service, suspend and resume expiry and deletion for a held scope, delete the rows of a tenant order in AlertRules and AlertInstances without touching platform rules, answer a project order and a run purge each with a receipt that names no rows and says why, acknowledge through a typed client of AcknowledgeOrderTask with the workload token that holds factory.data.acknowledge, and are idempotent on the order id. | ConnectSoft.AI.SoftwareFactory.AlertRuleService |
AIFACTORY-TASK-4488 Verify alert-data-follows-retention-and-deletion-orders through the acceptance suite |
verification | Run dotnet test -c Release --filter "Category=Acceptance&Feature=InboxHandlers"; a zero-match filter counts as a failure; the tests prove AC1 to AC3 of AIFACTORY-US-1122 over a two-tenant fixture with a fake of AcknowledgeOrderTask that records the receipt and can answer 403 and 404, including the project order and the run purge acknowledged with receipts that name no rows, the redelivered order and the hold that blocks expiry. |
ConnectSoft.AI.SoftwareFactory.AlertRuleService |