avelino / avelino/dotagent

Implement `dotagent bootstrap` (currently a stub)

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
area: cli good first issue priority: high type: feature
Dominant language
Rust
Stars
3
Forks
1
Avg merge
4h 50m
Merged PRs (30d)
1

Description

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`](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`](docs/reference/agent-spec.md#health-states) — 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.

Contributor guide

Open the contributing guide

Research direction

Start at crates/dotagent/src/commands/mod.rs::bootstrap, then read daemon.rs and crates/dotagent-state/src/lib.rs to trace discovery and window-state writes. Check the health-state contract in docs/reference/agent-spec.md and the README Tour section. Done means bootstrap lists each touched schedule, status reports ok, repeated runs preserve real success history, and the README mentions running it after install.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.