Skip to content

Latest commit

 

History

History
121 lines (89 loc) · 2.85 KB

File metadata and controls

121 lines (89 loc) · 2.85 KB

Inheritance

Heading Inheritance

Tasks inherit metadata from their containing headings.

Metadata Behavior
Projects (+) Hierarchical: joined with /
Tags (#) Union: all inherited + task's own
Assignees (@) Union: all inherited + task's own
Custom fields Child overrides parent per-key

Context Stack Algorithm

Push Heading

1. Pop headings at same or deeper level
2. Append new heading to stack

Resolve Task

1. Collect inherited project_path (joined with /)
2. Collect inherited tags (in order)
3. Collect inherited assignees (in order)
4. Append task's own project to path
5. Merge task's own tags (order preserved, duplicates removed)
6. Merge task's own assignees (order preserved, duplicates removed)

Example

# TODO +work

## Sprint +sprint #q4

- [ ] Fix bug #urgent
Step Stack
After # TODO +work [(1, "work", [])]
After ## Sprint +sprint #q4 [(1, "work", []), (2, "sprint", [q4])]

Resolved task:

Field Value
project_path "work/sprint"
tags ["q4", "urgent"]

Subtask Inheritance

Subtasks always inherit from their parent task (not just headings).

Metadata Behavior
project_path Always inherited (subtask cannot override)
Tags (#) Parent tags + subtask's explicit tags
Assignees (@) Parent assignees + subtask's explicit assignees
Custom fields Parent fields, subtask explicit fields override

Subtask Sorting

Subtasks are always sorted by priority:

  1. Letter priorities first (A-Z)
  2. Number priorities second (1-99)
  3. No priority last
  4. Within same priority, alphabetically by title

Example

# Project +backend #q4 @team

- [ ] Parent task
  - [ ] (B) Second priority
  - [ ] No priority child @alice
  - [ ] (A) First priority #subtask

Resolved subtasks (sorted):

Title Priority project_path tags assignees
First priority A "backend" ["q4", "subtask"] ["team"]
Second priority B "backend" ["q4"] ["team"]
No priority child - "backend" ["q4"] ["team", "alice"]

Edge Cases

Case Behavior
Same level heading Replaces previous
Deeper heading pops previous Stack unwinds
No headings No inheritance
Task adds to inherited Never removes
Subtask with explicit +project Ignored (inherits from parent)

ParsedHeading

Field Type
level int
text str
projects list[str]
tags list[str]
assignees list[str]
custom_fields dict[str, str]
line int

Related

  • ARCHITECTURE.md - System design
  • GRAMMAR.md - Heading syntax