Skip to content

ctx v0.19.0

Choose a tag to compare

@github-actions github-actions released this 05 Apr 19:39
· 1608 commits to root since this release
v0.19.0
49aebc8

monthday + seasonal dimensions — Cyclic Phase Model ~95%

Closes two gaps in the GottZ Cyclic Phase Model: monthday (day-of-month, ~30-cycle) and seasonal (day-of-year, 365-cycle).

Principle

Every cyclic time variance must be dimensionally captured. The original vision spec had naming bugs:

  • "monthly" was meant as day-of-month, not month-of-year
  • "yearly" was meant as day-of-year (seasonal), not year-number

year stays linear/monotonic (not cyclic). Only day-of-year is cyclic (seasonal patterns like Christmas recur annually).

What's new

Two new cyclic dimensions:

Dimension Cycle σ Semantics
monthday ~30 days 0.10 Monatsanfang, Gehaltstag, 1.-5. des Monats
seasonal 365 days 0.08 Weihnachten, Jahrestage, "letztes Jahr um diese Zeit"

Schema (Migration 019)

  • Two new partial B-Tree indexes (idx_temporal_monthday, idx_temporal_seasonal)
  • Backfill from existing source_date values via EXTRACT(DAY/DOY FROM ...)
  • No schema changes — derived from existing data

Engine

  • DimensionPhase: +monthday (v-1)/30, +seasonal (v-1)/365
  • QueryPhase: +monthday t.Day(), +seasonal t.YearDay()
  • DimensionSigma: +monthday=0.10, +seasonal=0.08
  • year explicitly removed from DimensionSigma (not cyclic)

Parser matchers

  • matchAnnualHoliday: Weihnachten, Silvester, Neujahr → {month: 0.4, seasonal: 0.6} (dual-anchor)
  • matchMonthSegment: Monatsanfang / Monatsmitte / Monatsende → {monthday: 1.0} (pure cyclical)
  • Priority 8a/8b in NormalizeTemporalRules

Results

  • Backfill: 158 blocks × 2 new dimensions = 316 new EAV rows
  • Live: "Weihnachten" → cyclic_dims=[month, seasonal], 25 matches, 1ms latency
  • Live: "Monatsanfang" → cyclic_dims=[monthday], 41 matches, 0ms
  • Tests: +30 unit tests, test.sh 16/16, eval.sh 43/43, no regression

Still missing (v0.20.0)

daily dimension (hour-of-day) requires schema change: content_dates DATE[] → content_times TIMESTAMPTZ[].

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v0.19.0

Full Changelog: v0.18.0...v0.19.0