Skip to content

Allow Dec 8 publication beside cancelled calendar placeholder - #95

Merged
ow merged 2 commits into
mainfrom
fix/cancelled-calendar-placeholder
Nov 19, 2026
Merged

ow merged 2 commits into
mainfrom
fix/cancelled-calendar-placeholder

Conversation

@ow

@ow ow commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Problem and change

The Nov 19 production Cron discovered the official Dec 8, 17:30 council meeting (source 2399, eSCRIBE a9d4b010-6031-4b91-b569-4ff05e542571) but held publication because cancelled Dec 7 meeting 411 is an unmatched annual-schedule placeholder within 14 days. The same guard blocks document reconciliation.

Add a forward migration that excludes explicitly Cancelled placeholders from the nearby-date guard in apply_calendar_sync and reconcile_calendar_source. Dec 7 remains a separate cancelled record; Dec 8 can get its own Planned meeting. Active and unknown-status placeholders still hold possible reschedules. Exact-date matching, established identities, duplicate protections and grants are unchanged. No existing row is updated by the migration.

Validation

  • Disposable PostgreSQL 17: all 12 calendar SQL contract tests pass. The two cancelled-placeholder regressions failed against the old functions before the fix.
  • Covers an already-discovered/unlinked source, preservation of the cancelled row, Planned date/time, retry deduplication, document reconciliation and active/NULL-status holds alongside a cancellation.
  • Existing exact-match, GUID deduplication, explicit cancellation, lease and public-access tests pass. All five checks (changes, migrations-check, pipeline, types, web) passed on exact head 512dd8678f42d91a1df193c3ff473a1dde6929e9: CI, Web types.
  • Added the SQL contract suite to migration PR CI; git diff --check passes. Migration lint and SQL contracts passed in CI.
  • Refreshed exactly two nullable generated Kysely auth declarations (link_token_hash: string | null, dedicated_scope: boolean | null) using the standard generator/patch against production metadata with read-only sessions. Fresh main reproduced the identical stale-artifact diff. Existing local auth schema is older; this is a metadata-only refresh, with no auth behavior or schema changes. Exact diff and absence of existing secrets were verified before push; independent review found no issues.
  • Independent agent review found no blocking issues; confirmed the function-body diff consists only of the two status predicates.

Release coordination — draft, do not merge yet

This is the only reopened Open Langford work. No production mutation, sync trigger, migration application or deployment has been performed for this PR.

  1. Review CI and the complete pending production migration list before release approval. Read-only verification on Nov 19 confirmed all seven main migration versions already applied; only this PR’s calendar migration is pending. Recheck at release time. Merging to main automatically runs the Supabase migrations workflow and Cloudflare deployment. The new migration is 20261119150000_cancelled_calendar_placeholder.sql; do not run manual Wrangler deployment.
  2. Once the migration is applied, existing calendar Cron (00:17 / 12:17 UTC) can publish Dec 8 automatically. There is no need to change the Worker or trigger a broad sync. Check source 2399 and meeting 411 before any manual intervention because Cron may already have acted.
  3. If a coordinated immediate, single-event publication is approved, use a fresh claim_calendar_sync('manual') lease and apply_calendar_sync with exactly the freshly verified Dec 8 event in one short database transaction. The existing CLI --apply imports the full feed, so it is not the single-event path.
  4. Before that transaction, verify source 2399 still has the exact GUID, municipality 1, Dec 8 at 17:30, not cancelled, and no public link; verify meeting 411 remains Cancelled with only annual source 865; ensure no new conflicting active placeholder or Dec 8 public record exists. Refresh official evidence before opening the transaction, then lock/recheck the relevant rows under the lease.
  5. Require exactly created=1, updated=0, held=0, a distinct Planned public record linked to source 2399, and meeting 411 unchanged before commit. Roll back on any mismatch. This also updates the sync receipt and public-content-version trigger, not just the source/new meeting. After commit, reversal would need fresh dependency/content checks; it is not an unconditional delete. Never attach the GUID to meeting 411.
  6. Verify the live meetings page lists Dec 8 at 17:30 and retains cancelled Dec 7, then check source identity and the latest sync receipt. The annual-PDF warning is separate and is not addressed here.

@ow
ow marked this pull request as ready for review November 19, 2026 22:32
@ow
ow merged commit 8cd512c into main Nov 19, 2026
5 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.

1 participant