syntaxai/tdd.md · main · goals / graph-depth-polyglot.md

graph-depth-polyglot.md 19 lines · 1625 bytes raw · source

slug: graph-depth-polyglot title: Port §5 graphDepth metric to Go (package-directory DAG) + Rust (Cargo crate DAG) date: 2026-05-24 branch: sama-v2-graphdepth-polyglot pr_number: 34 merge_sha: 832b7c9 status: lossy related_posts: [sama-v2-go-project-dive, sama-v2-rust-project-ripgrep]

Recovered opening (from prior-session conversation summary, paraphrased):

Goal: Port the §5 graphDepth metric to Go (package-directory DAG) and Rust (Cargo-workspace crate DAG). Measure dive and ripgrep at the same pinned SHAs as the workingSetFit run — one repo, two measured metrics, same source tree. The dive audit's hand-estimated graphDepth (~5) is the load-bearing claim to test.

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_graph_depth_polyglot.ts (pure Layer 1, memoised DFS with bounded-cycle handling) + src/c14_go_graph_depth.ts + src/c14_rust_graph_depth.ts (Layer 2 adapters parsing go.mod and Cargo.toml workspaces respectively). The Rust adapter caught and fixed a [[bin]]/[[test]] array-of-tables clobbering bug in the scoped TOML subset parser. Measured: dive @d6c69194 = 12 (estimate ~5 was wildly off; subdirectory hops folded into top-level in the eye-estimate); ripgrep @4519153e = 5 (estimate ~5 confirmed exactly via 10-crate DAG hand-trace). 31 new tests. See PR #34.