refactor(analyzer): centralize scoring weights/thresholds into one config; no score change
What
Pure refactor. Moves every tunable scoring weight and threshold out of the scattered per-file const blocks into one documented config: a Methodology struct in internal/analyzer/methodology.go. DefaultMethodology() returns EXACTLY the current values; each field is documented with its value and a one-line rationale. The analyzer reads from a package-level defaultMethodology so scorers, normalizer, archetype classifier, health, momentum, trend, influence, and the connection cap all draw their numbers from one place.
Centralized:
- all six domain scorer weights (source_control, code_review, cicd, security, collaboration, infrastructure)
- influence factor weights
percentileMinUsers- archetype thresholds (the demo-fit "88 users" block)
- momentum at-risk/accelerating thresholds
- health factor weights +
MaxArchetypes - trajectory threshold
- connections
>50member cap
No score change (proven two ways)
- The existing value-asserting analyzer tests pass with NO edits to any expected value (
go test -race ./...all green). - Before/after
analyzeof one fixed fixture (generate --seed 42) is byte-identical across all six output files (empty diff). The analyzer has pre-existing run-to-run nondeterminism from map-iteration tie-ordering (a plaindiff -ris noisy even binary-vs-itself); the empty-diff was obtained by pinning that tie-ordering identically in both the before and after binaries, so any difference would be attributable solely to this change. There was none.
Validation
go vet ./...: cleanCGO_ENABLED=1 go test -race ./...: all pass- golangci-lint v2.11.4: 0 issues
- coverage: analyzer 94.4%, module 66.8% (>= 65%)
Scoped out (follow-up, to keep the diff tractable)
Momentum team-risk factor weights (0.4/0.3/0.3) and adoption-sentiment cutoffs (+/-0.05), the security artifact-type identifiers (not tunable knobs), and the archetype affinity coefficients in ComputeAffinities.