Skip to content

feat(time): resolve named sync ranges in IANA timezone - #416

Merged
BramVR merged 2 commits into
mainfrom
codex/issue-402-timezone-ranges
Jul 31, 2026
Merged

feat(time): resolve named sync ranges in IANA timezone#416
BramVR merged 2 commits into
mainfrom
codex/issue-402-timezone-ranges

Conversation

@BramVR

@BramVR BramVR commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Outcome

  • add sync --timezone <IANA-zone> with UTC fallback and exact now, today, and yesterday inputs
  • resolve one captured clock across fan-out into physical, civil, or daily provider boundaries
  • preserve explicit date/RFC3339 behavior, exclusive --to, strict preflight, and exact provider-string cursor semantics
  • handle 23/25-hour DST days, skipped civil dates, skipped/repeated midnight transitions, fold identity during validation, and fractional physical now
  • update the command registry, status conflicts, completion policy, generated command docs, and drift coverage

Closes #402

Proof

  • go test ./...
  • go test -race ./...
  • make fmt-check
  • go vet ./...
  • pinned repository lint: 0 issues
  • make docs-check
  • make docs-site
  • exact built CLI help + invalid-zone preflight proof
  • Windows amd64 binary and test-binary cross-build; hosted Windows execution remains a required PR check
  • go mod verify and go mod tidy -diff
  • reachability vulnerability scan: no vulnerabilities found
  • Public Model Identifier Gate and production confidentiality gate: clean
  • default structured autoreview: clean after accepted edge-case fixes
  • required API-boundary second-engine autoreview: clean

Risk and scope

No schema, migration, provider write, credential, release, or publication changes. Sync planning resolves once; execution consumes the planned provider strings, and completed-run cursor advancement still stores the exact resolved exclusive --to. Embedded timezone data and persisted config precedence remain scoped to #403; resolved-range status/audit exposure remains scoped to #405.

Dependency freshness was audited without widening this feature PR. Available module updates are unrelated; this change adds no dependency.

Copilot AI review requested due to automatic review settings July 31, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds timezone-aware resolution for named sync range boundaries (now, today, yesterday) so a single captured clock instant can be rendered into provider-appropriate physical/civil/daily boundaries (including DST edge cases) while preserving existing explicit date/RFC3339 behavior and exclusive --to semantics.

Changes:

  • Introduces a new range resolver that resolves named boundaries in an explicit IANA timezone (defaulting to UTC) and preserves exact instants for preflight ordering.
  • Threads --timezone and a single captured resolvedAt through sync planning/execution so fan-out members share one resolution clock.
  • Updates CLI surface area and documentation (flags, --status conflicts, completion tests, and command docs), plus expands test coverage for DST/skipped-date/fold and fractional precision.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/googlehealth/rollup_spec.go Allows named boundaries through rollup normalization and preserves fractional RFC3339 via RFC3339Nano formatting.
internal/googlehealth/rollup_spec_test.go Adds coverage to ensure hourly rollup normalization preserves fractional RFC3339 precision.
internal/googlehealth/range_resolver.go New resolver for named boundaries with IANA timezone handling and target-aware rendering (physical/civil/daily).
internal/googlehealth/range_resolver_test.go Adds extensive tests for resolver behavior across targets, DST, skipped dates, fold instants, and precision.
docs/commands/sync.md Documents --timezone and named boundaries semantics, including DST/skipped-date behavior.
cmd/gohealthcli/sync.go Adds --timezone flag and validates explicitly provided empty timezone.
cmd/gohealthcli/sync_timezone_test.go End-to-end tests asserting named boundaries reach correct provider filters per target shape and that cursor stores exact resolved --to.
cmd/gohealthcli/sync_status.go Adds --timezone to the deterministic conflict list for sync --status.
cmd/gohealthcli/sync_status_test.go Tests --timezone conflict handling with --status.
cmd/gohealthcli/sync_preflight_gate.go Integrates range resolution into preflight, preserves legacy default-to behavior when applicable, and tightens ordering checks using exact instants.
cmd/gohealthcli/sync_preflight_gate_test.go Adds tests for local-now resolution, explicit-boundary ordering, DST/fold handling, and shared resolution clock behavior.
cmd/gohealthcli/sync_orchestrator.go Captures a single resolvedAt once per fan-out invocation when absent.
cmd/gohealthcli/sync_orchestrator_test.go Tests that one captured range clock is shared across fan-out members.
cmd/gohealthcli/completion_test.go Adds completion directive coverage for sync --timezone.
cmd/gohealthcli/commands.go Updates generated command registry text to describe named boundaries + --timezone.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/googlehealth/rollup_spec.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@BramVR
BramVR merged commit 6b97824 into main Jul 31, 2026
7 checks passed
@BramVR
BramVR deleted the codex/issue-402-timezone-ranges branch July 31, 2026 10:38
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.

feat(time): resolve named sync ranges in an explicit IANA timezone

2 participants