avelino / avelino/dotagent

Agent dependencies (DAG) — `[[depends_on]]` upstream agents

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
area: manifest area: scheduler type: feature
Dominant language
Rust
Stars
3
Forks
1
Avg merge
4h 50m
Merged PRs (30d)
1

Description

Agents are independent today: each has its own schedule, runs on its own cadence. But many real workflows have ordering: "rebuild the cache only after the daily ingest finished", "generate the report only if the data sync succeeded in the last hour", "notify Slack only when the upstream agent succeeded".

There is no way to declare these dependencies. Operators end up either chaining everything inside one giant agent (which is fragile) or scheduling each step with conservative time gaps (which is wasteful).

## Proposal

A `[[depends_on]]` block in `agent.toml` declaring upstream agents and freshness requirements:

```toml
[[depends_on]]
agent = "data-sync"
schedule = "hourly" # optional — defaults to "any schedule"
status = "success" # success | recovered | any
max_age_minutes = 60 # how recent must the upstream success be
```

When the schedule fires, the daemon checks each `[[depends_on]]` entry. If any upstream is missing or stale, the agent is **skipped** (logged as `dependency_not_satisfied`, audit event emitted, not treated as failure).

## Acceptance criteria

- [ ] Parsing in `AgentManifest`.
- [ ] Daemon evaluates dependencies before each fire decision.
- [ ] Cycle detection: `doctor` errors out if A→B→A.
- [ ] New audit event `dependency_not_satisfied` with the upstream that failed the check.
- [ ] `dotagent why` (sibling issue) explains "skipped because dependency X is stale".
- [ ] Doc in `agent-spec.md`.

## Where to start

- `crates/dotagent-core/src/manifest.rs` — schema.
- `crates/dotagent-state/src/lib.rs` — reading other agents' heartbeats.
- `crates/dotagent/src/commands/daemon.rs` — tick loop.

## Non-goals

- Cross-machine dependencies. Local heartbeats only.
- Triggering an upstream to run on demand. If upstream is stale, downstream is skipped — not "wait and re-fire upstream".
- Replacing Airflow. This is "soft ordering", not full DAG scheduling.

Contributor guide

Open the contributing guide

Research direction

Start in crates/dotagent-core/src/manifest.rs to trace AgentManifest parsing, then read crates/dotagent-state/src/lib.rs for local heartbeats and crates/dotagent/src/commands/daemon.rs for the tick loop. Done means dependencies are evaluated before firing, cycles are rejected by doctor, unmet checks emit the specified audit event, dotagent why explains skips, and agent-spec.md documents the feature.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.