seeds.tachi.ac

This commit is contained in:
zk
2026-04-21 23:25:54 +00:00
parent c157d0026a
commit ea52824a4b
75 changed files with 7936 additions and 247 deletions
@@ -25,7 +25,7 @@ export function CreateScoreCalcData<TGame extends V3Game>(
chart as any,
) as MongoDerivedMetrics[TGame];
// Per-GPT `scoreCalcs` take game-specific score/derived types; at runtime inputs match `gptString`.
// Per-GPT `scoreCalcs` take game-specific score/derived types; at runtime inputs match `game`.
const scoreCalcs = impl.scoreCalcs as unknown as (
scoreData: ScoreData<TGame>,
derivedData: MongoDerivedMetrics[TGame],
@@ -59,7 +59,7 @@ export async function rederiveScoresForChart(chartId: string, log: KtLogger): Pr
for (const row of rows) {
const score = ToScoreDocument(row as ScoreDocumentJoinRow);
// GPT-specific union types aren't callable with the generic GPTString,
// game-specific union types aren't callable with the generic game,
// so we cast through `any` the same way CreateScoreCalcData does.
const derivedData = (impl.scoreDeriver as any)(score.scoreData, chart);
+1 -3
View File
@@ -29,7 +29,6 @@ import {
type GoalDocument,
type GoalSubscriptionDocument,
type integer,
LEGACY_GameToGPTString,
type PBScoreDocument,
type QuestDocument,
type QuestSubscriptionDocument,
@@ -72,13 +71,12 @@ export async function EvaluateGoalForUser(
): Promise<EvaluatedGoalReturn | null> {
const chartIDs = await ResolveGoalCharts(goal);
const v3Game = goal.game;
const gptString = LEGACY_GameToGPTString(v3Game);
const gameConfig = GetGameConfig(v3Game);
const scoreConf = GetScoreMetricConf(gameConfig, goal.criteria.key);
if (!scoreConf) {
throw new Error(
`Invalid goal.criteria.key, got '${goal.criteria.key}', but no config exists for this metric for ${gptString}.`,
`Invalid goal.criteria.key, got '${goal.criteria.key}', but no config exists for this metric for ${v3Game}.`,
);
}