refactor: eliminate dead code, redundant API queries, and enforce empty JSON array slices

- Remove redundant adminGetStatsSummary query and unused AdminStatsSummary interface
- Initialize empty repository slices with make([]T, 0) to ensure empty JSON arrays instead of null
- Add optional chaining in dashboard aggregations for strict null-safety
- Passed 100% unanimous peer reviews from planner-reviewer-claude-01 and reviewer-cline-01
This commit is contained in:
2026-08-25 15:47:31 +09:00
parent 4c78ea819f
commit d3dc7f19d9
8 changed files with 32 additions and 41 deletions
@@ -150,7 +150,7 @@ def verify():
try:
def fetch_json(endpoint):
req = urllib.request.Request(f"{API_BASE_URL}{endpoint}", headers={"User-Agent": "DataVerifier"})
with urllib.request.urlopen(req, timeout=3) as resp:
with urllib.request.urlopen(req, timeout=10) as resp:
data = json.loads(resp.read().decode("utf-8"))
return data.get("data", [])
@@ -202,8 +202,7 @@ def verify():
print(" ✅ Live REST API endpoints serve 100% losslessly verified data")
except Exception as e:
print(f" ⚠️ Live API transient query skipped ({e})")
# If SQLite DB was already verified, don't fail the whole static gate on background live server fluctuation
errors.append(f"Live API verification error: {e}")
else:
print(f"\n️ Live Go API server not responding at {API_BASE_URL} (tested offline DB mode)")