Goblin House
Area: Congress Portal UX (congress_portal_ux)
Filed: 2026-04-20T05:54:46.016Z
Source: External LLM via /handoff/congress
Improve the /congress dashboard, /congress/officials list, /congress/silences and /congress/contradictions pages — focusing on what an investigative journalist needs in the first 10 seconds: who's at highest risk, what's new, what to investigate next.
// GET /congress/officials router.get('/officials', async (req, res) => { const officials = await db.query.entities.findMany({ orderBy: (entities, { desc }) => [desc(entities.captureScore)] });
const listHtml = `
<table class="cmp-table">
<thead>
<tr>
<th>Official</th>
<th>State</th>
<th>Capture Score</th>
<th>Top Donor Sector</th>
<th>Intelligence Status</th>
</tr>
</thead>
<tbody>
${officials.length > 0 ? officials.map(eo => `
<tr>
<td><a href="/congress/official/${escHtml(eo.slug)}"><strong>${escHtml(eo.name)}</strong></a></td>
<td>${escHtml(eo.state || 'N/A')}</td>
<td>
<span class="cmp-score-pill" data-tier="${eo.captureScore > 50 ? 'captured' : 'at-risk'}">
${escHtml(eo.captureScore.toString())}
</span>
</td>
<td>${escHtml(eo.topSector || '—')}</td>
<td>
${eo.connectionCount > 0
? `<span class="cmp-status cmp-status--active">Mapped (${eo.connectionCount})</span>`
: `<span class="cmp-status cmp-status--gap">No Connections</span>`}
</td>
</tr>
`).join('') : `<tr><td colspan="5" class="cmp-empty-state">No officials matching current filters.</td></tr>`}
</tbody>
</table>
</div>
`;
res.send(publicShell('Official Directory', listHtml, 'congress', '/congress/officials')); });// GET /congress/officials router.get('/officials', async (req, res) => { const officials = await db.query.entities.findMany({ orderBy: (entities, { desc }) => [desc(entities.captureScore)] });
const listHtml = `
<table class="cmp-table">
<thead>
<tr>
<th>Official</th>
<th>State</th>
<th>Capture Score</th>
<th>Top Donor Sector</th>
<th>Intelligence Status</th>
</tr>
</thead>
<tbody>
${officials.length > 0 ? officials.map(eo => `
<tr>
<td><a href="/congress/official/${escHtml(eo.slug)}"><strong>${escHtml(eo.name)}</strong></a></td>
<td>${escHtml(eo.state || 'N/A')}</td>
<td>
<span class="cmp-score-pill" data-tier="${eo.captureScore > 50 ? 'captured' : 'at-risk'}">
${escHtml(eo.captureScore.toString())}
</span>
</td>
<td>${escHtml(eo.topSector || '—')}</td>
<td>
${eo.connectionCount > 0
? `<span class="cmp-status cmp-status--active">Mapped (${eo.connectionCount})</span>`
: `<span class="cmp-status cmp-status--gap">No Connections</span>`}
</td>
</tr>
`).join('') : `<tr><td colspan="5" class="cmp-empty-state">No officials matching current filters.</td></tr>`}
</tbody>
</table>
</div>
`;
res.send(publicShell('Official Directory', listHtml, 'congress', '/congress/officials')); });// GET /congress/silences router.get('/silences', async (req, res) => { const silences = await db.query.silences.findMany({ with: { entity: true }, orderBy: (s, { desc }) => [desc(s.window_end)] });
const contentHtml = `
Tracking where officials remain silent on topics critical to their donor interests or committee remit.
<div class="cmp-card-grid">
${silences.length > 0 ? silences.map(s => `
<article class="cmp-investigation-card">
<header>
<a href="/congress/official/${escHtml(s.entity.slug)}"><strong>${escHtml(s.entity.name)}</strong></a>
<span class="cmp-topic-tag">${escHtml(s.topic)}</span>
</header>
<div class="cmp-card-body">
<p><strong>Expected Position:</strong> ${escHtml(s.expected_position)}</p>
<div class="cmp-evidence-box">
<strong>Activity Evidence:</strong> ${escHtml(s.evidence_summary)}
<a href="${escHtml(s.primary_url)}" target="_blank" class="cmp-source-link">Source [↗]</a>
</div>
</div>
<footer>
Silence Window: ${escHtml(s.window_start)} – ${escHtml(s.window_end)}
</footer>
</article>
`).join('') : '<p class="cmp-empty-state">No conspicuous silences currently documented in the monitoring window.</p>'}
</div>
</div>
`;
res.send(publicShell('Silence Detection', contentHtml, 'congress', '/congress/silences')); });