Apply faction-specific tariffs and list received tariffs in the ledger - #67
Conversation
Income lookups asked for the base TARIFFS rate with the guild's faction id, but the handler ignored the id for tariffs, so per-faction tariff overrides were never charged. Tariffs were also gated on the base rate being above zero, so an override on a 0% base did nothing. - Resolve faction-specific tariffs in TaxHandler.getTaxRate - Charge the per-guild rate without the base-rate gate - Clamp specific tariffs when a tariff bracket applies - Scope the tariff proposal preview to the targeted faction, and skip factions with their own rate when previewing a base change - Ledger Tariffs item now lists factions paying us, not what we pay Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
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 (7)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughTariff rate handling now accounts for faction-specific overrides in rate lookup, bracket application, and targeted impact previews. Province income calculation and guild tariff ledger reporting also use updated tariff payment handling. ChangesTariff Handling
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No identified tariff-rate, preview, income, or ledger issue remains to address before normal merge checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Tariff changes now affect payments across faction boundaries. The review found a potential mismatch between tariff policy limits and rates used for collection, and a proposal-preview path that may understate a base-rate change. The available evidence does not establish that either path is exploitable by an ordinary player. 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 each tariff rate, Comment |
Problem
Nations reported that faction-specific tariffs had no effect. For example, The Holy Order has a 15% base tariff and a 0% tariff for FIG, but FIG still paid 15%.
ProvinceManager.getIncomeasks forTaxTarget.TARIFFSwith the guild's faction id, butTaxHandler.getTaxRatereturned the base rate forTARIFFSand ignored the id. Guild and vassal taxes already resolve overrides, but tariffs didn't.Changes
TaxHandler.getTaxRate(TARIFFS, id)now returns the faction-specific tariff when one exists.hasTariffs()is removed; preview/law clamping still applies throughgetTaxRate.previewTariffRateChangetakes the target faction id. A specific change only affects that faction, and a base change skips factions with their own rate.createLedgerTariffsItemadds up what every guild pays this faction, grouped by the payer's faction, and lists the top 5.Testing
TaxHandlerTariffTest(override below the base, override on a 0% base, bracket clamping).mvn testpasses.🤖 Generated with Claude Code
Summary by CodeRabbit