Before code, we draw the system. Domain boundaries, request paths, data ownership, and the edges that will later show up as traces.
- C4 context and container diagrams for the target architecture
- Sequence diagrams for the critical request and the failure path
- Data-flow graph: producers, stores, consumers, retention
- Service contracts: REST, events, and tool schemas for agents
C4 containersData-flow graphOpenAPI / events
export const graph = {
nodes: ["gateway", "intake", "agent", "rag", "ledger"],
edges: [
["client", "gateway", "https"],
["gateway", "intake", "rest"],
["intake", "agent", "command"],
["agent", "rag", "retrieve"],
["agent", "ledger", "tool:write"],
],
ownership: { ledger: "finance", rag: "knowledge" },
};