feat(topology): recover complexity per sub-package with per-child engine routing#123
Merged
Conversation
β¦ine routing (#78) The last whole-tree measurement arm. On an undeclared fan-out, complexity ran once over the whole tree, routed by whole-tree engine selection. Recover it per assessment root with the FULL engine ladder re-routed per child (route_complexity_child, a scoped mirror of the whole-tree routing): ESLint on the JS/TS slice using the child's OWN flat config + local bin, lizard on the non-JS slice (inventory sliced to the subtree), scc fallback (keep-set sliced). Findings are namespaced (backend/complexity) and labelled per package. The single git-hotspots CSV is accumulated across packages β truncated once before the loop, appended per arm, always in TARGET-relative (namespaced) paths (scc/lizard/eslint findings re-prefixed; the standalone-lizard CSV's file column namespaced via awk) β so the churn Γ complexity join stays whole-tree. If nothing is measured the (empty) CSV is dropped, matching the pre-#78 absent state. Single package / declared workspace β one iteration at "." reusing the whole-tree routing, no cd, SLUG_NS empty, $PWD == $TARGET β byte-identical to before, CSV included (verified end-to-end on the lizard, scc and merged arms + full parsed-set diff). A fan-out routes each child to its own engine and accumulates a namespaced CSV. With stats (#121), duplication (#122) and now complexity, every measurement arm recovers per sub-package β #78 is complete. Closes #78 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012oHR4g8pH7Ui242SRycFzw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The last whole-tree measurement arm. On an undeclared fan-out,
complexityran once over the whole tree, routed by whole-tree engine selection. This recovers it per assessment root, with the full engine ladder re-routed per child (route_complexity_child, a scoped mirror of the whole-tree routing):inventory_paths_under);scc_keep_for_root).Findings are namespaced (
backend/complexity) and labelled per package (π¦ Sub-package: β¦).git-hotspots CSV stays whole-tree. The single
complexity-full.csvis accumulated across packages β truncated once before the loop, appended per arm, always in TARGET-relative (namespaced) paths (scc/lizard/eslint findings re-prefixed; the standalone-lizard CSV's file column namespaced via awk) β so the churn Γ complexity join keeps working. If nothing is measured, the empty CSV is dropped to match the pre-#78 absent state exactly.One honest note: a fan-out child lacking its own eslint flat config reports its JS/TS complexity as unmeasured (rather than borrowing a root config) β strictly more honest than today's single-engine-for-the-whole-fanout behaviour.
Why this is safe
Single package / declared workspace β one iteration at
.reusing the whole-tree routing, no cd,SLUG_NSempty,$PWD == $TARGET,ns=""β byte-identical to before (the gate).Verification
complexityrecord,complexity-full.csv, and console; plus a full parsed-set diff (all records identical bar theCHECKUP_OUT_DIRpath in one git-hotspots message). The empty-vs-absent CSV edge is normalised so even the filesystem matches.proc/complexity+svc/complexityrecords, andcomplexity-full.csvaccumulates namespaced rows (proc/job.py,svc/server.go).Completes #78
With stats (#121), duplication (#122) and now complexity, every measurement arm recovers per sub-package. The eslint/lizard/scc arms, the duplication engines, and the scc-based stats all honour the detected topology.
Closes #78
π€ Generated with Claude Code