GZ-Economy (Currency, Market and Multiplayer Trade Routes)

by gz-mods

#DELIVERY_DRONES_UPDATE: Now deliver goods to your neighbors via disposable drone! #TRADE_ROUTES_UPDATE: Contract goods to buy or sell and get cash-on-delivery! Automatic ledger! Multiplayer and single player trade, market, ledger and currency. Fully functioning economy system for Factorio. *Make and accept offers from other players * Supply/demand based economy * Automate purchases and sell excess goods for FLUX.

Content
3 hours ago
2.0 - 2.1
562
Transportation Logistics Character Environment Logistic network Storage

Changelog

Version: 1.2.2
Date: 2026-09-25
  Integration:
    - Registered Economy with the GIZMOD Item Tabs API; items, fluids, and recipes created by this mod are grouped into its own row under the active MASTER tab.

Version: 1.2.1
Date: 2026-09-24
  Global Statistics:
    - Reports each team's current Flux wealth to Gizmod for GDP rankings.
    - Reports the highest-production-value science pack each team has produced, including the science item used for the ranking.
    - Statistics refresh after research and on a low-frequency background cadence without increasing the pricing worker budget.

Version: 1.2.0
Date: 2026-09-24
  Changes:
    - Promoted the current Economy build to the 1.2.0 release line.
    - Includes the synchronized buy/sell Details refresh and resolved-price cache protections from 1.1.100.

Version: 1.1.100
Date: 2026-09-24
  Changes:
    - Fixed Price Details refreshes promoting only the buy price while leaving the sell price on an unresolved active snapshot.
    - Details now publishes buy and sell cache rows as one pair and immediately promotes either side when its active value is unresolved.
    - Positive staged sell prices can no longer be downgraded to zero by a later Details refresh.

Version: 1.1.99
Date: 2026-09-24
  Changes:
    - Fixed resolved FluxMart prices reverting back to "calculating…" after opening Price Details. A positive staged price can no longer be overwritten by a later zero/unresolved background result for the same cache key.
    - Successful Price Details calculations now promote a previously unresolved active row immediately, so the shop UI keeps the resolved value on subsequent refreshes.
    - Snapshot commits preserve previously resolved positive buy/sell rows when a new pass only produces an unresolved zero for the identical pricing configuration.

Version: 1.1.98
Date: 2026-09-24
  Changes:
    - Fixed FluxMart/Auto-Buy rows remaining on "calculating…" after their staged price had already resolved. Open catalog UIs now consume staged pricing progress once per second without increasing the price-worker budget.
    - Price Debug now publishes a successfully calculated row into the active staging cache, so an item that visibly resolves in its detail inspector no longer waits for a later catalog pass before the shop UI can show it.
    - Zero-valued active snapshot rows now yield to newly resolved positive staged rows; market signal/trend reads follow the same rule, so resolved items no longer remain visually stuck behind stale zero cache entries.

Version: 1.1.97
Date: 2026-09-24
  Changes:
    - Price snapshots now make bounded guaranteed progress every tick and expose staged rows immediately, preventing long-lived Calculating states.
    - Removed synchronous end-of-window price-cache catch-up to avoid large calculation hitches.
    - Admin unresolved-cost diagnostics now include all recipe-graph products, including hidden intermediates and fluids, with blocker summaries.

Version: 1.1.94
Date: 2026-09-23
  Features:
    - Added purple Gizmod Vault wealth milestones at 1, 100, and 500 Blue, White, Yellow, Orange, and Red Flux.
    - Milestones use force-shared Vault balance and can unlock several thresholds from one large deposit/credit.
    - Existing saves silently synchronize already-earned Vault milestones during configuration change; future thresholds announce normally.
Version: 1.1.93
Date: 2026-09-23
  Admin / Trade UI:
    - Renamed the Customs Warehouse Buy/Sell/Browse Offers tab to For Sale.
    - Admins now get an Admin Delete button on every open For Sale listing and every open Contract posting.
    - Admin-deleting a direct-sale listing safely returns any reserved shipment payload and Disposable Cargo Drone instead of destroying seller property, and declines outstanding price offers tied to that listing.
    - Contract admin deletion is limited to open public postings so already-accepted or in-flight freight contracts cannot be orphaned.
Version: 1.1.92
Date: 2026-09-23
  Customs Warehouse UI:
    - Added an attached Outgoing Drone Delivery section to the native Customs Warehouse inventory window.
    - The panel clearly states that slots 1–16 are used for outgoing drone deliveries and shows a live slot-by-slot preview of the cargo that would be reserved if a direct-sale offer were posted.
    - Shipment preview includes item icons, non-normal quality icons, and exact stack quantities without altering or filtering the native 256-slot inventory.
    - Corrected the Disposable Cargo Drone item description to reflect that direct-sale drones are consumed from the seller player inventory.
Version: 1.1.91
Date: 2026-09-23
  Cargo Drone Trade:
    - Direct-sale listings no longer look for or consume Disposable Cargo Drones from Customs Warehouse slots 17–256.
    - Confirming a direct-sale listing now consumes one Disposable Cargo Drone from the seller player's main inventory and escrows it with the listing.
    - Customs slots 1–16 remain the only warehouse slots read for the direct-sale shipment payload; slots 17–256 are ignored by direct-sale posting.
    - Cancelling an unsold listing returns the reserved drone to the seller player inventory; repeat-open listings reserve subsequent drones from that same inventory when the next sale is committed.
    - Updated the Direct Buy/Sell UI, warehouse descriptions, and delivery documentation to match the corrected drone source.
Version: 1.1.90
Date: 2026-09-23
  Cargo Drone Trade:
    - Moved Direct Buy/Sell and Contracts access behind the Customs Warehouse; those trade tabs no longer appear in the standalone Economy window.
    - Direct-sale sellers now post from the Customs Warehouse they are operating. Exactly slots 1–16 are captured as the shipment payload; the 256-slot warehouse's remaining slots are ignored for cargo.
    - Disposable Cargo Drones are supplied separately from Customs slots 17–256 and reserved with the posted shipment.
    - Reduced the scripted Cargo Drone trunk from 1000 slots to its intended 16 slots.
    - Added the seller confirmation warning that only the first 16 Customs slots are read, plus a default-enabled "leave this offer open to other buyers once sold" option.
    - Buyers now choose one of their own Customs Warehouses before "Purchase direct sale"; new deliveries use the exact seller source and buyer destination and launch through the existing scripted flight system.
    - Repeat direct-sale offers remain visible after a sale and require the seller to refill the same 16-slot manifest plus another drone before the next purchase can reserve it.
  Contracts:
    - Cargo Drone Goods Available postings remember the seller Customs Warehouse; the accepting buyer chooses their destination when agreeing to the contract.
    - Cargo Drone Goods Wanted postings remember the buyer destination; the accepting seller uses their current Customs Warehouse as the source.
    - Removed automatic warehouse selection from new Cargo Drone contract acceptance while retaining compatibility with existing delivery state.
  Compatibility:
    - Legacy pre-1.1.90 one-stack Cargo Drone listings remain purchasable and retain automatic seller-source routing while honoring the buyer-selected destination.
    - Removing a Customs Warehouse now clears both destination and seller-source contract bindings so active contracts return to a waiting state instead of retaining dead endpoints.
