Fix model freshness stuck at 0% by calling onModelDeployed on deploy
CI / build-and-push (push) Successful in 27s

onModelDeployed was defined but never invoked — lastModelReleaseTick
stayed at 0 so the freshness guard always returned 0. Now deployModel
updates obsolescence state, setting freshness to 1.0 with proper decay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 09:51:53 -04:00
parent 00e790591e
commit fdedd6f4d0
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -42,7 +42,7 @@ import {
} from '@ai-tycoon/shared'; } from '@ai-tycoon/shared';
import { import {
emptyDCNetworkSummary, emptyCampusNetworkSummary, emptyClusterNetworkSummary, emptyDCNetworkSummary, emptyCampusNetworkSummary, emptyClusterNetworkSummary,
BENCHMARKS, TECH_TREE, BENCHMARKS, TECH_TREE, onModelDeployed,
} from '@ai-tycoon/game-engine'; } from '@ai-tycoon/game-engine';
import { INITIAL_RIVALS } from '@ai-tycoon/game-engine'; import { INITIAL_RIVALS } from '@ai-tycoon/game-engine';
@@ -1082,6 +1082,10 @@ export const useGameStore = create<Store>()(
...pl, modelId, isActive: true, ...pl, modelId, isActive: true,
})), })),
}, },
market: {
...s.market,
obsolescence: onModelDeployed(s.market.obsolescence, s.meta.tickCount),
},
})), })),
deployVariant: (familyId, variantId) => set((s) => ({ deployVariant: (familyId, variantId) => set((s) => ({
+1
View File
@@ -5,6 +5,7 @@ export { getAvailableResearch, getResearchNode } from './systems/researchSystem'
export { getResearchBonuses } from './systems/researchBonuses'; export { getResearchBonuses } from './systems/researchBonuses';
export type { ResearchBonuses } from './systems/researchBonuses'; export type { ResearchBonuses } from './systems/researchBonuses';
export { emptyDCNetworkSummary, emptyCampusNetworkSummary, emptyClusterNetworkSummary } from './systems/infrastructureSystem'; export { emptyDCNetworkSummary, emptyCampusNetworkSummary, emptyClusterNetworkSummary } from './systems/infrastructureSystem';
export { onModelDeployed } from './systems/market/obsolescenceSystem';
export { canRaiseFunding, getNextFundingRound, computeValuation } from './systems/fundingSystem'; export { canRaiseFunding, getNextFundingRound, computeValuation } from './systems/fundingSystem';
export { TECH_TREE } from './data/techTree'; export { TECH_TREE } from './data/techTree';
export { INITIAL_RIVALS } from './data/competitors'; export { INITIAL_RIVALS } from './data/competitors';