Skip to content

Improve ten weather and archive workflows for v0.5.0 - #12

Merged
lennrt merged 11 commits into
lennrt:mainfrom
agent-lennrt:improve/ten-verified-workflows-20261101
Nov 1, 2026
Merged

lennrt merged 11 commits into
lennrt:mainfrom
agent-lennrt:improve/ten-verified-workflows-20261101

Conversation

@agent-lennrt

@agent-lennrt agent-lennrt commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Ten new improvements to weather analysis, archive collection, and interactive exploration, based on current main after merged PR #9. This is one consolidated follow-up PR.

# Improvement and benefit Direct regression evidence
1 Paired comfort readings. Heat index, wind chill, and dew point use matching sensor samples. Disjoint temperature/humidity rows no longer invent a 146.6°F heat index. TestComfortRequiresPairedInputs, outliers, zero, quarter-hour means, and inclusive threshold checks.
2 Historical rain coverage. Daily, period, and this-day totals preserve missing rain as null, retain measured zero and available partial sums, and expose sample counts. Rain normals use rain-contributing years. CLI/MCP/app views explain coverage. TestHistoricalRainCoverage, TestHistoricalRainNormalsDenominator, actual MCP nullable schemas, terminal partial markers, and browser history tests.
3 Collision-safe backups. Rapid repeated collections preserve separate snapshots. Bounded retries never overwrite an existing file; retention orders both old and new timestamp formats correctly. Same-clock distinct-byte copies, mixed-format retention, saturated collision cleanup, and symlink checks.
4 Newest live observation. Select the greatest validated timestamp regardless of API array order; first row wins ties. Ascending, descending, shuffled, tied, singleton, and malformed-row cases.
5 Stable collection device. Without an explicit selector, CLI collection reuses an existing archive's device. Reordering accessible stations no longer breaks an unattended collector. Actual mock HTTP collection with reordered stations; bound, legacy, empty, corrupt, and explicit-override cases.
6 Offline archive status. `tempestkeep status --format text json` reports coverage, freshness, saved backfill state, and ten largest internal gaps over one hour without a token or MCP client.
7 Daily forecast summaries. Daily cards show high, low, maximum rain chance, and returned day count, preserving missing values. Browser checks for daily/hourly switching, missing values, and measured zero.
8 Long SQL cell inspection. Search beyond compact previews and open an accessible text dialog, with a shared 65,536-character limit and clear truncation notice. Keyboard open/close, focus return, hostile text, limit boundaries, and stale-dialog replacement.
9 Dataset keyboard continuity. Switching datasets keeps focus on the replacement selected control, so keyboard navigation can continue. Browser keyboard selection, focus, and next-Tab assertions.
10 Explicit device validation. collect --device-id 0 fails before configuration or external work instead of silently choosing another device. Invalid dotenv/no-token/no-file regression and selector precedence cases.

These ideas came from investigation under the autonomous improvement request, extending the earlier user priorities around rainfall and multi-station workflows. Existing dependency PRs #2, #10, and #11 are not duplicated. Documentation highlights these workflows; version metadata advances to 0.5.0-dev. Documentation and version work are not counted as extra improvements.

Adversarial review follow-up

Four reproduced defects are repaired in this same PR:

Finding Repair and regression
Metadata limits measured SQLite's native encoding, rejecting valid UTF-16 ASCII and accepting oversized UTF-8 CJK values. Bound the encoded SQL projection, then enforce the existing 4,096-byte limit on the returned string. TestMetadataReadBoundsAcrossDatabaseEncodings covers both readers, UTF-8/UTF-16le/UTF-16be, Unicode boundaries, NULL, NUL, and non-TEXT values.
A legacy metadata view could reevaluate its value between the size guard and projection, bypassing the intermediate allocation bound. Materialize one selected value before checking it. TestMetadataViewEvaluatesValueOnce uses an isolated deterministic test driver to alternate short and oversized values.
Automatic collection used a duplicate metadata query that missed uppercase legacy META tables and rejected long valid UTF-16 device IDs. Use the shared bounded metadata reader. TestCollectionDeviceMetadataUsesSharedReader protects saved identity in all three cases.
The terminal day rain chart displayed absent sensor readings as zero. This predates the PR but conflicts with its missing-rain requirement. Leave absent readings as gaps and retain measured-zero and partial readings. TestDayRainSparklinePreservesMissingAndReportedReadings exercises the actual renderer.

Each bug regression failed against the prior implementation and passed with the fix. No additional production UI defect was reproduced. Existing browser tests now also check all-zero daily forecasts and text ending exactly at the 65,536-character search boundary. Independent analytics probes covered UTC, the Los Angeles fall-back day, and Kathmandu.

The README and command guides clarify saved device identity in empty archives and rain-chart gaps. The deterministic documentation capture now includes daily forecast cards and the searchable Devices table. Both new images were inspected independently and use synthetic data.

Follow-up verification at 100f84f: full make verify on Go 1.27.3, all 63 browser tests, bundle build/check, four screenshot captures, 19 strict specification checks, 131 Markdown files, and post-commit secret scanning passed. All 11 hosted checks passed on this head: CI, CodeQL and its result check, and dependency review. The earlier run below records initial qualification.

Examples: daily forecast, searchable station devices.