Version: 1.1.89
Date: 2026-09-23
  Pricing:
    - Fixed returned catalysts and self-seeding recipes blocking the valuation graph indefinitely.
    - Recipe pricing now uses net material flow: matching item/fluid inputs are cancelled against expected outputs before cost derivation.
    - Self-replicating recipes such as seed/culture loops can bootstrap from their external consumed materials, while unchanged catalysts no longer require an unrelated pre-existing price.
    - Pure zero-input/net-duplication loops remain excluded so they cannot create free economic value.
    - Bumped the static price-cache schema and runtime version so existing saves rebuild affected item prices on upgrade.
  UI / Diagnostics:
    - FluxMart now labels permanently unresolved zero-basis items as "unpriced" instead of leaving them at "calculating…" forever.
    - Price Debug shows the candidate recipe paths and the unpriced ingredients blocking them; recipe-less world resources are identified as needing a root basis.
Version: 1.1.88
Date: 2026-09-21
  Fixes:
    - Added a one-time migration that clears stale military FluxMart stock from every military item except firearm magazines and piercing-rounds magazines.
    - Fresh saves no longer bootstrap 1000 stock for other automatically discovered military items.
    - Bumped the static catalog cache schema for the corrected military stock defaults.
  Admin UI:
    - Added an editable Stock field to the item Price Debug/details popup; Apply + Refresh now sets the live global stock for that catalog row.
Version: 1.1.87
Date: 2026-09-21
  Fixes:
    - Fixed fresh-save startup ordering so shop_catalog exists before legacy catalog migrations run.
    - Removed the redundant hard-coded nutrients trade exclusion; existing spoilable-item rules remain authoritative.
  Pricing:
    - Retained nutrients as a fixed 250 Purple Flux per-item production cost basis.
Version: 1.1.86
Date: 2026-09-21
  Pricing:
    - Added nutrients as a fixed 250 Purple Flux per-item production cost basis.
    - Recipes consuming nutrients now inherit that cost instead of treating nutrients as unresolved/free input.
    - Bumped the static price-cache schema so downstream nutrient-based recipe values rebuild on upgrade.
Version: 1.1.85
Date: 2026-09-21
  Changes:
    - Replaced blanket military-item restocking with an explicit per-item restocking allowlist.
    - Firearm magazines and piercing-rounds magazines are the only default restocking items.
    - Added a Restocking section to the Admin Shop tab for adding/removing restockable items.
    - Retained the old military-restocking mod setting as hidden legacy compatibility only.
Version: 1.1.84
Date: 2026-09-20
  Performance:
    - Fixed the major periodic Economy hitch identified by Gizmod profiling: FluxMart price-snapshot construction now advances every tick instead of batching 30 ticks of catalog work into one frame.
    - Restarted price snapshots now always receive a full 60-second staging window instead of trying to catch up to a stale near-term swap boundary after startup/configuration changes.
    - Cached static science-item classification so snapshot availability checks do not repeatedly query runtime prototype metadata for every item quality on every refresh.
  Diagnostics:
    - Retains Gizmod-routed Economy stage diagnostics from 1.1.83 for verification.
Version: 1.1.83
Date: 2026-09-20
  Diagnostics:
    - Fixed stage-level performance diagnostics so LuaProfiler durations are preserved instead of becoming the literal string [LuaProfiler] in JSON.
    - Requires Gizmod 1.0.54 and routes raw profiler LocalisedStrings through Gizmod's central profiler-aware debug output.
    - Real elapsed values are written to GIZMOD_logs/profile_gz-economy.log; session_gz-economy.jsonl retains the matching tick/stage structure and flattened metadata.
    - Increased diagnostic batch size from 15 to 60 ticks to reduce debugger I/O overhead during hitch reproduction.
    - Diagnostic command output now tells admins which two Gizmod logs to upload after reproducing a hitch.
  Investigation:
    - The 1.1.82 capture confirmed an exploration-linked on_chunk_generated event about 21.8 seconds after the timed capture began, but its elapsed duration was lost by the old JSON serializer and could not be used as proof of the hitch source.
Version: 1.1.82
Date: 2026-09-20
  Diagnostics:
    - Added stage-level runtime profiling for Economy exploration hitches.
    - Captures top-level Economy on_tick workers, on_chunk_generated, and individual Sundry offer-pool/spawn phases.
    - Diagnostic batches are routed through Gizmod's central gz-economy debugger/session JSONL; the new diagnostic path does not write its own log file.
    - Added /gz-economy-diag-start [seconds], /gz-economy-diag-stop, and /gz-economy-diag-status admin commands.
    - Starting a diagnostic capture requests a Gizmod debug session automatically; Gizmod's Automatic Output checkbox can also drive continuous capture.
    - Added remote performance_diagnostics_start/stop/status helpers for scripted testing.
Version: 1.1.81
Date: 2026-09-20
  Performance:
    - Removed the remaining synchronous Sundry's full-catalog offer scan from depot generation.
    - Sundry's eligible offer pool now rebuilds in small 24-row background batches and is reused by every depot.
    - New/changed FluxMart catalog rows mark the Sundry offer pool dirty without forcing an immediate rebuild.
    - Sundry compound vegetation/decorative cleanup is now split into narrow row batches before the existing tile batches.
    - Sundry offer selection no longer copies the entire offer pool for each generated depot.
  Fixes:
    - Updated the runtime schema/version marker to match the packaged Economy version so migrations and cache reconciliation are no longer stuck on 1.1.78.
Version: 1.1.80
Date: 2026-09-20
  Performance:
    - Moved Sundry's depot placement out of on_chunk_generated into a staged per-tick queue.
    - Split Sundry's terrain pad placement into small tile batches and disabled expensive tile correction.
    - Avoided repeated Sundry's force relationship setup during each depot spawn.
Version: 1.1.79
Date: 20. 09. 2026
  Changes:
    - Replaced the Price Debug shop-exclusion checkbox with an explicit Remove from Shop + Auto-Buy button.
    - Removed items expose a Restore to Shop + Auto-Buy button in the same popup.
    - The action remains persistent and applies to every quality of the selected item.
Version: 1.1.78
Date: 20. 09. 2026
  Changes:
    - Built-in/basic FluxMart listings now start with zero stock instead of 1000.
    - Player sales add exactly their sold quantity to finite market stock.
    - Added an upgrade migration that removes the legacy 1000-item bootstrap from existing basic listings without wiping stock above that amount.
    - Zero-stock listings remain visible; explicit periodic restocking can still replenish them when enabled.
Version: 1.1.77
Date: 2026-09-20
  Changes:
    - New player-sold FluxMart listings now use Gizmod milestones for their public announcement.
    - FluxMart listing milestones use the new teal shop-update presentation and show the item icon immediately beside the localized item/quality name.
    - The first sale of each item + quality remains independently announcement-eligible; repeat sales do not rebroadcast.
    - Falls back to the legacy public chat message if the Gizmod milestone service is unavailable.
Version: 1.1.76
Date: 2026-09-20
  Changes:
    - Replaced the confusing combined FluxMart stocking option with independent controls: always restock military items, player-sold items create shop listings, restock all items periodically, and time between restocks.
    - Periodic restocking is disabled by default; military-only restocking remains enabled by default; player-sold listings remain enabled by default; the restock interval defaults to 60 minutes.
    - Removed player-stock gating from ordinary pre-existing FluxMart listings. Finite stock remains visible at zero and only replenishes through player sales or an enabled restock rule.
    - Preserved Carbon Fiber at its existing default root value of 2000 Purple Flux per item.
    - GZ Chemistry Saltpeter now has a default root value of 5 Purple Flux per item when present.
    - Corrected the Space Age cold fluoroketone root prototype from the invalid "cold-fluoroketone" name to the real "fluoroketone-cold" fluid, restoring Railgun/Quantum Processor price-chain resolution.
