feat(senior-unilp-manager): let a ratchet cron stay quiet when nothing happened - #235
Merged
Conversation
…g happened
A ratchet tick wired as a cron script job delivered the full result of every
mandate on every run, so a healthy ratchet posted a block of JSON saying nothing
happened, every ten minutes, until nobody read it any more.
`tick --json` now takes `--alert-only`. A tick that found nothing still prints the
whole payload — the cron run history keeps it, so a quiet tick stays auditable —
but ends on the line `{"wakeAgent": false}`, which `has_actionable_output()`
already reads as "no news": the run succeeds and nothing is delivered. A tick that
fired, adopted a landed fire, halted, was rejected, expired, or built a plan on a
dry run prints a one-line summary above the JSON and is delivered as usual.
NEEDS_ATTENTION is tested apart from the action, and deliberately alerts on every
tick. It is a terminal state, so a halted mandate reports the same plain `noop` as
a healthy one while it sits there waiting for a person; filtering on the action
alone would silence the one alarm that must never go quiet. Hand-rolled wrapper
scripts that filter on `action != "noop"` have exactly that bug, which is part of
why this belongs in the skill rather than in each user's shell script.
The flag is opt-in and only touches `--json` output, so running `tick` by hand
prints what it always did.
Closes #234
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #234
The problem
A ratchet tick wired as a cron script job delivered the full result of every mandate on every run. On a healthy ratchet that is a block of JSON saying nothing happened, every ten minutes, until nobody reads it any more.
The change
tick --jsonnow takes--alert-only.Quiet tick — still prints the whole payload, so the cron run history keeps it and a silent tick stays auditable — then ends on the gate line:
has_actionable_output()(src/agentos/scheduler/scripts.py) already reads that last line as "no news", so the run succeeds andscript_run_handlerdelivers nothing. No core change was needed.Notable tick — a summary line per mandate above the JSON, delivered as usual:
Summary first and JSON last is deliberate: the gate reads the final line, and pretty-printed JSON ends in
}, which is not a gate. An alert cannot accidentally silence itself.noop,skipped,waiting,deferredfired,adopted,halted,rejected,dry-run,expired,missing,errorNEEDS_ATTENTIONThat last row is the one that matters.
NEEDS_ATTENTIONis terminal, so a halted mandate reports the same plainnoopas a healthy one while it waits for a person. Filtering on the action alone silences the one alarm that must never go quiet — the bug in every hand-rolledaction != "noop"wrapper script, and the reason this belongs in the skill.The flag is opt-in and only affects
--json, sotickrun by hand prints exactly what it always did.Verification
Against live mandates:
End to end through the gateway's own gate:
Docs
SKILL.mdgains the--alert-onlycron recipe, an explanation of why a quiet tick is not a dead job, and an error-handling row for "this cron has said nothing for hours" — expected, and the run history proves it ran.🤖 Generated with Claude Code