phase 16: fix TS strict mode errors, node 24, update steering docs

This commit is contained in:
Celes Renata
2026-04-11 16:35:50 -07:00
parent faccb0b8db
commit 1fcb79503e
8 changed files with 86 additions and 66 deletions
+10 -10
View File
@@ -20,7 +20,7 @@ export function OpsModelPage() {
{/* Key metrics */}
<div className="grid grid-cols-2 gap-3 sm:grid-cols-5">
<StatCard label="Total Extractions" value={p.total_extractions} />
<StatCard label="Total Extractions" value={String(p.total_extractions ?? '—')} />
<StatCard label="Success Rate" value={p.success_rate != null ? `${((p.success_rate as number) * 100).toFixed(1)}%` : '—'} color="text-green-400" />
<StatCard label="Avg Latency" value={p.avg_duration_ms != null ? `${Math.round(p.avg_duration_ms as number)}ms` : '—'} />
<StatCard label="Retry Rate" value={p.retry_rate != null ? `${((p.retry_rate as number) * 100).toFixed(1)}%` : '—'} color="text-yellow-400" />
@@ -40,20 +40,20 @@ export function OpsModelPage() {
<div key={i} className="rounded border border-surface-700 bg-surface-950 p-3">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<span className="font-mono text-sm text-brand-300">{f.ticker as string}</span>
<span className="font-mono text-sm text-brand-300">{String(f.ticker)}</span>
<StatusBadge status="failed" />
<span className="text-xs text-gray-500">{f.model_name as string}</span>
<span className="text-xs text-gray-500">{String(f.model_name)}</span>
</div>
<span className="text-xs text-gray-500">{f.recorded_at ? new Date(f.recorded_at as string).toLocaleString() : ''}</span>
<span className="text-xs text-gray-500">{f.recorded_at ? new Date(String(f.recorded_at)).toLocaleString() : ''}</span>
</div>
<div className="mt-1 text-xs text-gray-400">
{f.document_title as string} ({f.document_type as string})
{f.document_title ? String(f.document_title) : ''} ({String(f.document_type)})
</div>
{f.validation_errors && (
{f.validation_errors ? (
<div className="mt-1 text-xs text-red-400">
{JSON.stringify(f.validation_errors)}
{JSON.stringify(f.validation_errors) ?? ''}
</div>
)}
) : null}
</div>
))}
</div>
@@ -63,10 +63,10 @@ export function OpsModelPage() {
);
}
function StatCard({ label, value, color = 'text-gray-100' }: { label: string; value: unknown; color?: string }) {
function StatCard({ label, value, color = 'text-gray-100' }: { label: string; value: string; color?: string }) {
return (
<Card className="text-center">
<div className={`text-xl font-bold ${color}`}>{value != null ? String(value) : '—'}</div>
<div className={`text-xl font-bold ${color}`}>{value}</div>
<div className="text-xs text-gray-500">{label}</div>
</Card>
);