Add ai-21-migration module: upgrading Spring AI 2.0.x to 2.1.0, measured. One probe source tree run on 2.0.0, 2.0.2, 2.0.3 and 2.1.0 (Anthropic prompt tokens with caching, auth header, discarded temperature, thinking parts, message mutability, entity() on refusals), three compile breaks, API and configuration diffs from the jars, ChatMemory to session copy, a wrapping ToolCallingManager under tool confirmation, the OpenAI Responses switch, VectorStore.upsert on real pgvector, a grep checklist and an OpenRewrite recipe. Scripted and local fake models; no provider called. Spring Boot 4.2.0, Spring AI 2.1.0, Java 25.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7N4ZDbUtA3ofqAqRV
This commit is contained in:
Claude
2026-12-03 09:46:46 +05:30
parent 8f69e7bf50
commit c8fa0912f7
71 changed files with 1990 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Regenerates every file in output/. Needs JDK 25, Maven, Docker (for 11-upsert) and network
# access to Maven Central and GitHub. No model provider is called and no API key is needed.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p target
echo "== probes: one source tree against four Spring AI versions"
for pair in 2.0.0:4.1.0 2.0.2:4.1.0 2.0.3:4.1.0 2.1.0:4.2.0; do
v=${pair%:*}
(cd probes && mvn -B clean test -Dspring-ai.version="$v" -Dboot.version="${pair#*:}" > "../target/probe-$v.log")
done
{
echo "# javac -Xlint:deprecation,removal on probes/.../LegacyAssistant.java (from the Maven build log)"
for v in 2.0.3 2.1.0; do echo "Spring AI $v: $(grep -c 'WARNING.*LegacyAssistant' "target/probe-$v.log" || true) warnings"; done
grep 'WARNING.*LegacyAssistant' target/probe-2.1.0.log \
| sed -E 's#.*LegacyAssistant.java:#LegacyAssistant.java:#; s/org\.springframework\.ai\.//g; s/@org\.jspecify\.annotations\.Nullable java\.lang\.//'
} > output/06-legacy-warnings.txt
echo "== compile breaks"; scripts/compile-breaks.sh > /dev/null
echo "== 2.1.0 module"; mvn -B clean test > target-main.log; mkdir -p target && mv target-main.log target/main.log
echo "== API, config, BOM"; scripts/api-diff.sh > /dev/null; scripts/bom-diff.sh > /dev/null
echo "== checklist"; scripts/grep-checklist.sh legacy-app > output/16-grep-checklist.txt
echo "== OpenRewrite"; scripts/openrewrite.sh > /dev/null
echo done