Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "module",
"private": true,
"scripts": {
"check:dashboard": "node scripts/check-dashboard-source.mjs",
"validate:data": "node scripts/validate-data.mjs",
"check:frontend": "node scripts/check-frontend.mjs"
},
Expand Down
5 changes: 3 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ <h4>Ecosystem</h4>
<div class="index-info">
<div class="index-level">Bitcoin Quantum Readiness<span class="index-level-tag" style="background:${levelBg[comp.current_level]||'var(--red-bg)'};color:${levelColors[comp.current_level]||'var(--red)'}">${comp.current_level}</span></div>
<div style="display:flex;gap:2rem;margin:1rem 0;flex-wrap:wrap">
<div><span style="font-family:'JetBrains Mono',monospace;font-size:1.5rem;font-weight:800;color:var(--orange)">${voiced.score}</span><span style="font-size:0.8rem;color:var(--text-muted)"> / 100 voiced urgency<br><span style="font-size:0.7rem;color:var(--text-muted)">(among developers who voiced a position)</span></span><br><span style="font-size:0.75rem;color:var(--text-muted)">${voiced.voices_count} of ${data.length} developers have voiced positions</span></div>
<div><span style="font-family:'JetBrains Mono',monospace;font-size:1.5rem;font-weight:800;color:var(--orange)">${voiced.score}</span><span style="font-size:0.8rem;color:var(--text-muted)"> / 100 voiced urgency<br><span style="font-size:0.7rem;color:var(--text-muted)">(among developers who voiced a position)</span></span><br><span style="font-size:0.75rem;color:var(--text-muted)">${voiced.voices_count} of ${total} developers have voiced positions</span></div>
<div><span style="font-family:'JetBrains Mono',monospace;font-size:1.5rem;font-weight:800;color:var(--red)">${coverage.score}%</span><span style="font-size:0.8rem;color:var(--text-muted)"> coverage</span><br><span style="font-size:0.75rem;color:var(--text-muted)">${coverage.silent} of ${coverage.total} developers have said nothing</span></div>
</div>
<p class="index-explain">${comp.formula}</p>
Expand Down Expand Up @@ -1200,10 +1200,11 @@ <h4>Ecosystem</h4>

// Ranked devs only (not notable)
const ranked = devs.filter(d => !d.notable && d.rank >= 1);
const rankMax = Math.max(...ranked.map(d => d.rank), 1);
bubbles = [];

ranked.forEach(dev => {
const x = padL + ((dev.rank - 1) / (total - 1)) * plotW;
const x = padL + ((dev.rank - 1) / Math.max(rankMax - 1, 1)) * plotW;
const y = padT + plotH - ((dev.quantum_urgency_score - 1) / 4) * plotH;
const vol = dev.pq_work_volume || 0;
const r = Math.max(6, Math.min(18, 6 + vol * 2.5));
Expand Down
37 changes: 37 additions & 0 deletions scripts/check-dashboard-source.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env node
import fs from "fs";

const html = fs.readFileSync(new URL("../public/index.html", import.meta.url), "utf8");
const errors = [];

function assert(condition, message) {
if (!condition) errors.push(message);
}

assert(
!html.includes("${data.length} developers have voiced positions"),
"dashboard must not read data.length; the dataset is an object with metadata/developers",
);

assert(
html.includes("${voiced.voices_count} of ${total} developers have voiced positions"),
"voiced-position copy should use metadata.total_assessed",
);

assert(
html.includes("const rankMax = Math.max(...ranked.map(d => d.rank), 1);"),
"bubble chart should compute its influence scale from ranked entries",
);

assert(
html.includes("Math.max(rankMax - 1, 1)"),
"bubble chart should scale x positions against the max ranked position, not total assessed entries",
);

if (errors.length) {
console.error(`check-dashboard-source failed with ${errors.length} error(s):`);
for (const error of errors) console.error(`- ${error}`);
process.exit(1);
}

console.log("check-dashboard-source passed");