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>
125 lines
11 KiB
XML
125 lines
11 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1382" viewBox="0 0 1200 1382" 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="1380" 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">$ set -e
|
|
mkdir -p /tmp/probe
|
|
CT=complete-ttl-probe
|
|
docker rm -f "$CT" >/dev/null 2>&1 || true
|
|
docker run -d --name "$CT"</tspan><tspan x="24" dy="22"> --network "container:workmachine" \
|
|
-e POSTGRES_PASSWORD=probe -e POSTGRES_USER=probe -e POSTGRES_DB=probe \
|
|
postgr</tspan><tspan x="24" dy="22">es:16-alpine -p 55432 >/dev/null
|
|
for i in $(seq 1 40); do docker exec "$CT" pg_isready -U probe -p 55432 >/dev/null 2>&1</tspan><tspan x="24" dy="22"> && break; sleep 1; done
|
|
docker exec "$CT" psql -U probe -p 55432 -d probe -tAc 'select version()' | cut -c1-24
|
|
M=adapte</tspan><tspan x="24" dy="22">r/outbound/persistence-jpa/src/main/resources/db/migration
|
|
for d in postgresql jpa/core jpa/idempotency; do
|
|
for f in "</tspan><tspan x="24" dy="22">$M/$d"/V*.sql; do
|
|
docker exec -i "$CT" psql -U probe -p 55432 -d probe -q < "$f" >/dev/null 2>&1 || true
|
|
done
|
|
done</tspan><tspan x="24" dy="22">
|
|
|
|
echo
|
|
echo '# 같은 연산·같은 응답에 재생 창만 바꿔 완료를 두 번 부른다'
|
|
cat > /tmp/probe/cp.sh <<'CPSH'
|
|
# 락파일의 한 </tspan><tspan x="24" dy="22">구성에 실린 좌표 전부를 캐시 경로로 바꾼다. Gradle 실행 없이 재현된다.
|
|
LOCK=${1:-adapter/outbound/persistence-jpa/gradle</tspan><tspan x="24" dy="22">.lockfile}
|
|
CONF=${2:-postgresqlIntegrationTestRuntimeClasspath}
|
|
CACHE=/root/.gradle/caches/modules-2/files-2.1
|
|
cp=""
|
|
whi</tspan><tspan x="24" dy="22">le IFS= read -r line; do
|
|
coord=${line%%=*}; confs=${line#*=}
|
|
case ",$confs," in *",$CONF,"*) ;; *) continue ;; esac
|
|
</tspan><tspan x="24" dy="22"> group=${coord%%:*}; rest=${coord#*:}; name=${rest%%:*}; ver=${rest##*:}
|
|
jar=$(find "$CACHE/$group/$name/$ver" -name </tspan><tspan x="24" dy="22">'*.jar' ! -name '*sources*' ! -name '*javadoc*' 2>/dev/null | head -1)
|
|
[ -n "$jar" ] && cp="$cp:$jar"
|
|
done < <(grep -E</tspan><tspan x="24" dy="22"> '^[a-zA-Z0-9._-]+:[^=]+=' "$LOCK")
|
|
echo "${cp#:}"
|
|
CPSH
|
|
cat > /tmp/probe/CompleteTtlProbe.java <<'JAVA'
|
|
import dev.caske</tspan><tspan x="24" dy="22">leton.application.idempotency.RequestFingerprint;
|
|
import dev.caskeleton.application.idempotency.StoredResponse;
|
|
import d</tspan><tspan x="24" dy="22">ev.caskeleton.application.idempotency.v2.*;
|
|
import dev.caskeleton.application.transaction.OperationId;
|
|
import dev.caskel</tspan><tspan x="24" dy="22">eton.adapter.outbound.persistence.postgresql.idempotency.PostgreSqlOwnerSafeIdempotencyStore;
|
|
import java.time.Duration;</tspan><tspan x="24" dy="22">
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionMana</tspan><tspan x="24" dy="22">ger;
|
|
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
|
|
import org.springframework.transaction.support.T</tspan><tspan x="24" dy="22">ransactionTemplate;
|
|
|
|
/** 같은 연산·같은 응답에 재생 창만 바꿔 완료를 두 번 부른다. */
|
|
public class CompleteTtlProbe {
|
|
|
|
</tspan><tspan x="24" dy="22"> public static void main(String[] args) throws Exception {
|
|
var dataSource = new SimpleDriverDataSource(
|
|
(ja</tspan><tspan x="24" dy="22">va.sql.Driver) Class.forName("org.postgresql.Driver").getDeclaredConstructor().newInstance(),
|
|
"jdbc:postgresql:/</tspan><tspan x="24" dy="22">/127.0.0.1:55432/probe", "probe", "probe");
|
|
var jdbc = new JdbcTemplate(dataSource);
|
|
var transactions = new Tran</tspan><tspan x="24" dy="22">sactionTemplate(new DataSourceTransactionManager(dataSource));
|
|
var store = new PostgreSqlOwnerSafeIdempotencyStore(j</tspan><tspan x="24" dy="22">dbc);
|
|
|
|
jdbc.update("update capability_schema_registry set lifecycle_state = 'ACTIVE' "
|
|
+ "where capability_i</tspan><tspan x="24" dy="22">d = 'jpa-idempotency-owner-safe-v2'");
|
|
jdbc.update("delete from idempotency_record");
|
|
|
|
var scope = new Idempoten</tspan><tspan x="24" dy="22">cyScopeDigest("b".repeat(64), 1, "PROBE");
|
|
var fingerprint = RequestFingerprint.ofSha256("probe-request".getBytes())</tspan><tspan x="24" dy="22">;
|
|
var attempt = new IdempotencyClaimAttempt("1".repeat(64), new OperationId("op-1"));
|
|
var request = new Idempote</tspan><tspan x="24" dy="22">ncyClaimRequest(
|
|
scope, fingerprint, attempt, Duration.ofMinutes(5), Duration.ofHours(1), "json.v1", 2);
|
|
var</tspan><tspan x="24" dy="22"> response = new StoredResponse("{\"v\":\"SAME\"}");
|
|
|
|
transactions.executeWithoutResult(status -> {
|
|
var owner =</tspan><tspan x="24" dy="22"> ((IdempotencyClaimOutcome.Acquired) store.claim(request)).owner();
|
|
var started = store.markExecutionStarted(owner</tspan><tspan x="24" dy="22">, new OperationId("op-1")).owner().orElseThrow();
|
|
System.out.println("첫 완료 (재생 창 1시간) : "
|
|
+ st</tspan><tspan x="24" dy="22">ore.complete(started, response, Duration.ofHours(1), new OperationId("op-1")));
|
|
});
|
|
String first = jdbc.queryFor</tspan><tspan x="24" dy="22">Object(
|
|
"select extract(epoch from (replay_until - updated_at))::int::text from idempotency_record",
|
|
Str</tspan><tspan x="24" dy="22">ing.class);
|
|
String digestFirst = jdbc.queryForObject(
|
|
"select last_transition_result_digest from idempotency</tspan><tspan x="24" dy="22">_record", String.class);
|
|
System.out.println("저장된 재생 창(초) : " + first);
|
|
|
|
var owner2 = new Idempoten</tspan><tspan x="24" dy="22">cyOwner(scope, "1".repeat(64),
|
|
jdbc.queryForObject("select attempt from idempotency_record", Long.class),
|
|
</tspan><tspan x="24" dy="22"> jdbc.queryForObject("select state_revision from idempotency_record", Long.class),
|
|
new OperationId("op-1"));
|
|
</tspan><tspan x="24" dy="22"> transactions.executeWithoutResult(status ->
|
|
System.out.println("둘째 완료 (재생 창 9시간) : "
|
|
+ st</tspan><tspan x="24" dy="22">ore.complete(owner2, response, Duration.ofHours(9), new OperationId("op-1"))));
|
|
String second = jdbc.queryForObject(</tspan><tspan x="24" dy="22">
|
|
"select extract(epoch from (replay_until - updated_at))::int::text from idempotency_record",
|
|
String.cla</tspan><tspan x="24" dy="22">ss);
|
|
String digestSecond = jdbc.queryForObject(
|
|
"select last_transition_result_digest from idempotency_recor</tspan><tspan x="24" dy="22">d", String.class);
|
|
System.out.println("저장된 재생 창(초) : " + second);
|
|
System.out.println("전이 다이제</tspan><tspan x="24" dy="22">스트 그대로인가 : " + digestFirst.equals(digestSecond));
|
|
}
|
|
}
|
|
JAVA
|
|
CP="adapter/outbound/persistence-jpa/build/classes/j</tspan><tspan x="24" dy="22">ava/main:application-core/build/classes/java/main:$(bash /tmp/probe/cp.sh adapter/outbound/persistence-jpa/gradle.lockfi</tspan><tspan x="24" dy="22">le postgresqlIntegrationTestRuntimeClasspath)"
|
|
javac -encoding UTF-8 -nowarn -cp "$CP" -d /tmp/probe /tmp/probe/Complete</tspan><tspan x="24" dy="22">TtlProbe.java
|
|
java -Dstdout.encoding=UTF-8 -cp "$CP:/tmp/probe" CompleteTtlProbe 2>&1 | grep -v SLF4J
|
|
|
|
docker rm -f "$CT</tspan><tspan x="24" dy="22">" >/dev/null 2>&1 || true</tspan></text>
|
|
<text x="24" y="1102" 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="1124" 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-02T04:43:45+00:00 · exit 0</tspan></text>
|
|
<line x1="24" y1="1138" x2="1176" y2="1138" stroke="#30363d"/>
|
|
<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">PostgreSQL 16.15 on x86_</tspan></text>
|
|
<text x="24" y="1200" 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="1222" 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="1244" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">첫 완료 (재생 창 1시간) : COMPLETED</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">저장된 재생 창(초) : 3600</tspan></text>
|
|
<text x="24" y="1288" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">둘째 완료 (재생 창 9시간) : ALREADY_COMPLETED_SAME_RESULT</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">저장된 재생 창(초) : 3600</tspan></text>
|
|
<text x="24" y="1332" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">전이 다이제스트 그대로인가 : true</tspan></text>
|
|
</svg>
|