diff --git a/.skills/mcc-integration-testing/references/command-matrix.md b/.skills/mcc-integration-testing/references/command-matrix.md index 31077374..782bc745 100644 --- a/.skills/mcc-integration-testing/references/command-matrix.md +++ b/.skills/mcc-integration-testing/references/command-matrix.md @@ -19,7 +19,7 @@ This skill uses a fixed set of stable commands for local offline integration tes - `look east` - `/gamemode survival` - `respawn` -- `/tp CursorBot 0 -60 0` +- `/tp MCCBot 0 -60 0` - `smoke_test_from_mcc_full_spectrum` - `integration_test_chat_response` @@ -29,63 +29,63 @@ Notes: ## Server-side commands via `mc-rcon` -- `op CursorBot` +- `op MCCBot` - `gamerule sendCommandFeedback true` - `gamerule logAdminCommands true` - `time set day` - `weather clear` - `say Hello from the server console` -- `msg CursorBot This is a private whisper` -- `effect give CursorBot minecraft:speed 30 1` -- `effect give CursorBot minecraft:regeneration 10 1` -- `kill CursorBot` +- `msg MCCBot This is a private whisper` +- `effect give MCCBot minecraft:speed 30 1` +- `effect give MCCBot minecraft:regeneration 10 1` +- `kill MCCBot` ## Representative entity coverage -- `execute as CursorBot at @s run summon minecraft:cow ~2 ~ ~` -- `execute as CursorBot at @s run summon minecraft:zombie ~4 ~ ~` -- `execute as CursorBot at @s run summon minecraft:creeper ~6 ~ ~` -- `execute as CursorBot at @s run summon minecraft:skeleton ~8 ~ ~` -- `execute as CursorBot at @s run summon minecraft:villager ~-2 ~ ~` -- `execute as CursorBot at @s run summon minecraft:allay ~-4 ~ ~` -- `execute as CursorBot at @s run summon minecraft:armor_stand ~ ~ ~2` -- `execute as CursorBot at @s run summon minecraft:item_display ~-6 ~ ~ {item:{id:"minecraft:diamond",count:1}}` -- `execute as CursorBot at @s run summon minecraft:spider ~10 ~ ~` -- `execute as CursorBot at @s run summon minecraft:pig ~-8 ~ ~` +- `execute as MCCBot at @s run summon minecraft:cow ~2 ~ ~` +- `execute as MCCBot at @s run summon minecraft:zombie ~4 ~ ~` +- `execute as MCCBot at @s run summon minecraft:creeper ~6 ~ ~` +- `execute as MCCBot at @s run summon minecraft:skeleton ~8 ~ ~` +- `execute as MCCBot at @s run summon minecraft:villager ~-2 ~ ~` +- `execute as MCCBot at @s run summon minecraft:allay ~-4 ~ ~` +- `execute as MCCBot at @s run summon minecraft:armor_stand ~ ~ ~2` +- `execute as MCCBot at @s run summon minecraft:item_display ~-6 ~ ~ {item:{id:"minecraft:diamond",count:1}}` +- `execute as MCCBot at @s run summon minecraft:spider ~10 ~ ~` +- `execute as MCCBot at @s run summon minecraft:pig ~-8 ~ ~` ## Block placement coverage -- `execute as CursorBot at @s run fill ~1 ~ ~1 ~3 ~2 ~3 minecraft:stone` -- `execute as CursorBot at @s run setblock ~5 ~ ~5 minecraft:chest` -- `execute as CursorBot at @s run setblock ~5 ~1 ~5 minecraft:furnace` -- `execute as CursorBot at @s run setblock ~6 ~ ~5 minecraft:crafting_table` +- `execute as MCCBot at @s run fill ~1 ~ ~1 ~3 ~2 ~3 minecraft:stone` +- `execute as MCCBot at @s run setblock ~5 ~ ~5 minecraft:chest` +- `execute as MCCBot at @s run setblock ~5 ~1 ~5 minecraft:furnace` +- `execute as MCCBot at @s run setblock ~6 ~ ~5 minecraft:crafting_table` ## Dimension change coverage -- `execute in minecraft:the_nether run tp CursorBot 0 64 0` -- `execute in minecraft:overworld run tp CursorBot 0 -60 0` +- `execute in minecraft:the_nether run tp MCCBot 0 64 0` +- `execute in minecraft:overworld run tp MCCBot 0 -60 0` ## Representative particle coverage -- `execute as CursorBot at @s run particle minecraft:happy_villager ~ ~1 ~ 0.5 0.5 0.5 0 12 force` -- `execute as CursorBot at @s run particle minecraft:end_rod ~ ~1 ~ 0.5 0.5 0.5 0.01 20 force` -- `execute as CursorBot at @s run particle minecraft:explosion ~ ~1 ~ 0 0 0 0 1 force` -- `execute as CursorBot at @s run particle minecraft:totem_of_undying ~ ~1 ~ 0.5 0.5 0.5 0.1 20 force` -- `execute as CursorBot at @s run particle minecraft:flame ~ ~1 ~ 0.2 0.2 0.2 0.02 30 force` -- `execute as CursorBot at @s run particle minecraft:heart ~ ~2 ~ 0.3 0.3 0.3 0 5 force` +- `execute as MCCBot at @s run particle minecraft:happy_villager ~ ~1 ~ 0.5 0.5 0.5 0 12 force` +- `execute as MCCBot at @s run particle minecraft:end_rod ~ ~1 ~ 0.5 0.5 0.5 0.01 20 force` +- `execute as MCCBot at @s run particle minecraft:explosion ~ ~1 ~ 0 0 0 0 1 force` +- `execute as MCCBot at @s run particle minecraft:totem_of_undying ~ ~1 ~ 0.5 0.5 0.5 0.1 20 force` +- `execute as MCCBot at @s run particle minecraft:flame ~ ~1 ~ 0.2 0.2 0.2 0.02 30 force` +- `execute as MCCBot at @s run particle minecraft:heart ~ ~2 ~ 0.3 0.3 0.3 0 5 force` ## Representative sound coverage -- `execute as CursorBot at @s run playsound minecraft:entity.lightning_bolt.thunder master CursorBot ~ ~ ~ 1 1 0` -- `execute as CursorBot at @s run playsound minecraft:block.note_block.bell master CursorBot ~ ~ ~ 1 1 0` -- `execute as CursorBot at @s run playsound minecraft:entity.experience_orb.pickup master CursorBot ~ ~ ~ 1 1 0` +- `execute as MCCBot at @s run playsound minecraft:entity.lightning_bolt.thunder master MCCBot ~ ~ ~ 1 1 0` +- `execute as MCCBot at @s run playsound minecraft:block.note_block.bell master MCCBot ~ ~ ~ 1 1 0` +- `execute as MCCBot at @s run playsound minecraft:entity.experience_orb.pickup master MCCBot ~ ~ ~ 1 1 0` ## Explosion coverage -- `execute as CursorBot at @s run summon minecraft:tnt ~3 ~ ~` -- `execute as CursorBot at @s run summon minecraft:tnt ~6 ~ ~` +- `execute as MCCBot at @s run summon minecraft:tnt ~3 ~ ~` +- `execute as MCCBot at @s run summon minecraft:tnt ~6 ~ ~` ## Kill and respawn cycle -- `kill CursorBot` (via RCON, requires survival mode) +- `kill MCCBot` (via RCON, requires survival mode) - `respawn` (via MCC command after death) diff --git a/.skills/mcc-integration-testing/scripts/prepare_offline_mcc_config.sh b/.skills/mcc-integration-testing/scripts/prepare_offline_mcc_config.sh index 64727a58..1e30f673 100644 --- a/.skills/mcc-integration-testing/scripts/prepare_offline_mcc_config.sh +++ b/.skills/mcc-integration-testing/scripts/prepare_offline_mcc_config.sh @@ -28,11 +28,11 @@ if [[ $# -ge 3 && -f "$1" ]]; then TEMPLATE_INI="$1" OUTPUT_INI="$2" MC_VERSION="$3" - LOGIN_NAME="${4:-CursorBot}" + LOGIN_NAME="${4:-MCCBot}" else OUTPUT_INI="$1" MC_VERSION="$2" - LOGIN_NAME="${3:-CursorBot}" + LOGIN_NAME="${3:-MCCBot}" fi ACCOUNT_TYPE="${MCC_TEST_ACCOUNT_TYPE:-mojang}" diff --git a/.skills/mcc-integration-testing/scripts/run_achievements_test.sh b/.skills/mcc-integration-testing/scripts/run_achievements_test.sh index 4ea0c3ec..1484acd6 100755 --- a/.skills/mcc-integration-testing/scripts/run_achievements_test.sh +++ b/.skills/mcc-integration-testing/scripts/run_achievements_test.sh @@ -37,6 +37,8 @@ fi SERVER_DIR="$1" MC_VERSION="$2" PROFILE="$3" +SESSION_NAME="achievements-${SERVER_DIR//[^a-zA-Z0-9]/_}-${PROFILE}" +TEST_USERNAME="$(_mcc_resolve_username "$SESSION_NAME")" if [[ "$PROFILE" != "legacy" && "$PROFILE" != "modern" ]]; then echo "Unsupported profile: $PROFILE" >&2 @@ -55,11 +57,11 @@ COMMAND_LOG="$RUN_DIR/commands.log" SUMMARY_ENV="$RUN_DIR/summary.env" PROBE_SCRIPT="$RUN_DIR/achievement_probe.cs" CFG="$RUN_DIR/MinecraftClient.$MC_VERSION.ini" -INPUT_FILE="$REPO_ROOT/mcc_input.txt" +INPUT_FILE="$(_mcc_session_input_file "$SESSION_NAME")" SERVER_LOG_FILE="$MCC_SERVERS/$SERVER_DIR/logs/latest.log" TARGET_ID="minecraft:story/root" -TARGET_COMMAND_GRANT="advancement grant CursorBot only minecraft:story/root" -TARGET_COMMAND_REVOKE="advancement revoke CursorBot only minecraft:story/root" +TARGET_COMMAND_GRANT="advancement grant $TEST_USERNAME only minecraft:story/root" +TARGET_COMMAND_REVOKE="advancement revoke $TEST_USERNAME only minecraft:story/root" TARGET_TYPE="Modern 🌱" PORT="unknown" MCC_PID="" @@ -74,8 +76,8 @@ EXECUTED="yes" if [[ "$PROFILE" == "legacy" ]]; then TARGET_ID="achievement.openInventory" - TARGET_COMMAND_GRANT="achievement give achievement.openInventory CursorBot" - TARGET_COMMAND_REVOKE="achievement take achievement.openInventory CursorBot" + TARGET_COMMAND_GRANT="achievement give achievement.openInventory $TEST_USERNAME" + TARGET_COMMAND_REVOKE="achievement take achievement.openInventory $TEST_USERNAME" TARGET_TYPE="Legacy 🧱" fi @@ -286,7 +288,7 @@ if [[ ! -d "$MCC_SERVERS/$SERVER_DIR" ]]; then fail "Server directory not found: $MCC_SERVERS/$SERVER_DIR" fi -bash "$SCRIPT_DIR/prepare_offline_mcc_config.sh" "$CFG" "$MC_VERSION" CursorBot >/dev/null || fail "Failed to prepare temporary MCC config." +bash "$SCRIPT_DIR/prepare_offline_mcc_config.sh" "$CFG" "$MC_VERSION" "$TEST_USERNAME" >/dev/null || fail "Failed to prepare temporary MCC config." PORT="$(bash "$SCRIPT_DIR/get_server_port.sh" "$SERVER_DIR")" "$SCRIPT_DIR/ensure_offline_server.sh" "$SERVER_DIR" @@ -296,6 +298,7 @@ if [[ "$PROFILE" == "legacy" && -f "$MCC_SERVERS/$SERVER_DIR/server.properties" sed_in_place 's/^use-native-transport=.*/use-native-transport=false/' "$MCC_SERVERS/$SERVER_DIR/server.properties" fi +mkdir -p "$(dirname "$INPUT_FILE")" : > "$INPUT_FILE" rm -f "$MCC_LOG" @@ -306,9 +309,9 @@ wait_for_server_ready "$SERVER_DIR" || fail "Server did not become ready." log_step "Starting MCC for $MC_VERSION" ( cd "$REPO_ROOT" - MCC_FILE_INPUT=1 dotnet run --project MinecraftClient -c Release --no-build -- \ + MCC_FILE_INPUT=1 MCC_INPUT_FILE="$INPUT_FILE" dotnet run --project MinecraftClient -c Release --no-build -- \ "$CFG" \ - CursorBot \ + "$TEST_USERNAME" \ - \ "localhost:$PORT" \ "--accounttype=mojang" \ @@ -323,9 +326,9 @@ log_step "Starting MCC for $MC_VERSION" MCC_PID=$! wait_for_file_pattern "$MCC_LOG" "Server was successfully joined." "MCC join success" 90 || fail "MCC failed to join." -wait_for_file_pattern "$SERVER_LOG_FILE" "CursorBot joined the game" "server join entry" 30 || fail "Server never logged the join." +wait_for_file_pattern "$SERVER_LOG_FILE" "$TEST_USERNAME joined the game" "server join entry" 30 || fail "Server never logged the join." -run_server_command "op CursorBot" +run_server_command "op $TEST_USERNAME" run_server_command "gamerule sendCommandFeedback true" if [[ "$PROFILE" == "modern" ]]; then run_server_command "gamerule logAdminCommands true" diff --git a/.skills/mcc-integration-testing/scripts/summarize_test_run.sh b/.skills/mcc-integration-testing/scripts/summarize_test_run.sh index d0b74ff7..ac8efacf 100755 --- a/.skills/mcc-integration-testing/scripts/summarize_test_run.sh +++ b/.skills/mcc-integration-testing/scripts/summarize_test_run.sh @@ -22,4 +22,4 @@ echo "MCC highlights:" grep -E "Server was successfully joined|FileInput|smoke_test_from_mcc_full_spectrum|There are [0-9]+ of a max|health|Creative" "$MCC_LOG" || true echo echo "Server highlights:" -grep -E "joined the game|Made CursorBot a server operator|game mode|smoke_test_from_mcc_full_spectrum|summon|particle|playsound|tnt" "$SERVER_LOG" || true +grep -E "joined the game|Made .* a server operator|game mode|smoke_test_from_mcc_full_spectrum|summon|particle|playsound|tnt" "$SERVER_LOG" || true diff --git a/DebugTools/MccMcpSampleClient/Program.cs b/DebugTools/MccMcpSampleClient/Program.cs index 0bd91fdb..15ac2b70 100644 --- a/DebugTools/MccMcpSampleClient/Program.cs +++ b/DebugTools/MccMcpSampleClient/Program.cs @@ -30,7 +30,7 @@ try ToolEnvelope initialWorldState = await CallSuccessAsync(client, executed, "mcc_world_state"); JsonElement initialWorldData = RequireData(initialWorldState); - string botName = ReadString(initialWorldData, "username") ?? "CursorBot"; + string botName = ReadString(initialWorldData, "username") ?? "MCCBot"; Coordinate initialLocation = ReadCoordinate(initialWorldData, "location"); long setupBaseline = 0;