Version: 1.1.75
Date: 2026-09-20
  Changes:
    - FluxMart market-introduction announcements now track item quality separately. The first player sale of each quality of an item is announced publicly once.
Version: 1.1.74
Date: 2026-09-20
  Changes:
    - FluxMart now publicly announces in chat the first time a player sells a new item listing into shop stock.
Version: 1.1.73
Date: 2026-09-20
  Changes:
    - Fixed FluxMart stocking-disabled behavior: ordinary catalog rows no longer receive periodic automatic replenishment.
    - With stocking/restocking disabled, finite-stock listings remain visible at zero stock; purchasing the last unit disables buying without removing the row from FluxMart.
    - Added the default-on runtime-global option "Military items are always restocked". Military goods can continue replenishing independently of ordinary FluxMart restocking, or follow normal merchandise rules when the option is disabled.

Version: 1.1.72
Date: 2026-09-20
  Changes:
    - Enabled "Items sold to shop become available in FluxMart" by default.
    - Enabled Sundry's Export Depots by default.
    - Added a runtime-global "Enable stocking and restocking of items" control for FluxMart.
    - When stocking mode is enabled, non-military FluxMart inventory starts empty and only becomes available after a player sells that item into market supply.
    - Once player-stocked, normal automatic restocking may replenish that item toward equilibrium.
    - Military goods remain stocked and restock normally; guns, ammunition, and other combat-category goods are exempt from the player-stock requirement.

Version: 1.1.71
Date: 2026-09-19
  Changes:
    - Moved the science-pack FluxMart/Auto-Buy exclusion from the Factorio mod-settings screen into Economy > Admin Shop > Shop Exclusions.
    - Fixed science-pack detection by using Factorio 2.x item prototype lab-input metadata, with subgroup fallback for compatibility.
    - Existing saves migrate the old science-exclusion setting once; the GZ Economy registry is authoritative afterward.

Version: 1.1.70
Date: 2026-09-19
  Changes:
    - GZ Economy-owned windows, dialogs, cards, tab panes, and scroll panes now use Gizmod's per-player Glass UI styles instead of vanilla opaque gray GUI styles.
    - Native inventory/container GUI remains untouched.
Version: 1.1.66
Date: 2026-09-18
  Changes:
    - FluxMart favorites now use the signal-star icon as a sprite button.
    - Favorite buttons are blank by default, show the star on hover, and keep the star visible while selected.
    - Widened the favorite button to 43 px so the full star icon is visible.

Version: 1.1.65
Date: 2026-09-18
  Changes:
    - Moved the FluxMart favorite toggle to the right of the item name and widened it so the star renders fully.
    - Added exclusion checkboxes beside unresolved/problem catalog items in Admin Shop.
    - Added an Admin Shop item selector for persistently excluding any additional item from FluxMart and Auto-Buy.

Version: 1.1.64
Date: 2026-09-17
  Features:
    - FluxMart now has a persistent per-player ★ Favorites category as the first category tab.
    - Every FluxMart row has a ★/☆ toggle; favorited catalog rows appear in Favorites while remaining in their normal category.
    - Favorites work with the existing delayed search filter and persist across reconnects/saves.

Version: 1.1.63
Date: 2026-09-17
  Performance:
    - FluxMart snapshot pricing now runs in 30-tick batches (twice per second) instead of entering the global pricing worker every tick; the one-minute atomic refresh behavior is unchanged.
    - Price snapshot rows share cached category market modifiers so buy and sell calculations do not repeatedly recompute the same category pressures.
    - ATM, Auto-Buy, Supply Depot output, Auto-Sell, rail recovery, and rare restock work now run in staggered bounded registry batches rather than polling one registry record every tick.
    - Search debounce now uses exact due-tick player buckets; idle servers no longer scan every connected player every tick just to see whether a search is pending.
    - state.ensure() now has a synchronized per-version fast path, eliminating repeated market/account/contract structure reconciliation from hot runtime calls.
    - Legacy coin migration is paced to once every five ticks during upgrade conversion.

Version: 1.1.62
Date: 2026-09-17
  Features:
    - Price Debug now includes an admin checkbox to persistently exclude the inspected item from both FluxMart and Auto-Buy across all qualities.
    - Unchecking the Price Debug exclusion restores the item to automatic shop discovery.
    - Open FluxMart/Auto-Buy views refresh immediately when the checkbox changes, while the Price Debug window remains open for rapid catalog curation.

Version: 1.1.61
Date: 2026-09-17
  Bugfixes:
    - Fixed the admin FluxMart Price Debug click path referencing the anti-arbitrage ratio before its Lua local declaration, which made the inspector fail as soon as a row was opened.
    - Price Debug now traps breakdown errors, logs them, and reports them to the admin instead of allowing an inspector failure to terminate the mod event.
    - Bounded the ingredient-component table shown by Price Debug to 64 rows to avoid pathological modded recipes creating enormous synchronous GUI trees.

Version: 1.1.60
Date: 2026-09-17
  Fixes:
    - Fix FluxMart/Supply Depot arbitrage when a catalog row has a Base Price override or manual row basis: sell-side valuation now uses the same effective row basis instead of always using the recipe-derived production value.
    - Add a hard anti-arbitrage ceiling: Supply Depot sell quotes may never exceed 95% of the active FluxMart buy price for the same quantity. The guard is enforced both when snapshots are built and when cached quotes are read, so old saves are safe immediately after upgrading.
    - Clamp sell trend signals to the same anti-arbitrage ceiling.
  Diagnostics:
    - Price Debug now shows the sell basis source/unit basis, uncapped sell calculation, 95% buy-price ceiling, and whether the safety cap is active.

Version: 1.1.59
Date: 2026-09-17
  Changes:
    - Rail contracts with Buyer as transport provider now use true buyer pickup semantics.
    - Seller selects a source Customs Warehouse for Buyer Pickup contracts.
    - When a buyer-owned train docks, whole contract lots transfer from seller Customs into the train and settle immediately; Economy does not track the cargo after handoff.
    - Seller Rail Delivery continues to use a buyer-selected destination Customs Warehouse.
    - Existing buyer-provided Rail contracts with obsolete buyer-side warehouse bindings are unbound on migration and wait for the seller to select a pickup source.
    - Customs contract endpoint UI now distinguishes Buyer Pickup sources from Seller Delivery/Cargo Drone destinations.

Version: 1.1.58
Date: 2026-09-17
  Changes:
    - Seller-delivered Cargo Drone contracts now require the buyer to explicitly select the destination Customs Warehouse.
    - Cargo Drone contracts appear in the buyer Customs Warehouse contract assignment dropdown alongside Rail contracts.
    - Cargo Drone dispatch no longer auto-selects a buyer warehouse or public Sundry's endpoint; every lot targets the bound buyer warehouse exactly.
    - Contract dispatch waits safely when no destination is assigned, the destination is unavailable/full, or seller cargo exists only on another surface.
    - Cargo Drone destinations cannot be rebound or unbound while a contract lot is in flight.

