Context relationships
Map how bounded contexts depend on each other in SpecsGraph, with upstream and downstream direction and patterns like customer/supplier and open host service.
Upstream and downstream
A relationship connects two contexts and says which way influence flows. The upstream context provides something the downstream context depends on: data, events or an API. When upstream changes, downstream feels it. Changes downstream rarely affect upstream.
At Northwind, Catalog is upstream of Orders. Orders needs Catalog's products, prices and stock levels to build a checkout, but Catalog does not care what Orders does with them. If Catalog renames a field, Orders has to adapt; the reverse is not true.
Direction describes dependency, not which way requests travel. Orders calls Catalog's API, and Catalog is still upstream.
Relationship fields
Relationship patterns
The patterns come from Domain-Driven Design context maps. Each one describes how the two teams and their models deal with each other.
Northwind's relationships
The Northwind map has 9 relationships. Each row reads upstream first.
Notice what is missing. Catalog and Identity have no edge between them: they go separate ways, and the map does not need to say so. When a missing edge is a deliberate choice, record it in the decision log so nobody adds the integration later without knowing why it was left out.
Relationships on the map
On the system map, each relationship is an edge with an arrow from upstream to downstream. Select an edge to see its patterns, description and linked requirements. When you zoom into a context, its neighbors stay visible around it, so you can see what it depends on and what depends on it.
Follow the edges when you review a change. A proposal that changes how Catalog reports stock levels reaches Orders and Analytics downstream, and the edges show both before anyone approves it.
Changing relationships
Relationships change through proposals, like contexts and requirements. Agents read them with get_context, which returns a context's relationships along with its services and requirements, and draft changes with propose_structure_change.
Each context's relationships are published in its context.md file, for example specsgraph/contexts/orders/context.md for Orders. Spec files in your repository shows the format.
Links between requirements, terms and decisions
Relationships connect contexts. Finer links connect single nodes, inside a context or across two. They are what a proposal's diff follows when it shows linked nodes the proposal does not edit.
A related link has no type of its own. It says two rules depend on each other, so a change to one brings the other into view in the review, as BIL-04 does for ORD-12.
Next steps
- Bounded contexts and subdomains for the nodes these edges connect.
- The system graph for how relationships appear on the map.
- Domain-driven and behavior-driven foundations for more on context maps.