fix: 커맨드 차등 생명주기와 로그 그래프를 보강
장수 55종과 수뇌 35종의 상태, 로그, 메시지, 예약 턴 비교를 닫습니다. 실제 시나리오 프로필과 대표 PostgreSQL 수명주기, 즉시 외교와 출병 회귀를 추가하고 발견된 Ref 로그 및 생성 장수 저장 차이를 교정합니다.
This commit is contained in:
@@ -27,18 +27,21 @@ describe('processGeneralActionWithFallback', () => {
|
||||
|
||||
const fallbackResolver: GeneralActionResolver = {
|
||||
key: 'fallbackCmd',
|
||||
resolve: () => ({
|
||||
effects: [
|
||||
{
|
||||
type: 'log',
|
||||
entry: { text: 'Primary failed', scope: 'general', category: 'action', format: 'month' },
|
||||
} as any,
|
||||
],
|
||||
alternative: {
|
||||
commandKey: 'alternativeCmd',
|
||||
args: { foo: 'bar' },
|
||||
},
|
||||
}),
|
||||
resolve: (context) => {
|
||||
context.addPostProgressionLog?.('Primary post-progression');
|
||||
return {
|
||||
effects: [
|
||||
{
|
||||
type: 'log',
|
||||
entry: { text: 'Primary failed', scope: 'general', category: 'action', format: 'month' },
|
||||
} as any,
|
||||
],
|
||||
alternative: {
|
||||
commandKey: 'alternativeCmd',
|
||||
args: { foo: 'bar' },
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
const alternativeResolver: GeneralActionResolver = {
|
||||
@@ -100,18 +103,8 @@ describe('processGeneralActionWithFallback', () => {
|
||||
mockLoader
|
||||
);
|
||||
|
||||
// It should eventually execute alternativeResolver
|
||||
// BUT resolveGeneralAction creates a FRESH resolution from the FINAL resolver.
|
||||
// It does NOT merge logs currently. (As per my implementation comment)
|
||||
// Wait, did I implement log merging? No.
|
||||
// I implemented a simple loop that re-runs `resolveGeneralAction`.
|
||||
// So the final resolution comes from `alternativeResolver`.
|
||||
|
||||
// Let's verify what we expect.
|
||||
// If we want legacy parity, we might expect logs from the first attempt too.
|
||||
// But for now, let's verify the loop works.
|
||||
|
||||
expect(resolution.logs).toHaveLength(2); // 'Primary failed' + 'Alternative executed...'
|
||||
expect(resolution.postProgressionLogs.map((entry) => entry.text)).toEqual(['Primary post-progression']);
|
||||
expect(resolution.alternative).toBeUndefined(); // The final one succeeded
|
||||
expect(mockLoader.load).toHaveBeenCalledWith('alternativeCmd');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user