Skip to content

Define the task types once and route the typed task update through the shared pipeline #3441

Closed

Description

@malibio

Overview

Define the task types once, in nodespace-types, and route the typed task update through the shared update pipeline (ADR-086 §1, §4 "Flat").

Problem Statement

  • Two definitions. TaskNode, TaskNodeUpdate, TaskStatus and the priority enum exist in packages/nodespace-types/src/task.rs and again in packages/core/src/models/task_node.rs, with different fields. Core's copy also writes camelCase keys (dueDate, startedAt, completedAt).
  • A wrong response. The daemon's update_task_node (packages/daemon/src/services/node_service.rs) builds its response from core's copy (task.into_node()). The response hard-codes lifecycle_status: "active" and drops the node's extension properties.
  • Its own write path. Core's update_task_node (packages/core/src/services/node_service/schema.rs) writes through its own store method rather than the generic pipeline, so it doesn't share the pipeline's validation, title_template, invariant dispatch and events.
  • Unclearable priority. TaskNodeUpdate.priority can't be cleared: neither copy uses the clearable deserializer.
  • Ignored properties. The proto UpdateTaskNodeRequest.properties is sent by the dev-proxy and ignored by the daemon.
  • content in the typed update. Typed updates carry only the type's schema fields; content is an envelope field written through the generic update.

Proposed Solution

  1. Delete core's TaskNode, TaskNodeUpdate, TaskStatus and priority copies; core imports the nodespace-types definitions, and core-only behaviour becomes free functions or extension traits.
  2. Core's update_task_node lowers the typed update into the generic update pipeline.
  3. The daemon responds with the node as stored, through the typed conversion, keeping lifecycle_status and extension properties.
  4. priority (and every clearable field) uses the clearable deserializer: absent = unchanged, null = clear.
  5. Drop content from TaskNodeUpdate, and drop the ignored properties from the typed task RPC (or honour it as extension fields; choose one and document it).
  6. ProjectNode.priority uses the same shared priority enum as task.

No migration: reset the database.

Architecture Impact

Implements decisions/086-core-node-types-defined-once-typed-by-category.md §1 and §4 (nodespace-docs) for task (and the shared priority scale with project).

Acceptance Criteria

  • No task type is defined in packages/core/src/models/task_node.rs; core imports the nodespace-types ones (the file is deleted or holds only functions)
  • A typed task update goes through the generic pipeline: title_template, invariants and events fire (test)
  • A typed update's response keeps lifecycle_status and extension properties (test with an archived task carrying a custom: field)
  • priority: null clears; an absent priority leaves it unchanged (test)
  • TaskNodeUpdate has no content
  • project.priority uses the shared priority enum
  • Follows development/node-type-sequence.md; the node-types.md task and project sheets updated in the same PR
  • bun run test:changed passes; bun run quality:fix clean

Technical Specifications

Reference Files

  • packages/nodespace-types/src/task.rs, packages/nodespace-types/src/project.rs
  • packages/core/src/models/task_node.rs
  • packages/core/src/services/node_service/schema.rs (update_task_node)
  • packages/daemon/src/services/node_service.rs (update_task_node)
  • packages/proto/proto/node_service.proto (UpdateTaskNodeRequest)
  • packages/dev-tools/src/dev-proxy.ts, packages/desktop-app/app-lib/src/commands/nodes.rs

Dependencies

Related Issues

Non-Goals

  • SchemaNode and the AI-chat types (separate issues)

Activity

  1. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 301 test files passed, 5558 tests passed

  2. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions