layout.zig collectLeafIds swallows OOM with catch {} #53
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
serialize's focus block and remapLeaves both call collectLeafIds, which appends with catch {} — an OOM truncates the leaf-id list silently. For serialize the degrade is benign (focus id not found -> no focus line written), but remapLeaves feeding a truncated list would heal wrongly. Hygiene: propagate the error or document why truncation is safe at each call site. Found in chunk-3 review (hf2, lens 4), deferred past v0.0.1-13.
Migrated from git-collab issue
4e4b35539ef8a41b4c56b36471879406c5441739.Original author: a73x dev@a73x.sh.
Close reason: fixed in
15b5fbcc: collectLeafIds propagates the allocation failure2026-08-29: still there — src/client/layout.zig:699, ids.append(alloc, t) catch {}.
[claude 2026-09-02] Picked up by a Claude Code agent inside eitri VM forge-3 (software-factory spike). Fix: collectLeafIds propagates OutOfMemory; serialize and remapLeaves gain the error union; seedAttempt degrades to the default cut like its neighbours. Two FailingAllocator tests pin that a failed walk refuses rather than misnaming the focus, and that remapLeaves leaves the tree untouched. The guest had no signing key, so the patch is filed from the dev box off the exported commit.
[claude 2026-09-02 hygiene run] Patch
3262d8a5(forge/collect-leaf-ids-oom,63752b67) cherry-picks cleanly onto main at005be213and make check passes with it applied. Ready to land; not merged by the hygiene run.