`tools.jsonl` rows copied `root_task_id` / `delegation_role` from task
metadata, so a direct root — whose metadata carries neither — logged rows
with no lineage at all while pooled roots and children did (h7 M2). The
row writer now resolves lineage through the ONE resolver already used by
usage, cost and acceptance (`task_results.resolve_task_lineage`: a direct
root is its own root, `delegation_role=root`), and copies only the
parent id and depth from metadata. Rows without a task stay as they were.
The `proactive_message` and `schedule_task_from_direct_chat` event rows
carried no `task_id`. They now do, which makes them visible in the task's
own log stream: `gateway/logs.py` filters `/api/logs/{name}?task_id=` by
task/parent/root id, so a proactive owner message or a subagent scheduled
from a direct turn appears in that task's Logs tail instead of only in
the global events log. `_schedule_task` stays at its 300-line function
cap by dropping a local import the module already had.