Statement of Claim has no rule mapped (Auto resolves to event name only, no legal source) #99

Open
opened 2026-05-25 13:21:29 +00:00 by mAi · 1 comment
Collaborator

m's report (2026-05-25 15:20)

Due date
2026-05-25
Type (optional)
Statement of Claim  ×
Search or type…  Browse all  + Add new type…
Rule
Enter custom rule  Auto
Statement of Claim                                 ← only the name, no rule citation

Statement of Claim and the statement of claim still does not have a rule...

Root cause hypothesis

When Type = Statement of Claim is picked and Rule = Auto, the resolved-rule display should show the canonical legal source (e.g. UPC RoP R.13 for UPC CFI SoC). Instead it just shows the event name — meaning either:

  1. The paliad.deadline_rules row for SoC has an empty / NULL legal_source field.
  2. The Auto-resolution logic isn't finding a matching rule for Type='Statement of Claim' + the active project's proceeding_type.
  3. There's a Statement of Claim event_type but no deadline_rules row links it to a legal source.

What to do

  1. Diagnose first — query paliad.deadline_rules WHERE submission_code LIKE '%soc%' OR name ILIKE '%statement of claim%' (or however SoC is identified in the catalog). Confirm whether the rule row exists AND has legal_source populated.
  2. If row missing: add it. UPC CFI SoC = UPC RoP Rule 13 (Statement of claim and its content). UPC RoP Rule 13(1) for content requirements.
  3. If row exists but legal_source empty: populate it.
  4. If row + legal_source exist but Auto-resolution fails: check the Type→Rule mapping logic in internal/services/deadline_service.go (or wherever Auto resolution happens). Maybe the event_type slug doesn't match between the Type picker and the Rule row.
  5. Verify live on a UPC CFI project — pick Statement of Claim as Type → Rule Auto should show Statement of Claim · UPC RoP R.13 (or similar canonical chip).