Version: 1.1.57
Date: 2026-09-17
  Features:
    - Added Cargo Drone as a selectable transport type for delivery contracts.
    - Cargo Drone contracts automatically ship one contract lot at a time from a seller-owned Customs Warehouse to a compatible buyer-owned Customs Warehouse on the same surface.
    - Each dispatched contract lot consumes one Disposable Cargo Drone from the same seller Customs Warehouse as the cargo.
    - Cargo Drone contract payment settles only after the complete lot reaches the buyer Customs Warehouse. A destroyed drone loses the lot and makes no payment; the contract remains active for another attempt.
    - Cargo Drone contracts do not use manual receiving-warehouse binding or the rail transport-provider setting.
  GUI:
    - Contract posting form now includes Rail / Cargo Drone transport selection and disables the Rail provider selector when Cargo Drone is selected.
    - Active Cargo Drone contracts show live courier status in the contract card.

Version: 1.1.56
Date: 2026-09-17
  Changes:
    - Added a bounded manufacturing value-added multiplier to recipe-derived cost basis. Recipe roots remain 1.00x; each recipe-chain layer adds 0.10x, capped at 2.50x at depth 15.
    - Value-added is computed from raw/material ingredient cost and applied once for the total chain depth, so long modded chains do not compound exponentially.
    - Price diagnostics now show recipe-chain depth, value-added multiplier, raw material value, and raw material allocation.
    - Petroleum processing participates as a depth-1 manufactured fluid chain, and water now retains its configured non-zero root value during recipe derivation.
    - Synthetic steel fallback now receives the same depth-based value-added treatment as ordinary recipe-derived steel.

Version: 1.1.55
Date: 2026-09-17
  Changes:
    - FluxMart and Auto-Buy searches now apply one second after the final keystroke, while retaining the 3-character minimum.
    - Admin Shop can persistently remove an item from both FluxMart and Auto-Buy and restore it later.
    - Admin Shop now reports catalog items with unresolved cost basis and data-stage unpriced fluids.
    - Water now has a tiny non-zero material basis (0.05 Purple per fluid unit); Space Age ice has a 1-Purple primary-resource basis.
    - Steel plate receives a canonical 5x iron-plate runtime/data-stage fallback if compatibility recipes leave it disconnected from the recipe graph.

Version: 1.1.54
Date: 2026-09-17
  Changes:
    - Moved Delivery History out of Vault and into its own section at the bottom of Contracts.
    - Vault remains focused on wealth distribution, force balance, listings, offers, and transaction history.

Version: 1.1.53
Date: 2026-09-17
  Changes:
    - Consolidated Buy and Sell into a single Browse Offers tab. Make an Offer (Sell Items) is shown first, followed by global listings.
    - Consolidated Ledger and My Listings into Vault to reduce the number of user-facing tabs.
    - Vault now orders distinct blocks as World Wealth Distribution, Force Balance, My Listings, Delivery History, My Offers, and Transactions.
    - Force Balance retains Vault deposit, terminal output, and withdrawal controls.
    - Legacy Buy/Sell/My Listings/Ledger tab requests are redirected to the new consolidated tabs for compatibility.

Version: 1.1.52
Date: 2026-09-17
  Features:
    - Wealth HUD now uses a taller camera box with a blue-glass backing panel to better match the GZ-Dock look.
    - Added Alt+E custom input to cycle the Wealth HUD through full-size -> half-size -> closed.
    - Wealth HUD now renders flux icons as sprites instead of leaking raw [item=...] markup in the camera overlay.
    - Ledger Wealth HUD button now advertises the Alt+E hotkey.
Version: 1.1.51
Date: 2026-09-17
  Changes:
    - Added a pull-up camera-backed Global Wealth HUD to the Ledger when GZ Diplomacy is registered through Gizmod.
    - Wealth HUD uses exact runtime-rendered arcs: the viewer team is an exploded gold segment and all other economies are anonymous blue segments sorted by wealth.
    - The HUD refreshes on the same one-minute global market boundary as the Ledger wealth display.
    - Kept the existing 50-cell wealth strip as a lightweight fallback/reference display.
Version: 1.1.50
Date: 2026-09-17
  Changes:
    - Added a Diplomacy-aware World Wealth Distribution strip to the Ledger.
    - The strip uses 50 text cells at 2% resolution: the viewer's team is gold and all other positive force balances are anonymous blue blocks sorted largest-to-smallest.
    - Other teams' identities and exact balances are not exposed; alternating blue shades only distinguish adjacent anonymous blocks.
    - Open Ledger wealth strips refresh on the same one-minute boundary as the global market snapshot.
Version: 1.1.49
Date: 2026-09-17
  FluxMart:
    - Every shop catalog row now uses exactly one full item stack as its default bundle quantity, regardless of category or source.
    - Existing rows are migrated to stack size; manual bundle prices are rescaled during migration to preserve their prior per-item price.
    - Admin and external catalog registration can no longer override bundle quantity, and the admin catalog editor shows stack quantity as read-only.
Version: 1.1.48
Date: 2026-09-17
  UI:
    - FluxMart and Auto-Buy search fields no longer filter or rebuild the catalog until at least 3 characters have been entered.
    - Clearing a search or backing below 3 characters immediately restores the unfiltered catalog.
  FluxMart:
    - Automatically listed buildings/placeable items and intermediate products now default to one full item stack per purchase batch.
    - Existing automatically market-created rows still at the old quantity of 1 are migrated to their stack size; explicit admin/external bundle sizes are preserved.
Version: 1.1.47
Date: 2026-09-16
  Performance:
    - Research completion no longer rebuilds the entire per-force FluxMart unlock cache.
    - Added a data-stage technology-to-unlocked-recipe index and runtime recipe-to-catalog-row reverse index, so on_research_finished touches only rows whose recipes were unlocked by that technology.
    - Removed per-research profiler/debug bookkeeping from the Economy hot path.
Version: 1.1.46
Date: 2026-09-16
  Performance:
    - FluxMart buy and sell pricing now uses a global 60-second double-buffered snapshot. The next snapshot is calculated incrementally across the minute, then swapped in atomically at the boundary.
    - Opening FluxMart or Auto-Buy no longer calculates missing prices. Manual purchases, Auto-Buy, and Supply Depot sales consume the active snapshot instead of forcing live price calculations.
    - Open FluxMart/Auto-Buy views refresh together when the one-minute market snapshot swaps, with a visible countdown to the next refresh.
  Market UI:
    - Added buy/sell trend arrows comparing the active snapshot with the previous snapshot.
    - Falling buy prices are highlighted as GOOD BUY when category demand is above neutral; rising sell prices are highlighted as GOOD SELL under the same demand condition.
Version: 1.1.45
Date: 2026-09-16
  Performance:
    - FluxMart display sell prices are now snapshotted on the normal market-update cycle instead of being recalculated when the GUI opens or rebuilds. Actual Supply Depot settlement remains live.
  FluxMart:
    - Added a search field that filters catalog rows by item, category, quality, or catalog ID while preserving lazy category rendering.
  Auto-Buy:
    - Auto-Buy is now organized into the same category tabs as FluxMart, with only the selected category materialized.
    - Added an Auto-Buy search field using the same catalog filter behavior as FluxMart.
Version: 1.1.44
Date: 2026-09-15
  Performance:
    - Removed the FluxMart-open hitch introduced by the sell-price column. Sell-price display now uses a side-effect-free O(1) catalog-row quote instead of running the full Supply Depot transaction simulator for every row.
    - Sell-class resolution accepts a known category and caches prototype classification, avoiding repeated full-catalog searches for modded items.
    - Sell-price GUI rendering no longer allocates unused transaction-detail tables. Actual Supply Depot settlement logic is unchanged.
    - FluxMart category bodies are now lazy-built; opening the depot creates rows only for the visible category instead of every category in the catalog.
