Beagle SCM
SUBS-052: post's selective gate is nesting-blind — a staged change ≥2 mounts down is silently skipped
be post at the top of a selective wt (anything staged in the TOP wtlog) gates each mounted sub by parent-scope rows, its adv bucket, or anyStaged(that sub's OWN wtlog) — never probing NESTED wtlogs. A change staged two mounts down (JS-113b: dog/abc/POL.c put-staged in libabc's wtlog, dog itself clean) leaves the mid sub out of scope, the recursion never starts, and the top post commits only the top's files — no error, no warning. The cascade itself (postSubs post-order recursion + gitlink bumps, DIS-058 D6/D7) is nested-capable; only the SUBS-042 gate is single-level. Sibling of SUBS-051 (put's single-level descent); the gate must recur the same way. Found 2026-07-11 by code-read while answering "will a top post commit dog and dog/abc?" — not executed against a live tree.
Context
- Gate (
be @ jsrc tip, post.js:484-488 in postSubs): if (parentSelective && !subInParentScope(wtl, s.path) && s.bucket !== "adv" && !anyStaged(wtlog.open(subInfo))) continue; — all three probes see ONE level; a grandchild wtlog's staged row is invisible.
- Evidence state (work/JS-113b): top wtlog selective (staged CMakeLists.txt/net.cpp put rows);
dog clean, not adv, no parent row targets dog/...; dog/abc has POL.c put-staged → a top jab post would skip dog entirely and silently omit POL.c.
- Commit-all mode (nothing staged at top) is NOT affected: the gate falls through and postTree recurses into every mounted sub, so nested commits + bumps cascade correctly.
- SUBS-051 is the staging-side twin (fixed in work/SUBS-051, pending merge): until it lands, a nested change cannot even be put-staged from the top — the repro should stage from INSIDE the grandchild to stay independent.
Goals
- A selective top post commits a staged change at ANY mount depth: the sub-scope test becomes transitive (a sub is in scope iff its own wtlog OR any descendant mounted sub's wtlog has staged rows, or any descendant is adv), then the existing post-order recursion does the rest (grandchild commit → child bump+commit → parent bump+commit).
- Selective semantics otherwise unchanged: a dirty-but-unstaged out-of-scope sub stays uncommitted, exactly as SUBS-042 specifies.
- Repro test (jab-only) in beagle-ext-tests: nested fixture (reuse test/sub/nestedput's green-field recipe), stage in the grandchild from within it, stage a top file, top post → assert all three levels commit with correct gitlink bumps; a second fixture arm asserts an unstaged dirty sub is still skipped.
Constraints
- Fix inside
be/verbs/post/post.js (a transitive anyStagedDeep/scope probe over mounted descendants — subs.enumerate or recurse.isMount per level); do not restructure postSubs' recursion or the bump synthesis.
- Mind the adv bucket transitivity: a grandchild adv under a clean child must still pull the child into scope (the child's own postSubs then bumps it).
- Comments ≤2 lines, SUBS-052-prefixed; repro-first per Issues.
WIP
Design decisions
TODOs
Blockers and bummers
Outcome