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
@@ -1,8 +1,4 @@
import type {
ProvenanceEntry,
RecommendationCandidate,
RecommendationContext,
} from "./types.js";
import type { ProvenanceEntry, RecommendationCandidate, RecommendationContext } from "./types.js";
import { renderProvenance } from "./provenance-templates.js";
import type { LanguageTag } from "./provenance-templates.js";
@@ -182,7 +178,8 @@ const WHY_TEMPLATES: Record<LanguageTag, WhyTemplates> = {
nl: {
coverage100: "Jullie hebben alle ingrediënten thuis.",
coveragePct: "Jullie hebben {{pct}} % van de ingrediënten thuis.",
coverageLow: "Jullie hebben {{pct}} % van de ingrediënten; de rest komt op het boodschappenlijstje.",
coverageLow:
"Jullie hebben {{pct}} % van de ingrediënten; de rest komt op het boodschappenlijstje.",
expiringToday: "{{ingredient}} moet vandaag gebruikt worden.",
expiringTomorrow: "{{ingredient}} moet uiterlijk morgen gebruikt worden.",
expiringDays: "{{ingredient}} moet binnen {{days}} dagen gebruikt worden.",
@@ -7,23 +7,9 @@ import type { ProvenanceEntry } from "./types.js";
*/
export type LanguageTag =
| "sv"
| "en"
| "es"
| "it"
| "de"
| "fr"
| "da"
| "nb"
| "fi"
| "nl"
| "pl"
| "pt";
"sv" | "en" | "es" | "it" | "de" | "fr" | "da" | "nb" | "fi" | "nl" | "pl" | "pt";
const TEMPLATES: Record<
string,
Record<LanguageTag, string>
> = {
const TEMPLATES: Record<string, Record<LanguageTag, string>> = {
favoriteCuisine: {
sv: "För att du har berättat att du gillar {{cuisine}} mat.",
en: "Because you said you like {{cuisine}} food.",
@@ -124,10 +110,7 @@ const TEMPLATES: Record<
},
};
export function renderProvenance(
entries: ProvenanceEntry[],
languageTag: string,
): string {
export function renderProvenance(entries: ProvenanceEntry[], languageTag: string): string {
const lang = (languageTag.split("-")[0] ?? "sv") as LanguageTag;
const parts: string[] = [];
for (const entry of entries) {
@@ -142,10 +125,7 @@ export function renderProvenance(
return parts.join(" ");
}
export function renderProvenanceList(
entries: ProvenanceEntry[],
languageTag: string,
): string[] {
export function renderProvenanceList(entries: ProvenanceEntry[], languageTag: string): string[] {
const lang = (languageTag.split("-")[0] ?? "sv") as LanguageTag;
return entries
.map((entry) => {
@@ -230,7 +230,12 @@ function memoryFit(candidate: RecommendationCandidate, ctx: RecommendationContex
// Favoritkök
if (memory.kind === "structured_fact" && value.favoriteCuisine === candidate.cuisine) {
const weight = memory.verifiedByUser || memory.origin === "user_stated" ? 1 : memory.origin === "observed" ? 0.7 : 0.4;
const weight =
memory.verifiedByUser || memory.origin === "user_stated"
? 1
: memory.origin === "observed"
? 0.7
: 0.4;
score = Math.max(score, weight);
if (weight >= 0.7) {
provenance.push({