Version: 1.1.43
Date: 2026-09-14
  Bugfixes:
    - Fixed a startup/configuration-change crash in the runtime recipe price rebuild caused by prototype_table being referenced before its local declaration entered scope.
    - Kept the prototype accessor local via an explicit forward declaration so the final-prototype recipe index remains available without leaking a global.
Version: 1.1.42
Date: 2026-09-14
  Changes:
    - FluxMart now shows the current Supply Depot sell value beside the buy price for every catalog row.
    - Sell values use the same displayed batch size and live market/stock calculation as an actual Supply Depot settlement, and refresh with the row.
Version: 1.1.41
Date: 2026-09-14
  Fixes:
    - Fixed Supply Depot auto-sell row starvation by rotating a persistent cursor through sorted inventory contents instead of restarting at the first 40 rows every pass.
    - Added explicit iron ore, copper ore, and calcite primary price bases so direct-ore recipes do not make downstream intermediates unsellable.
    - Runtime price rebuilding now derives from the final loaded recipe prototypes, with the data-stage recipe graph retained as a fallback. This captures compatibility mods that alter recipes after GZ-Economy's own data-final-fixes pass.
    - Bumped the price-cache schema and runtime version so stale zero-value qualified-item caches are discarded on upgrade.
Version: 1.1.40
Date: 2026-09-06
  Progression:
    - Added an early Currency technology using the GZ Economy thumbnail as its research icon.
    - Currency unlocks the Supply Depot and Customs Warehouse crafting/conversion recipes.
    - The Flux ATM remains available from the start.
    - Added an existing-save migration so the newly gated recipes stay locked until Currency is researched.
Version: 1.1.39
Date: 2026-09-06
  Changes:
    - Reworked petroleum pricing as a linked coproduct network instead of a cheapest-recipe special case.
    - Advanced oil processing now sets the absolute value entering heavy oil, light oil, and petroleum gas.
    - Heavy/light cracking ratios now set the relative unit values, conserving cost basis through cracking.
    - Sulfur, plastic, solid fuel, and rocket fuel are no longer hardcoded price roots and derive from their actual recipes.
    - Removed the temporary advanced-oil authoritative-recipe override used in 1.1.38.
    - Bumped the static price-cache schema so existing saves rebuild petroleum and downstream prices.
Version: 1.1.38
Date: 2026-09-04
  Bugfixes:
    - Anchored heavy oil, light oil, and petroleum gas cost derivation to advanced oil processing whenever that recipe exists.
    - Coal liquefaction can no longer undercut the crude-oil petroleum chain through its recycled heavy-oil loop and collapse downstream fluid values.
    - Runtime and data-stage price solvers use the same canonical petroleum recipe rule, with fallback to normal recipe selection for total-conversion mods that remove advanced oil processing.
    - Price-cache schema bumped to v7 so existing saves rebuild affected oil-chain values on upgrade.
Version: 1.1.37
Date: 2026-09-04
  Fixes:
    - Fixed deterministic multi-fluid recipe pricing (notably advanced oil processing) allocating equal cost to each output type instead of allocating by expected fluid quantity.
    - Advanced oil processing now conserves the full crude-oil cost basis across heavy oil, light oil, and petroleum gas according to their 25/45/55 output quantities.
    - Probabilistic and mixed item/fluid coproduct recipes retain the previous separate-output-bucket model, preserving rarity pricing such as uranium processing.
  Diagnostics:
    - Price breakdowns now report the coproduct allocation method and total coproduct output when quantity-weighted fluid allocation is used.
Version: 1.1.36
Date: 2026-09-04
  Features:
    - Added a default-enabled runtime-global option to reject ammonia barrels from Supply Depot sales.
    - Added a default-enabled runtime-global option to disable spoilage and all spoilable items from FluxMart/Supply Depot buying and Supply Depot selling.
  Changes:
    - Spoilable detection uses the runtime item prototype spoil timer, so modded spoilable items are covered automatically; the terminal spoilage item is explicitly covered as well.
    - These Supply Depot restrictions do not affect independent buyers such as Sundry's export depots.
Version: 1.1.35
Date: 2026-09-04
  Fixes:
    - Light Resource Outposts from GZ Diplomacy are now excluded from FluxMart and Supply Depot Auto-Buy catalog discovery.
    - Existing/manual catalog rows for the Light Resource Outpost are rejected at runtime and removed from cached shop catalogs on upgrade.
    - Supply Depots now reject and spill Light Resource Outposts instead of auto-selling them for Flux.
Version: 1.1.34
Date: 2026-09-02
  GUI:
    - Supply Depot Economy screens now open exactly one tick after the native depot container, ensuring the Economy screen is created and rendered on top.
    - Deferred opens are stored in synchronized tick buckets and only complete while the same depot is still open, avoiding a recurring GUI/entity scan.
    - Closing the underlying depot contents continues to promote the Economy screen as the active GUI rather than closing it.
Version: 1.1.33
Date: 2026-09-02
  GUI:
    - Closing the native Supply Depot inventory no longer closes the Economy screen layered above it.
    - When the underlying depot contents are closed, the Economy frame becomes the active opened GUI so it remains on top and closes independently.
Version: 1.1.32
Date: 2026-09-02
  Changes:
    - Renamed the existing science-purchase map option to "Disable science pack in FluxMart and Auto-Buy menus" for clarity.
    - The option remains enabled by default and continues to hide and block science purchases in both FluxMart and Supply Depot Auto-Buy.
Version: 1.1.31
Date: 2026-09-01
  Fixes:
    - Restore the absorbed Cargo Drone item, recipe, and a trimmed Disposable Cargo Drones technology; the recipe retains the original 20 engine unit + 40 low-density structure + 1 radar material cost.
    - Make disposable drones mechanically real: posting a Cargo Drone listing now reserves one crafted drone in addition to the cargo, cancelling the unsold listing returns it, and launching the shipment permanently consumes it.
    - Add clear listing feedback when a seller selects Cargo Drone delivery without a disposable drone available.
Version: 1.1.30
Date: 2026-09-01
  Fixes:
    - Fixed a server-crashing Sundry's merchant GUI error when opening a Zed/depot with multiple purchase offers.
    - Sell buttons in the shared offer table now use unique per-row GUI element names; Factorio does not allow sibling GUI elements to reuse the same explicit name.
    - The Sundry's click handler accepts the new row-specific Sell button names while retaining compatibility with the old base name.
Version: 1.1.29
Date: 2026-08-30
  Features:
    - Manual FluxMart purchases now open a compact quantity dialog with item, stock, estimated unit price, total price, and post-purchase balance.
    - Quantity changes recalculate the purchase summary immediately and validate stock and available Flux before enabling Purchase.
  Changes:
    - Automatically discovered ammo now defaults to a 100-item FluxMart batch instead of 1; existing automatic ammo rows still at the old 1-item value migrate to 100.
    - The FluxMart Batch column is now the default dialog quantity rather than a fixed quantity-per-click restriction.
  GUI:
    - Successful manual purchases update the affected FluxMart row and balance in place instead of rebuilding the whole Economy window, so the category tab and scroll position no longer jump back to the top.
    - Global stock/price changes for the purchased row are refreshed in place for other connected players who currently have that row open.
Version: 1.1.28
Date: 2026-08-29
  Fixes:
    - Fixed a multiplayer desync in the deferred GZ-Diplomacy warehouse-claim synchronization after configuration changes.
    - The one-tick deferred synchronization flag is now stored in synchronized mod storage instead of a non-serialized Lua local, so paused dedicated servers and newly joining clients execute the same state transition.
    - Existing warehouse/customs claim reconciliation now processes unit numbers in explicit sorted order.
    - Corrected the internal GZ-Economy version constant to 1.1.28.
  Diagnostics:
    - The supplied desync report showed the server alone registering external claim source external:549808 for a gz-economy-flux-warehouse owned by team_001; the client lacked that source and its resulting territory cells.
Version: 1.1.27
Date: 2026-08-29
  Changes:
    - Reworked Sundry's generation into a pre-drawn deterministic state machine with 12x12-chunk cells and a 15% candidate rate.
    - Expanded the pre-drawn Sundry's grid to roughly 64,000x64,000 tiles around the Nauvis starting position.
    - Team/start reservations now exclude every Sundry's cell intersecting a 768-tile radius instead of reserving a fixed 3x3 group of cells.
    - Removed the BLOCKED/UNROLLED runtime path. Disabling Sundry's no longer mutates candidate cells or permanently consumes unexplored regions.
    - Existing terrain is not scanned or backfilled when Sundry's is enabled; only newly generated chunks can advance WAITING cells to GENERATED.
  Performance:
    - Normal chunk generation now performs only the setting/surface checks, one direct cell lookup, and a state comparison; random classification is precomputed when the grid is built.
    - Chunk deletion ignores all cells unless the deleted chunk directly owns a spawned Sundry's compound.
  Migration:
    - Existing live Sundry's depots are preserved and remapped into the new grid. Legacy blocked/unrolled cells are replaced by deterministic WAITING/REJECTED states.
Version: 1.1.26
Date: 2026-08-29
  Features:
    - Added the runtime-global map setting "Disable science in FluxMart and Auto-Buy", enabled by default.
    - When enabled, science-category and science-pack listings are hidden from both purchase surfaces and cannot be bought manually or by Supply Depot automation.
    - Existing science Auto-Buy rules are preserved but ignored while the setting is enabled, so disabling the option later restores them.
  Notes:
    - Science can still be sold and can remain in finite market stock; this option only blocks FluxMart/Auto-Buy purchasing.
Version: 1.1.25
Date: 2026-08-26
  API:
    - Added gz_economy.admin_credit_flux for Gizmod's admin recovery panel.
    - The method requires an actual admin player index, validates the target and Flux tier, and credits the selected player's current force/team ledger.
    - Admin Flux recovery grants are routed through GZ-Economy's Gizmod debug logging.
  Notes:
    - No market, pricing, contract, depot, or passive-income behavior changed.
Version: 1.1.24
Date: 2026-08-25
  Features:
    - Supply Depots and player Customs Warehouses now register through GZ-Diplomacy's external territory-claim API so these container-based structures extend the placing team's territory.
    - Existing registered Supply Depots/Customs Warehouses are synchronized to Diplomacy once on the first live tick after init/configuration.
    - FluxMart and Auto-Buy tabs are available only while the player is within 16 tiles of a same-force Supply Depot.
    - Manual FluxMart purchase handling also revalidates the 16-tile Supply Depot requirement at click time.
    - Auto-Buy Save buttons carry the exact Supply Depot unit number that opened/built the row, so rules are always written to that specific depot rather than a stale/nearest warehouse.
  GUI:
    - Opening a Supply Depot now leaves the native depot inventory open and layers the GZ-Economy interface over it.
    - Closing the underlying Supply Depot inventory with E closes the Economy overlay as well.
    - Opening another native GUI (including character inventory via E) closes a standalone Economy window.
  Compatibility:
    - Uses gz-diplomacy.register_external_claim when available; no GZ-Diplomacy prototype names are hardcoded into Economy.

Version: 1.1.23
Date: 2026-08-24
  Features:
    - Add Batch Size, Base Price (per unit), and Extra Multiplier controls to the top of the admin item price-breakdown dialog.
    - Add Apply + Refresh to persist those per-entry FluxMart overrides and immediately rebuild the live pricing breakdown.
  Changes:
    - Base Price overrides are local to the selected FluxMart catalog row and do not rewrite production recipe values for other items.

Version: 1.1.22
Date: 2026-08-24
  Features:
    - Absorb Cargo Drone visuals under the retained MIT license; GZ Economy has no Cargo Drone mod dependency or runtime link.
    - Add Cargo Drone as a third one-off listing delivery mode with goods reserved when the listing is posted.
    - Add a lightweight disposable-drone state machine: 64-tile visible departure, virtual transit at 1,000 tiles/minute, 64-tile arrival, Customs parking/unload, then despawn.
    - Prefer seller/buyer-owned same-surface Customs Warehouses and fall back to Sundry's public Customs endpoints with private per-player parcel lockers.
    - Settle buyer/seller Flux escrow automatically only after successful delivery; destroyed visible drones fail the transaction and refund the buyer.
  Performance:
    - Virtual shipments use scheduled arrival buckets and no physical entity, pathfinding, or per-tick long-distance simulation. Only visible departure/arrival drones are actively moved.

Version: 1.1.21
Date: 2026-08-24
  Features:
    - Add optional Sundry's Export Depots, disabled by default as a map setting.
    - Add 24x24-chunk event-driven cell state machine with one 50% roll per cell lifecycle.
    - Add five random Sundry's building variants and 20 random Zed merchant names/quips.
    - Add west/east neutral Customs sinks using the existing stopped-train delivery detector.
    - Add 2-3 permanent premium purchase offers per depot at 3x-5x markup.
    - Add chunk-culling reset/despawn/spawn-reservation remote APIs.
    - Terraform successful frontier placement candidates by clearing trees/rocks/cliffs and stamping dirt.

Version: 1.1.20
Date: 2026-08-23
  Changes:
    - FluxMart retail prices now scale linearly with elapsed game time at +2.5% per in-game hour. Production basis values remain unchanged; only final shop pricing and its floor/ceiling move with time.
    - Added a one-time, throttled existing-save migration that converts legacy coins held by players and player-force entities 1:1 into Purple Flux deposited directly to the owning force account.
    - Added the elapsed-time multiplier to the admin price-breakdown window and exposed it through the gz_economy remote API.

Version: 1.1.19
Date: 2026-08-23
  Changes:
    - Holmium ore is now the 5 Purple Flux primary price basis; stone is likewise rooted at 5 Purple Flux so the existing 10-Purple stone-brick value and holmium-solution recipe can derive normally from ingredients.
    - Increased the main Economy window and its working scroll area by 200 GUI pixels on displays with enough vertical room.
    - FluxMart now has category tabs and a simplified Buy | Item | Batch | Stock | Price | Per Unit | Basis layout.
    - Removed the redundant 1x quantity from FluxMart item-name cells; bundle quantity is shown only in the Batch column.
    - Manual FluxMart purchases now always enter the buying player's main inventory, never the open Supply Depot inventory.
    - Supply Depot sales now emit flying-text payout feedback at the depot whenever a sale settlement credits Flux.
    - Economy windows now close cleanly through the standard E inventory key path; closing the main Economy frame also cleans up its auxiliary price/config windows.
Version: 1.1.18
Date: 2026-08-23
  Changes:
    - Barreled-fluid item values now derive from the fluid value plus the empty-barrel/steel material cost, including GZ-Tweaks universal barrels.
    - Intermediate fluid prices now derive from their actual recipes wherever upstream price bases exist; sulfuric acid is no longer a hardcoded fluid root and follows 5 sulfur + 1 iron plate + water -> 50 acid.
    - Fluid derivation preserves fractional Purple Flux per fluid unit so 50-unit barrel costs remain precise.
    - Reverse empty-barrel recipes are excluded from the price graph to prevent reversible packaging loops from collapsing fluid and barrel prices.
    - Filled barrels with a fuel_value receive an energy premium of 1 + fuel_value / 100 MJ after their material price is derived; if the item has no fuel_value, the contained fluid's fuel value is used.
    - Price-cache diagnostics now expose unpriced fluids and provisional fluid roots for missing natural-resource bases.
    - Steam has a zero material basis because water is zero-value and process energy is not priced.