Files most likely touched

  • internal/db/migrations/12X_fix_soc_rule.up.sql (or one-off SQL via supabase MCP if it's just a data correction)
  • internal/services/deadline_service.go (if logic bug)
  • internal/services/event_service.go (if event_type → rule mapping is here)

Hard rules

  • Cross-reference curie's #94 audit findings — log this as a finding too if you spot related Statement of Claim issues across other proceedings.
  • Cite UPC RoP R.13 in the migration comment.
  • go build ./... && go test ./internal/... && cd frontend && bun run build clean.
  • Branch: mai/<worker>/soc-rule-mapping.

Out of scope

  • Adding rules for other proceedings' SoC equivalents (e.g. DE LG Klageerhebung) — those have their own rules already (ZPO §253).
  • Restructuring the Type ↔ Rule relationship (#93 inventor design covers that).

Reporting

mai report completed with branch + SHAs + diagnosed root cause + UX path showing Auto resolves to a canonical legal source for SoC.

## m's report (2026-05-25 15:20) ``` Due date 2026-05-25 Type (optional) Statement of Claim × Search or type… Browse all + Add new type… Rule Enter custom rule Auto Statement of Claim ← only the name, no rule citation ``` > Statement of Claim and the statement of claim still does not have a rule... ## Root cause hypothesis When Type = Statement of Claim is picked and Rule = Auto, the resolved-rule display should show the canonical legal source (e.g. `UPC RoP R.13` for UPC CFI SoC). Instead it just shows the event name — meaning either: 1. The `paliad.deadline_rules` row for SoC has an empty / NULL `legal_source` field. 2. The Auto-resolution logic isn't finding a matching rule for Type='Statement of Claim' + the active project's proceeding_type. 3. There's a Statement of Claim event_type but no deadline_rules row links it to a legal source. ## What to do 1. **Diagnose first** — query `paliad.deadline_rules WHERE submission_code LIKE '%soc%' OR name ILIKE '%statement of claim%'` (or however SoC is identified in the catalog). Confirm whether the rule row exists AND has legal_source populated. 2. **If row missing**: add it. UPC CFI SoC = UPC RoP Rule 13 (Statement of claim and its content). UPC RoP Rule 13(1) for content requirements. 3. **If row exists but legal_source empty**: populate it. 4. **If row + legal_source exist but Auto-resolution fails**: check the Type→Rule mapping logic in `internal/services/deadline_service.go` (or wherever Auto resolution happens). Maybe the event_type slug doesn't match between the Type picker and the Rule row. 5. **Verify live** on a UPC CFI project — pick Statement of Claim as Type → Rule Auto should show `Statement of Claim · UPC RoP R.13` (or similar canonical chip). ## Files most likely touched - `internal/db/migrations/12X_fix_soc_rule.up.sql` (or one-off SQL via supabase MCP if it's just a data correction) - `internal/services/deadline_service.go` (if logic bug) - `internal/services/event_service.go` (if event_type → rule mapping is here) ## Hard rules - Cross-reference curie's #94 audit findings — log this as a finding too if you spot related Statement of Claim issues across other proceedings. - Cite UPC RoP R.13 in the migration comment. - `go build ./... && go test ./internal/... && cd frontend && bun run build` clean. - Branch: `mai/<worker>/soc-rule-mapping`. ## Out of scope - Adding rules for other proceedings' SoC equivalents (e.g. DE LG Klageerhebung) — those have their own rules already (ZPO §253). - Restructuring the Type ↔ Rule relationship (#93 inventor design covers that). ## Reporting `mai report completed` with branch + SHAs + diagnosed root cause + UX path showing Auto resolves to a canonical legal source for SoC.
mAi self-assigned this 2026-05-25 13:21:29 +00:00
Author
Collaborator

Folded into Wave 0 on branch mai/brunel/wave0-tier0-deadline-fixes @ 05f7ea2 (single migration 127 alongside the 13 Tier 0 audit fixes from m/paliad#94).

Root cause: upc.inf.cfi.soc row carries rule_code = NULL and legal_source = NULL. The Type=Statement-of-Claim / Rule=Auto resolution therefore renders the event name without a citation, and the deadline-search result card has no legal-source link.

Fix — migration 127 (internal/db/migrations/127_wave0_tier0_deadline_fixes.up.sql):

UPDATE paliad.deadline_rules
   SET rule_code    = 'RoP.013.1',
       legal_source = 'UPC.RoP.13.1',
       updated_at   = now()
 WHERE submission_code = 'upc.inf.cfi.soc'
   AND is_active = true
   AND lifecycle_state = 'published'
   AND rule_code IS NULL
   AND legal_source IS NULL;

UPC RoP R.13 defines the Statement of Claim; R.13(1) lists the required contents. The SoC carries no statutory deadline (duration=0, parent_id=NULL — it is the originating filing that anchors the proceeding's trigger date), so only the citation metadata is backfilled. Duration / anchor / party untouched.

Guard rule_code IS NULL AND legal_source IS NULL makes re-apply a no-op once the fix has landed.

Applied to live DB via Supabase MCP with audit_reason set; verified post-fix shape:

upc.inf.cfi.soc → rule_code='RoP.013.1', legal_source='UPC.RoP.13.1'

Frontend display via existing FormatLegalSourceDisplay helper:
UPC.RoP.13.1UPC RoP R.13(1)
BuildLegalSourceURLhttps://youpc.org/laws#UPCRoP.013

NOT self-merged. Awaiting maria's merge gate.

**Folded into Wave 0** on branch `mai/brunel/wave0-tier0-deadline-fixes` @ 05f7ea2 (single migration 127 alongside the 13 Tier 0 audit fixes from m/paliad#94). **Root cause**: `upc.inf.cfi.soc` row carries `rule_code = NULL` and `legal_source = NULL`. The Type=Statement-of-Claim / Rule=Auto resolution therefore renders the event name without a citation, and the deadline-search result card has no legal-source link. **Fix — migration 127** (`internal/db/migrations/127_wave0_tier0_deadline_fixes.up.sql`): ```sql UPDATE paliad.deadline_rules SET rule_code = 'RoP.013.1', legal_source = 'UPC.RoP.13.1', updated_at = now() WHERE submission_code = 'upc.inf.cfi.soc' AND is_active = true AND lifecycle_state = 'published' AND rule_code IS NULL AND legal_source IS NULL; ``` UPC RoP R.13 defines the Statement of Claim; R.13(1) lists the required contents. The SoC carries no statutory deadline (duration=0, parent_id=NULL — it is the originating filing that anchors the proceeding's trigger date), so only the citation metadata is backfilled. Duration / anchor / party untouched. Guard `rule_code IS NULL AND legal_source IS NULL` makes re-apply a no-op once the fix has landed. **Applied to live DB** via Supabase MCP with audit_reason set; verified post-fix shape: ``` upc.inf.cfi.soc → rule_code='RoP.013.1', legal_source='UPC.RoP.13.1' ``` Frontend display via existing `FormatLegalSourceDisplay` helper: `UPC.RoP.13.1` → `UPC RoP R.13(1)` ✓ `BuildLegalSourceURL` → `https://youpc.org/laws#UPCRoP.013` NOT self-merged. Awaiting maria's merge gate.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#99
No description provided.