feat: record the materials each mage weapon was crafted from - #36
XxFran10xX wants to merge 1 commit into
Conversation
The weapon now carries what the craft actually charged (gear_craft_inputs PDC, item path to amount; empty for staff bypass crafts). Socket rewrites and refreshes copy it along with the part list. Recycler reads it with GearProvenance.readInputs instead of today's part costs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughGear crafting now records the materials charged as JSON metadata on the prepared item. Gear copy and refresh operations preserve this metadata. ChangesCraft input provenance
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to Crafted gear records its cost map and carries it through the inspected rebuild paths. No actionable merge blocker is established; normal checks remain appropriate. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves craft-cost history without moving current refund authority to item metadata. No new material-credit attack path was demonstrated, but completeness of the recorded costs and compatibility with future recycling remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks the crafting tray, Comment |
Summary
Recycler returns the current cost of a weapon's stamped parts. That is wrong when a part's cost changed after crafting, and it returns materials for weapons staff crafted for free (
magic.bypass_crafting_cost).GearInventoryManager.tryPreparestamps thechargedmap (already computed for abort refunds) onto the prepared weapon:magic:gear_craft_inputs, JSON item path to amount. Empty for staff bypass crafts.copyGearPdchelpers (socket rewrite after charging, andGearRefresher) carry the stamp to the rebuilt item, likegear_parts.GearProvenance.readInputs(ItemStack)returns the map, ornullfor weapons crafted before this change.Recycler will read this in a follow-up PR.
Note: this overlaps with the open coverage PR #35 (same
GearProvenance/GearItemBuilderfiles); whichever merges second needs a small rebase.Testing
mvn verifypasses locally (Magic main has no test suite yet).🤖 Generated with Claude Code
Summary by CodeRabbit