Result: done (part; 4 sites left on a gap or defect, see Found)
Files: crates/nikaia-std/src/tools/text_tiers.nika crates/nikaia-std/src/tools/lowered/text_tiers.rs docs/briefs/b950d.step1.report.md docs/briefs/b950d.md.report.md
Commit: text_tiers: six get-clone-insert sites use BTreeMap::entry, the value changed in place
Part: #950
Model: Opus 5.5
Tests: it text_tiers fold_counters fold_inline fold_lambdas parallel_folds catch_handler catch_nested catch_error_type + guard set 123 ok; nikaia test –project tests/compiler 327 ok (own copy of the binary); clippy clean; pre-push-check ok; lower-std fixpoint (third run, same diff)
Gate: green
Deviation: no new test (tools rewrite, no compiler change). Two commits: ca687c19 (check_program 164, fold_bound reach/touch/name, throws 727) and this one (text_tiers 422, 732, 2076, 2900, 4848, 4858). lowered.rs not staged (only foreign comptime_tree names). comptime_driver, emit_needs: already entry (b950b), nothing left. No or_default in std.contracts, so none used. throws 727: a && !contains_key split into if a { entry.or_insert_with } (the value is a set’s clone: built only on insert).
Found: GAP sharing 510 (note): or_insert_with(fn() { Handle { .., ty: ty } }) is NK2105, a captured value cannot be moved into a lambda even where it runs at most once (or_insert_with is FnOnce; fold_bound itself counts it once). Probe: let t: Vec[i64] = [1]; m.entry("k").or_insert_with(fn() { H { a: "x", t: t } }) -> NK2105. or_insert would clone two strings on every call; site left.
Found: DEFECT sharing 677, 687 (multi-statement change through an entry): let mut x = m.entry(k).or_insert(v) is required by the checker (NK1139 without mut) but lowers as let mut x = ... of a &mut V, rustc warns unused_mut (clippy -D warnings). Probe: let mut all = m.entry(k).or_insert([]); all.push("x") then nikaia lower. Sites left.
Found: DEFECT text_tiers 2765 (tie_add(all, tie) on an entry): let mut all = m.entry(k).or_insert([]); add(all, "x") with fn add(mut all: Vec[String], ..) is NK1102 (ref Vec[String] passed for Vec[String]); and the get_mut form let mut all = m["a"] ?? return; add(all, "y") checks but lowers let all = get_mut(..) then add(&mut all, ..), rustc E0596. Site left.
Found: kept by ADR-collections-1 section 5 (key cloned on the insert path only, or used again after): fold_bound none left; ledger 254; modules 388, 393; prover_passes 152; sharing 1571, 1578; surface 135, 162 (also set added); text_tiers 784, 1781, 4843, 4904; throws 131; ty 1780. Compound bodies: sharing 593, text_tiers 3991. Value replaced by a function of the old one (no entry form): text_tiers positions/lent_kinds sites 824, 1167, 2487, 3145, 4397, 4839, 4875, 5229-5287. Get-or-skip sites (?? continue/return, get_mut, not entry): text_tiers 704, 722.
Needs: owner decision (move into a once-run lambda, NK2105 for or_insert_with); fix (entry view lowered let mut; mut parameter given an entry/get_mut view)
Changelog: none (no version change)
Owner: issue comment for #950: step 7 done except sharing 510 (gap NK2105 in or_insert_with), sharing 677/687 and text_tiers 2765 (two lowering/checker defects above) and the #949 files
Disk freed: none (target/nikaia-project-tests 3.5G; / 8.2G free; no new entry over 100 MB)
Rs2nika: none (no move)
Pushed: a0b13e6133322cc1ad3c53885bc336f0947841a9