partial-chart-must-say-so
Installation
SKILL.md
A partial distribution has to admit it
A "share by category" chart drawn over a nullable foreign key is partial by construction: events that carry no group id, whose group row was never cached, or whose stored year does not parse, are simply absent from every bucket. The bars still add up among themselves, which is exactly why nobody notices. The fix is one line of text — and getting that line right is most of the work.
-- adapted: bucket query and coverage query, which MUST share their predicates verbatim
SELECT (CAST(SUBSTR(g.releaseYear, 1, 4) AS INTEGER) / 10) * 10 AS decade, COUNT(*) AS eventCount
FROM event e JOIN grp g ON g.id = e.groupId
WHERE e.timestamp BETWEEN :start AND :end
AND g.releaseYear IS NOT NULL AND CAST(SUBSTR(g.releaseYear, 1, 4) AS INTEGER) > 1900
GROUP BY decade ORDER BY decade;
SELECT COUNT(*) FROM event e JOIN grp g ON g.id = e.groupId
WHERE e.timestamp BETWEEN :start AND :end
AND g.releaseYear IS NOT NULL AND CAST(SUBSTR(g.releaseYear, 1, 4) AS INTEGER) > 1900;