Skip to content

Curtailment: Response profiles and automation rules #384

Description

@negarn

Alignment note

This issue remains the broader product/settings scope for reusable curtailment response profiles and automation rules. The immediate MQTT source settings API/runtime reload work is tracked separately by #405 and draft PR #409; that work should not close this issue.

Current codebase alignment:

Context

We need a settings/curtailment area that lets operators configure reusable curtailment response profiles and automation rules that apply those profiles when configured conditions are met.

Example workflow: an operator creates an Emergency curtailment response profile that sheds the full load across all miners in the fleet. The operator then creates an automation rule that watches for a condition, such as an emergency response obligation or other triggering signal, and applies the Emergency curtailment profile when that condition is met.

Requirements

  • Add a settings/curtailment page or equivalent settings entry point for curtailment configuration. If the /energy page keeps an “Edit settings” entry point near the plan-curtailment action, it should route to this area.
  • Allow users to create and edit response profiles.
  • A response profile should represent the curtailment action to apply, such as full fleet shed, partial reduction, target power limit, site scope, miner selection strategy, and restore behavior as supported by the domain model.
  • Allow users to create and edit automation rules.
  • An automation rule should define a triggering condition and select the response profile to apply when that condition is met.
  • Allow users to enable or disable each automation rule without deleting it.
  • Allow users to reorder automation rules in the table/list so ordering can represent priority when more than one trigger is active at the same time.
  • Make the priority behavior explicit in the product/API behavior, especially when multiple enabled rules match concurrently.
  • Support editing existing profiles and rules without losing their relationship to existing automations.
  • Profile/rule CRUD, enablement, disablement, and ordering should require org-scoped curtailment:manage.
  • Rule execution by trusted automation should not be blocked by a public handler user-auth gate.
  • Leave room for UI details to change as the product shape is refined.

Out of scope

Acceptance criteria

  • Users with org-scoped curtailment:manage can create, view, edit, and persist curtailment response profiles.
  • Users with org-scoped curtailment:manage can create, view, edit, enable/disable, reorder, and persist curtailment automation rules.
  • Each automation rule can be associated with a response profile that is applied when the rule condition is met.
  • Rule ordering is persisted and used as priority when concurrent triggers need precedence.
  • Editing an existing response profile or automation rule preserves relationships to existing automations unless the user explicitly changes them.
  • The implementation includes appropriate client/server validation and targeted tests for profile CRUD, rule CRUD, enablement, ordering, priority behavior, permission gates, and response profile association.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions