Skip to content

Commit 460811e

Browse files
authored
docs(planning): close phase 66.3.1 after #1154 merged and deployed (#1155)
Closes out Phase 66.3.1 in `.planning/`. Planning docs only; no code changes. - `66.3.1-13-SUMMARY.md` covers the plan 13 work: - the Chrome check on the owner's local day; - four review cycles, with every finding fixed; - the merge as `34af21437`; - export-report v154 and generate-pdf v149 deployed from main and checked with `get_edge_function`; - the Vercel production deploy READY. - `STATE.md` and `ROADMAP.md` mark 66.3.1 complete (13/13) and point to 66.4. - Follow-ups recorded for a later phase: - `formatDate` prints timestamptz values on their UTC day in about 27 files; - the comment inside `generate_lease_rent_charges`; - V-2 accepts `{ p_today: undefined }`. [hudsor01]
2 parents 34af214 + 6cf768d commit 460811e

3 files changed

Lines changed: 101 additions & 9 deletions

File tree

‎.planning/ROADMAP.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ None of the renumbered phases had a directory, plan, summary or PR, so nothing s
3939
- [x] **Phase 66.1: Postgres-backed rate limiting with trusted client-IP forwarding** *(INSERTED)* - Move the limiter off Upstash into Postgres, fail closed, with a real per-client key on `/apply/[token]` (completed 2026-08-22, #967)
4040
- [x] **Phase 66.2: Tailwind v4 and shadcn/ui canonical remediation** *(INSERTED)* - Fix the live styling defects (magenta secondary, mobile control deformation, unreadable dark-mode surfaces) at the root, then canonicalize tokens, classes and vendored shadcn components, and move the owner shell to the canonical shadcn Sidebar. One PR.
4141
- [x] **Phase 66.3: Lease and analytics fixes** *(INSERTED)* - Lease detail Terms/Timeline/Renew/Terminate, analytics trends and labels, printable application without screening claims (completed 2026-12-01, #1142; follow-ups #1153)
42-
- [ ] **Phase 66.3.1: Owner-local dates and unit whitespace** *(INSERTED)* - Owner date math uses the owner's local day instead of UTC; unit numbers and property names normalized on write
42+
- [x] **Phase 66.3.1: Owner-local dates and unit whitespace** *(INSERTED)* - Owner date math uses the owner's local day instead of UTC; unit numbers and property names normalized on write (completed 2026-12-03, #1154)
4343
- [ ] **Phase 66.4: Record any expense** *(INSERTED)* - Property-level expenses with categories, recurring entries and receipts
4444
- [ ] **Phase 66.5: Rent roll and late-rent alerts** *(INSERTED)*
4545
- [ ] **Phase 66.6: Security deposit tracking** *(INSERTED)*
@@ -401,7 +401,7 @@ Plans:
401401
- [x] 66.3.1-10-PLAN.md — Replay fixture local-day-and-trim (authenticated unit insert, day clamp, reversal date, ACLs), assertion, CLI, workflow step, mutation-sweep rows
402402
- [x] 66.3.1-11-PLAN.md — V-2 made absolute, full gates, local migration replay, Aikido scan
403403
- [x] 66.3.1-12-PLAN.md — Owner-gated production apply (A1-A3, B), ledger reconcile, md5 fidelity, ACL/DATE-03 sweeps, rolled-back probes, db:types fix + regen, integration runs
404-
- [ ] 66.3.1-13-PLAN.md — Claude in Chrome verification, owner go-ahead PR, CI + perfect-PR loop, post-merge export-report/generate-pdf deploy
404+
- [x] 66.3.1-13-PLAN.md — Claude in Chrome verification, owner go-ahead PR, CI + perfect-PR loop, post-merge export-report/generate-pdf deploy
405405

406406
### Phase 66.4: Record any expense (INSERTED)
407407

@@ -555,7 +555,7 @@ Phases execute in this order: 52 → 53 → 54 → 55 → 56 → 65 → 66 → 6
555555
| 66.1 | 5/5 | Complete | 2026-08-22 |
556556
| 66.2 | 39/39 | Complete | 2026-11-09 |
557557
| 66.3 | 12/12 | Complete | 2026-12-01 |
558-
| 66.3.1 | 12/13 | In Progress | - |
558+
| 66.3.1 | 13/13 | Complete | 2026-12-03 |
559559
| 66.4 | 0/TBD | Not started | - |
560560
| 66.5 | 0/TBD | Not started | - |
561561
| 66.6 | 0/TBD | Not started | - |

‎.planning/STATE.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ gsd_state_version: 1.0
33
milestone: v10.0
44
milestone_name: Claims Integrity + Canonical Feature Expansion
55
status: executing
6-
last_updated: "2026-12-03T02:45:00.000Z"
7-
last_activity: 2026-12-02
8-
stopped_at: "Phase 66.3 merged 2026-12-01 as #1142; follow-ups merged as #1153 (7c430f43f; migration 20261201125304). Phase 66.3.1 (owner-local dates and unit whitespace) inserted and planned 2026-12-01 (13 plans, 8 waves, checker passed, 0 blockers). Executing 66.3.1 since 2026-12-02: waves 1-7 (plans 01-12) done; the four migrations are live in production (20261203000149, 20261203000405, 20261203010229, 20261203022837), types regenerated, the three integration files pass. Next: plan 13 (Chrome check, owner go-ahead PR, merge, export-report and generate-pdf deploy)."
6+
last_updated: "2026-12-03T16:40:00.000Z"
7+
last_activity: 2026-12-03
8+
stopped_at: "Phase 66.3 merged 2026-12-01 as #1142; follow-ups merged as #1153. Phase 66.3.1 (owner-local dates and unit whitespace) merged 2026-12-03 as #1154 (34af21437): four migrations live (20261203000149, 20261203000405, 20261203010229, 20261203022837), export-report v154 and generate-pdf v149 redeployed from main. Follow-ups: formatDate UTC timestamptz class (~27 files), generate_lease_rent_charges in-body comment, V-2 accepts p_today undefined. Next: /gsd:discuss-phase 66.4."
99
progress:
1010
total_phases: 22
11-
completed_phases: 10
11+
completed_phases: 11
1212
total_plans: 124
13-
completed_plans: 123
14-
percent: 45
13+
completed_plans: 124
14+
percent: 50
1515
---
1616

1717
<!--
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
phase: 66.3.1-owner-local-dates-and-unit-whitespace
3+
plan: 13
4+
subsystem: verification / ship
5+
tags: [p_today, chrome, pr, perfect-pr, edge-functions, deploy]
6+
requires: ["66.3.1-12"]
7+
provides:
8+
- the owner-local day checked in the real app against the migrated production database
9+
- PR #1154 merged to main as 34af21437
10+
- export-report and generate-pdf live with resolveOwnerToday and p_today
11+
affects: ["66.4 (branches from this main)"]
12+
tech-stack:
13+
added: []
14+
patterns: ["merge commit pinned to the reviewed head sha; Edge deploy from main with explicit slugs, checked with get_edge_function"]
15+
key-files:
16+
created:
17+
- src/lib/__tests__/unit-suite-timezone.test.ts
18+
- src/hooks/api/query-keys/__tests__/lease-expiring-owner-day.test.ts
19+
- src/lib/templates/__tests__/lease-template-dates.test.ts
20+
modified:
21+
- vitest.config.ts
22+
- src/hooks/api/query-keys/lease-keys.ts
23+
- src/components/dashboard/expiring-leases-widget.tsx
24+
- src/lib/templates/lease-template.ts
25+
- src/app/(owner)/reports/generate/components/report-types.ts
26+
- src/components/documents/documents-vault.client.tsx
27+
- tests/integration/rls/rent-ledger-append-only.test.ts
28+
decisions:
29+
- "The unit suite runs in America/Chicago, pinned in vitest.config.ts's main process. vi.stubEnv('TZ') inside a threads worker never reached Date, so four owner-day tests passed only on a Central-time host"
30+
- "Owner's call: formatDate printing timestamptz values on their UTC day (about 27 files) is a follow-up phase, not this PR"
31+
- "Owner's call: the in-body generate_lease_rent_charges comment ('up to 6 hours early') stays as applied; correcting it needs a production write"
32+
- "Owner's call: one more review cycle, then merge with no P0/P1; the second consecutive clean cycle was waived"
33+
metrics:
34+
completed: 2026-12-03
35+
tasks: 4
36+
---
37+
38+
# Phase 66.3.1 Plan 13: Verify and ship Summary
39+
40+
The phase is merged and live. Owner RPCs, reversals, the two report Edge Functions and the dashboard's expiring-leases widget all use the owner's local day. Unit numbers and property names are stored trimmed.
41+
42+
## Task 1: Chrome check
43+
44+
The check ran on :3050 against production at 20:39 CST on 2026-12-02. The local day was 12-02 and the UTC day was 12-03.
45+
- Every owner-day request on 10 pages carried `p_today: "2026-12-02"`.
46+
- Reports > Expenses reads "Nothing spent Jan 1 to Dec 2, 2025".
47+
48+
Details are in `66.3.1-13-CHROME.md`. The 320px layout could not be measured: the window resize did not apply.
49+
50+
## Task 2: PR
51+
52+
PR #1154 was opened from `gsd/phase-66.3.1-owner-local-dates` on the owner's go-ahead.
53+
54+
## Task 3: CI and review
55+
56+
Four review cycles ran. Every finding was fixed on the branch:
57+
58+
| Cycle finding | Fix |
59+
|---------------|-----|
60+
| `checks` failed on four owner-day tests that depend on the timezone | `process.env.TZ = "America/Chicago"` in `vitest.config.ts`, a guard test, and removal of 26 dead `vi.stubEnv("TZ")` lines |
61+
| The `/reports/generate` file name and the documents zip name used the UTC day | `formatLocalYmd` plus local time; `documentsZipFilename` tested |
62+
| The expiring-leases widget bounded `end_date` by a UTC instant | `leaseQueries.expiringEnriched(today)` keys on and bounds by the owner's day |
63+
| The lease template's dates were the UTC day of module load | `createDefaultContext` computes the local day on each call |
64+
| The reversal-date integration test depended on whether a run crossed UTC midnight | It accepts either day only when the UTC day changed during the run |
65+
| Comments overstated what the code does | Corrected (A1 header date, Edge headers, tax-year comment, hook docs, cache-buster history) |
66+
67+
The final cycle found no P0 or P1. The owner waived the second consecutive clean cycle.
68+
69+
The final head was `2e06999f3`, with 17 checks passing and 2 skipped. All three required checks passed: checks, e2e-smoke and rls-security. migration-replay, the 9 mutation-sweep shards, CodeQL and gitleaks also passed.
70+
71+
## Task 4: Merge and deploy
72+
73+
| Step | Result |
74+
|------|--------|
75+
| Merge | At 10:21 CST on 2026-12-03 via `gh api … /pulls/1154/merge` (merge commit, sha-pinned to `2e06999f3`). The merge commit is `34af21437` |
76+
| Edge deploy | `bun scripts/deploy-edge-functions.ts export-report generate-pdf` from main: export-report **v154** and generate-pdf **v149**, both ACTIVE |
77+
| Edge verify | `get_edge_function` shows each version with `verify_jwt: false`, and `resolveOwnerToday`, `p_today` and `_shared/owner-today.ts` are in each bundle |
78+
| Vercel | Production deployment `dpl_At7bHda5hHtRdYfzeDChUEaT4bUF` for `34af21437` is READY |
79+
80+
## Follow-ups (not in this phase)
81+
82+
1. `formatDate` prints timestamptz values on their UTC day across about 27 files (tenants, inspections, applications, work orders).
83+
2. The comment inside `generate_lease_rent_charges`'s applied body says next month's charge can appear "up to 6 hours early". Through the 05:00 UTC cron it is at most 1 hour early for Central owners.
84+
3. V-2 accepts `{ p_today: undefined }` as passing the day (P3).
85+
4. These remain as documented in the PR:
86+
- timestamptz-to-owner-day comparisons still cut at UTC midnight;
87+
- `start_lease_ledger` uses the UTC month.
88+
89+
## Self-Check: PASSED
90+
91+
- `git log main --oneline -1` is `34af21437 fix: owner-local dates and trimmed unit numbers (#1154)`.
92+
- Both Edge Functions report the versions above through `get_edge_function`.

0 commit comments

Comments
 (0)