Add crafting recipes and pickup drops#14
Conversation
📋 Summary
This PR adds substantial, well-factored survival-crafting functionality. The pure 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)[CRITICAL] private setMode(mode: GameMode): void {
const prev = this.settings.mode;
this.applySettings({ mode });
if (prev !== mode) {
if (mode === "creative") {
this.seedInventoryForMode("creative");
this.stats.reset();
} else {
const save = loadSave(this.settings.seed);
if (save) {
this.inventory.clear();
this.inventory.load(save.inventory);
this.inventory.loadCrafting(save.crafting);
this.stats.load(save.stats);
} else {
this.seedInventoryForMode("survival");
this.stats.reset();
}
}
this.invUI.refresh();
this.refreshHud();
}
this.hud.showToast(mode === "creative" ? "Creative mode" : "Survival mode");
this.saveState();
}
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 8 | Recipes.ts is a pure matcher; Game remains the orchestrator but grows slightly. |
| Open/Closed | 7 | Recipes are append-only, but mode-switch logic is hardcoded rather than extensible. |
| Liskov Substitution | 10 | No inheritance hierarchy to evaluate. |
| Interface Segregation | 8 | Small, focused interfaces (Recipe, MatchResult, DroppedItem). |
| Dependency Inversion | 7 | match() is dependency-free; Game still depends on concrete systems. |
| Average | 8.0 |
🎯 Final Assessment
Overall Confidence Score: 70%
How to interpret: 61-80%: Minor concerns, mostly ready with some fixes.
Confidence Breakdown:
- Code Quality: 80% (clean, typed, follows existing patterns)
- Completeness: 85% (recipes, UI, drops, tests, builds all present)
- Risk Level: 55% (the creative→survival data-loss bug is a real regression)
- Test Coverage: 75% (recipe matcher has tests; mode switching and drops have no integration tests)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60% (blocked until critical fix)
- No security concerns
- Tests present and passing (if applicable)
Verdict:
MERGE WITH FIXES — address the creative→survival progress-loss bug; remaining issues are minor.
📋 Summary
📌 Review Metadata
The implementation is well-factored and the recipe matcher is cleanly testable. Both the game and website build cleanly, and all tests pass. Two previously reported issues have been fixed, but a few new interaction bugs remain. 🔴 Critical Issues (Must Fix - Blocks Merge)✅ All previously reported critical issues have been resolved. No new critical issues identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 8 | Recipes.ts is a pure matcher; Game remains the orchestrator but grows slightly. |
| Open/Closed | 7 | Recipes are append-only, but mode-switch logic is hardcoded rather than extensible. |
| Liskov Substitution | 10 | No inheritance hierarchy to evaluate. |
| Interface Segregation | 8 | Small, focused interfaces (Recipe, MatchResult, DroppedItem). |
| Dependency Inversion | 7 | match() is dependency-free; Game still depends on concrete systems. |
| Average | 8.0 |
🎯 Final Assessment
Overall Confidence Score: 75%
How to interpret: 61-80%: Minor concerns, mostly ready with some fixes.
Confidence Breakdown:
- Code Quality: 85% (clean, typed, follows existing patterns)
- Completeness: 90% (recipes, UI, drops, tests, builds all present)
- Risk Level: 60% (two real interaction bugs: toast spam and creative→survival leak)
- Test Coverage: 80% (recipe matcher has tests; UI/drop edge cases lack integration tests)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60% (blocked until high-priority fixes land)
- No security concerns
- Tests present and passing (if applicable)
Verdict:
MERGE WITH FIXES — address the drop-pickup toast spam/HUD refresh and the creative→survival held-item leak before merging.
|
Addressed review feedback in 183a997:
Verification:
|
|
Addressed latest review feedback in c7b2efa:
Verification:
|
📋 Summary
📌 Review Metadata
The implementation is well-factored, builds cleanly, and the recipe matcher is cleanly testable. All previously reported issues from prior automated reviews have been addressed. 🔴 Critical Issues (Must Fix - Blocks Merge)✅ All previously reported critical issues have been resolved. No new critical issues identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 8 | Recipes.ts is a pure matcher; Inventory now manages slots + crafting grid; Game remains the orchestrator. |
| Open/Closed | 7 | Recipes are append-only, but mode-switch logic is hardcoded rather than extensible. |
| Liskov Substitution | 10 | No inheritance hierarchy to evaluate. |
| Interface Segregation | 8 | Small, focused interfaces (Recipe, MatchResult, DroppedItem). |
| Dependency Inversion | 7 | match() is dependency-free; Game still depends on concrete systems. |
| Average | 8.0 |
🎯 Final Assessment
Overall Confidence Score: 85%
How to interpret: 81-100%: High confidence, ready to merge or with trivial fixes.
Confidence Breakdown:
- Code Quality: 85% (clean, typed, follows existing patterns)
- Completeness: 90% (recipes, UI, drops, tests, builds all present)
- Risk Level: 75% (creative→survival vital reset is a real exploit; drops could merge for perf)
- Test Coverage: 80% (recipe matcher has tests; mode/vitals edge cases lack integration tests)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing (if applicable)
Verdict:
MERGE WITH FIXES — address the creative→survival vital-reset exploit; the drops-merging suggestion is optional.



Summary
Closes #8
Verification