1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! The containment forest a human `bl list` renders (bl-61e0) — the read-side
//! projection of [`crate::task::Task::parent`].
//!
//! Containment is already stored frontmatter and already rendered by `show`'s
//! children section; a flat listing simply DISCARDS it, which is what makes a
//! store full of identically-titled gate children unreadable. So the tree is
//! derived, human-render only — the same class as the claim-age suffix, the
//! fleet-view label and the `->bl-xxxx` delivery marker ([`super::target`]).
//! No new stored field and no new flag: bedrock `--json` returns before any of
//! this and stays the flat stored-frontmatter mirror (§3).
//!
//! ONE invariant, no special cases: the forest is over the RENDERED set. A row
//! indents under its parent only when that parent is also being rendered;
//! otherwise it IS a root. A closed parent, a filtered-out parent, a foreign
//! parent under the default scope — every one of them takes that same path, so
//! "orphan" needs no branch of its own.
//!
//! §10's display order is not re-derived here: the caller hands rows in §10
//! order and the walk is stable, so that order simply applies PER SIBLING LEVEL
//! instead of globally. Ordering is display-only (it never enters `ready()`,
//! §3/§10), so nothing semantic moves — the accepted trade is that a
//! low-priority parent pulls its high-priority children down with it, which is
//! right: a child is meaningless out of its parent's context.
use HashMap;
/// The render order of `nodes` — each `(id, parent)` in §10 order — as
/// `(index, depth)` pairs, parents immediately followed by their subtree.
/// TOTAL: every input row comes back exactly once, at the depth of its chain of
/// rendered ancestors.
pub
/// Emit `i` at `depth`, then its children one level deeper — skipping any row
/// already emitted, which both dedupes the two sweeps and terminates a cycle.