Split Tomorrow report identity

This commit is contained in:
2026-06-14 23:22:31 +00:00
parent afe6803a63
commit 386263784c
20 changed files with 75 additions and 73 deletions

View File

@@ -394,7 +394,7 @@ func reportIDForCommand(kind ReportKind) (report.ID, error) {
case ReportDaily:
return report.DailyToday, nil
case ReportTomorrow:
return report.DailyTomorrow, nil
return report.Tomorrow, nil
case ReportHourly:
return report.Hourly, nil
case ReportThreeDay:
@@ -1085,7 +1085,7 @@ func recentChanges(ctx context.Context, store state.Store, priorSnapshot *state.
PrecipTimingShiftMinutes: cfg.PrecipTimingShiftMinutes,
}
switch reportID {
case report.DailyToday, report.DailyTomorrow:
case report.DailyToday, report.Tomorrow:
return changes.CompareDaily(previous, current, thresholds)
case report.ThreeDay:
return changes.CompareThreeDay(previous, current, thresholds)

View File

@@ -1240,7 +1240,7 @@ func TestGenerateTomorrowReportUsesTomorrowBriefingDate(t *testing.T) {
t.Fatalf("GenerateReport() error = %v", err)
}
if result.Metadata.ReportID != report.DailyTomorrow || result.Metadata.Variant != "tomorrow" {
if result.Metadata.ReportID != report.Tomorrow || result.Metadata.Variant != "tomorrow" {
t.Fatalf("metadata report/variant = %q/%q, want tomorrow", result.Metadata.ReportID, result.Metadata.Variant)
}
dailySummary, ok, err := module.StanzaValue[map[string]any](result.ModuleSnapshot, "derived_daily_summary")
@@ -1253,12 +1253,12 @@ func TestGenerateTomorrowReportUsesTomorrowBriefingDate(t *testing.T) {
if _, ok := result.ModuleSnapshot.LookupStanza("tomorrow_planning"); !ok {
t.Fatal("tomorrow_planning stanza missing")
}
if !strings.Contains(filepath.Base(result.ReportPath), "daily_tomorrow") {
if !strings.Contains(filepath.Base(result.ReportPath), "tomorrow") {
t.Fatalf("ReportPath = %q, want managed tomorrow report path", result.ReportPath)
}
}
func TestTomorrowReportCanCompareAgainstPriorDailySnapshot(t *testing.T) {
func TestTomorrowReportCanCompareAgainstPriorTomorrowSnapshot(t *testing.T) {
server := dailyBundleServer(t)
cfg := config.Defaults()
cfg.WeatherAPI.BaseURL = server.URL + "/"
@@ -1270,8 +1270,7 @@ func TestTomorrowReportCanCompareAgainstPriorDailySnapshot(t *testing.T) {
}
priorResolved, err := ResolveGenerate(GenerateRequest{
Config: cfg,
Report: ReportDaily,
Date: mustParse("2026-05-30T12:00:00-05:00"),
Report: ReportTomorrow,
}, mustParse("2026-05-29T17:00:00-05:00"))
if err != nil {
t.Fatalf("ResolveGenerate(prior) error = %v", err)
@@ -1301,10 +1300,10 @@ func TestTomorrowReportCanCompareAgainstPriorDailySnapshot(t *testing.T) {
t.Fatalf("GenerateReport() error = %v", err)
}
if result.PriorSnapshot == nil {
t.Fatal("PriorSnapshot = nil, want compatible prior daily snapshot")
t.Fatal("PriorSnapshot = nil, want compatible prior tomorrow snapshot")
}
if len(result.RecentChanges) == 0 {
t.Fatal("RecentChanges length = 0, want changes from compatible prior daily snapshot")
t.Fatal("RecentChanges length = 0, want changes from compatible prior tomorrow snapshot")
}
}
@@ -1622,7 +1621,7 @@ func TestResolveGenerateMapsCommandToReportDefinition(t *testing.T) {
{
name: "tomorrow",
kind: ReportTomorrow,
wantID: report.DailyTomorrow,
wantID: report.Tomorrow,
wantPrompt: "weather.daily_report",
wantStart: "2026-05-30T00:00:00-05:00",
wantEnd: "2026-05-31T00:00:00-05:00",