Dependencies & Ordering
Source nodes can depend on other source nodes. The resolver uses these dependencies to determine hydration order — ensuring upstream data is available before downstream sources execute.
Declaring dependencies
Use depends_on in the source frontmatter:
source:
transport: mcp
server: jira
tools: [jira_get_sprint_issues]
depends_on:
- contextnest://sources/project-configTopological ordering
The resolver sorts source nodes in topological order based on their dependency graph:
project-config → current-sprint-tickets → sprint-risk-analysisAt each step, the agent has the upstream results available in its session context when it reads the downstream source’s instructions.
Cycle detection
Circular dependencies are forbidden. If the dependency graph contains a cycle, validation fails with a Rule 15 error:
Circular dependency detected: A → B → C → ABody-level references
Dependencies can also be expressed in the markdown body:
Before fetching sprint tickets, ensure you have the project
configuration from [Project Config](contextnest://sources/project-config).Both the frontmatter depends_on and body references should point to the same targets. If they diverge, validation flags the inconsistency.