2.0 KiB
2.0 KiB
Changes Internals
This document describes structured Recent Changes comparison.
Purpose
internal/changes compares current and prior module snapshots and emits
compact change records for prompt input data packages.
Inputs And Outputs
Inputs:
- prior module snapshot
- current module snapshot
- comparison thresholds from configuration
Outputs:
- ordered
changes.Changeitems with type, message, previous value, and current value where useful
Boundaries
- This package compares structured module snapshot data only.
- It does not read filesystem state, find prior snapshots, render Markdown, invoke Scriptorium, or compare generated report text.
Config Fields Used
The app maps these fields into comparison thresholds:
recent_change.temperature_degreesrecent_change.precip_probability_pointsrecent_change.wind_gust_miles_per_hourrecent_change.precip_timing_shift_minutes
External Adapters Used
None.
State Or Manifest Behavior
None directly. The app loads prior module snapshots through internal/state
before calling comparison functions.
Skip And Resume Behavior
No resume behavior. When the app has no prior comparable snapshot, it sends an empty Recent Changes list without calling a comparison function.
Failure Behavior
- Daily comparison requires
derived_daily_summaryandderived_daypart_summariesstanzas. It also usesalert_digestandprecip_timingwhen present. - 3-Day comparison requires
derived_daypart_summaries. - Weekend comparison requires
derived_daypart_summaries. - Storm Report comparison returns no changes.
Tests
Inspect:
internal/changes/daily_test.gointernal/changes/three_day_test.gointernal/changes/weekend_test.gointernal/app/app_test.go
Invariants
- Recent Changes are based on structured snapshots, not Markdown report text.
- Report compatibility is determined outside this package by report definitions and state lookup.
- Output stays compact enough for prompt input.