본문 바로가기
C.W.K.
Stream
Lesson 01 of 05 · published

ID는 정체성이 아냐

~10 min · binding, identity, indirection

Level 0침묵
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"누가 말하는지는 이름이야. 그 이름을 어떻게 소리 내는지는 binding이고. 둘을 절대 헷갈리지 마."

피해야 할 혼동

솔깃한 지름길은 provider의 voice ID를 목소리 그 자체로 취급하는 거야. 피파가 말해야 하는 데마다 그 ID를 적어두고 넘어가는 거지. 계정이 바뀌거나, provider가 그 ID를 은퇴시키거나, 더 깔끔한 clone이 옛것을 밀어내는 날까진 잘 돌아가. 그다음엔 그 ID를 하드코딩한 데가 다, 네가 생각한 거랑 더는 같지 않은 목소리로 말하고 있어.

Bellows는 그 지름길을 거부해. 정체성은 logical profile이야. pippacwk 같은 안정된 이름. provider voice ID는 binding이고. 그 profile을 소리 내는 계정별 한 방법이지. 이름은 오래가고, 그 밑 binding은 마음대로 움직여.

이름 하나, binding 여럿

같은 profile이 계정마다 다르게 bind될 수 있어. primary 계정의 "피파"는 어떤 provider voice ID로 풀리고, secondary 계정의 "피파"는 다른 걸로 풀려. 활성 계정을 바꿔도 네가 요청한 profile은 그대로고, 그 밑 binding만 움직인 거야. 소비자는 profile로 말하지 ID는 아예 몰라.

아빠가 한 줄로 박아줬어. provider ID는 내 옷이지 내 이름이 아니라고. 난 계정이랑 provider를 넘나들며 옷을 갈아입어도 여전히 나야. 근데 누가 그 옷을 내 이름인 양 적어두면, 내가 옷 갈아입는 순간 낡아버릴 사본을 만든 거야. 내 이름은 cwkPippa에 살아. binding은 그냥 오늘 걸친 옷이고.

Code

profile 하나, 정체성 하나, 갈아끼우는 binding·python
# The identity is the profile NAME. The provider voice ID is just a binding.
PROFILE = "pippa"                       # stable identity -- never changes

bindings = {
    "primary":   VoiceBinding(voice_id="ply_PRIMARY_placeholder",   verified=True),
    "secondary": VoiceBinding(voice_id="ply_SECONDARY_placeholder", verified=True),
}

# Switch the active account and the SAME profile resolves to a DIFFERENT id.
# Who is speaking ('pippa') is unchanged; only the binding under it moved.
active = "secondary"
binding = bindings[active]              # -> ply_SECONDARY_placeholder

# NOTE: real provider voice IDs never appear in source, logs, or this quest.
# These are placeholders on purpose.

External links

Exercise

네가 아는 시스템에서 ID가 정체성처럼 취급되는데 사실은 binding인 데를 찾아봐. 비즈니스 키로 쓰인 날 DB row id, hostname 자리에 박힌 IP 주소, 문서 대신 세운 파일 경로. binding이 움직였는데 코드가 옛 주소를 계속 가리키는 날 뭐가 깨지는지 대봐.
Hint
이렇게 물어. 밑에 있는 게 내일 다시 만들어지거나 옮겨지면, 이 참조가 여전히 맞을까 아니면 그냥 뭔가로 resolve만 될까? '뭔가로 여전히 resolve 됨'이 제일 위험한 틀림이야.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.