feat(schedule): add hash-suppressed monitor gate - #227
Open
raymondginger2018-sudo wants to merge 1 commit into
Open
feat(schedule): add hash-suppressed monitor gate#227raymondginger2018-sudo wants to merge 1 commit into
raymondginger2018-sudo wants to merge 1 commit into
Conversation
Add core.schedule.monitor — SHA-256 change detection for scheduled jobs. Run a script or fetch a URL, compare the output hash against the last seen value, and skip the LLM call entirely when nothing changed (silent tick). First run records a baseline; a change injects a unified diff + current output for the next LLM turn. State is persisted in a small SQLite store. Design derived from Hermes cron/monitor.py. Includes tests for byte-exact hashing, diff truncation, silent no-change, source failure preservation, and store persistence.
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
Add
core.schedule.monitor— a hash-suppressed change detection utility (P4). Before each scheduled LLM tick, run a script or fetch a URL; SHA-256 the output and compare against the last known hash. When nothing changed, skip the LLM call entirely (silent tick). When something changed, inject a unified diff + current output for the next LLM turn.Design
changed=True.MonitorStore) with WAL mode and upsert semantics.monitor_gate()runs the monitored source exactly once per tick.Tests
11 tests covering: byte-exact hashing, diff generation and truncation, baseline/change/no-change cases, source failure preservation,
MonitorStorepersistence (upsert + restart), andmonitor_gatehigh-level flow (persists new hash after change, keeps old hash on source failure).Motivation
This is the maintainable version of a pattern derived from Hermes cron/monitor.py: one focused feature, no orphan modules, no speculative wiring into unproven consumers.