Files
CatoandClaude 5794526f18 fix(roadmap): render milestone records from the fleet map instead of throwing (#125)
The fleet map's milestones are { title, done } objects (ROADMAP.md
checkboxes); this renderer assumed bare strings and rendered the object as a
React child, which threw and served /roadmap as a 500 the moment the record
was first filled (2026-09-28). Both shapes render now, with a check on the
done ones, matching bip-kit's DevelopmentProfile type.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 04:36:35 -07:00

52 lines
1.6 KiB
TypeScript

/** Public, allowlisted projection from the canonical Loki profile. Never local roadmap copies. */
export interface DevelopmentProfile {
slug: string;
name: string;
what: string | null;
stack: string | null;
identity: {
problem: string | null;
solution: string | null;
mission: string | null;
vision: string | null;
};
roadmap: {
title: string;
status: string | null;
progress: number | null;
targetDate: string | null;
/** Legacy string rows and the fleet map's checked milestone records. */
milestones: (string | { title: string; done: boolean })[];
}[];
changelog: { date: string; done: string }[];
urls: {
live: string | null;
repo: string | null;
orangecat: string | null;
solon: string | null;
};
}
export async function developmentProfile(): Promise<{
profile: DevelopmentProfile | null;
checkedAt: string | null;
unavailable: boolean;
}> {
try {
const response = await fetch('https://loki.orangecat.ch/api/fleet/map', {
next: { revalidate: 300 },
signal: AbortSignal.timeout(8000),
});
if (!response.ok) throw new Error('Map unavailable');
const data = await response.json();
if (!Array.isArray(data.projects)) throw new Error('Invalid map');
const profile = data.projects.find((p: DevelopmentProfile) => p.slug === 'substrata') ?? null;
return {
profile,
checkedAt: typeof data.generatedAt === 'string' ? data.generatedAt : null,
unavailable: false,
};
} catch {
return { profile: null, checkedAt: null, unavailable: true };
}
}