← Back to Pull requests

fix: protocol start date lands a day early west of Greenwich #12

Closed
unknown closed this pull request without merging on Aug 11, 2026 06:10 UTC
View on GitHub
unknown unknown commented on Aug 11, 2026 05:56 UTC
Author

Fixes #10. Picking 5 July stored 4 July for anyone in the Americas.

new Date("2026-07-05") and new Date("2026-07-05T00:00") are not the same instant. The language parses a date-only string as UTC and a date-time string with no offset as local, so the bare form used by the start date handler landed on the previous evening in every timezone behind UTC. In US Central the picked 5 July became 4 July at 19:00, and toDateInput read it back as the 4th.

Ahead of UTC it happened to look fine, UTC midnight being 02:00 the same morning in Ljubljana, which is why the report came from Central time and not from anywhere in Europe.

It was not only cosmetic. startedAt anchors the schedule, and every dose time is derived from its local day, so the whole series shifted a day earlier along with the label.

fromDateInput builds the instant from parts instead of parsing a string, which sidesteps the rule rather than working around it, and is how src/lib/import/values.ts already reads a date. The three datetime-local inputs were never affected: they pass a date-time string, which parses as local already.

The new test fails on the old implementation in America/Chicago on five of its eight cases, and the round trip assertion holds in every timezone, so it does not depend on where CI happens to run.

Gate: tsc clean, eslint clean, 970 tests including 8 new, passing in six timezones from Kiritimati to Chicago.

Diff: 178 lines (+133 / -45) across 2 files Reviewer: ArunNGun Review duration: 13m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 178 lines diff across 2 files
0.35
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.310
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.5% (MEDIUM) · Higher = larger blast radius
35.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.3% · Safe to merge
15.3%
Repository