Skip to content

[process-manager PM-4] Restart controller: pure nextDelay(state, policy, clock) #515

Description

@rickylabs

Summary

Pure restart-decision function nextDelay(state, policy, clock): S7 numbers locked (E3 — exp backoff double-to-cap-15000ms, reset-after-30000ms stable), windowed restart budget, skip-exit-codes, and poll-based memory threshold with default pollIntervalMs: 5000, configurable per policy (latency explicit).

Scope

Design source

  • research/design/d1-supervision-engine-core.md (restart controller) · plan.md §4 PM-4, E3

Acceptance criteria

  • gate: pure function — deterministic under injected clock; unit tests cover backoff/reset/budget/skip-exit-codes
  • gate: memory threshold is poll-based with configurable pollIntervalMs (default 5000) — never marketed as a watchdog (R10)
  • gate: scoped check/lint/fmt wrappers green (--ext ts,tsx)

Non-scope

  • Process spawning (PM-5); OS watchdogs (systemd WatchdogSec is PM-15/16).

Drift / Debt

  • none

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions