Repository navigation
Improve archive recovery, multi-station workflows, and weather analysis for v0.4.0 - #9
Merged
lennrt merged 15 commits intoOct 18, 2026
Conversation
lennrt
approved these changes
Oct 18, 2026
lennrt
approved these changes
Oct 18, 2026
17 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Archive owners can repair selected history and continue bounded MCP backfills across daylight-saving changes. Metadata exports support reproducible analysis. Multi-station users can select the exact MCP collection device and find its parent station in the app. Weather views preserve sensor coverage, correct seasonal and pressure trends, expose dense chart readings, and keep table controls across refreshes.
This consolidated batch contains twelve improvements and the 0.4.0 development version bump:
CLI range repair:
collect --start YYYY-MM-DD --end YYYY-MM-DDfills old gaps even when newer observations exist. Both local dates are included, with a 366-calendar-day limit. Invalid ranges fail before external work. Replay preserves committed rows and ordinary collection metadata, with existing checkpoint and backup rules.Exact MCP continuation:
backfill_archiveaccepts exclusivebefore_epoch. Pass the returnednext_beforedirectly and repeatstartandmax_days. Explicit requests preserve shared progress. This fixes the one-hour gap that date-only continuation can leave on a 25-hour day.Event-sensor coverage: observation points include
rain_readingsandlightning_readings. Counts distinguish unknown totals, measured zero, and partial coverage. MCP Apps displays missing readings and an incomplete-coverage notice while preserving original tool results and arbitrary SQL values.Seasonal trend correction: center both time and temperature within each calendar month. An unmatched month no longer dilutes the trend. The regression fixture previously reported about 0.8973°F per decade instead of 36. Repeated constant readings return zero slope, with undefined R² omitted and a “flat” CLI label.
Dense chart inspection: pointer, touch, and keyboard controls select every returned point, up to 2,000. The inspector shows the source time and timezone, metric, units, and missing state. It uses actual plotted spacing and preserves selection and focus on resize.
Richer exports: opt-in
export --metadataappends device identity, report and wind intervals, precipitation type, and source. Default CSV/JSONL output stays unchanged. The new read-only streaming API preserves stored zeroes and missing values, supports older schemas, bounds source text, and enables reproducible solar-energy estimates.Table refresh continuity: compatible results keep the selected dataset, search, sort direction, and valid page. Pending edits, search focus, and text selection survive. Changed structures or new request contexts reset controls; failed refreshes keep the previous view.
MCP device selection:
mcp --device-idoverridesTEMPEST_DEVICE_ID. A positive ID resolves lazily to an accessible Tempest device and its default station. Empty or zero environment values keep discovery. Explicit tool station overrides affect one read only. Unknown or non-Tempest selections cannot collect into or bind the archive, and archive-only reads remain available.Station-device exploration:
list_stationsgains a derived Devices table with parent station ID/name, device ID/type, and serial. IDs are searchable without separators. The view retains missing fields and duplicates, caps traversal at 2,000 stations and device entries, and marks unsafe browser integers instead of offering rounded IDs. No payload mutation or extra API call is needed.Pressure comparison correction: use indexed candidates on both sides of the requested window start, choose the nearest eligible sample, and prefer the older sample on ties. Pairs must span at least half the window. A sparse fixture previously reported rising pressure (+3 mb/3h) where the nearest reading shows falling pressure (about -6.0335 mb/3h). Actual sample span and freshness rules remain visible.
Early report validation:
statsandexportreject unsupported epochs or ranges above the existing elapsed-span limit before dotenv or archive access, returning usage status 2. Valid local calendar days retain their daylight-saving boundaries.Rain-summary coverage:
rain_statsand CLI rain reports return an explicit null total when no rain readings exist, preserve measured zero, and exposeobservationsplusrain_readings. Partial totals sum only reported measurements. The app keeps a rainfall headline for missing data and shows coverage without implying continuous uptime.Nine improvements came from code and workflow investigation under the autonomous improvement request. Richer exports, table-filter persistence, rain-summary coverage, the feature-focused documentation overview, and the version bump were explicit user priorities. The docs overview now leads with multi-station discovery and selection, then highlights interactive charts, archive repair, exports, and offline workflows. No open feature issue supplied this scope. Existing dependency PRs #2, #6, and #8 are outside this batch.
Compatibility
SeriesPointadds two integer fields. Existing method signatures stay unchanged.RainStats.TotalInchanges fromfloat64to*float64; callers must handle nil.RainStatsalso addsObservationsandRainReadings. External unkeyedSeriesPointstruct literals need the added fields.ArchiveObs,EachArchiveObs, andMaxArchiveSourceBytesare additive API for streaming stored metadata.before_epochinput and reading counts. Strict JSON consumers must accept the new fields. Corrected seasonal and sparse-pressure trend values and flat-series behavior are intentional. Export metadata is opt-in and leaves default output unchanged. Rain summarytotal_inis always present as number-or-null, with two required sample counts; strict consumers must accept these changes.TEMPEST_DEVICE_ID, including rejecting previously ignored malformed values. Explicit CLI ranges ignore an environment seed floor and reject an explicit--backfill-startconflict.The follow-up export and refresh specification and ADR 0010 record optional metadata, source bounds, table state, and version decisions.
The latest station-selection and pressure specification and ADR 0011 cover device choice, bounded device inspection, pressure samples, and early report bounds. Live conditions and forecasts remain station-level, even when one of several devices at a station is selected. Device resolution retries follow the configured API cache lifetime. Lazy startup can create an empty archive before discovering that a positive device ID is inaccessible; failure cannot bind or collect into it.
The rain coverage specification and ADR 0012 explain the intentional nullable-total contract. Rainy-day thresholds, day counts, wettest-day selection, and spell rules remain unchanged. Counts describe stored samples, not continuous coverage; daily, period, and climate-normal rainfall contracts are outside this slice.
Observation-series numeric event totals retain their existing zero default for compatibility. Consumers must use the new counts to distinguish unavailable readings. Counts measure samples, not continuous uptime. Trend R² describes the within-month fit, not statistical significance.
Verification
make verifypassed on Go 1.27.2, macOS ARM64: modules, formatting/imports, docs, tidy, vet, ordinary tests, race tests, four fuzz targets, lint, workflows, generated API, vulnerability/license/SBOM/secret checks, pure-Go host and Linux ARM64 builds, and the synthetic MCP demo.npm run spec:checkpassed all eleven baseline/change items.npm run app:build,npm run app:check, andnpm run app:testpassed; 55 browser tests cover the final bundle.npm run app:screenshotspassed. Desktop and 390-pixel views were inspected independently.All 11 hosted checks passed against commit
f7d57f2d402fdcf39a523ba94ae17b0e5530a6f4, including full Linux verification, native macOS/Windows tests, 55 browser tests, specifications, CodeQL, lint, and supply-chain checks. See the CI run and PR checks. No live WeatherFlow credentials were used. Browser tests use the official synthetic host and do not certify a specific third-party client. The subprocess signal test skips Windows becauseos.Interruptcannot signal a child there; the remaining tests run natively in CI.Security and privacy
Documentation
make docs-checkand strict specification checks passed after the final evidence edits.Active binary fallback, plugin, embedded app, and version guidance now use 0.4.0. The batch uses fifteen logical commits on one branch. No release, tag, deployment, or merge is part of this PR.