CorrelationStrategy with Spearman, and MoonPhase as a control #15

Closed
opened 2026-08-26 09:15:15 +00:00 by GKaszewski · 0 comments
Owner

What to build

The tracer for ADR 0006. One CorrelationStrategy end to end — Spearman — scoring MetricKinds against DayMood, plus the display contract that every later strategy inherits.

CorrelationStrategy is a closed enum. Every strategy returns the same shape, because the point of having several is that they are directly comparable; heterogeneous results would defeat it.

Spearman first because Mood is ordinal. The domain asserts Rad is better than Good but never that the gap from Awful to Bad equals the gap from Good to Rad, which is exactly what Pearson assumes.

MoonPhase ships here, derived from Date on read and never stored — it is a function of the calendar, not an observation, so there is nothing to persist and no value that can go stale. It earns its place as a control: a strategy set reporting a strong lunar effect is reporting its own false-positive rate. It is also, straightforwardly, fun.

The display contract is the constraint, and it is deliberate. Results are not ranked, not badged with significance, and not surfaced as an insights feed. Ranking by strength selects precisely for whichever metric got lucky, and a significance badge converts a coincidence into a claim someone may act on. Show the coefficient with its sample size and let the User read it as exploration.

A minimum sample size gates output entirely: below it, return nothing rather than a coefficient built from a handful of days. That threshold is configuration, not a constant.

Acceptance criteria

  • CorrelationStrategy is a closed enum; Spearman is implemented
  • Every strategy returns the same result shape
  • Correlations score MetricKinds against DayMood, one point per Date
  • A Date with several entries contributes one point, not one per entry
  • Below the configured minimum sample size, no coefficient is returned
  • Minimum sample size is configuration
  • MoonPhase derives from Date, is never stored, and is correlated like any other input
  • Results display with coefficient and sample size, unranked and unbadged
  • No p-values or significance indicators appear anywhere in the response or UI

Blocked by

## What to build The tracer for ADR 0006. One `CorrelationStrategy` end to end — Spearman — scoring `MetricKind`s against `DayMood`, plus the display contract that every later strategy inherits. `CorrelationStrategy` is a closed enum. Every strategy returns the same shape, because the point of having several is that they are directly comparable; heterogeneous results would defeat it. Spearman first because `Mood` is ordinal. The domain asserts Rad is better than Good but never that the gap from Awful to Bad equals the gap from Good to Rad, which is exactly what Pearson assumes. **`MoonPhase` ships here**, derived from `Date` on read and never stored — it is a function of the calendar, not an observation, so there is nothing to persist and no value that can go stale. It earns its place as a **control**: a strategy set reporting a strong lunar effect is reporting its own false-positive rate. It is also, straightforwardly, fun. **The display contract is the constraint, and it is deliberate.** Results are not ranked, not badged with significance, and not surfaced as an insights feed. Ranking by strength selects precisely for whichever metric got lucky, and a significance badge converts a coincidence into a claim someone may act on. Show the coefficient with its sample size and let the User read it as exploration. A minimum sample size gates output entirely: below it, return nothing rather than a coefficient built from a handful of days. That threshold is configuration, not a constant. ## Acceptance criteria - [ ] `CorrelationStrategy` is a closed enum; Spearman is implemented - [ ] Every strategy returns the same result shape - [ ] Correlations score `MetricKind`s against `DayMood`, one point per `Date` - [ ] A `Date` with several entries contributes one point, not one per entry - [ ] Below the configured minimum sample size, no coefficient is returned - [ ] Minimum sample size is configuration - [ ] `MoonPhase` derives from `Date`, is never stored, and is correlated like any other input - [ ] Results display with coefficient and sample size, unranked and unbadged - [ ] No p-values or significance indicators appear anywhere in the response or UI ## Blocked by - #7 - #12
GKaszewski added the ready-for-human label 2026-08-26 09:15:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/k-mood#15