Skip to content

feat(#7): add subtask support to task management API - #8

Closed
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/7-add-subtasks
Closed

feat(#7): add subtask support to task management API#8
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/7-add-subtasks

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown

Summary

  • Add subtask support to the task management API, enabling users to break tasks into smaller, trackable child tasks
  • New endpoints: POST /tasks/:id/subtasks (create) and GET /tasks/:id/subtasks (list)
  • Subtasks share core task properties (title, description, completed) and are linked via parentId
  • Cascade delete removes all subtasks when a parent task is deleted
  • Single-level nesting enforced — subtasks of subtasks are rejected with a 400 error
  • Backward compatible: GET /tasks continues to return all tasks including subtasks

Changes

  • src/store.js: Extended TaskStore with createSubtask(), listSubtasks(), cascade delete in delete(), and parentId field on all tasks
  • src/index.js: Added route handlers for POST /tasks/:id/subtasks and GET /tasks/:id/subtasks
  • src/store.test.js: Added 9 new tests covering subtask creation, nesting rejection, parent validation, listing, cascade delete, backward compatibility, and parent isolation

Testing

All 16 tests pass (7 existing + 9 new):

  1. Create subtask under valid parent → 201 with correct parentId
  2. Create subtask under non-existent parent → error
  3. Reject subtask of a subtask (single-level nesting)
  4. List subtasks of a parent → returns only that parent's subtasks
  5. List subtasks of non-existent parent → null
  6. List subtasks when parent has none → empty array
  7. Cascade delete parent → all subtasks also deleted
  8. GET /tasks returns all tasks including subtasks (backward compat)
  9. Only returns subtasks belonging to the specified parent

Closes #7

Post-script verification

  • Branch is not main/master (agent/7-add-subtasks)
  • Secret scan passed (gitleaks — 77fa054a08e6345d0561de4fc22d420c9fef5d5c..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

Add hierarchical subtask support allowing users to break tasks into
smaller, trackable child tasks. Subtasks share core task properties
and are linked to a parent task.

Changes:
- store.js: Add createSubtask() with parent validation and
  single-level nesting enforcement, listSubtasks() to retrieve
  children by parent ID, and cascade delete to automatically
  remove subtasks when a parent is deleted. Tasks now include
  a parentId field (null for top-level tasks).
- index.js: Add POST /tasks/:id/subtasks and
  GET /tasks/:id/subtasks endpoints following the existing
  RESTful nested resource pattern.
- store.test.js: Add 9 tests covering subtask creation,
  nesting rejection, listing, cascade delete, backward
  compatibility, and parent isolation.

Closes #7
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 11, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:06 AM UTC · Completed 8:20 AM UTC

Commit: 500cf9e · View workflow run →

@kadel kadel closed this Aug 11, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Review skipped — this PR is already closed.

The /fs-review command only reviews open pull requests.

Posted by fullsend post-review check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Subtasks

1 participant