Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/instructions/moderne-run-recipe.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ If the user already knows the exact recipe name or provides a path to a local re

**Never guess recipe names.** Only use names returned by a search or that the user explicitly provides.

**If `search_recipes` and `learn_recipe` MCP tools are available** (provided by `mod mcp`):
**If `edit_code` / `analyze_code` and `learn_recipe` MCP tools are available** (provided by `mod mcp`):

1. Use `search_recipes` with natural-language queries to find recipes by keyword:
- Example queries: "migrate to Spring Boot 3", "remove unused imports", "upgrade JUnit 5"
1. Use `edit_code` (to modify the codebase) or `analyze_code` (to examine it without changes) with natural-language queries to find recipes by keyword:
- Example queries: "migrate persistence namespace", "remove unused imports", "upgrade test framework"
- Results include the fully-qualified recipe name and display name
- Paginate with the `offset` parameter (25 results per page)

Expand Down Expand Up @@ -242,7 +242,7 @@ If recipe needs fixes:

## Reference

Search recipes: `search_recipes` MCP tool, or `<CLI> config recipes search "<query>"`
Search recipes: `edit_code` (for modifications) or `analyze_code` (for non-modifying analysis) MCP tool, or `<CLI> config recipes search "<query>"`

Learn recipe details: `learn_recipe` MCP tool with the fully-qualified recipe name

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Set up JDK 11
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '25'
distribution: 'temurin'
cache: maven

Expand Down
18 changes: 10 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
<description>Ministry of Magic — Registered Wizards Management Service</description>

<properties>
<maven.compiler.target>25</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.release>25</maven.compiler.release>
<dropwizard.version>4.0.2</dropwizard.version>
<h2.version>2.2.224</h2.version>
<mainClass>org.ministry.magic.WizardRegistryApplication</mainClass>
Expand Down Expand Up @@ -117,9 +116,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.15.0</version>
<configuration>
<release>11</release>
<release>25</release>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -159,18 +158,18 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
<version>3.5.5</version>
<configuration>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
<argLine>-Dnet.bytebuddy.experimental=true</argLine>
<argLine>-Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.2</version>
<version>3.5.5</version>
<executions>
<execution>
<goals>
Expand All @@ -179,6 +178,9 @@
</goals>
</execution>
</executions>
<configuration>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED -Dnet.bytebuddy.experimental=true</argLine>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class WizardRegistryApplication extends Application<WizardRegistryConfiguration> {

public static void main(String[] args) throws Exception {
void main(String[] args) throws Exception {
new WizardRegistryApplication().run(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public WizardResponse updateStatus(@PathParam("id") UUID id, String newStatus) {
try {
RegistrationStatus status = RegistrationStatus.valueOf(newStatus.trim().toUpperCase());
return WizardResponse.fromWizard(service.updateStatus(id, status));
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException _) {
throw new WebApplicationException("Invalid status: " + newStatus, Response.Status.BAD_REQUEST);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public String hashPassword(String password) {
byte[] hash = md.digest(password.getBytes());
StringBuilder sb = new StringBuilder();
for (byte b : hash) {
sb.append(String.format("%02x", b));
sb.append("%02x".formatted(b));
}
return sb.toString();
} catch (NoSuchAlgorithmException e) {
Expand Down
38 changes: 12 additions & 26 deletions src/main/java/org/ministry/magic/service/WizardService.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ public List<Wizard> listWizards() {
public List<Wizard> findByHouse(String house) {
try {
return dao.findByHouse(org.ministry.magic.core.House.valueOf(house.toUpperCase()));
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException _) {
throw new WebApplicationException("Invalid house: " + house, Response.Status.BAD_REQUEST);
}
}

public List<Wizard> findByStatus(String status) {
try {
return dao.findByStatus(RegistrationStatus.valueOf(status.toUpperCase()));
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException _) {
throw new WebApplicationException("Invalid status: " + status, Response.Status.BAD_REQUEST);
}
}
Expand Down Expand Up @@ -123,38 +123,24 @@ public long countActiveWizards() {
}

public String describeRegistrationEvent(Object event) {
if (event instanceof Wizard) {
Wizard w = (Wizard) event;
if (event instanceof Wizard w) {
return "Wizard registration: " + w.getFirstName() + " " + w.getLastName();
} else if (event instanceof String) {
String msg = (String) event;
} else if (event instanceof String msg) {
return "Registry message: " + msg;
} else if (event instanceof List) {
List list = (List) event;
} else if (event instanceof List list) {
return "Batch event: " + list.size() + " records";
}
return "Unknown event type";
}

public String getHouseDescription(org.ministry.magic.core.House house) {
String description;
switch (house) {
case GRYFFINDOR:
description = "Brave at heart, dwell in nerve and chivalry";
break;
case HUFFLEPUFF:
description = "Just and loyal, patient and true";
break;
case RAVENCLAW:
description = "Wit beyond measure is man's greatest treasure";
break;
case SLYTHERIN:
description = "Cunning folk use any means to achieve their ends";
break;
default:
description = "Unaffiliated with a Hogwarts house";
}
return description;
return switch (house) {
case GRYFFINDOR -> "Brave at heart, dwell in nerve and chivalry";
case HUFFLEPUFF -> "Just and loyal, patient and true";
case RAVENCLAW -> "Wit beyond measure is man's greatest treasure";
case SLYTHERIN -> "Cunning folk use any means to achieve their ends";
default -> "Unaffiliated with a Hogwarts house";
};
}

public String buildWizardSummaryHtml(Wizard wizard) {
Expand Down