feat(monitor): add monitor primitive with poll-until-finalizer and state persistence#20
Merged
Merged
Conversation
…ate persistence Closes #19
…on in built-in probes Avoids token exposure in process arguments visible to other processes on the host.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a first-class
monitorCLI command to the council orchestrator that replaces ad-hoc background polling loops with a structured, owned primitive.monitor start --name <n> --interval <dur> --deadline <dur> --cmd <probe> --until <predicate> --then <finalizer> --exec-dir <dir>— synchronous poll loop; on predicate match runs the finalizer in the same process; on deadline fails loudly with last probe outputmonitor status --name <n> --exec-dir <dir>— reads and prints current state frommonitors/<name>.jsonmonitor list --exec-dir <dir>— lists all monitors with dead-monitor detection (last tick >2.5x interval ago while still polling)Built-in probes:
probe:actions-runs-for-sha,probe:pr-mergeable,probe:ghcr-package-visible.State file persisted at
<exec-dir>/monitors/<name>.jsonwith fields: name, status, startedAt, deadline, lastTickAt, lastOutput, intervalMs, cmd, until, then.Fixes #19
Test plan
npm testincouncil/ts/)tsc --noEmit)parseDuration,isMonitorDead,evaluatePredicate