feat(m02-df): 다른 로직 입력 받는 알약 예시값 자리

- CfLogicRef.examples(받는 알약 이름 → 값) · Eval 값 차례 = 이어진 선 > 넘긴 값 > 상자 예시값 > 그 로직 자기 예시값
- CfDesign.example — 변수 = variable.example · 다른 로직 = examples(없으면 null)
- 시험 23개

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBToTCGk5dqDKeXCEP3vhk
This commit is contained in:
2026-10-01 19:52:55 +09:00
co-authored by Claude Opus 5.5
parent 9848bd01b9
commit dad45e997b
3 changed files with 38 additions and 3 deletions
+19 -2
View File
@@ -64,6 +64,8 @@ export interface CfLogicRef {
outputs: CfPill[];
/** 받는 알약 = 그 로직의 「설계 때 정할 것」(변수 · 재료 자리) */
designs: CfPill[];
/** 선 없는 받는 알약의 예시값(키 = 받는 알약 이름) — 값 차례 = 이어진 선 > 넘긴 값 > 이것 > 그 로직 자기 예시값 */
examples?: Record<string, number | string>;
}
export interface CfInput {
@@ -154,6 +156,8 @@ export interface CfDesign {
unit: string;
variable?: CfVariable;
element?: CfElementRef;
/** 보일 예시값 — 변수 = variable.example · 다른 로직 = logic.examples(없으면 빈 칸 → 그 로직 자기 예시값) */
example?: number | string | null;
}
/** 사용자 요소 — 그룹에 없는 새 요소(마스터에 안 씀 · `_data` 에 저장) */
@@ -567,7 +571,14 @@ export function designInputs(lg: CfLogic): CfDesign[] {
for (const b of lg.boxes) {
const vars = b.input?.variables ?? b.func?.variables ?? [];
for (const v of vars)
out.push({ box: b.id, port: v.name, kind: "변수", unit: v.unit || "-", variable: clone(v) });
out.push({
box: b.id,
port: v.name,
kind: "변수",
unit: v.unit || "-",
variable: clone(v),
example: v.example,
});
for (const e of b.input?.mode === "group" ? b.input.elements : [])
if (e.mode === "choice")
out.push({
@@ -580,7 +591,13 @@ export function designInputs(lg: CfLogic): CfDesign[] {
if (b.input?.mode === "logic")
for (const d of b.input.logic?.designs ?? [])
if (!lg.links.some((l) => l.to.box === b.id && l.to.name === d.name))
out.push({ box: b.id, port: d.name, kind: "다른 로직", unit: d.unit || "-" });
out.push({
box: b.id,
port: d.name,
kind: "다른 로직",
unit: d.unit || "-",
example: b.input.logic?.examples?.[d.name] ?? null,
});
}
return out;
}