|
| 1 | +# Task 1216 Active-Status Task Forest |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Keep the pinned-conversation task forest as the operation-room view, but only |
| 6 | +render task nodes whose status is `in_progress` or `in_review`. Historical |
| 7 | +`done` tasks and not-yet-started `todo` tasks stay out of the default forest. |
| 8 | + |
| 9 | +`scope=all` remains the diagnostic escape hatch for the complete task map. |
| 10 | + |
| 11 | +## Filtering Contract |
| 12 | + |
| 13 | +The default forest endpoint still starts from pinned conversation roots and |
| 14 | +uses the existing recursive task subtree walk. The status filter is applied |
| 15 | +after the recursive walk has reached the subtree, not before it. This preserves |
| 16 | +active descendants below inactive intermediate tasks. |
| 17 | + |
| 18 | +Thread root nodes are not task status filtered. If a pinned conversation has a |
| 19 | +task subtree but no retained active task, the response may contain only the |
| 20 | +thread root for that pinned conversation. |
| 21 | + |
| 22 | +## Reparenting Contract |
| 23 | + |
| 24 | +Filtering inactive task nodes can remove an intermediate parent. Every retained |
| 25 | +task is reparented as follows: |
| 26 | + |
| 27 | +1. Follow the original parent chain using `parent_task_number`, with legacy |
| 28 | + `source_task_id` and `source_task_thread_id` as fallbacks. |
| 29 | +2. The first ancestor in the same pinned subtree whose status is |
| 30 | + `in_progress` or `in_review` becomes the retained task's parent. |
| 31 | +3. If no retained ancestor exists before the pinned conversation root, the task |
| 32 | + attaches directly to that thread root. |
| 33 | +4. The returned `parent_node_id`, `parent_thread_id`, and `parent_task_number` |
| 34 | + describe this rendered parent, not the filtered-out original parent. |
| 35 | + |
| 36 | +The resulting graph stays connected from each pinned conversation root to the |
| 37 | +active task nodes while skipping inactive history. |
0 commit comments