avelino/dotagent

Implement `dotagent bootstrap` (currently a stub)

Open

#3 创建于 2026年5月20日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Rust (1 fork)github user discovery
area: cligood first issuepriority: hightype: feature

仓库指标

Star
 (2 star)
PR 合并指标
 (PR 指标待抓取)

描述

When you dotagent install a fresh daemon, every (agent, schedule) window starts with no history, so the health state defaults to stale. On day one every notifier sees "agent never ran" and fires.

dotagent bootstrap is the documented escape — one-shot, mark every schedule's current window as ok, then let the real schedule take over. The subcommand exists in the CLI surface but the implementation is a stub that returns Err("bootstrap — not yet implemented"). Every new install today needs a manual workaround (touching heartbeat files, suppressing alerts in the notifier, or living with the noise).

Proposal

Make dotagent bootstrap work end-to-end:

  1. Discover every agent under $DOTAGENT_ROOT (same logic the daemon uses).
  2. For each (agent, schedule), create a synthetic window record marked ok.
  3. Print a one-line summary per agent (bootstrapped 3 schedules for hello-fish).
  4. Be idempotent — re-running should be a no-op (or refresh expected_at without losing prior success markers).

Acceptance criteria

  • dotagent bootstrap exits 0 on a clean install and lists every agent/schedule it touched.
  • After bootstrap, dotagent status shows everything as ok, not stale.
  • Running it twice is safe and does not overwrite real success history.
  • README.md "Tour, 5 minutes" mentions running bootstrap once after install.

Where to start

  • crates/dotagent/src/commands/mod.rs::bootstrap — current stub.
  • crates/dotagent/src/commands/daemon.rs — how the daemon already reads/writes window state.
  • crates/dotagent-state/src/lib.rs — the StateStore API and window file layout.
  • docs/reference/agent-spec.md — health-state contract.

Non-goals

  • Backfilling historical runs from any source (the goal is just "suppress day-one noise", not "fake history").
  • Touching the daemon's tick loop. This is a CLI-only command.

贡献者指南