Skip to content

Named conditions over Muru's own figures, and overlays that follow one - #696

Merged
GrahamDumpleton merged 3 commits into
developfrom
conditions
Nov 15, 2026
Merged

GrahamDumpleton merged 3 commits into
developfrom
conditions

Conversation

@GrahamDumpleton

Copy link
Copy Markdown
Collaborator

The second group of Next issues, one commit each.

  • Named conditions over Muru's signals, with firing and resolved events #123: [condition.NAME] in the daemon's file or an applied file, with when, for, clear_when, clear_for and min_requests. It is written in the PromQL-shaped subset ADR 0061 records: signals named after Muru's metrics plus the autoscaler's and the budget's state, label matchers, windows of up to an hour, numbers in base units.
    • The daemon evaluates every condition each second over the edge's samples, keeping each term's readings for its window, with three-valued logic. A term with too few requests or no data is unknown, and an unknown condition holds its state.
    • Each change is a condition.firing or condition.resolved event. muructl condition list and show, ListConditions and the MCP conditions tool give the states.
  • Overlays triggered by a named condition, with guards against flapping #689: trigger = { condition = 'NAME' } on an overlay. It is active while the condition fires, ends once it resolves and min_active has passed, and is held as it is while the condition is unknown.
    • Guards against flapping: cooldown, and max_per_hour (counted in the store). latch keeps it active until ended by hand.
    • preconditions.probe asks the release_ready release a path through the edge.
    • Apply refuses an unknown condition, and warns about an overlay that starves its own condition.
    • overlay list and preview show the condition's state and figures.

Filed along the way: #695, durations by client class, so latency can take client_class.

Checks:

  • just lint, just docs, the Rust tests of muru-controller, muructl and muru-config, and tests/python with muru._native hidden.
  • The conditions, overlays, overlay webhook, apply, scaling, reload and MCP integration suites.
  • cargo-deny, pip-audit and Dependabot: none open.
  • In the Lima VM: the controller and config tests, and the conditions and overlays suites.

Closes #123
Closes #689

🤖 Generated with Claude Code

…he daemon, with firing and resolved events (#123)

`[condition.NAME]` in the daemon's file or an applied file has `when`,
`for`, `clear_when`, `clear_for` and `min_requests`, written in the
PromQL-shaped subset ADR 0061 records: signals named after Muru's
metrics and the daemon's own state, label matchers, windows of up to an
hour and numbers in base units. Each second the daemon reads what each
term needs from the edge's samples, keeps those readings for the longest
window, and evaluates every condition with three-valued logic: too few
requests or no data leave a term unknown, and an unknown condition holds
its state. `condition.firing` and `condition.resolved` events carry each
term's figure, and `ListConditions`, `muructl condition list` and
`show`, and the MCP `conditions` tool give the states. `latency` takes
no `client_class` until #695.
…d once it resolves, with guards against flapping (#689)

`trigger = { condition = 'NAME' }` makes the overlay reconciliation
follow the condition's state each second through
`overlays::condition_step`: idle, it activates while the condition
fires; active by its condition, it ends once the condition has resolved
and `min_active` has passed, held through `cooldown`; unknown holds it
as it is. `max_per_hour` caps activations, counted in the store's
`overlay_activations`, and a held or capped activation is one
`overlay.skipped` event while the condition keeps firing. `latch` keeps
it until ended by hand, `preconditions.probe` asks the `release_ready`
release a path through the edge, and apply refuses an unknown condition
and warns about an overlay that starves its own condition. `overlay
list` and `preview` show the condition's state and figures.
@GrahamDumpleton
GrahamDumpleton marked this pull request as ready for review November 15, 2026 10:08
@GrahamDumpleton
GrahamDumpleton merged commit 237a0e2 into develop Nov 15, 2026
25 checks passed
@GrahamDumpleton
GrahamDumpleton deleted the conditions branch November 15, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overlays triggered by a named condition, with guards against flapping Named conditions over Muru's signals, with firing and resolved events

1 participant