Skip to content

feat(scheduled-history): Gap 3 watchdog over OpenChamber run history (#2174) - #11158

Merged
dezren39 merged 1 commit into
mainfrom
queue/20699-2174-gap3-watchdog
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/20699-2174-gap3-watchdog

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Gap 3 of #2174: watchdog coverage over the Gap 1 run history.

What landed (pm-stack/scheduled-history/)

  • watchdog.py — watchdog.py check reads the collect.py store (~/.local/state/openchamber-scheduled-history/history.json) and flags, per scheduled task:
    • missing_run — no run scheduled within the task's expected cadence window;
    • stale — newest run older than the stale threshold (default 2× the window, --stale-multiplier) with nothing in flight;
    • failed_latest — most recent terminal outcome is an error class (error/failed/failure/timeout/timed_out).
  • Expected-window source, stated in every alert's evidence: a declared per-task window from --windows (JSON: task id → seconds) when present, otherwise the observed schedule — the minimum interval between consecutive scheduled_for instants in the task's own history (window_source: observed-schedule). A task whose history is younger than one window is in its first window and cannot alert for missing/stale; disabled tasks are skipped; an in-flight (non-terminal) latest run suppresses missing/stale.
  • Alert path: one JSON document (scheduled-history-watchdog/v1) on stdout — task, condition, and evidence timestamps per alert — with exit 1 when any alert fires and 0 when healthy. That document is the input the fleet-watchdog cron consumes; the script sends nothing itself and changes no schedule.
  • test_watchdog.py — 13 checks in test_collect.py's plain-script style: healthy, missing, stale, failed-latest, first-window grace, declared-window override (both directions), disabled skip, in-flight suppression. All pass; test_collect.py still 19/19.
  • README gains a Gap 3 section, including the known limit: a task whose observed history mixes a burst of test runs with its real cadence derives a too-tight window — declare its window instead.

Live smoke against the real store at build time: 37 tasks checked, 29 alerts (mostly stale — the collector's store had not ticked for ~6h at that moment, which is exactly the silence this check exists to surface).

Per-gap status after this PR: Gap 1 closed (openchamber PR #2082 + code PR #8437); Gap 2 (token accounting) is #2072-owned; Gap 3 is this PR; Gaps 4 (server residency), 5 (shared-state locality), and 6 (identity binding) have no packets yet.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

watchdog.py check consumes the Gap 1 collect.py store and flags missing_run, stale, and failed_latest per scheduled task, with the expected-window source (declared --windows override or observed schedule) stated in each alert. JSON on stdout + exit 1 on alerts is the alert path for the fleet-watchdog cron. test_watchdog.py: 13 checks; test_collect.py still 19/19.
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 08:18
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 52cc5ea2-9dea-431f-9ac6-a61758469227
Commits

Reviewing files that changed from the base of the PR and between 5f21c24 and b76f809.

Files selected for processing: 3

  • pm-stack/scheduled-history/README.md
  • pm-stack/scheduled-history/test_watchdog.py
  • pm-stack/scheduled-history/watchdog.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T08:18:23.448744Z
We couldn’t complete this review. Comment @codex review to try again.
b76f809 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 0f5ee58 into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20699-2174-gap3-watchdog branch November 17, 2026 08:22
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.

1 participant