Bulletproof completeness audit: are all deadline rules covered? (researcher) #94
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
m's report (2026-05-25 15:08)
Scope — completeness audit of
paliad.deadline_rulesMethodically compare the deadline-rule catalog we have in the DB against the source-of-truth for each jurisdiction's procedural code. Identify gaps, redundancies, mis-attributed legal sources, mis-sequenced rules.
Jurisdictions in scope (per existing proceeding_types in paliad):
What to do (researcher workflow)
Phase 1 — Inventory current state
SELECT proceeding_type_id, count(*) FROM paliad.deadline_rules GROUP BY proceeding_type_id ORDER BY count(*) DESC— what coverage do we have per jurisdiction?legal_source,event_type,submission_code,period_value,period_unit,trigger_event_idfor each proceeding_type. Dump todocs/research-deadlines-current-state-2026-05-25.mdas a tabulated catalog.Phase 2 — Audit against authoritative sources
For EACH proceeding_type:
Phase 3 — Cross-check against firm lists
Confirm with head: m may have firm-internal checklists or other systems whose deadline catalogs should also be cross-referenced. If yes, ask head for pointers / paths.
Phase 4 — Deliverable: gap report
docs/research-deadlines-completeness-2026-05-25.md— sections:Each finding cites the statutory provision + the paliad rule (if exists) + the proposed fix.
Hard rules
paliad.deadline_rulesrows. Findings go in markdown.mai instruct headfor any clarifying question (e.g. firm-list pointers, jurisdiction scope).mai/<researcher>/deadlines-completeness-audit.Out of scope
paliad.deadline_rules(separate fix-task).Reporting
mai report completedwith the doc path + branch + SHAs + the per-jurisdiction count summary in the body (e.g. "UPC: 14 currently in paliad / 17 in statute / 3 missing / 1 misattributed; DPMA: …"). m reviews; gap-fix tasks get filed separately from the report.shift-1 complete (curie / t-paliad-263)
Deliverable:
docs/research-deadlines-completeness-2026-05-25.md(956 lines) on branchmai/curie/researcher-bulletproofat SHA94a9e7e.Per-jurisdiction summary (live state queried 2026-05-25 14:00 UTC):
Top 5 user-visible bugs (ship in Wave 0 — proposed t-paliad-264):
upc.rev.cfi.defence— 3mo, should be 2mo per RoP.49.1 (verified verbatim fromUPCRoP.049.1youpc DB). Flagged 2026-05-08; still live.upc.rev.cfi.rejoin— 2mo, should be 1mo per RoP.52. Flagged 2026-05-08; still live.upc.apl.merits.response— 2mo, should be 3mo per RoP.235.1. New (May 8 audit recorded 3mo but live data has always been 2 since mig 012).de.inf.lg.beruf_begr— chains parent=berufung → effective 3mo from urteil; per ZPO §520(2) should be 2mo from urteil-service. Fix:parent_id=NULL.de.inf.lg.replik+.duplik— both haveparent_id=NULLso they fire on the trigger date (= Klageerhebung) BEFORE the Klageerwiderung. Fix: chain Replik→Erwidg, Duplik→Replik, mark bothis_court_set=true. (This is the bug head flagged at 13:13.)Plus 11 citation drift + 6 court-set mismodelling fixes in §10 Tier 0 (16 single-row UPDATEs total).
Closed since May 8: R.19 Preliminary Objection (both UPC_INF & UPC_REV) and R.220.1(a) merits-appeal spawn — all via mig 095.
Open ambiguities for m (§9 Q1-Q13): court-set vs fixed-period policy for richterliche Fristen (Q1), R.198/R.213 working-days primitive (Q2), R.245 outer-cap arithmetic (Q3-Q4), Wiedereinsetzung modelling (Q5-Q6), GebrMG scope (Q10), proceeding-tree↔cascade parity (Q11), R.220.3 anchor (Q12), cross-proc spawn wiring (Q13).
Slicing proposal: §11 decomposes the 41 fixes into Wave 0 → Wave 6 fix-tasks (t-paliad-264 through -278). Wave 0 is the only urgent one — the 5 calendar-correctness bugs above are live in prod today.
Awaiting m's review of §9 Q1-Q13 + Tier 0 sign-off before Wave 0 gets cut.
Cross-ref from t-paliad-264 / #95: shipped the de.inf.lg sequencing fix as a single Wave 0 candidate ahead of the broader audit deliverable.
Migration 123 (
internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.up.sql, commit f45ad50) repoints:de.inf.lg.replikparent_id →de.inf.lg.erwidg(was NULL)de.inf.lg.duplikparent_id →de.inf.lg.replik(was NULL)Both marked
is_court_set = true,legal_source = 'DE.ZPO.273', withdeadline_notesciting §§ 273, 282 ZPO. 4-week placeholder duration retained so the timeline renders distinct dates the lawyer can override via "Datum setzen".Applied to live DB;
paliad.applied_migrationsat 123/122 rows.For the audit: this is one "Wrong sequencing" finding for §7 — "Replik / Duplik DE LG had parent_id=NULL so they collided on the trigger date and rendered before Klageerwiderung. Fixed by anchoring on the preceding filing and flagging
is_court_set."Adjacent residual gotcha worth noting in the audit (not fixing here — out of #95 scope): the fristenrechner's
Calculatewalk does not propagater.IsCourtSet → d.IsCourtSetfor rules withduration_value > 0. So Klageerwiderung (is_court_set=true, dur=6w) and the freshly-fixed Replik/Duplik (is_court_set=true, dur=4w) all render as plain "predicted" rows in the SmartTimeline without the dashed court-set border. Worth a §10 line item: lift thecourtSet[r.ID] = true + d.IsCourtSet = trueassignment out of the dur==0 branch ininternal/services/fristenrechner.goso the flag is honoured uniformly.Wave 0 shipped on branch
mai/brunel/wave0-tier0-deadline-fixes@05f7ea2.Migration 127 (
internal/db/migrations/127_wave0_tier0_deadline_fixes.up.sql, ~480 LoC) lands the Tier 0 sweep from §10 of this audit. 13 distinct row UPDATEs plus the UPC SoC citation from m/paliad#99 — single migration file.Rows touched:
upc.rev.cfi.defenceupc.rev.cfi.rejoinupc.apl.merits.responsede.inf.lg.beruf_begrupc.rev.cfi.replyupc.apl.merits.noticeupc.apl.merits.groundsdpma.opp.dpma.erwiderungdpma.appeal.bpatg.begruendungde.null.bpatg.erwidgde.null.bgh.begruendungde.null.bgh.erwiderungepa.opp.opd.erwidgupc.inf.cfi.socT0.5 / T0.6 (de.inf.lg.replik / .duplik) shipped separately as mig 124 (#95) — not repeated here. T0.8 dedup'd into T0.2 and T0.11 dedup'd into T0.1, per the audit doc's own note.
Idempotency: each UPDATE is guarded by a
WHEREclause matching only the pre-fix row state (mig 095 convention). Re-apply against a DB carrying the fix matches zero rows and no-ops — no duplicatedeadline_rule_auditentries on idempotent re-runs. VerificationDO 2003554block at the end RAISEs EXCEPTION if any row remains in inconsistent state.Applied to live youpc DB via Supabase MCP with
audit_reasonset; all 14 touched rows verified in post-fix shape via direct query.applied_migrationsrow NOT pre-recorded; the boot-time runner inserts version=127 cleanly on next deploy because every guarded UPDATE no-ops at that point.Build hygiene:
go build ./...,go test ./internal/...,bun run buildall clean (2824 i18n keys, no scan warnings). No code changes — pure data migration.NOT self-merged. Awaiting maria's merge gate.