Skip to main content

What Are Relationships?

Relationships are the connective tissue in sudocode’s context graph. They create typed, bidirectional links between specs and issues, enabling graph-based planning, dependency resolution, and intelligent work ordering.
Key Principle: Relationships model how entities connect - what blocks what, what implements what, and how context flows through your project.
A relationship is a directional, typed connection between two entities (specs or issues). Every relationship has:
  • From entity - The source (e.g., ISSUE-001)
  • To entity - The target (e.g., SPEC-001)
  • Relationship type - What kind of connection (e.g., implements)
Relationships are bidirectional - sudocode automatically tracks both directions, so you can traverse the graph from either end.

Relationship Types

sudocode supports six relationship types, each with specific semantics:

blocks

Hard blocker dependencyFrom entity cannot proceed until To entity is complete

implements

Implementation linkIssue implements requirements from a spec

depends-on

Soft dependencyFrom entity needs To entity but not a hard blocker

references

General referenceContextual link without specific semantics

related

AssociationEntities share context or are related

discovered-from

Discovery trackingIssue was discovered while working on another issue

Detailed Relationship Semantics

Direction: From → To (“From blocks To”)Meaning: To entity cannot start or complete until From entity is done.Use cases:
  • Sequential implementation tasks
  • Dependencies between infrastructure and features
  • Prerequisites that must be satisfied first
Example:
Graph behavior:
  • Blocked entities won’t appear in sudocode ready query
  • Topological sorting uses blocks for execution order
  • Status of blocker affects what’s ready
Direction: From → To (“From depends on To”)Meaning: From entity needs context/output from To entity, but it’s not a hard blocker.Use cases:
  • Informational dependencies
  • Context that should be read but doesn’t block work
  • Related work that informs implementation
Example:
Graph behavior:
  • Doesn’t block execution (entity still appears in ready queue)
  • Provides context for agents working on the issue
  • Can be used for soft ordering hints
Direction: From → To (“From references To”)Meaning: General contextual link without specific blocking or implementation semantics.Use cases:
  • Cross-referencing related entities
  • Creating links between documentation
  • Default type for [[ID]] syntax without explicit type
Example:
Graph behavior:
  • No blocking or ordering implications
  • Purely for navigation and context
  • Automatic type for cross-references without explicit type
Direction: New Issue → Source Issue (“New was discovered from Source”)Meaning: A new issue was discovered while working on another issue.Use cases:
  • Tracking scope creep
  • Understanding how issues spawn new work
  • Tracing problem discovery during implementation
Example:
Graph behavior:
  • Shows issue genealogy
  • Helps understand how work expands
  • Can identify issues that frequently spawn new issues

Creating Relationships

Using the CLI

The link command creates relationships between entities:
Examples:
sudocode automatically determines entity types (spec or issue) by checking which exists in your database.

Using Markdown Syntax

You can embed relationships directly in markdown using extended Obsidian-style syntax:
Syntax Rules:
  • [[ID]] - Basic reference (defaults to references type)
  • [[ID|Display Text]] - Reference with custom display text
  • [[ID]]{ type } - Reference with relationship type (shorthand)
  • [[ID]]{ type: typename } - Reference with relationship type (explicit)
  • [[ID|Display]]{ type } - Combination of display text and type
When you use this syntax in markdown files, sudocode automatically creates the corresponding relationships in the database when syncing.

Hierarchical Relationships

While not a relationship type in the table, specs and issues support parent-child hierarchies through the parent_id field:

For Specs

For Issues

Parent-child relationships are stored directly in the parent_id field, not in the relationships table. This enables efficient tree traversal and hierarchical queries.

Bidirectional Tracking

All relationships are automatically tracked in both directions:
Now you can query from either direction:
This bidirectional tracking enables:
  • Forward traversal - What does this entity depend on/reference?
  • Backward traversal - What depends on/references this entity?
  • Graph queries - Find all connected entities
  • Impact analysis - What’s affected if this changes?

Graph-Based Planning

Relationships enable sudocode’s graph-based planning and execution:

Topological Ordering

The ready command uses blocks relationships to determine execution order:
After ISSUE-001 closes:

Finding Blocked Work

Dependency Chains

Relationships create dependency chains that agents can traverse:
Agents can:
  • Start with a spec
  • Find unblocked issues that implement it
  • Work through issues in topological order
  • Provide feedback back to the spec

Viewing Relationships

In Entity Details

In Graph Form

Best Practices

Choosing the Right Relationship Type

1

Is it a hard blocker?

Use blocks if From must complete before To can proceed
2

Is it implementing requirements?

Use implements for issue → spec implementation links
3

Is it informational context?

Use depends-on for soft dependencies or references for general links
4

Is it associative?

Use related for bidirectional associations without specific semantics
5

Was it discovered during work?

Use discovered-from to track issue genealogy

Modeling Dependencies Effectively

Using Relationships for Multi-Agent Workflows

1

Model clear dependencies

Use blocks to prevent agents from working on blocked tasks
2

Link issues to specs

Use implements so agents can read requirements
3

Track discovered work

Use discovered-from when agents find new issues during implementation
4

Query ready work

Agents use sudocode ready to find unblocked, high-priority work

CLI Commands

Quick reference for relationship commands:

Link Command Reference

See complete documentation for the link command

Database Schema

For reference, here’s how relationships are stored:
The composite primary key ensures:
  • No duplicate relationships
  • Same entities can have multiple relationship types
  • Efficient bidirectional queries

Next Steps

Specs

Learn about specs - high-level requirements that issues implement

Issues

Learn about issues - actionable work items that can be linked

Feedback System

Provide anchored feedback from issues back to specs

Link Command

Complete CLI reference for the link command