From cfdfbbcc000acb3664dbc90776f08fc37eec5f2c Mon Sep 17 00:00:00 2001 From: opus Date: Tue, 21 Apr 2026 11:38:01 +0200 Subject: [PATCH] fix(erp-cc-kpi-skills-brains-keys): Truth Registry schema real keys - skills.TOTAL (not count_total) = 15509 - brains peut etre Array length - fetcher JS mis a jour sk.TOTAL puis fallback count_total et count_unique - Array.isArray check pour brains - GOLD wtp_kpi_fix preserve - chattr safe - HTTP 200 valide live - cause racine mon fetcher utilisait count_total qui n existe pas dans schema Truth Registry V107 - zero regression additif pur --- weval-technology-platform.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/weval-technology-platform.html b/weval-technology-platform.html index 43056377c..02693a0ff 100644 --- a/weval-technology-platform.html +++ b/weval-technology-platform.html @@ -3013,12 +3013,11 @@ if (typeof window.navigateTo === 'function'){ const br = tr.brains || {}; if (ag.count_unique) document.getElementById('erp-kpi-agents').textContent = ag.count_unique; // skills count may be number or object with total - let skc = typeof sk === 'number' ? sk : (sk.count_total || sk.count || (sk.items && sk.items.length) || 0); - if (!skc && typeof sk === 'object') { - skc = Object.values(sk).reduce((a,b) => a + (typeof b === 'number' ? b : 0), 0); - } + // Skills: Truth Registry uses .TOTAL key (15509) + let skc = typeof sk === 'number' ? sk : (sk.TOTAL || sk.count_total || sk.count_unique || 0); if (skc) document.getElementById('erp-kpi-skills').textContent = skc.toLocaleString('fr-FR'); - let brc = typeof br === 'number' ? br : (br.count || (br.items && br.items.length) || 0); + // Brains may be array + let brc = typeof br === 'number' ? br : (Array.isArray(br) ? br.length : (br.count || (br.items && br.items.length) || 0)); if (brc) document.getElementById('erp-kpi-brains').textContent = brc; } catch(e) { /* silent */ }