Skip to content

Add core blocks/blocked_by, relates_to/duplicates, and creator relationships on task #2637

Closed

Description

@malibio

Overview

task has no way today to declare that it is blocked by, or blocks, another task — nor a general "relates to"/"duplicates" link, nor who originally created/reported it (distinct from assignee, which already exists via person.tasks). Every mainstream work-tracking tool (Jira's "blocks"/"is blocked by"/"relates to", Linear's issue relations and Reporter field) treats these as first-class, universal capabilities — not something specific to any one methodology. They belong on the core task/person schemas themselves, the same way project.tasks and person.tasks (→ assignee) already do, not gated behind a specific recipe's install.

Problem Statement

There is no relationship in packages/core/src/models/core_schemas.rs or packages/core/src/models/schema.rs's BUILTIN_RELATIONSHIP_NAMES for task-to-task blocking/relation links, or for a task's creator/reporter (as opposed to its assignee) — confirmed via direct inspection of both files, and via search of ../nodespace-docs/decisions/ and ../nodespace-docs/components/ for blocks/blocked_by/depends_on/reporter/creator as task-relationship concepts (no ADR names any of these; unrelated hits are about build/task-graph ordering, not this feature). A methodology recipe wanting to demonstrate real Jira/Linear-style workflows has nothing to build on for this without first defining it.

Proposed Solution

Three separate SchemaRelationship declarations, all optional (required: None throughout — the common case for every one of these is absence), all reusing the existing SchemaRelationship/set_schema_declarations mechanism already exercised by project.tasks and person.tasks/assignee — no new relationship machinery required for any of them.

1. Self-referential blocking pair on task (mirrors project.tasks's declaration shape, packages/core/src/models/core_schemas.rs ~line 371-381, but Many/Many since a task can block multiple others and be blocked by multiple others):

SchemaRelationship {
    name: "blocks".to_string(),
    target_type: Some("task".to_string()),
    direction: RelationshipDirection::Out,
    cardinality: RelationshipCardinality::Many,
    required: None,
    reverse_name: "blocked_by".to_string(),
    reverse_cardinality: RelationshipCardinality::Many,
    edge_fields: None,
    description: Some("Tasks that cannot start/complete until this task is done".to_string()),
},

2. Self-referential, symmetric-in-meaning relation pairs on task (same shape, seeded as separate optional declarations; duplicates is directional — one task is the duplicate of another — relates_to is a weaker, non-directional-in-meaning link but still stored as a directed edge like every other relationship here):

SchemaRelationship {
    name: "relates_to".to_string(),
    target_type: Some("task".to_string()),
    direction: RelationshipDirection::Out,
    cardinality: RelationshipCardinality::Many,
    required: None,
    reverse_name: "related_from".to_string(),
    reverse_cardinality: RelationshipCardinality::Many,
    edge_fields: None,
    description: Some("Tasks this task is related to, with no directional dependency".to_string()),
},
SchemaRelationship {
    name: "duplicates".to_string(),
    target_type: Some("task".to_string()),
    direction: RelationshipDirection::Out,
    cardinality: RelationshipCardinality::Many,
    required: None,
    reverse_name: "duplicated_by".to_string(),
    reverse_cardinality: RelationshipCardinality::Many,
    edge_fields: None,
    description: Some("The task(s) this task duplicates".to_string()),
},

3. Creator/reporter pair on person (mirrors person.tasks's existing assignee declaration exactly, ~line 1329-1340, distinct relationship name since a task can have a different creator than assignee):

SchemaRelationship {
    name: "reported_tasks".to_string(),
    target_type: Some("task".to_string()),
    direction: RelationshipDirection::Out,
    cardinality: RelationshipCardinality::Many,
    required: None,
    reverse_name: "creator".to_string(),
    reverse_cardinality: RelationshipCardinality::One,
    edge_fields: None,
    description: Some("Tasks originally reported/created by this person".to_string()),
},

Once ../nodespace-docs/decisions/078-schema-extends-relationship-for-field-composition.md (ADR-078)'s extends lands (tracked by #2598), any task-extending schema (e.g. a future issue schema) inherits all of these automatically — no separate declaration needed on the extending schema, consistent with how extends composes relationships the same as fields.

Architecture Impact

No existing ADR documents task dependency/relation/creator relationships — this is new capability, not a reversal of a prior decision.

Acceptance Criteria

  • task schema declares blocks/blocked_by, relates_to/related_from, duplicates/duplicated_by as shown above, seeded via the existing set_schema_declarations path
  • person schema declares reported_tasks/creator as shown above, alongside its existing tasks/assignee declaration
  • All new relationships are queryable via existing relationship-traversal APIs (NodeService::get_related_nodes), matching how project.tasks/tasks.project and person.tasks/assignee already work
  • required: None on every new declaration, both ends
  • A cycle (A blocks B blocks A) is representable at the data level (no new cycle-detection required — existing relationships already permit cycles unless explicitly validated against; confirm during implementation whether this needs the same treatment as any other schema relationship, i.e. none, since only ADR-078's extends requires cycle detection, not general relationships)
  • Tests pass (bun run test:all)
  • Code passes bun run quality:fix

Technical Specifications

Reference Files

  • packages/core/src/models/core_schemas.rs (~line 44, task schema; ~line 371-381, project.tasks — the exact shape for the self-referential pairs to mirror; ~line 1329-1340, person.tasks/assignee — the exact shape reported_tasks/creator mirrors)
  • packages/core/src/models/schema.rs — BUILTIN_RELATIONSHIP_NAMES (confirm whether any of these names need to be added here, or whether schema-declared relationships on a core type don't require that list — project.tasks/tasks.project did not need an entry there, so precedent suggests no change needed, but verify during implementation)
  • packages/core/tests/schema_relationship_declarations_test.rs — existing test coverage pattern for schema-declared relationships to follow

Dependencies

None — this can be implemented independently of extends (#2598); extending schemas simply inherit these once extends lands.

Related Issues

Non-Goals

  • Any Play/automation enforcing that a blocked task cannot start or complete until its blocker is done — this issue is schema-only; enforcement behavior (if wanted) is separate future work
  • UI for authoring/displaying any of these relationships — schema/data-layer only

Activity

  1. changed the title [-]Add core blocks/blocked_by relationship on task[/-] [+]Add core blocks/blocked_by, relates_to/duplicates, and creator relationships on task[/+] on Sep 15, 2026
  2. malibio commented on Sep 17, 2026

    @malibio
    CollaboratorAuthor

    Baseline (frontend): Test Files 247 passed, Tests 5085 passed.

  3. self-assigned this
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions