Files
document-haness/docs/keycloak-session-store/final/.techviz/b3-rotation-contention/spec.json
T
DongHyeonkaandClaude Opus 5 95c0e680b5 docs(keycloak-session-store): take the sentences out of the diagram canvases
The skill says drawings carry names and sentences go in <desc> and the
paragraph beside the figure. I put sentences in node details and edge labels
instead, and 27 of the 28 diagrams shipped with prose inside the canvas —
"예측 다섯 개가 틀렸다", "아홉 번 조용히 실패했다", "막혀서 닿지 않는다".

Only label and details render on the canvas; description does not. So every
sentence moved to a noun phrase and the meaning stays in description, which
was already carrying it.

  막혀서 닿지 않는다              -> 차단
  아홉 번 조용히 실패했다         -> 조용한 실패 9건
  예측 다섯 개가 틀렸다           -> 틀린 예측 5건
  로그아웃이 정리하지 않는다      -> 로그아웃 미정리
  볼륨이 없으면 여기까지다        -> 볼륨 없음

Three node labels were sentences too and became names: 세션 스냅샷, 예측
선기록, 대조군 확보.

What stays is what the rules protect — identifiers, commands and measured
values: PRIMARY KEY (client_registration_id, principal_name),
ValidationFailedException: 1 changesets check sum, nginx -t && nginx -s
reload, SET LOCAL synchronous_commit TO OFF. Those are names of things, not
prose about them.

294 canvas strings across 28 diagrams, none matching a sentence ending,
average 11 characters. All 28 still lint clean and re-rendered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 11:50:33 +09:00

150 lines
4.2 KiB
JSON

{
"version": "1.1",
"id": "b3-rotation-contention",
"title": "회전 경쟁에서 이긴 요청도 진다",
"question": "같은 refresh token 으로 동시에 여러 요청이 오면 어떻게 되는가",
"type": "architecture",
"direction": "TB",
"audience": [
"Refresh Token Rotation 을 켜려는 백엔드 엔지니어"
],
"summary": "하나가 성공하고 나머지가 실패하는 것이 아니다. 경쟁이 감지되면 client session 이 지워져 이긴 요청의 새 토큰조차 쓸 수 없다.",
"alt": "동시에 도착한 refresh 요청들이 경쟁을 일으키고, 그 결과 client session 자체가 지워지는 구성.",
"long_description": "revokeRefreshToken 을 켜고 refreshTokenMaxReuse 를 0 으로 둔 상태에서 같은 refresh token 으로 동시에 5건을 보냈다. 순차로 돌리면 재현되지 않으며 백그라운드로 띄우고 wait 해야 경합이 생긴다. 이긴 요청이 받은 새 토큰조차 쓸 수 없었다. Keycloak 이 경쟁을 감지하면 client session 을 지우기 때문이다.",
"source_context": {
"document": "docs/keycloak-session-store/final/document.md",
"document_sha256": "1d44cba1905544d92f1d26ae36a8deb64a3db3914d6b488fd30d6ae7f8cfbabe",
"anchor": {
"kind": "heading",
"value": "B-3 · Refresh Token Rotation 경쟁 (Q2)",
"line": 391
}
},
"composition": {
"profile": "component-flow",
"diagram_only": true,
"reference_ids": [
"payment-event-flow"
],
"rationale": "경쟁의 결과가 개별 요청이 아니라 세션 전체에 미치는 것이 지배적 질문이다. 영향 경로이므로 component-flow 를 골랐다."
},
"groups": [],
"nodes": [
{
"id": "concurrent",
"label": "동시 refresh 5건",
"kind": "actor",
"role": "source",
"emphasis": "primary",
"description": "같은 refresh token 을 쓴다.",
"details": [
"& + wait 필요"
],
"evidence": [
{
"start_line": 369,
"end_line": 375
}
],
"assumption": false
},
{
"id": "rotation",
"label": "회전 검사",
"kind": "process",
"role": "control",
"emphasis": "warning",
"description": "이미 쓴 토큰인지 본다.",
"details": [
"revokeRefreshToken=true · refreshTokenMaxReuse=0"
],
"evidence": [
{
"start_line": 369,
"end_line": 377
}
],
"assumption": false
},
{
"id": "client-session",
"label": "client session",
"kind": "component",
"role": "target",
"emphasis": "warning",
"description": "경쟁이 감지되면 지워진다.",
"details": [],
"evidence": [
{
"start_line": 378,
"end_line": 384
}
],
"assumption": false
},
{
"id": "new-token",
"label": "이긴 요청의 새 토큰",
"kind": "component",
"role": "target",
"emphasis": "warning",
"description": "세션이 지워져 쓸 수 없다.",
"details": [],
"evidence": [
{
"start_line": 378,
"end_line": 384
}
],
"assumption": false
}
],
"edges": [
{
"id": "c-r",
"from": "concurrent",
"to": "rotation",
"label": "동시 도착",
"kind": "request",
"evidence": [
{
"start_line": 369,
"end_line": 377
}
],
"assumption": false
},
{
"id": "r-cs",
"from": "rotation",
"to": "client-session",
"label": "경쟁 감지 시 삭제",
"kind": "blocked",
"evidence": [
{
"start_line": 378,
"end_line": 384
}
],
"assumption": false
},
{
"id": "cs-nt",
"from": "client-session",
"to": "new-token",
"label": "사용 불가",
"kind": "blocked",
"evidence": [
{
"start_line": 378,
"end_line": 384
}
],
"assumption": false
}
],
"legend": [],
"metadata": {
"rationale": "실패가 진 요청에만 오지 않는다는 것을 그렸다. 재시도 설계가 여기서 갈린다."
}
}