--- slug: working-set-polyglot title: Port §5 workingSetFit metric to Go + Rust source trees date: 2026-05-24 branch: sama-v2-workingset-polyglot-measured pr_number: 32 merge_sha: 43c6f7a status: lossy related_posts: [sama-v2-go-project-dive, sama-v2-rust-project-ripgrep, sama-v2-workingset-cross-repo-baseline] --- **Recovered opening (from prior-session conversation summary, paraphrased):** > Goal: Port the §5 workingSetFit metric to Go and Rust source trees. Run it against /tmp/dive and /tmp/ripgrep at pinned SHAs; replace the hand-estimated workingSetFit values in the dive + ripgrep audit blog posts with measured numbers; convert the cross-repo argument from "n=1 measured + n=3 estimated" to "n=3 measured + n=1 estimated". **What is preserved from the original /goal:** only the opening sentence above, recovered from the prior-session conversation summary at the start of this conversation. The full *Done when* clauses, *Constraints (anti-fudge)*, and *Load-bearing files* sections did not survive summarization. **What landed:** `src/b32_working_set_polyglot.ts` (pure Layer 1) + `src/c14_working_set_walker.ts` (Layer 2 adapter) + `scripts/measure-working-set.ts` (CLI). 24 new tests covering bound-edge inclusivity + Go-vs-Rust test-file asymmetry (Go excludes `*_test.go`; Rust includes all `.rs` per /sama/v2 §6.2 inline-tests dialect). Measured results: dive @d6c69194 = 52.17% (originally hand-estimated ~80%, a 28-point miss); ripgrep @4519153e = 54.00% (originally ~60%, a 6-point miss). See [PR #32](https://github.com/syntaxai/tdd.md/pull/32).