Version: 1.1.17
Date: 2026-08-23
  Changes:
    - Customs Warehouse rolling-stock detection now supports unusually long train carriages instead of requiring the carriage center to be within the vanilla wagon-sized docking window.
    - Cargo Ships boats and cargo ships are recognized through their normal cargo-wagon/locomotive train prototypes, including long cargo-ship bodies that overlap the warehouse scan area while their center lies farther away.
    - Compatibility remains generic to all locomotive, cargo-wagon, fluid-wagon, and artillery-wagon prototypes; no hard dependency on Cargo Ships is required.
Version: 1.1.16
Date: 2026-08-23
  Changes:
    - Added a hard FluxMart stock ceiling of 1,000,000 units per item/quality listing.
    - Selling, restocking, external registration, admin-created entries, and existing-save stock normalization all clamp to the same 1,000,000-unit ceiling.
    - Market equilibrium bands are also clamped below the hard stock ceiling so pricing diagnostics cannot describe unreachable inventory levels.
Version: 1.1.15
  Changes:
    - Added the Map setting "Items sold to shop become available in FluxMart", disabled by default.
    - When disabled, selling an item that has no existing FluxMart listing no longer creates a market catalog row, preventing arbitrary sold items from entering the automatic restock system.
    - Selling items that are already present in FluxMart still adds their sold quantity to normal finite market stock.
    - When enabled, the previous behavior is preserved: newly sold item types become FluxMart listings and participate in normal market restocking.
Version: 1.1.14
  Changes:
    - Reworked depot, ATM, and Customs Warehouse runtime maintenance to use rotating cursors instead of synchronized full-registry scans.
    - Supply Depot output refill retains its 30-tick per-depot cadence but rotates depots across simulation ticks instead of refreshing every depot together.
    - Auto-buy and auto-sell retain their configured per-depot cadence but are distributed across simulation ticks.
    - ATM processing is distributed one terminal at a time.
    - Rail verification and recovery scanning now process at most one active train and one Customs Warehouse per tick.
    - Customs GUI status refresh is player-staggered and periodic debug flushing is moved off the common 60-tick boundary.
    - These changes target large-map rhythmic stutter while preserving event-driven rail detection and economy behavior.
Version: 1.1.13
  Changes:
    - Added generic runtime FluxMart item registration API for external mods.
    - Added single and batch registration calls plus source unregistration.
    - External listings use normal GZ-Economy recipe-derived pricing and recipe unlock detection.
    - Newly registered listings seed to equilibrium minimum once; re-registration preserves live global stock.
    - Added docs/FLUXMART_API.md.
Version: 1.1.12
  Changes:
    - Fixed the admin Price Debug popup collapsing to only its header.
    - Price Debug now receives an explicit adaptive height based on the player's GUI resolution and display scale.
    - The breakdown scroll pane explicitly occupies the remaining inspector body so all pricing sections are visible and scrollable on compact displays.
Version: 1.1.11
  Changes:
    - Added Admin Settings Root Commodity Pricing rows with Configure buttons for every explicitly root-priced item.
    - Root editor exposes base price, base quantity, FluxMart retail floor/ceiling, and equilibrium minimum/maximum.
    - Base price / base quantity is runtime-authoritative for recipe valuation.
    - Changing a root commodity immediately rebuilds downstream recipe-derived item and fluid values.
    - Price-cache schema upgraded to v3 and now retains the normalized recipe graph for runtime revaluation.
    - Root-specific equilibrium bands override the global band for that root commodity.
    - Root-specific retail floor/ceiling override global retail multiplier clamps for that root commodity only.
    - Admin price diagnostics display live root overrides and runtime recipe provenance.
Version: 1.1.10
  Changes:
    - Replaced the single global market equilibrium point with a stock band.
    - Default market stock band is 1,000 minimum to 100,000 maximum for most goods.
    - Stock at or below the lower bound receives no stock-based discount.
    - Stock from the lower bound to the upper bound smoothly drives prices downward from 1.00x to the configured surplus floor.
    - Stock above the upper bound remains at the configured surplus floor rather than depressing prices indefinitely.
    - Automatic market replenishment only fills shortages up to the lower bound and never replenishes into the discount range.
    - Existing 1.1.9 custom equilibrium settings migrate to the lower bound.
    - Catalog entries support optional per-item market_stock_min / market_stock_max overrides for future scarce or bulk commodities.
    - Admin price diagnostics now show stock state and the effective lower/upper stock band used for the item.
Version: 1.1.9
  Changes:
    - Supply Depot warehouse sales now settle through the global FluxMart stock pool.
    - Default warehouse settlement cadence changed to every 120 ticks (2 seconds).
    - Settlement iterates only the registered warehouse registry; no world/surface scan is performed.
    - Removed duplicate 30-tick sale processing from the depot output-refill loop.
    - Warehouse sale payout is quantity-aware across the global stock curve, preventing large batches from receiving the entire pre-sale price.
    - FluxMart auto-buy uses quantity-aware bundle pricing as stock is consumed.
    - Global stock changes now invalidate cached FluxMart prices through a stock revision counter.
    - Added explicit global equilibrium stock (default 1000).
    - Market restock now replenishes shortages toward equilibrium and never adds stock above equilibrium.
    - Admins can click item names in FluxMart or Auto-Buy to open a complete live price calculation breakdown.
    - Price diagnostics include recipe/root derivation, ingredient components, quality multiplier, markup, admin modifier, mood, supply, demand, event, global stock modifier, clamps, final buy price, and warehouse sell-side calculation.
    - Data-stage price cache schema upgraded to v2 with recipe derivation provenance for modded-item debugging.
Version: 1.1.8
Date: 2026-08-20
  Changes:
    - Added explicit receiving-contract assignment to the Customs Warehouse relative inventory panel.
    - Active buyer contracts must be assigned to one specific Customs Warehouse before rail deliveries can settle.
    - The Customs panel lists active receiving contracts and supports Assign Contract / Unassign directly beside the normal inventory.
    - Assigning a contract previews the exact train scan area for 8 seconds.
    - Removed the implicit Bind This Warehouse action from the main Contracts screen.
    - Removed script-driven train dispatch after Customs settlement; normal Factorio train schedules control departure.

Version: 1.1.7
Date: 2026-08-20
  Bugfixes:
    - Fixed a Factorio 2.0 crash when switching a Customs Warehouse rail side: LuaRendering has no is_valid() method.
    - Updated scan-preview and Customs arrow cleanup to resolve LuaRenderObject instances and call their destroy() method directly.

Version: 1.1.6
Date: 2026-08-20
  Changes:
    - Replaced Customs Warehouse INPUT/OUTPUT text overlays with Factorio's standard blue indication-arrow sprites.
    - Three arrows now point inward on the rail/input side and outward on the warehouse/output side.
    - The train scan-area preview remains tied to the Switch Rail Side control.

