···178178 logoUrl,
179179 logoWithBackgroundUrl,
180180 };
181181- // Plugin manifest may omit modelCard; we require it for display.
182181 if ((serverEntry as { modelCard?: ModelCard }).modelCard == null) {
183182 throw new Error(
184184- `Integration "${id}" (${packageSpec}) must provide a modelCard with at least "modelDetails" and "technicalIntegration" sections.`,
183183+ `Integration "${id}" (${packageSpec}) must provide a modelCard with all required sections (see REQUIRED_MODEL_CARD_SECTION_IDS).`,
185184 );
186185 }
187186 map.set(id, serverEntry);
+20-15
types/integration.ts
···3939 * Either subsections (with bold sub-headings) or top-level fields, or both.
4040 */
4141export type ModelCardSection = Readonly<{
4242- /** Stable id for the section (e.g. "modelDetails", "trainingData"). */
4242+ /** Stable id for the section (e.g. "trainingData", "biasAndLimitations"). */
4343 id: string;
4444 /** Display title (e.g. "Model Details"). */
4545 title: string;
···7373 * Use assertModelCardHasRequiredSections() to validate at runtime.
7474 */
7575export const REQUIRED_MODEL_CARD_SECTION_IDS = [
7676- 'modelDetails',
7777- 'technicalIntegration',
7676+ 'trainingData',
7777+ 'policyAndTaxonomy',
7878+ 'annotationMethodology',
7979+ 'performanceBenchmarks',
8080+ 'biasAndLimitations',
8181+ 'implementationGuidance',
8282+ 'relevantLinks',
7883] as const;
79848085/**
8181- * Asserts that a model card has at least the required sections (basic information
8282- * and technical integration). Call when registering integration manifests.
8686+ * Asserts that a model card has at least the required sections.
8787+ * Call when registering integration manifests.
8388 * @throws Error if any required section id is missing
8489 */
8590export function assertModelCardHasRequiredSections(card: ModelCard): void {
8691 const sectionIds = new Set((card.sections ?? []).map((s) => s.id));
8787- for (const requiredId of REQUIRED_MODEL_CARD_SECTION_IDS) {
8888- if (!sectionIds.has(requiredId)) {
8989- throw new Error(
9090- `Model card must include a section with id "${requiredId}" (e.g. Basic Information / Model Details and Technical Integration).`,
9191- );
9292- }
9292+ const missing = REQUIRED_MODEL_CARD_SECTION_IDS.filter(
9393+ (id) => !sectionIds.has(id),
9494+ );
9595+ if (missing.length > 0) {
9696+ throw new Error(
9797+ `Model card is missing required section(s): ${missing.map((id) => `"${id}"`).join(', ')}.`,
9898+ );
9399 }
94100}
95101···141147 signalTypeIds?: readonly string[];
142148 /**
143149 * Model card: structured metadata (model name, version, sections) for the UI.
144144- * When present, the integration detail page renders it. Built-in integrations
145145- * should always provide a model card with at least sections "modelDetails" and
146146- * "technicalIntegration"; use assertModelCardHasRequiredSections() when
147147- * registering.
150150+ * When present, the integration detail page renders it. Integrations must
151151+ * include all sections listed in REQUIRED_MODEL_CARD_SECTION_IDS; use
152152+ * assertModelCardHasRequiredSections() when registering.
148153 */
149154 modelCard?: ModelCard;
150155 /**