fix: remove non-functional --domains flag; wire run trend detection

Problem

Two defects in the analysis pipeline:

  1. The --domains count flag was inert. scoreAllUsers hardcodes all six scorers and iterates AllDomains regardless of the flag value. The count was only defaulted to 6 and printed in one log line. The same dead count lived in three layers: RunOptions.Domains (analyzer), AnalyzeConfig.Domains (config, never read by any command), and the --domains flag plus MANIFOLD_DOMAINS variable (command line and deploy.yml). It looked configurable but changed nothing.

  2. The run all-in-one command never passed RunOptions to analyzer.Run, so a full manifold run could never do trend detection even though analyze --previous-dir could.

Real variable-domain scoring would ripple through the hardcoded six-domain assumption in the normalizer, archetype, and summary code. That is a methodology change deferred to later. The honest fix now is to remove the non-functional flag.

Fix

Remove the count flag across all three layers:

  • cmd/manifold/analyze.go: drop the --domains flag and its plumbing.
  • internal/analyzer/analyze.go: drop RunOptions.Domains, its default, and the domains= log argument. The log line now reports the real len(AllDomains).
  • internal/config/config.go: drop the inert AnalyzeConfig struct, its default, and its merge branch.
  • deploy.yml: drop MANIFOLD_DOMAINS and the --domains argument.
  • manifold.example.yml, docs/configuration.md: drop the domains rows.
  • internal/config/config_test.go: drop assertions and fixtures that set Analyze.Domains.

Wire run trend detection:

  • Add a --previous-dir flag to run, build RunOptions{PreviousDir}, and pass it to analyzer.Run. manifold run --previous-dir DIR now performs trend and momentum detection.

The six-domain model (AllDomains, the six scorers, DomainScores) is unchanged. Only the user-facing count flag is removed.

Validation

  • make check (go vet + full test suite) passes on Go 1.24.2.
  • go test -race ./... passes on Go 1.24.2.
  • New cmd/manifold/run_test.go asserts the --previous-dir flag flows through to a non-empty RunOptions.PreviousDir (trend detection wiring), and that an empty value leaves it empty (trends off).
  • Existing analyzer trend tests, including TestRunEndToEnd_WithTrends, still pass after the RunOptions.Domains removal.
  • Post-removal grep for --domains, MANIFOLD_DOMAINS, RunOptions.Domains, and AnalyzeConfig returns nothing.

🤖 Generated with Claude Code

Merge request reports

Loading