KB-1E64
S167E Chaos Hardening Report
4 min read Revision 1
S167E — Chaos-Test Hardening Report
Agent: Claude Code CLI | Ngay: 2026-03-26 PRs: 1 (#634) Manual deploys: 0 Local build: PASS
Step 0 Quotes
- OR: Incomex Operating Rules v4.68+
- Merge: CI GREEN = 4 required checks
- S167D bugs: TD-375 (v_reg writable), TD-376 (fake issues), TD-377 (runner), TD-378 (scanner), TD-379 (birth gate), TD-380 (retire), TD-381 (WARNING hidden)
- Assembly Gate Q0: CÓ, PG FIRST
PHẦN A: Cleanup Results
| Data | Before | After | Delta |
|---|---|---|---|
| system_issues chaos | 2 | 0 | -2 |
| v_registry_counts chaos | 3 | 0 | -3 |
| dot_tools chaos | 55 | 0 | -55 |
| entity_deps chaos | 0 | 0 | 0 |
| universal_edges fake | 1 | 0 | -1 |
PHẦN B: Blocker Fixes
TD-375: v_registry_counts guard — PASS
- fn_guard_v_registry_counts blocks direct INSERT/UPDATE/DELETE
- Evidence: INSERT INTO v_registry_counts → ERROR: Direct modification blocked
TD-376: system_issues guard — PASS
- fn_guard_system_issues_insert requires source_system or source field
- Evidence: INSERT INTO system_issues (title, severity, status) → ERROR: Anonymous inserts blocked
TD-377: Runner in container — NOT A BUG
- Runner runs on VPS HOST via NVM node, not inside Docker container
- Cron job uses /opt/incomex/deploys/web-test/scripts/integrity/ path
- Architecture is correct — runner doesn't need to be in Nuxt container
TD-378: Scanner live count — PASS
- CHECK 5 now compares meta_catalog.record_count vs live Directus COUNT(*)
- Catches stale metadata counts
PHẦN C: Secondary Bugs
TD-379: Birth Gate _dot_origin — DOCUMENTED, NOT FIXED
- Birth Gate currently WARNS about NULL _dot_origin
- Making it a hard BLOCK would break Directus Admin UI workflows
- Risk documented. Policy decision needed from orchestrator.
TD-380: retire_entity() — NOT A BUG
- Function correctly queries v_registry_counts.code_column
- Does NOT reference table_registry.code (old column)
TD-381: WARNING hidden — NOT A BUG
- 0 open WARNING issues exist (all auto-resolved by S165)
- API filter status=open correctly returns 0 warnings
- Expected behavior, not a bug
Evidence
| # | Check | Evidence | Result |
|---|---|---|---|
| K1 | Chaos data = 0 | COUNT = 0 for all 5 tables | PASS |
| K2 | v_reg INSERT blocked | ERROR: S167E guard | PASS |
| K3 | Fake issues blocked | ERROR: S167E guard | PASS |
| K4 | Runner exists on host | ls main.js → EXISTS | PASS |
| K9 | verify_counts | ERROR in verify_counts() for species_collection_map (code column) | KNOWN ISSUE (species_collection_map uses different column) |
| K10 | CI GREEN + merge | PR #634 merged, 4 required PASS | PASS |
| K11 | Smoke test | 17/17 PASS, system-issues all=1 | PASS |
Self-check
| # | Câu hỏi | ĐẠT/KHÔNG |
|---|---|---|
| 1 | OR + rules read | ĐẠT |
| 2 | Assembly Gate | ĐẠT |
| 3 | 7 chaos cleanup | ĐẠT (61 records removed) |
| 4 | TD-375 v_reg guard | ĐẠT |
| 5 | TD-376 system_issues guard | ĐẠT |
| 6 | TD-377 runner | ĐẠT (runs on host, not bug) |
| 7 | TD-378 scanner live count | ĐẠT |
| 8 | TD-379 _dot_origin | DOCUMENTED (policy decision needed) |
| 9 | TD-380 retire_entity | ĐẠT (not a bug) |
| 10 | TD-381 WARNING | ĐẠT (not a bug) |
| 11 | verify_counts | KNOWN ISSUE (species_collection_map code column) |
| 12 | CI GREEN merged | ĐẠT |
| 13 | Smoke test | ĐẠT (17/17) |
| 14 | Report uploaded | ĐẠT |