ci: trigga på master + formatfix inför Gitea Actions
CI / Typecheck, test & build (push) Failing after 2s

This commit is contained in:
Sven (AAMOS AI)
2026-08-13 17:25:14 +07:00
parent 61d60931ad
commit c32a7e33c7
141 changed files with 40555 additions and 45210 deletions
@@ -18,11 +18,7 @@ import { BRAND } from "@app/shared-types";
import * as fs from "node:fs/promises";
import * as path from "node:path";
const OUTPUT_DIR = path.resolve(
import.meta.dirname ?? "..",
"..",
"output",
);
const OUTPUT_DIR = path.resolve(import.meta.dirname ?? "..", "..", "output");
const NULLCELL_TARGETS: PipelineTarget[] = [
// Endast jordnötssmör-cellen återstår; rikare, lagade middagsrätter.
@@ -74,13 +70,33 @@ function deriveEquipment(mainId: string): string[] {
function guessDna(mainId: string, ingredientIds: string[]) {
const vegetables = ingredientIds.filter((id) =>
["tomato", "spinach", "zucchini", "paprika", "carrot", "cucumber", "lettuce", "corn", "onion", "garlic"].includes(id),
[
"tomato",
"spinach",
"zucchini",
"paprika",
"carrot",
"cucumber",
"lettuce",
"corn",
"onion",
"garlic",
].includes(id),
);
const carbs = ingredientIds.filter((id) =>
["rice_white", "pasta_dry", "potato", "bread", "tortilla", "oats", "quinoa"].includes(id),
);
const proteins = ingredientIds.filter((id) =>
["pork_loin", "chicken_breast", "chicken_thigh", "minced_beef", "salmon", "tofu", "egg", "peanut_butter"].includes(id),
[
"pork_loin",
"chicken_breast",
"chicken_thigh",
"minced_beef",
"salmon",
"tofu",
"egg",
"peanut_butter",
].includes(id),
);
return {
protein: proteins[0] ?? null,
@@ -103,7 +119,9 @@ function toSeedRecipe(
titleSv: c.titleSv,
descriptionSv: c.descriptionSv,
cuisine: (c.cuisine as SeedRecipe["cuisine"]) ?? "international",
mealTypes: (c.mealTypes as SeedRecipe["mealTypes"]) ?? [target.mealType as SeedRecipe["mealTypes"][number]],
mealTypes: (c.mealTypes as SeedRecipe["mealTypes"]) ?? [
target.mealType as SeedRecipe["mealTypes"][number],
],
tags: deriveTags(target.mealType, target.mainIngredientId) as SeedRecipe["tags"],
methods: deriveMethods(target.mainIngredientId) as SeedRecipe["methods"],
equipment: deriveEquipment(target.mainIngredientId) as SeedRecipe["equipment"],
@@ -193,7 +211,9 @@ async function main() {
},
};
console.error(`[gapfill] ${NULLCELL_TARGETS.length} nollceller, max ${NULLCELL_TARGETS.reduce((s, t) => s + t.count, 0)} recept`);
console.error(
`[gapfill] ${NULLCELL_TARGETS.length} nollceller, max ${NULLCELL_TARGETS.reduce((s, t) => s + t.count, 0)} recept`,
);
const result = await runPipeline(
client,
@@ -205,11 +225,18 @@ async function main() {
);
const verifiedExports: Array<{ target: PipelineTarget; slug: string; recipe: SeedRecipe }> = [];
const rejects: Array<{ target: PipelineTarget; title: string; status: string; reasons: string[] }> = [];
const rejects: Array<{
target: PipelineTarget;
title: string;
status: string;
reasons: string[];
}> = [];
for (let i = 0; i < result.verificationResults.length; i++) {
const vr = result.verificationResults[i];
const target = NULLCELL_TARGETS.find((t) => t.mainIngredientId === vr.canonicalIngredientIds[0]) ?? NULLCELL_TARGETS[0];
const target =
NULLCELL_TARGETS.find((t) => t.mainIngredientId === vr.canonicalIngredientIds[0]) ??
NULLCELL_TARGETS[0];
if (vr.status === "verified") {
const slug = makeUniqueSlug(vr.candidate.titleSv, usedSlugs);
@@ -87,17 +87,16 @@ async function main() {
const client = createAamosClient(process.env);
console.error("[pilot-batch] Startar generering...");
console.error(`[pilot-batch] Katalog: ${catalog.length} ingredienser`);
console.error(`[pilot-batch] Mål: ${targets.length} matris-celler, ~${targets.reduce((s, t) => s + t.count, 0)} recept`);
const result = await runPipeline(
client,
targets,
catalog,
ingredientLookup,
similarityLookup,
{ maxPrepTimeMinutes: 30, maxCookTimeMinutes: 45, portions: 4 },
console.error(
`[pilot-batch] Mål: ${targets.length} matris-celler, ~${targets.reduce((s, t) => s + t.count, 0)} recept`,
);
const result = await runPipeline(client, targets, catalog, ingredientLookup, similarityLookup, {
maxPrepTimeMinutes: 30,
maxCookTimeMinutes: 45,
portions: 4,
});
// ── 6. Rapportera ────────────────────────────────────────────────────────
const report = {
batchId: `pilot-${Date.now()}`,
@@ -146,9 +145,11 @@ async function main() {
}
if (result.candidates.length === 0 && result.geminiResult.status === "ok") {
console.error("\n**Notering:** Gemini returnerade ok men inga kandidater. " +
"Mock-klienten stödjer inte GENERATE_RECIPE_CANDIDATES ännu — " +
"kör med AAMOS_MODE=gemini för live-generering.");
console.error(
"\n**Notering:** Gemini returnerade ok men inga kandidater. " +
"Mock-klienten stödjer inte GENERATE_RECIPE_CANDIDATES ännu — " +
"kör med AAMOS_MODE=gemini för live-generering.",
);
}
}