Skip to content

Seed a core Play that completes a parent task when all its children are done #2636

Closed

Description

@malibio

Overview

has_child is NodeSpace's universal outline/hierarchy edge — any node can nest under any other via the same mechanism the whole tree-of-nodes UI already uses (packages/core/src/behaviors/mod.rs, packages/core/src/services/node_service/hierarchy.rs's get_children/get_parent). A task (or any extends-descendant of task, once extends lands — see Dependencies) nested under another task via has_child is already, structurally, a sub-task/sub-issue today: no schema work is required for hierarchy itself. What's missing is the one behavior every flat/Jira/Linear-style methodology assumes exists: when every child of a parent task reaches a "done" state, the parent should complete too.

This is not methodology-specific — it doesn't reference any Linear-recipe concept (cycle, issue, backlog) — so it belongs as a core, unconditionally-seeded Play, not something bundled into a specific methodology recipe's install flow.

Problem Statement

Today, nothing keeps a parent task's status in sync with its children's completion. A user (or an installed recipe like the Linear-style one) has no way to get "closing the last sub-task auto-closes the parent" without hand-authoring a Play from scratch, and no existing Play or documented convention already does this — confirmed via search of ../nodespace-docs/decisions/, ../nodespace-docs/architecture/, ../nodespace-docs/components/ for has_child combined with parent/completion terms.

Proposed Solution

A single core-seeded Play (node_type: "play", always installed, not tied to any recipe/bundle):

  • Trigger: a node's status property changes to a "done" category value (see ../nodespace-docs/decisions/078-schema-extends-relationship-for-field-composition.md, ADR-078, for what "done category" resolves to once an extending schema like issue has a richer status vocabulary — this Play must read status at task scope via that ADR's scope-relative resolution, not assume the literal stored value is always done).
  • Condition: the changed node has a parent (via has_child's reverse direction — this node is the child), and every one of that parent's has_child children is itself in a "done" category status.
  • Action: set the parent's status to done.

This issue is now purely a Play definition — trigger, condition, action, seeded as data. It carries no engine work of its own: the two capabilities it depends on (a real reverse name for has_child, and a resolver that can walk it from a Play condition) are tracked as their own general-purpose issues, since both turned out to be needed by other consumers too (assignee/project/creator lookups for a forthcoming Linear-style recipe), not just this one Play. Once both land, this issue is exactly as much work as any other seeded core Play — author it, install it unconditionally.

Architecture Impact

No existing ADR documents parent/child task auto-completion — this is new behavior, not a reversal of a prior decision. This issue depends on scope-relative status resolution (../nodespace-docs/decisions/078-schema-extends-relationship-for-field-composition.md, ADR-078's "Enum-value extension on an inherited field" section) to correctly treat an extended status value (e.g. issue's backlog) as its task-scope "done"-category equivalent when deciding whether a child is complete — this Play is exactly the kind of base-scoped consumer that section's maps_to resolution exists to keep working unmodified across extends.

Acceptance Criteria

  • Core Play seeded unconditionally (not gated behind any methodology recipe's install flow) that sets a parent task's status to done when every has_child child reaches a done-category status
  • Play correctly treats an extended descendant's richer status vocabulary (e.g. issue.status: backlog) via ADR-078's scope-relative resolution, not just the literal task.status enum values
  • Play does not fire/no-op correctly when a parent has zero children (must not auto-complete an empty task)
  • Test coverage for multi-level nesting (does completing a parent cascade to check the grandparent too, or stop at one level — decide and document during implementation)
  • Tests pass (bun run test:all)
  • Code passes bun run quality:fix

Technical Specifications

Reference Files

Dependencies

Related Issues

Non-Goals

Activity

  1. assigned and unassigned on Sep 17, 2026
  2. malibio commented on Sep 17, 2026

    @malibio
    CollaboratorAuthor

    Baseline (worktree issue-2636-parent-task-completion-play @ abc7a5f): Frontend 5213 passed, 1 failed (256 test files). Sole failure is a pre-existing perf-threshold flake unrelated to this work: architecture-benchmarks.test.ts 'bulk structural operations (100 indent/outdent) complete in <40ms' measured 43.35ms. No source changes made at baseline time.

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