Compatibility

  • Public Go API impact classified: DayStat.RainIn, PeriodStat.RainIn, YearDay.RainIn, MonthNormal.AvgRainIn, and MonthNormal.AvgRainyDays become pointers. Consumers must handle nil. Historical structs add reading/contributing-year counts; unkeyed literals need adjustment.
  • JSON/MCP impact classified: corresponding rain fields are explicit number-or-null, with additive rain_readings/rain_years. Rainy-day counts remain counts of observed rainy days. Partial months can contribute to normals; neither counts nor totals establish continuous coverage.
  • Archive/configuration impact classified: no schema migration or runtime dependency additions. Unconfigured CLI collection follows existing archive identity. Explicit CLI zero is invalid; nonempty zero environment values remain invalid for CLI collection. MCP retains its existing automatic zero environment behavior. Backups gain nanosecond filenames; legacy names remain eligible for retention.
  • Metadata readers apply the writer's existing 4,096-byte/NUL rules, with bounded intermediate allocation across UTF-8 and UTF-16 archives. Invalid stored metadata returns ErrInvalidArchive; ordinary malformed completion markers retain ErrInvalidCheckpoint.
  • ADRs 0013–0020 and active OpenSpec proposals document decisions and scenarios. The required Go patch moves to 1.27.3, because the final scan reproduced GO-2026-6809 on the old 1.27.2 baseline. No security check was disabled.

Verification

  • Full make verify passed on Go 1.27.3: modules, formatting/imports, documentation, vet, ordinary/race tests, four fuzz targets, lint, workflow validation, generated API evidence, vulnerabilities, licenses, SBOM, secrets, pure-Go host/Linux ARM64 builds, and the synthetic MCP demo. A task-specific temporary directory avoided unrelated lint lock contention; no checks were weakened.

  • npm run app:build, npm run app:check, and all 63 browser tests passed. npm run app:screenshots passed; desktop and 390-pixel views were inspected.

  • Focused ordinary/race tests and independent reproductions passed. New regressions failed against the original behavior before implementation. Live ordering is defensive contract hardening, not a claimed production outage.

  • Independent reviewers inspected the actual diff and requirements. Both supported findings were reproduced and repaired: partial this-day rain display and unbounded metadata reads. The 16 MiB metadata experiment fell from about 16 MiB to about 7 KiB of Go allocation while preserving error classification.

  • Bounded ub-mode tool audit ran in a separate scratch copy. Status mutation tests killed 25/28 variants; three survivors are equivalent under coverage-extrema validity and RFC3339 subsecond formatting. Three useful text-output assertions were added from the first run. Status functions scored below CRAP 10 with measured coverage. This is not a whole-project mutation score; the tool does not separately classify compilation failures or timeouts.

  • All 11 hosted checks passed for head 807fc71: CI (Go 1.27.3 verification, browser tests, macOS, Windows, lint, OpenSpec, vulnerabilities/licenses/SBOM, and history secret scanning), CodeQL and its result check, and dependency review.

Security and privacy

  • Synthetic data only; no credential, private station data, archive, export, or personal path included.
  • Inputs, display work, backup retries, metadata reads, and status output retain explicit bounds. Diagnostics preserve classifications and redaction.
  • No additional network origins, browser write controls, deployments, package releases, or merges.

Documentation

  • User, operator, API, release, multi-station, and feature documentation updated.
  • Behavior changes include ADRs, OpenSpec scenarios, and regression tests.
  • Documentation checks passed all 131 Markdown files; strict OpenSpec validation passed all 19 baseline/change items after the toolchain patch.

Review team and limits

The initial implementation run used ten real model instances: this coordinator and nine separately routed gpt-6.1-sol contributors, scheduled in batches because only three contributors can run concurrently. The coordinator's underlying model identity was not independently exposed by the harness. Research, implementation, and review had separate contexts. The adversarial follow-up used three fresh gpt-6.1-sol reviewers, each explicitly routed at ultra reasoning. They independently reviewed analytics, archive behavior, and the app, then cross-reviewed fixes. Team agreement is not proof of correctness.

Tests use synthetic data and a local MCP Apps host. No live WeatherFlow credentials or third-party client certification were used. Comfort remains a quarter-hour estimate; rain normals can include partial months. Status gaps exclude intervals before and after the archive. SQL inspection/search covers returned rows and the disclosed per-cell limit. Further release qualification remains a maintainer decision.

@agent-lennrt
agent-lennrt requested a review from lennrt as a code owner November 1, 2026 18:43
Apply the existing UTF-8 limit after a bounded projection of one materialized value. Regression tests reproduce UTF-16 boundary errors and repeated view evaluation; focused race tests and make verify pass.
Preserve saved identity for UTF-16 archives and case-insensitive legacy metadata tables. The new selector regressions fail on the previous implementation and pass with the shared reader.
Use rain sample counts instead of observation counts to distinguish absent rain from measured zero. The actual renderer regression covers missing, zero, and partial readings; ordinary and race checks pass.
Add reproducible synthetic screenshots, clarify saved device and rain-gap behavior, and strengthen zero-value and long-cell browser boundary assertions. All 63 browser tests, screenshot capture, and documentation checks pass.
@lennrt
lennrt merged commit bbd2522 into lennrt:main Nov 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants