Skip to content

Apply scrap tier rates to whitelisted catalysts - #29

Merged
XxFran10xX merged 1 commit into
mainfrom
feat/scrap-catalyst-recovery
Oct 1, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
feat/scrap-catalyst-recovery

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Scrap recycling now identifies the recorded base ingredient separately and applies tier recovery rates to all whitelisted catalysts. The renamed scrap_catalyst_return_rates section accepts exact paths or trailing * prefixes and defaults to gems only; excluded catalysts return nothing. Legacy gem rates remain a fallback.

Recovery already rolls independently per material unit on confirmation. Regression coverage demonstrates different returns from identical scrap without rolling the preview.

Validation: Java 21 mvn -B --no-transfer-progress clean verify passes all 53 tests and 100% line, branch, and instruction coverage. TFMCDev01 loaded the CI development artifact with AdvancedCrafting 2.2.5. A station smoke test recycled three identical 16-scrap deposits with iron, ruby, and feather records: previews excluded feather, no feathers returned, all scrap was consumed, and iron/ruby returns varied (9/11, 11/11, 9/15). CodeRabbit approved; manual diff review found no remaining issues.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: da172793-6069-4a68-b9e0-56b1cfe9b1dd

📥 Commits

Reviewing files that changed from the base of the PR and between 07c44cc and 72b4c27.

📒 Files selected for processing (6)
  • README.md
  • src/main/java/net/tfminecraft/recycler/Cache.java
  • src/main/java/net/tfminecraft/recycler/loader/ConfigLoader.java
  • src/main/java/net/tfminecraft/recycler/provider/AlloyScrapProvider.java
  • src/main/resources/config.yml
  • src/test/java/net/tfminecraft/recycler/ScrapRecoveryTest.java

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Alloy scrap recovery now supports catalyst return rates by ingredient tier, with configurable path-based whitelisting. The default whitelist covers gemstone ingredients; unlisted catalysts are excluded.
    • Base-material recovery rates remain independent of the catalyst whitelist.
    • Existing configurations using the legacy gemstone rate setting continue to work when the new catalyst settings are absent.
  • Documentation
    • Updated configuration guidance explains recovery rates, whitelist matching and fallback behaviour.

Walkthrough

Alloy scrap recovery now uses a separate return rate for recorded base materials and configurable, whitelisted return rates for catalysts. The loader supports legacy gem-rate settings when the catalyst-rate section is absent.

Changes

Alloy scrap recovery

Layer / File(s) Summary
Catalyst rate configuration
src/main/java/net/tfminecraft/recycler/Cache.java, src/main/java/net/tfminecraft/recycler/loader/ConfigLoader.java, src/main/resources/config.yml, README.md, src/test/java/net/tfminecraft/recycler/ScrapRecoveryTest.java
The cache and loader use catalyst-rate settings and whitelist paths. The loader falls back to legacy gem-rate settings when the new section is absent. The configuration, documentation, and reload tests reflect the new settings.
Base and catalyst output selection
src/main/java/net/tfminecraft/recycler/provider/AlloyScrapProvider.java, src/main/resources/config.yml, src/test/java/net/tfminecraft/recycler/ScrapRecoveryTest.java
The provider applies base-material rates to recorded base ingredients. It applies tier or default rates to catalysts that match the path whitelist. Tests cover output selection, whitelist behaviour, previews, and tier-rate lookup.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 72b4c

The base-material and whitelisted catalyst recovery changes are consistent with the documented behavior. No actionable merge-blocking risk is established; merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 72b4c

The recovery policy remains controlled by server administrators, and no introduced security bypass was verified. However, the new base-material exemption depends on externally supplied provenance whose validation was not available, and concurrent reload and interruption behavior remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The traced outcome is recovery-item creation at recycling stations. Shared policy affects station users across the server, while each confirmation obtains escrow by the confirming player's UUID. The inspected change does not establish broader machine, credential, or cross-service authority.

Trust Boundaries and Controls

  • observed — The inspected reload command requires recycler.admin, which defaults to operator access, and loads config.yml from the plugin's server data folder. The changed public loader does not itself introduce an ordinary-player configuration source.
  • observed — Loaded recovery rates are constrained to finite values between zero and one, with finite out-of-range values clamped and non-finite values replaced by defaults. Non-base ingredients are excluded unless their resolved paths match an administrator-configured rule.

Resilience and Maintainability Implications

  • observed — Confirmation removes input ownership before scheduled output delivery. This ordering predates the reviewed policy change in the immediate-parent comparison, so interruption-related loss is not retained as an introduced concern. Production recovery during interrupted delivery remains unverified.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@XxFran10xX
XxFran10xX merged commit 80c1846 into main Oct 1, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the feat/scrap-catalyst-recovery branch October 1, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant