Skip to content

Scan root/scope is a hypothesis: detect topology, judge it, recover (assess where first-party code actually lives) #78

Description

@maudlin

Thesis

The scan root is a hypothesis, not a fact: checkup models the target as a single package rooted at the scan dir, but on inherited/low-quality codebases the root is often a thin orchestrator with the real work one level down. Two jobs: judge the topology (it is itself a finding) and recover (descend and actually measure), so a "looks clean" read can't come from having looked in the wrong place.

Status — most of this is DONE; the remainder is Phase 2b

Phase 2b — the remaining recovery (this issue)

The checks that still run once over the whole tree, so on an undeclared fan-out they are neither measured in-package nor labelled per package:

  1. Package-script stragglers — circular-deps, unused-code, coverage are run_profiled (npm/script-based, exactly like clusters A/B) but currently run only at the root. On a fan-out the root has no such script → they skip, and the sub-packages' results are lost. Fold them into the recover pass (absorb circular-deps into cluster B; a new cluster C for unused + coverage). Low-risk — same proven pattern; byte-identical on a single-package repo. ← first increment.
  2. The scc/lizard measurement arms — codebase-stats, complexity, and the duplication lizard arm measure the whole tree (sub-package code is counted, but mushed into one record and routed by whole-tree dominance). Make them per-package: filter the existing single scc --by-file walk to each assessment root's subtree (reuse, don't re-walk), and route the complexity engine per package. Surface labelled (backend: 12 hotspots · frontend: clean). The harder half (per-package engine routing) — second increment.

Guardrails (unchanged)

Done when

  • circular-deps / unused / coverage recover per sub-package, labelled (increment 1).
  • complexity / duplication / codebase-stats measured + labelled per sub-package off the single scc walk (increment 2).
  • Single-package + declared-workspace repos unchanged (byte-identical).

Refs #7, #75; supersedes the original Repro B (now fixed).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions