KB-1FF2

S161B — Fix Foundation Report: Clean System Issues

5 min read Revision 1
reports161bfix-foundationsystem-issuesarchivedieu31

S161B — Fix Foundation Report

Agent: Claude Code (CLI) | Ngày: 2026-03-25 PRs: #610 (archive 15 stale), #611 (CAT-ALL fix — blocked by guard), #612 (rules update) Status: 15 stale issues archived. WATCHDOG kept. CAT-ALL needs separate fix.


Phase 1: Investigation Results

render_fault (135 = 121 dot-scanner archived + 14 runner open→archived)

  • 119 link_hỏng: Broken links to entities detected by dot-layer-integrity-audit (S108)
  • 2 lỗi_lớp_2: Layer 2 config issues
  • 14 dieu31-runner: OLD v1.0 contract checks (data-testid) → ARCHIVED in S161B

data_fault (615 = all dot-scanner, all archived)

  • 606 thiếu_quan_hệ: Missing entity_dependencies relationships for 256+ entities
  • 9 thiếu_mã_định_danh: Missing identifiers for tables, tasks, WCRs
  • All already archived status — historical findings from DOT scan

sync_fault (2 = all archived)

  • #20: meta_catalog said 116, actual 106 (collections count drift)
  • #27: meta_catalog said 56, actual 59 (changelog count drift)
  • Both already archived — drift from historical period

16 runner issues (dieu31-runner)

  • 15 stale: Created by M1 test runs with OLD v1.0 data-testid contracts
  • 1 WATCHDOG #758: Legitimate, actively updating (occurrence_count=4)

Phase 2: Classification Table

# Group Count Status Before Action Status After
A dot-scanner legacy (all types) 738 archived NO CHANGE archived
B runner stale (old contracts) 15 open ARCHIVED (PR #610) archived
C runner WATCHDOG 1 open KEPT open
Total 754 16 open / 738 archived 1 open / 753 archived

Phase 3: Fixes Applied

PR #610 — Archive 15 stale runner issues ✓

  • SQL migration archived IDs: 746-757, 759-761
  • WATCHDOG #758 kept open
  • Deploy confirmed: UPDATE 15 in logs
  • After: 1 open issue (WATCHDOG), 753 archived

PR #611 — CAT-ALL count fix ⚠️

  • Attempted UPDATE meta_catalog SET record_count = SUM(...)
  • BLOCKED by S129-A security guard: "Direct UPDATE of meta_catalog counting fields is blocked"
  • Called refresh_registry_counts() API → updated 5 individual collections but NOT CAT-ALL summary
  • CAT-ALL remains at 886 — needs separate fix mechanism
  • This causes Counting Contract Check CI failure (CAT-ALL=886 ≠ SUM=17319)

PR #612 — Rules update ✓

  • Added --admin merge ban to incomex-rules.md

Before vs After

Metric Before (S161) After (S161B) Delta
Total 754 754 0 (no delete)
Open 16 1 -15
Archived 738 753 +15
CRITICAL open 12 1 (WATCHDOG) -11
WARNING open 3 0 -3

Remaining Issues

Cannot Fix Now:

  1. CAT-ALL record_count = 886 (should be ~17319). Blocked by S129-A guard. Needs: fix the refresh mechanism to also update CAT-ALL summary row, or modify the guard to allow programmatic updates.
  2. 738 archived legacy issues: These are historical findings from DOT scan. They represent REAL data gaps (missing relationships, identifiers) that existed at time of scan. Fixing them would require large-scale data backfill of entity_dependencies + identifier codes — out of scope for this mission.

TD Candidates:

  • TD-NEW: Fix CAT-ALL refresh mechanism to include summary row
  • TD-NEW: Runner auto-lifecycle — close issues when contract/check is removed

VERIFY NUXT

VERIFY NUXT:
- Nuxt URL: /api/registry/system-issues
  Hiện: all=754, critical=133, warning=620, info=1, group_count=5
  PG: 754 total, 133 CRITICAL, 620 WARNING, 1 INFO
  KHỚP.

- Nuxt URL: /api/registry/system-issues-groups
  Hiện: 5 groups — data_fault=615, render_fault=135, sync_fault=2, contract_fault=1, watchdog_fault=1
  PG: Identical breakdown
  KHỚP.

- Open issues: PG=1 (WATCHDOG #758), UI includes all statuses
  KHỚP.

Tự kiểm tra

# Mục ĐẠT
1 Checkpoint + Assembly Gate ĐẠT
2 Phase 1 investigate 4 groups ĐẠT
3 Phase 2 classification table ĐẠT
4 15 stale → archived, WATCHDOG kept ĐẠT
5 render_fault: investigated, 121 archived legacy ĐẠT
6 sync_fault: 2 already archived ĐẠT
7 data_fault: 615 archived legacy, scope too large ĐẠT
8 VERIFY NUXT ĐẠT
9 Open issues reduced 16→1 ĐẠT
10 Report uploaded ĐẠT