bootstrap: observation scheduler — ObserveStrategy mapping, defaults, dedupe, event contract to Planner #1

Open
opened 2026-06-11 15:38:54 +02:00 by yorunikakeru · 0 comments
Owner

Repo is empty. First milestone for the Watcher, plus design gaps it must resolve (see FrogOS/spec#3):

  1. ObserveStrategy → scheduler. IR only has `poll { interval_ms }` today. Map each condition leaf to a polling task; design so event-driven strategies (netlink, inotify, udev) slot in later without IR changes beyond a new tag.
  2. Default when `observe` is absent. The wire allows conditions with no strategy — Watcher must pick a documented default (and push it into the spec).
  3. Interval dedup. Ten conditions polling /proc at 500ms should share one scan, not ten. Key tasks by (source, interval), fan out to condition evaluators.
  4. Event contract to Planner. Spec says `watch::Sender` — watch channels coalesce, so the payload must be a full `SystemState` snapshot (latest-wins), not deltas. Define SystemState jointly with Planner (FrogOS/planner#1) — it's the second cross-actor contract after IR.
  5. Composite conditions. `and`/`not` over leaves with different poll intervals: decide whether Watcher evaluates composites (recompute on any leaf change) or ships leaf states and lets Planner evaluate. Spec leans "Watcher не интерпретирует" → leaf states + Planner evaluates; confirm and document.
Repo is empty. First milestone for the Watcher, plus design gaps it must resolve (see FrogOS/spec#3): 1. **ObserveStrategy → scheduler.** IR only has \`poll { interval_ms }\` today. Map each condition leaf to a polling task; design so event-driven strategies (netlink, inotify, udev) slot in later without IR changes beyond a new tag. 2. **Default when \`observe\` is absent.** The wire allows conditions with no strategy — Watcher must pick a documented default (and push it into the spec). 3. **Interval dedup.** Ten conditions polling /proc at 500ms should share one scan, not ten. Key tasks by (source, interval), fan out to condition evaluators. 4. **Event contract to Planner.** Spec says \`watch::Sender\` — watch channels coalesce, so the payload must be a full \`SystemState\` snapshot (latest-wins), not deltas. Define SystemState jointly with Planner (FrogOS/planner#1) — it's the second cross-actor contract after IR. 5. **Composite conditions.** \`and\`/\`not\` over leaves with different poll intervals: decide whether Watcher evaluates composites (recompute on any leaf change) or ships leaf states and lets Planner evaluate. Spec leans "Watcher не интерпретирует" → leaf states + Planner evaluates; confirm and document.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FrogOS/Toad#1
No description provided.