constraint 실패 후 실패 검사 결과 항목을 직접 반환.

This commit is contained in:
2026-01-10 13:16:43 +00:00
parent d5d3949705
commit 3ec7e66948
9 changed files with 82 additions and 74 deletions
@@ -340,11 +340,12 @@ const buildConstraintContext = (
mode: 'full',
});
const createActionLog = (message: string): LogEntryDraft => ({
const createActionLog = (message: string, meta?: Record<string, unknown>): LogEntryDraft => ({
scope: LogScope.GENERAL,
category: LogCategory.ACTION,
format: LogFormat.MONTH,
text: message,
meta,
});
const resolveDefinition = (
@@ -505,7 +506,8 @@ export const createReservedTurnHandler = async (options: {
actionArgs = definition.parseArgs({}) ?? {};
actionKey = definition.key;
const reason = result.kind === 'deny' ? result.reason : '조건을 확인할 수 없습니다.';
logs.push(createActionLog(reason));
const meta = result.kind === 'deny' ? { constraintName: result.constraintName } : undefined;
logs.push(createActionLog(reason, meta));
}
const seedBase = buildSeedBase(context.world);