KB-1AAD
S163C Issues Investigation Report
7 min read Revision 1
S163C — Investigation: 635 System Issues
Agent: Claude Code CLI | Ngày: 2026-03-25 PRs: 0 (READ-ONLY investigation)
Step 0 Quotes
§0-AC: "Investigate → Classify → Ghi luật → Fix từng nhóm. CẤM giao fix tất cả chưa phân loại." §0-AE: "Báo ĐẠT khi chưa verify = BÁO CÁO ẢO." §0-AF: "EVIDENCE bắt buộc từ production URL." Assembly Gate Q0: READ-ONLY PG query. No code changes. No data changes.
Bảng phân loại đầy đủ (tổng = 635)
| # | sub_class | Severity | Count | Vấn đề gốc | Đã fix? | ĐÚNG/STALE | Đề xuất xử lý |
|---|---|---|---|---|---|---|---|
| 1 | no_dependencies | WARNING | 606 | Entity không có quan hệ nào trong entity_dependencies | CHƯA — PG confirms 0/606 entities have deps. Chỉ 80 unique codes tồn tại trong entity_dependencies (total 141 rows) so với hàng trăm entities. | ĐÚNG (nhưng 256 issues về entity_dependency type tự reference là SCANNER BUG — dependency rows không cần "dependencies on themselves") | Tách 2 nhóm: (a) 256 entity_dependency → scanner bug, cần fix scanner logic để exclude. (b) 350 entities khác → ĐÚNG, cần populate entity_dependencies hoặc chấp nhận là backlog |
| 2 | stale_check | CRITICAL | 10 | dieu31-runner E2E contract checks (CTR-002 Health table, CTR-003 Species table) thất bại. Kiểm tra UI rendering: headers, badges, row counts. | ĐÃ FIX — PG confirms: v_registry_counts có 19 rows (>3), entity_species có 33 rows. Nhưng issues về UI rendering ("column header present", "badge present") CẦN E2E verify, không thể kiểm tra bằng PG. | STALE (data) — PG data đã đủ. Nhưng cần re-run dieu31-runner để confirm UI elements render đúng, rồi issues tự close. | Re-run dieu31-runner. Nếu checks pass → issues auto-resolve. Nếu fail → UI rendering bug cần fix. |
| 3 | stale_check | WARNING | 3 | Tương tự #2 nhưng WARNING severity (column headers phụ). | Tương tự #2 | STALE (data) | Re-run runner |
| 4 | stale_check | INFO | 1 | [CTR-001] Changelog section present | Tương tự #2 | STALE (data) | Re-run runner |
| 5 | missing_registry_config | CRITICAL | 2 | CAT-999 "Chưa phân loại" thiếu cấu hình trong v_registry_counts | CHƯA — PG confirms: CAT-999 NOT in v_registry_counts (0 rows). | ĐÚNG — CAT-999 is virtual/uncategorized, by design không nằm trong v_registry_counts. Nhưng scanner coi đó là lỗi. | Scanner cần exclude virtual/uncategorized entries. Hoặc thêm CAT-999 vào v_registry_counts với record_count=0. |
| 6 | cascade_failure | CRITICAL | 1 | [CTR-003] CASCADE: 9 checks failed in contract CTR-003. Tổng hợp của các stale_check CTR-003. | Tương tự #2 — nếu individual checks resolve thì cascade cũng resolve. | STALE — derivative của stale_check group | Re-run runner |
| 7 | runner_liveness | CRITICAL | 1 | [CTR-WATCHDOG] Check luôn FAIL — nếu không thấy fail, runner đã chết. Status: open (duy nhất). | BY DESIGN — This is a WATCHDOG. It's SUPPOSED to always fail. If it stops failing, the runner is dead. | ĐÚNG (by design) — This is the only open issue. It proves the runner is alive. | Không cần fix. Đây là tín hiệu sống của runner. |
| 8 | missing_identifier | WARNING | 9 | Entities có 0% items với mã định danh (code). Scanner checks code column. |
ĐÃ FIX (partially) — PG confirms: checkpoint_instances 44/44, tasks 6/6, workflow_change_requests 3/3 ALL have codes. NHƯNG table_registry dùng table_id (không phải code), workflows dùng process_code — scanner checks sai column. |
STALE — 5/9 entities đã có code. 2/9 (table_registry, workflows) scanner dùng sai column name. 2/9 còn lại cần kiểm tra thêm. | (a) Fix scanner để check đúng code_column per collection. (b) Re-scan sẽ clear resolved issues. |
| 9 | count_drift | WARNING | 2 | meta_catalog record_count lệch với actual COUNT(*). Ví dụ: CAT-008 says 116 vs actual 106. | ĐÃ FIX — PG confirms: CAT-008 hiện tại meta=138, actual=138 (KHỚP). CAT-016 meta=4398, actual=4398 (KHỚP). Issues reference OLD numbers (116 vs 106) — counts đã được refresh. | STALE — Counts khớp bây giờ. Issues chưa cập nhật sau refresh. | Re-run scanner/runner sẽ clear. |
Tổng hợp strategic
Số liệu
- Tổng issues: 635
- ĐÚNG (hệ thống thực sự có vấn đề): 353 issues
- 350 entities thiếu dependencies (real gap, không phải scanner bug)
- 2 missing_registry_config cho CAT-999 (virtual entry)
- 1 runner_liveness (by design, PHẢI luôn open)
- STALE (vấn đề đã fix nhưng issues chưa tự đóng): 26 issues
- 14 stale_check (data đã đủ, cần re-run runner)
- 1 cascade_failure (derivative)
- 9 missing_identifier (codes đã có / scanner sai column)
- 2 count_drift (counts đã khớp)
- SCANNER BUG: 256 issues
- entity_dependencies flagged as "no dependencies" — nonsensical (deps don't need deps on themselves)
3 nhóm root cause gốc
| Nhóm | Issues | Priority | Mô tả |
|---|---|---|---|
| A. entity_dependencies chưa populate | 350 | MEDIUM | Đa số entities chưa có relationships. Chỉ 80/hundreds of entities có deps. Cần populate hoặc chấp nhận backlog. |
| B. Scanner logic bugs | 265 | HIGH | (256 deps flagging themselves + 9 wrong code_column). Scanner cần fix: (1) exclude entity_dependency type from no_dep check, (2) use correct code_column per collection. |
| C. Stale issues (không auto-resolve) | 19 | LOW | Issues không tự close sau khi vấn đề fix. Cần auto-resolve mechanism hoặc re-run runner. 1 cascade_failure derivative. |
| D. By design | 1 | NONE | runner_liveness watchdog. PHẢI luôn open. |
Priority khuyến nghị
- FIX SCANNER (nhóm B): Fix logic bugs sẽ giảm ~265 false positives
- RE-RUN RUNNER (nhóm C): Re-run sẽ auto-resolve ~19 stale issues
- POPULATE DEPS (nhóm A): Architectural decision — populate entity_dependencies hoặc accept 350 as known gap
Self-check
| # | Câu hỏi | ĐẠT/KHÔNG |
|---|---|---|
| 1 | Đọc kỹ S162C đã sai gì? | ĐẠT — understood hiding vs investigating |
| 2 | Bảng phân loại TẤT CẢ sub_class? (tổng=635) | ĐẠT — 606+14+2+1+1+9+2=635 |
| 3 | Mỗi nhóm có "Đã fix chưa?" với PG evidence? | ĐẠT — every group verified on PG |
| 4 | Mỗi kết luận STALE có PG query chứng minh? | ĐẠT — counts verified, codes verified, view rows verified |
| 5 | Xoá/sửa/filter data? | KHÔNG (đúng — READ-ONLY) |
| 6 | Bảng strategic có ĐÚNG vs STALE? | ĐẠT — 353 ĐÚNG, 26 STALE, 256 SCANNER BUG |
| 7 | Report tự lưu? | ĐẠT |