From f45ad50efb26bcb99b1f3188da49bdbd1236d720 Mon Sep 17 00:00:00 2001 From: mAi Date: Mon, 25 May 2026 15:27:03 +0200 Subject: [PATCH] mAi: #95 - t-paliad-264 - fix de.inf.lg Replik/Duplik sequencing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replik and Duplik had parent_id = NULL with a 4-week placeholder duration, so the projection anchored both off the proceeding's trigger date (Klageerhebung) - both rows rendered at the same calendar date AND before Klageerwiderung. Migration 123 anchors Replik on Klageerwiderung (de.inf.lg.erwidg) and Duplik on Replik, and marks both is_court_set = true with legal_source DE.ZPO.273. The 4-week placeholder duration is retained so the timeline gives a sane notional date for each row; the lawyer overrides it with "Datum setzen" once the court issues the actual period. ZPO citations in the migration comment per the t-paliad-264 brief: - Klageerhebung - § 253 ZPO - Anzeige Verteidigungsbereitschaft - § 276 Abs. 1 S. 1 ZPO - Klageerwiderung - § 276 Abs. 1 S. 2 + § 277 ZPO - Replik / Duplik - vom Gericht bestimmte Frist (§ 273 ZPO Anordnungskompetenz; § 282 ZPO prozessuale Foerderungspflicht) Applied to live youpc DB via Supabase MCP (audit_reason set, applied_migrations bumped to 123). Verified ordering for trigger 2026-05-25: Klage 2026-05-25 Mon Anzeige 2026-06-08 Mon Klageerwidg 2026-07-06 Mon Replik 2026-08-03 Mon Duplik 2026-08-31 Mon Each row strictly later than the previous; Replik and Duplik no longer collide on the same date and no longer precede the Klageerwiderung. --- ...e_inf_lg_replik_duplik_sequencing.down.sql | 31 ++++++++ ..._de_inf_lg_replik_duplik_sequencing.up.sql | 79 +++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.down.sql create mode 100644 internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.up.sql diff --git a/internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.down.sql b/internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.down.sql new file mode 100644 index 0000000..7b8ca5f --- /dev/null +++ b/internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.down.sql @@ -0,0 +1,31 @@ +-- Revert t-paliad-264 / m/paliad#95. +-- Restores Replik and Duplik to parent_id = NULL with the pre-fix +-- "Frist vom Gericht bestimmt" placeholder note. The pre-fix rows +-- carried legal_source = NULL and is_court_set = false; both +-- placeholder durations (4 weeks) are left untouched (the .up +-- migration did not modify them). +-- +-- audit_reason set_config required for the mig 079 trigger. + +SELECT set_config( + 'paliad.audit_reason', + 'mig 123 revert: unwind de.inf.lg Replik/Duplik sequencing back to pre-#95 placeholder state', + true); + +UPDATE paliad.deadline_rules +SET parent_id = NULL, + is_court_set = false, + legal_source = NULL, + deadline_notes = 'Frist vom Gericht bestimmt', + deadline_notes_en = NULL +WHERE submission_code = 'de.inf.lg.replik' + AND is_active = true; + +UPDATE paliad.deadline_rules +SET parent_id = NULL, + is_court_set = false, + legal_source = NULL, + deadline_notes = 'Frist vom Gericht bestimmt', + deadline_notes_en = NULL +WHERE submission_code = 'de.inf.lg.duplik' + AND is_active = true; diff --git a/internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.up.sql b/internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.up.sql new file mode 100644 index 0000000..ce2d5f5 --- /dev/null +++ b/internal/db/migrations/123_de_inf_lg_replik_duplik_sequencing.up.sql @@ -0,0 +1,79 @@ +-- t-paliad-264 / m/paliad#95 — Fix de.inf.lg Replik + Duplik sequencing. +-- +-- BEFORE this migration, the de.inf.lg rules for Replik and Duplik +-- had parent_id = NULL with duration_value = 4 weeks each. The +-- projection therefore anchored both off the proceeding's trigger +-- date (Klageerhebung) and added 4 weeks → both rows rendered at the +-- same calendar date, BEFORE Klageerwiderung (which sits at +-- Klageerhebung + 6 weeks per § 276 Abs. 1 S. 2 ZPO). +-- +-- Correct ZPO sequence for first-instance infringement before the +-- Landgericht is: +-- +-- Klageerhebung (§ 253 ZPO) +-- → Anzeige der Verteidigungsbereitschaft (§ 276 Abs. 1 S. 1 ZPO, +-- 2 Wochen ab Zustellung der Klage) +-- → Klageerwiderung (§ 276 Abs. 1 S. 2 + § 277 ZPO; vom Gericht +-- gesetzte Frist von mindestens 2 Wochen, in der Praxis 6 Wochen) +-- → Replik (vom Gericht gesetzte Frist; Anordnungskompetenz aus +-- § 273 ZPO, prozessuale Förderungspflicht der Parteien aus +-- § 282 ZPO; in der Praxis ~ 4 Wochen ab Zustellung der +-- Klageerwiderung) +-- → Duplik (vom Gericht gesetzte Frist; § 273, § 282 ZPO; in der +-- Praxis ~ 4 Wochen ab Zustellung der Replik) +-- +-- Replik and Duplik have NO statutory period — the Landgericht fixes +-- the period in its prozessleitende Verfügung. We model them as +-- is_court_set = true with a placeholder 4-week duration anchored on +-- the immediately preceding filing so the timeline (a) renders them +-- in strict chronological order and (b) gives the lawyer a sane +-- notional date that can be overridden via "Datum setzen" once the +-- court issues the actual period. +-- +-- legal_source set to DE.ZPO.273 (Vorbereitung des Termins — +-- court's case-management power that authorises setting Replik / +-- Duplik periods). The full citation chain (§§ 273, 282 ZPO) lives +-- in deadline_notes so the rendered card explains the source. +-- +-- Scope strictly de.inf.lg / cfi per the t-paliad-264 brief. Other +-- jurisdictions are out of scope and will be addressed via curie's +-- m/paliad#94 audit follow-ups. +-- +-- audit_reason set_config required at the top — the mig 079 trigger +-- on paliad.deadline_rules raises EXCEPTION 'audit reason required' +-- on any UPDATE without it. + +SELECT set_config( + 'paliad.audit_reason', + 'mig 123: t-paliad-264 / m/paliad#95 — anchor de.inf.lg Replik on Klageerwiderung and Duplik on Replik, mark both is_court_set per § 273 ZPO', + true); + +-- Replik anchors on Klageerwiderung (de.inf.lg.erwidg). +UPDATE paliad.deadline_rules +SET parent_id = ( + SELECT id FROM paliad.deadline_rules + WHERE submission_code = 'de.inf.lg.erwidg' + AND is_active = true + LIMIT 1 + ), + is_court_set = true, + legal_source = 'DE.ZPO.273', + deadline_notes = 'Frist vom Gericht in der prozessleitenden Verfügung bestimmt (§ 273 ZPO, prozessuale Förderungspflicht § 282 ZPO). In der Praxis ca. 4 Wochen ab Zustellung der Klageerwiderung; mit "Datum setzen" überschreiben, sobald die gerichtliche Verfügung vorliegt.', + deadline_notes_en = 'Period set by the court in its case-management order (§ 273 ZPO; parties'' duty to file timely under § 282 ZPO). Typically ca. 4 weeks after service of the Statement of Defence; use "Set date" to override once the court issues the actual period.' +WHERE submission_code = 'de.inf.lg.replik' + AND is_active = true; + +-- Duplik anchors on Replik (de.inf.lg.replik). +UPDATE paliad.deadline_rules +SET parent_id = ( + SELECT id FROM paliad.deadline_rules + WHERE submission_code = 'de.inf.lg.replik' + AND is_active = true + LIMIT 1 + ), + is_court_set = true, + legal_source = 'DE.ZPO.273', + deadline_notes = 'Frist vom Gericht in der prozessleitenden Verfügung bestimmt (§ 273 ZPO, prozessuale Förderungspflicht § 282 ZPO). In der Praxis ca. 4 Wochen ab Zustellung der Replik; mit "Datum setzen" überschreiben, sobald die gerichtliche Verfügung vorliegt.', + deadline_notes_en = 'Period set by the court in its case-management order (§ 273 ZPO; parties'' duty to file timely under § 282 ZPO). Typically ca. 4 weeks after service of the Reply; use "Set date" to override once the court issues the actual period.' +WHERE submission_code = 'de.inf.lg.duplik' + AND is_active = true;