Files
document-haness/docs/clean-architecture-backend-template/final/evidence/rendered/a05-f012-identity.svg
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

99 lines
17 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1822" viewBox="0 0 1200 1822" role="img">
<title>terminal evidence</title>
<desc>Terminal-style rendering generated from retained command output. Sensitive-looking values are redacted in the visual asset.</desc>
<rect x="1" y="1" width="1198" height="1820" rx="14" fill="#0d1117" stroke="#30363d"/>
<rect x="1" y="1" width="1198" height="44" rx="14" fill="#161b22"/>
<rect x="1" y="30" width="1198" height="14" fill="#161b22"/>
<circle cx="24" cy="22" r="6" fill="#ff5f57"/>
<circle cx="44" cy="22" r="6" fill="#febc2e"/>
<circle cx="64" cy="22" r="6" fill="#28c840"/>
<text x="92" y="27" fill="#8b949e" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace">terminal evidence</text>
<text x="24" y="68" fill="#c9d1d9" font-size="15" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">$ G=adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/Hibernate</tspan><tspan x="24" dy="22">BatchConfigurationGuard.java
echo &#x27;# 가드가 식별자를 찾는 방식&#x27;
grep -n &#x27;&#x27; &quot;$G&quot; | sed -n &#x27;49,75p&#x27;
echo
echo &#x27;# 이 타입</tspan><tspan x="24" dy="22">을 언급하는 곳 전부 (자기 파일 포함)&#x27;
grep -rnw &#x27;HibernateBatchConfigurationGuard&#x27; --include=*.java --exclude-dir=build </tspan><tspan x="24" dy="22">. | sed &#x27;s|^\./||&#x27;
echo -n &#x27;# 그 타입을 인스턴스화하는 main 코드: &#x27;
grep -rn &#x27;new HibernateBatchConfigurationGuard(&#x27; -</tspan><tspan x="24" dy="22">-include=*.java --exclude-dir=build . | grep -c &#x27;/main/&#x27;
echo -n &#x27;# 같은 패키지의 프로파일 레지스트리를 읽는 main 코드</tspan><tspan x="24" dy="22">: &#x27;
grep -rnw &#x27;JpaBatchProfileRegistry&#x27; --include=*.java --exclude-dir=build . | grep &#x27;/main/&#x27; | grep -vc &#x27;batch/JpaBatc</tspan><tspan x="24" dy="22">hProfileRegistry.java&#x27;
echo &#x27;# 계획 문서가 이 과제의 산출물로 적은 것&#x27;
grep -rn &#x27;startup diagnostics for IDENTITY&#x27; ../</tspan><tspan x="24" dy="22">docs/superpowers/plans/2026-08-11-jpa-persistence-platform-implementation-plan.md
echo
echo &#x27;# 가드가 거절하려는 전략이</tspan><tspan x="24" dy="22"> main 에 나타나는 곳&#x27;
grep -rn &#x27;GenerationType.IDENTITY&#x27; --include=*.java --exclude-dir=build . | grep &#x27;/main/&#x27; | sed &#x27;s</tspan><tspan x="24" dy="22">|^\./||&#x27;
echo -n &#x27;# main 에서 @GeneratedValue 를 쓰는 줄: &#x27;
grep -rnw &#x27;@GeneratedValue&#x27; --include=*.java --exclude-dir</tspan><tspan x="24" dy="22">=build . | grep -c &#x27;/main/&#x27;
echo
echo &#x27;# 출하 엔티티의 식별자 접근 방식&#x27;
echo -n &#x27;# main 의 @Entity 파일: &#x27;
grep -rl </tspan><tspan x="24" dy="22">&#x27;^@Entity&#x27; --include=*.java --exclude-dir=build . | grep -c &#x27;/main/&#x27;
echo -n &#x27;# 그중 @Id 를 필드에 단 파일: &#x27;
grep -rl</tspan><tspan x="24" dy="22"> &#x27;^@Entity&#x27; --include=*.java --exclude-dir=build . | grep &#x27;/main/&#x27; | xargs grep -lw &#x27;@Id&#x27; | wc -l
echo -n &#x27;# @Id 바로 </tspan><tspan x="24" dy="22">뒤가 메서드 선언인 것 (프로퍼티 접근): &#x27;
grep -rA1 -w &#x27;@Id&#x27; --include=*.java --exclude-dir=build . | grep &#x27;/main/&#x27; | gre</tspan><tspan x="24" dy="22">p -c &#x27;public .* get.*()&#x27;
echo -n &#x27;# @Access 나 AccessType 을 쓰는 줄 (저장소 전체): &#x27;
grep -rwE &#x27;@Access|AccessType&#x27; -</tspan><tspan x="24" dy="22">-include=*.java --exclude-dir=build . | wc -l
echo -n &#x27;# @EmbeddedId 를 쓰는 main 파일: &#x27;
grep -rlw &#x27;@EmbeddedId&#x27; --in</tspan><tspan x="24" dy="22">clude=*.java --exclude-dir=build . | grep &#x27;/main/&#x27; | sed &#x27;s|.*/||&#x27; </tspan></text>
<text x="24" y="442" fill="#8b949e" font-size="13" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">cwd: /shared/codebase/clean-architecture-backend-template/src</tspan></text>
<text x="24" y="464" fill="#8b949e" font-size="13" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">time: 2026-09-02T03:55:56+00:00 · exit 0</tspan></text>
<line x1="24" y1="478" x2="1176" y2="478" stroke="#30363d"/>
<text x="24" y="518" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 가드가 식별자를 찾는 방식</tspan></text>
<text x="24" y="540" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">49: public boolean usesIdentityGeneration(Class&lt;?&gt; entityType) {</tspan></text>
<text x="24" y="562" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">50: return identifierField(entityType)</tspan></text>
<text x="24" y="584" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">51: .map(field -&gt; field.getAnnotation(GeneratedValue.class))</tspan></text>
<text x="24" y="606" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">52: .filter(Objects::nonNull)</tspan></text>
<text x="24" y="628" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">53: .map(generated -&gt; generated.strategy() == GenerationType.IDENTITY)</tspan></text>
<text x="24" y="650" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">54: .orElse(false);</tspan></text>
<text x="24" y="672" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">55: }</tspan></text>
<text x="24" y="694" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">56:</tspan></text>
<text x="24" y="716" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">57: /**</tspan></text>
<text x="24" y="738" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">58: * Finds the {@code @Id} field, walking superclasses.</tspan></text>
<text x="24" y="760" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">59: *</tspan></text>
<text x="24" y="782" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">60: * &lt;p&gt;Superclasses are walked because a mapped superclass carrying the identifier is the common</tspan></text>
<text x="24" y="804" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">61: * shape; stopping at the declared class would silently classify every such entity as &quot;not</tspan></text>
<text x="24" y="826" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">62: * identity&quot; and let the guard pass on exactly the entities it was written for.</tspan></text>
<text x="24" y="848" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">63: */</tspan></text>
<text x="24" y="870" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">64: private static Optional&lt;Field&gt; identifierField(Class&lt;?&gt; entityType) {</tspan></text>
<text x="24" y="892" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">65: for (Class&lt;?&gt; current = entityType;</tspan></text>
<text x="24" y="914" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">66: current != null &amp;&amp; current != Object.class;</tspan></text>
<text x="24" y="936" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">67: current = current.getSuperclass()) {</tspan></text>
<text x="24" y="958" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">68: for (Field field : current.getDeclaredFields()) {</tspan></text>
<text x="24" y="980" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">69: if (field.isAnnotationPresent(Id.class)) {</tspan></text>
<text x="24" y="1002" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">70: return Optional.of(field);</tspan></text>
<text x="24" y="1024" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">71: }</tspan></text>
<text x="24" y="1046" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">72: }</tspan></text>
<text x="24" y="1068" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">73: }</tspan></text>
<text x="24" y="1090" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">74: return Optional.empty();</tspan></text>
<text x="24" y="1112" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">75: }</tspan></text>
<text x="24" y="1134" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
<text x="24" y="1156" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 이 타입을 언급하는 곳 전부 (자기 파일 포함)</tspan></text>
<text x="24" y="1178" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/java/dev/caskeleton/adapter/outbound/persistence/platform/IdStrat</tspan><tspan x="24" dy="22">egyContractTest.java:18: * &lt;p&gt;This is the measurement behind {@code HibernateBatchConfigurationGuard}. The guard refuses an</tspan></text>
<text x="24" y="1222" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/test/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigu</tspan><tspan x="24" dy="22">rationGuardTest.java:14: private final HibernateBatchConfigurationGuard guard = new HibernateBatchConfigurationGuard();</tspan></text>
<text x="24" y="1266" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigu</tspan><tspan x="24" dy="22">rationGuard.java:23:public final class HibernateBatchConfigurationGuard {</tspan></text>
<text x="24" y="1310" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/testkit/java/dev/caskeleton/adapter/outbound/persistence/testkit/id/IdentityEntity.java:16:</tspan><tspan x="24" dy="22"> * HibernateBatchConfigurationGuard} uses the same fact to refuse a batch profile that targets it.</tspan></text>
<text x="24" y="1354" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 그 타입을 인스턴스화하는 main 코드: 0</tspan></text>
<text x="24" y="1376" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 같은 패키지의 프로파일 레지스트리를 읽는 main 코드: 0</tspan></text>
<text x="24" y="1398" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 계획 문서가 이 과제의 산출물로 적은 것</tspan></text>
<text x="24" y="1420" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">2937:- Produces: Named batch profiles and startup diagnostics for IDENTITY and sequence mismatch.</tspan></text>
<text x="24" y="1442" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
<text x="24" y="1464" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 가드가 거절하려는 전략이 main 에 나타나는 곳</tspan></text>
<text x="24" y="1486" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigu</tspan><tspan x="24" dy="22">rationGuard.java:13: * &lt;p&gt;The case that matters is {@link GenerationType#IDENTITY}. An identity column&#x27;s value is</tspan></text>
<text x="24" y="1530" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigu</tspan><tspan x="24" dy="22">rationGuard.java:42: + &quot; uses GenerationType.IDENTITY, and IDENTITY disables insert batching: Hibernate&quot;</tspan></text>
<text x="24" y="1574" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigu</tspan><tspan x="24" dy="22">rationGuard.java:53: .map(generated -&gt; generated.strategy() == GenerationType.IDENTITY)</tspan></text>
<text x="24" y="1618" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># main 에서 @GeneratedValue 를 쓰는 줄: 0</tspan></text>
<text x="24" y="1640" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
<text x="24" y="1662" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 출하 엔티티의 식별자 접근 방식</tspan></text>
<text x="24" y="1684" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># main 의 @Entity 파일: 32</tspan></text>
<text x="24" y="1706" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># 그중 @Id 를 필드에 단 파일: 27</tspan></text>
<text x="24" y="1728" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># @Id 바로 뒤가 메서드 선언인 것 (프로퍼티 접근): 0</tspan></text>
<text x="24" y="1750" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># @Access 나 AccessType 을 쓰는 줄 (저장소 전체): 0</tspan></text>
<text x="24" y="1772" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"># @EmbeddedId 를 쓰는 main 파일: LiveEventEntity.java</tspan></text>
</svg>