From 455cfe8ea40909fcd38d6d3a57bb67dc5c9c29e7 Mon Sep 17 00:00:00 2001 From: Nestor Martinez Date: Sat, 18 Apr 2026 12:31:09 +0200 Subject: [PATCH] fix(dashboard): handle dict-shaped _catalog.json (v4.3+ schema) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit collect_skills() assumed _catalog.json is a flat list, but v4.3+ uses a dict with globalSkills/librarySkills arrays. Iterating over dict keys yielded strings, causing AttributeError: 'str' object has no attribute 'get' on the first run in any install with the current schema. Now detects both shapes: - dict → sum globalSkills + librarySkills, use real global count - list → legacy fallback (unchanged behavior) Also guards .get() with isinstance check so mixed content never crashes. Reproduced on fresh v4.4.1 install. /dashboard-sinapsis now runs green. --- core/_generate-dashboard.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/_generate-dashboard.py b/core/_generate-dashboard.py index 3e1b826..0087450 100644 --- a/core/_generate-dashboard.py +++ b/core/_generate-dashboard.py @@ -126,12 +126,18 @@ def collect_proposals(): def collect_skills(): cat = load_json(SKILLS / '_catalog.json', []) - total = len(cat) - stubs = sum(1 for s in cat if s.get('description', '').startswith('(auto-generated')) + if isinstance(cat, dict): + globals_list = cat.get('globalSkills', []) or [] + library_list = cat.get('librarySkills', []) or [] + all_skills = globals_list + library_list + globals_ = len(globals_list) + else: + all_skills = cat if isinstance(cat, list) else [] + globals_ = 5 + total = len(all_skills) + stubs = sum(1 for s in all_skills if isinstance(s, dict) and s.get('description', '').startswith('(auto-generated')) complete = total - stubs - # Approximate 5 globals from CLAUDE.md - globals_ = 5 - return total, globals_, complete - globals_, stubs + return total, globals_, max(0, complete - globals_), stubs def collect_projects():