Version: 1.1.5
Date: 2026-08-20
  Changes:
    - Added a Customs Rail Dock panel beside the normal Customs Warehouse inventory GUI.
    - Added a Switch Rail Side button without replacing the native container inventory.
    - Switching rail side now previews the exact train-detection area on the ground for 8 seconds.
    - Refactored rail scanning and scan preview to use one shared geometry function.
    - Hardened Customs input/output indicator rendering for the Factorio 2.0 rendering-object API.

Version: 1.1.4
Date: 2026-08-20
  Changes:
    - Customs Warehouses no longer open the Economy Contracts screen automatically; opening them now shows the normal inventory UI.
    - Removed the Customs Warehouse status panel from the main Economy Contracts screen.
    - Added in-world INPUT and OUTPUT side indicators to Customs Warehouses.

Version: 1.1.3
Date: 2026-08-20
  Changes:
    - Replaced Customs Warehouse runtime rotation with two explicit placeable prototypes/items: Wide (6x3) and Tall (3x6).
    - Added reciprocal 1:1 conversion recipes so Wide and Tall Customs Warehouses can be reconfigured through crafting without material loss.
    - Tall Customs Warehouses now mine back into the Tall item instead of the Wide item.
    - Removed the Customs Contracts-panel Rotate button and runtime entity-swap path.
Version: 1.1.2
Date: 2026-08-20
  Changes:
    - Reworked Contracts into a public freight board: buyers post Goods Wanted and sellers post Goods Available.
    - Accepting a posting now resolves the actual buyer and seller instead of requiring a named seller at posting time.
    - Contract terms now explicitly require Rail transport provided by either the Buyer or Seller; acceptance resolves that obligation to the actual posting/accepting player.
    - Customs rail validation now checks the resolved transport-provider force rather than always requiring the seller force train.
    - Replaced color-name currency text throughout the economy UI with the corresponding colored Flux coin icon; physical Flux token names are now simply Flux.
    - Migrates legacy unaccepted direct purchase contracts into public Goods Wanted postings while preserving active contracts.
Version: 1.1.1
Date: 2026-08-20
  Features:
    - Activated automated rail delivery settlement for accepted contracts bound to Customs Warehouses.
    - Customs Warehouses scan their configured long-side rail input once per second and also react immediately when trains enter station-wait state.
    - Valid seller-force trains enter a 10-second verification lock before cargo movement or payment.
    - Added whole-lot cargo transfer from trains directly into the 256-slot Customs Warehouse, with excess/unrelated cargo left aboard.
    - Added immediate COD settlement: seller is credited and buyer may be debited below zero through contract debt.
    - Added duplicate train/warehouse locks and same-stop blocking so a stopped train cannot settle twice without departing.
    - Added automatic next-schedule train dispatch after successful settlement when the train has at least two schedule records.
    - Added configurable Customs Warehouse rail-input side and live dock/verification/last-delivery status in the Contracts panel.
  Reliability:
    - Verification is cancelled if the train departs, the warehouse/contract changes, or train composition changes.
    - Cargo transfer rolls back if warehouse insertion or economic settlement fails.
    - Dispatch failure never rolls back an otherwise completed COD transaction.

Version: 1.1.0
Date: 2026-08-20
  Features:
    - Added the 6x3 Customs Warehouse prototype using the supplied front/side artwork, 256 inventory slots, and a Contracts-panel 90-degree orientation swap.
    - Added a Contracts tab to the GZ Economy menu with standing purchase-contract creation, seller acceptance, cancellation, and Customs Warehouse binding.
    - Added persistent contract and delivery IDs/state plus a COD settlement primitive for future rail/boat transport adapters.
    - Added contract-authorized debt accounting: COD settlement can debit a buyer below zero while crediting the seller immediately; later Flux credits pay down debt before becoming spendable.
    - Customs Warehouses open directly to Contracts and are kept separate from Supply Depot auto-sell/autobuy processing.
  Notes:
    - Rail train detection, the 10-second verification timer, cargo transfer, and train dispatch are not active in this build yet; the contract/accounting foundation is wired for that next step.

Version: 1.0.10
Date: 2026-08-19
  Changes:
    - Removed radar from the automatic Supply Depot / FluxMart catalog, including stale radar rows on upgraded saves.
    - Fixed premature shop unlocks by preferring each item's canonical crafting recipe and ignoring recycling/hidden recipes as unlock paths.
    - Excluded recycling recipes from manufactured-item value derivation, preventing circular recycling feedback from collapsing late-game equipment prices such as Portable Fusion Reactor and Shielded Singularity.
    - Applied an additional 10x markup to land mines (20x total automatic military markup).

Version: 1.0.9
Date: 2026-08-19
  Changes:
    - Brought standalone GZ Economy pricing into parity with the updated Terra Nauvis economy model.
    - Expanded authoritative base prices for late-game materials and the oil processing chain.
    - Added automatic priced catalog discovery for combat items, including derived recipe values and sensible ammo/throwable floors and markups.
  Bugfixes:
    - Replaced the old depth-limited recursive manufactured-item price solver with the fixed-point recipe-cost derivation used by Terra Nauvis, allowing long production chains to resolve reliably regardless of recipe prototype order.
    - Existing saves now import newly discovered static catalog rows when the price cache advances.
Version: 1.0.8
Date: 2026-08-18
  Changes:
    - Updated mod metadata for Factorio 2.0 compatibility.

Version: 1.0.7
Date: 2026-08-18
  Changes:
    - Updated the standalone Economy package for the Factorio 2.1 / Gizmod 1.0.12 modular stack.
  Bugfixes:
    - Economy debug commands now skip an already-owned command name instead of aborting mod loading.
Version: 1.0.6
Date: 2026-06-05
  Bugfixes:
    - Added Q close support for the GZ Economy standalone window.
Version: 1.0.5
Date: 2026-06-05
  Changes:
    - Added Gizmod-owned UI data-provider remote calls: ui_status / compact_status.
    - The compact status exposes icon/count Flux balance parts for Gizmod to render in its consolidated dock.
    - Suppressed the old independent top-flow Owned Flux label when Gizmod is present; GZ Economy now supplies data instead of owning HUD clutter.
    - Updated internal constants.version to 1.0.5.
Version: 1.0.4
Date: 2026-06-02
  Changes:
    - Fixed a bug where inserting items into the supply depot would put items in storage rather than turn them into flux
Version: 1.0.3
Date: 2026-06-01
  Changes:
    - Added Flux ATM coin exchange: coins inserted into the ATM convert to force Vault Flux at the live coin market rate.
    - Added coin market storage with a 1.20 default rate and +/-0.35 pressure band based on total coins sold per elapsed game second.
    - Supply Depots now reject coins and physical Flux by spilling them back out instead of converting them as goods.
Version: 0.3.1
Date: 2026-05-23
  Changes:
    - Reduced Supply Depot autobuy runtime overhead. Autobuy now purchases in bulk instead of looping one bundle at a time.
    - Added one-minute FluxMart shop price caching so depot automation does not recalculate item prices repeatedly.
    - Made economy.root()/economy.settings() cheap after first reconciliation, avoiding repeated catalog/default normalization during runtime tick handlers.
    - Coalesced balance button refreshes from control-side force/account credits into periodic dirty refreshes instead of immediate per-transaction GUI churn.
Version: 0.2.19
Date: 2026-05-21
  Changes:
    - Fixed startup crash caused by static catalog metadata being declared after first use.
    - Fixed stale undefined runtime value helper references in the data-stage price-cache path.
    - Removed save-migration/account-compatibility cleanup code from the fresh-game test build.
    - Removed old GUI compatibility aliases and legacy top-button cleanup.