Skip to content

Fix command bugs and remove stray file - #183

Merged
dmccoystephenson merged 2 commits into
mainfrom
fix/command-bugs-and-cleanup
Aug 2, 2026
Merged

Fix command bugs and remove stray file#183
dmccoystephenson merged 2 commits into
mainfrom
fix/command-bugs-and-cleanup

Conversation

@dmccoystephenson

@dmccoystephenson dmccoystephenson commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • /mr get no longer throws an uncaught NumberFormatException when given a non-numeric amount (e.g. /mr get Saddle abc); it now shows the usage message instead of a generic internal-error message.
  • /mr list now checks the morerecipes.listitems permission, matching plugin.yml, COMMANDS.md, and USER_GUIDE.md — previously it checked the undeclared morerecipes.list, which could deny the command to non-op players despite the docs promising it's available by default.
  • Removed a stray, unreferenced empty master file that had accidentally been committed at the repo root.
  • Added JUnit 5 + Mockito as test dependencies (the project previously had no test setup) and a regression test for the GetCommand fix.

Test plan

  • mvn compile — clean build
  • mvn test — new GetCommandTest passes (2/2)
  • Regression-verified empirically: with the GetCommand fix reverted (git stash), execute_withNonNumericAmount_returnsFalseWithoutLookingUpItem fails with the uncaught NumberFormatException; with the fix restored, it passes.
  • Verified all 17 recipe registrations (RecipeRegistry.javaobjects/*.java) have valid 3x3 shapes and matching ingredient keys — no drift found.
  • Verified COMMANDS.md, USER_GUIDE.md, CONFIG.md, CHANGELOG.md against the implementation.

Closes #180
Closes #181
Closes #182


This PR description was drafted during a Gardener session (Stephenson-Software/gardener).

dmccoystephenson and others added 2 commits August 2, 2026 16:07
- /mr get no longer throws an uncaught NumberFormatException on a
  non-numeric amount; it now shows the usage message
- /mr list now checks morerecipes.listitems (matching plugin.yml and
  the docs) instead of the undeclared morerecipes.list
- Remove a stray, unreferenced empty "master" file at the repo root

Closes #180, #181, #182

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Companion commit to f88aaa8 — the prior commit's git add included an
invalid "master" pathspec that aborted before staging these files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dmccoystephenson

dmccoystephenson commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

Self-review rubric:

  • Scope: PASS — every changed file maps directly to one of the three closed issues: master deletion (Stray empty 'master' file at repo root #180), ListCommand.java permission fix (/mr list permission node doesn't match plugin.yml (morerecipes.list vs morerecipes.listitems) #181), GetCommand.java fix + GetCommandTest.java (/mr get throws uncaught NumberFormatException for a non-numeric amount #182), pom.xml test deps only needed to make GetCommandTest.java runnable, CHANGELOG.md documents exactly these three changes. No unrelated formatting/renames/comment churn.
  • Tests-new: PASSGetCommandTest covers both branches of the new try/catch (non-numeric amount → early return; valid numeric amount → unchanged happy path through to inventory.addItem).
  • Tests-fix: PASS (empirically verified) — stashed just GetCommand.java, ran execute_withNonNumericAmount_returnsFalseWithoutLookingUpItem, confirmed it fails with an uncaught NumberFormatException (matching the bug description exactly). Popped the stash, ran the full suite, confirmed 2/2 pass.
  • Sibling structure: PASS — no new production classes added; GetCommandTest.java is the first test file in the repo, so there's no existing sibling convention to match — it mirrors the main source package layout (src/test/java/dansplugins/recipesystem/commands/) per this skill's own Phase 3 rule for a repo with no prior test setup.
  • Sibling renames: N/A — no parallel/sibling identifiers were renamed.
  • Docs: PASS — re-checked COMMANDS.md, USER_GUIDE.md, CONFIG.md against the new code; morerecipes.listitems was already the documented permission (the bug was the code disagreeing with the docs, not the other way around), so no doc text needed to change beyond the CHANGELOG.md entry already added.
  • Issue resolution: PASSStray empty 'master' file at repo root #180 (file removed), /mr list permission node doesn't match plugin.yml (morerecipes.list vs morerecipes.listitems) #181 (permission string now matches), /mr get throws uncaught NumberFormatException for a non-numeric amount #182 (exception caught, regression test added) — each issue's named surface area is directly changed.
  • CI: PASSbuild check green on the PR head SHA (mvn clean package, JDK 17).

Repo-specific:

  • Recipe registration verified, not assumed: N/A — this PR touches no recipe definitions or RecipeRegistry. As part of Phase 1 triage, all 17 recipe registrations in RecipeRegistry.javaobjects/*.java were traced and every ShapedRecipe.shape(...) call was confirmed to have a matching 3-row/3-column shape with all referenced ingredient keys mapped via setIngredient — no drift found, no changes needed there.

One note for reviewers: pom.xml also picks up maven-surefire-plugin:2.22.2 (pinned explicitly) since the repo previously had no test dependencies and the default Maven 3.6.x-bundled surefire doesn't run JUnit 5 out of the box.


This comment was drafted during a Gardener session (Stephenson-Software/gardener).

@dmccoystephenson
dmccoystephenson merged commit c264612 into main Aug 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant