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,7 +18,12 @@ export interface ExistingProfile {
averageEatenPortions: number | null;
averageLeftoverPortions: number | null;
observationCount: number;
lastSessionAnswers?: Array<{ sessionId: string; eaten: number; leftovers: number; date: string }> | null;
lastSessionAnswers?: Array<{
sessionId: string;
eaten: number;
leftovers: number;
date: string;
}> | null;
}
/**
@@ -48,7 +48,9 @@ const MS_PER_DAY = 86_400_000;
* Deterministisk, UTC, alltid samma svar för samma input.
*/
export function buildReconciliationCandidates(
items: Array<InventoryItemLike & { id: string; displayName: string; unit: string; locationName: string }>,
items: Array<
InventoryItemLike & { id: string; displayName: string; unit: string; locationName: string }
>,
context: ReconciliationContext,
now: Date = new Date(),
maxItems = 15,
+1 -6
View File
@@ -19,12 +19,7 @@ export interface NewScanObservation {
observationConfidence: number;
}
export type ScanDiffRowKind =
| "new_item"
| "moved"
| "quantity_changed"
| "vanished"
| "unchanged";
export type ScanDiffRowKind = "new_item" | "moved" | "quantity_changed" | "vanished" | "unchanged";
export interface ScanDiffRow {
kind: ScanDiffRowKind;
+4 -5
View File
@@ -175,7 +175,8 @@ export function householdTrustScore(
// 3. Andel uppskattade mängder (0100, 100 = alla har confidence 1)
const confidenceScore =
items.reduce((sum, i) => sum + Math.min(1, Math.max(0, i.confidence)), 0) / items.length * 100;
(items.reduce((sum, i) => sum + Math.min(1, Math.max(0, i.confidence)), 0) / items.length) *
100;
// 4. Poster som borde vara slut (0100, 100 = inga låga kvantiteter)
const depletionScore =
@@ -189,15 +190,13 @@ export function householdTrustScore(
// 5. Korrigeringsfrekvens (0100, 100 = inga korrigeringar)
const correctionRatio =
input.transactionCount30d > 0
? input.correctionCount30d / input.transactionCount30d
: 0;
input.transactionCount30d > 0 ? input.correctionCount30d / input.transactionCount30d : 0;
const correctionScore = Math.max(0, 100 - correctionRatio * 200);
const score = Math.round(
verifiedScore * 0.25 +
ageScore * 0.25 +
confidenceScore * 0.20 +
confidenceScore * 0.2 +
depletionScore * 0.15 +
correctionScore * 0.15,
);