A House Divided A House DividedDocumentation
↵
Changelog
Game Design/World & Simulation

Defence Procurement

Last updated 2026-10-29
Player wikiDefence Procurement
Source files

Summary#

Defence procurement lets a country's ministry award contracts to domestic corporations to build materiel (arsenal components) for its military. The subsystem is a set of independent guardrails around what used to be an almost unbounded transfer channel from the national defence appropriation into corporate cash, the defence price-band drain. Each guardrail is a small, pure module so the award route, the delivery sweep, and the client-side award form can all agree on the same numbers.

Player guide: Defence Procurement

Location: src/lib/military/, with tender bidding in src/lib/governmentContracts/

Key files:

Rules#

Background: the Price-Band Drain#

A delivery credits the supplier pricePerLot - productionCost per lot. Under the original cost model, a lot could be priced in the hundreds of millions while costing a few thousand to build, a margin above 99.99%. Because the price band's top was the GDP anchor (five orders of magnitude above the true build cost) and the cost model was an unrelated flat commodity-recipe figure, a defence contract was very close to a pure transfer of national appropriation into one corporation's cash balance. A minister with a stake in the supplier directly benefited. The guardrails below are the mitigation, not a full clawback (contracts already signed keep their terms).

Tenders and Bidding (src/lib/governmentContracts/)#

New defence contracts are no longer direct offers from a minister to a named CEO. The defence seat holder (an acting holder has the same authority) publishes a tender fixing the component, number of lots, required grade and maximum price per lot. Eligible domestic corporations nominate a certified plant and bid a price inside the price band. Bids are sealed until bidding closes, and the CEO may revise or withdraw a bid until then. The minister then picks any qualifying bid and publishes a reason; there is no automatic winner. The winning bid activates the order with no second acceptance step.

Constant Value Source
BIDDING_TURNS_MIN / BIDDING_TURNS_MAX / BIDDING_TURNS_DEFAULT 6 / 48 / 24 turns
AWARD_WINDOW_TURNS 24 turns after bidding closes (exactly 24, enforced by validDeadlines)
CONTRACTS_PAGE_SIZE 10 results per page on the country board

Publishing reserves the maximum obligation (tenderReservationValue = lots × maximumPricePerLot) against the appropriation and the window quota (reserveDefenceTender, ); award transfers the actual winning value and releases the difference. An open tender therefore holds resources for at most 72 turns (48 bidding plus 24 award). The tender's maximum price must be at least the lowest live price floor over every strategy that can build that component at that grade (defenceLiveLotFloor, ), and a tender below it is refused. Bidding costs nothing. Existing signed contracts and any legacy direct offers keep their stored terms.

A defence bid is rejected (defenceBidError) when the plant's grade (the lower of supplier grade and era grade) is below the required grade, when the amount is outside the plant's current price band or above the tender maximum, or when the supplier has less remaining quarterly room than the tender's lots. Bids sort cheapest first (compareBids).

All the guardrails below (window cap, supplier cap, price band, self-dealing, fill eligibility) still apply to a tender award.

Contract Award Limits (defenceContractLimits.ts)#

Contracts are budgeted in quarter-year tranches, not against an unlimited future stream.

Turn Spend Cap (defenceTurnSpendCap.ts)#

The award side limits the total a supplier may be promised in a window; this limits the rate at which that promise may settle, closing the throughput gap that let a single contract deliver an entire quarterly procurement window in one tick.

Lot Economics and Price Band (defenceLotEconomics.ts)#

Cost is derived from price, not the other way round, inverting the old model.

Live Price Ratios (defencePriceRatios.ts)#

Lot costing reads the same world commodity price ratio (globalPrice / COMMODITY_BASE_PRICES[commodity]) the corporation turn's own input-cost calculation uses, so a lot's cost floor and a plant's actual input bill move together. Deliberately the world ratio, not a country's reachable-market ratio, the award form is a client component that quotes a price band before any of that scope exists, and a world ratio is the same number for both sides of the negotiation. Never cached at module scope (a stale ratio would survive a world reset into the next era). NOMINAL_PRICE_RATIOS is an empty map (every ratio 1).

Self-Dealing (defenceSelfDealing.ts)#

The concentration cap stops one supplier taking the whole tranche; it says nothing about who owns that supplier. resolveSelfDealing() detects when the awarding minister has a stake in the receiving corporation:

The answer to self-dealing is disclosure plus a political price, not another cap:

Terminating a Contract (defenceTermination.ts)#

Tearing up a signed contract used to be free, instant, and returned both the appropriation and the window quota, so a minister could cancel a rival's order and re-award the room to their own plant. Termination is now priced by basis (terminationBasis):

Basis When Fee Quota
Withdrawal Contract still pending, supplier never accepted 0 Released
Cause Supplier at fault for DEFENCE_TERMINATION_CAUSE_TURNS = 3 delivery turns in a row (supplierFaultTurns) 0 Released
Convenience Anything else round(undelivered lots x pricePerLot x TARGET_SUPPLIER_MARGIN), i.e. 15% of the undelivered value Stays spent

Fill Eligibility (defenceFillEligibility.ts)#

resolveFillEligibility() is the single shared answer to "can this plant fill this order", used by the award picker, the award route, the CEO's accept, and the delivery sweep, previously each carried its own version and disagreed. AWARDABLE MUST MEAN DELIVERABLE.

Refusal reasons (FillIneligibilityReason):

Reason Meaning
foreign_supplier Plant is not in the buying country
currency_mismatch Corp is not paid in the buying country's currency (canSupply() infers the currency from the corp's own country, never defaults to USD, a prior USD default hid every non-US domestic plant)
no_materiel_line Plant's strategy supplies no arsenal component
retooled_off_component Plant has re-tooled off the component its contract was frozen on
no_output Plant produces nothing this turn, still eligible (a plant between production runs is a legitimate contract target; the reason rides along as a UI warning, not a refusal)
no_factories_assigned No production lines assigned to the order

State ownership is not a fill-eligibility factor: a National Corporation banks in its own country's currency like any other supplier; the only thing it changes is who clicks Accept (no player CEO).

Delivered grade is the tightest of three ceilings (deliveredGrade): the corporation's research ceiling, the contract's own gradeCeiling (3 when absent) and the era ceiling (maxTechTierForPreset, passed to the sweep as maxGrade).

Procurement Gate (procurementGate.ts)#

isProcurementBlocked(db, countryId, turn) blocks new awards in two cases:

  1. Global pause. isDefenceProcurementPaused(db) reads gameState.defenceProcurementPaused (singleton _id: "current", not filtered on isActive). When true, awarding a new contract and a CEO accepting a pending offer both refuse. This is a kill switch for a procurement-drain exploit, not a subsystem teardown.
  2. Demilitarisation bar. activeProcurementRestriction (collection procurementRestrictions) returns the turn until which a country under a peace settlement may award nothing.

Everything already active is untouched in both cases: the delivery sweep keeps settling live contracts, and cancel/decline stay open. publishTender calls the same gate before publishing a defence tender.

Delivery Sweep ()#

applyDefenceDeliveries(db, countryId, currentYear, maxGrade, currentTurn) settles every active contract. Four caps apply to each contract, in this order:

  1. what the plant produced: floor(deliveryCarry + contractLotsThisTurn(rawLotsFromSector(sector), assigned))
  2. what remains on the order: lotsOrdered - lotsDelivered
  3. what the contract's encumbrance (or, for legacy contracts, the uncommitted appropriation) covers: floor(funding / pricePerLot), with no overdraft
  4. the per-turn spend cap (lotsWithinTurnSpendCap)

deliverable = min(produced, remaining, affordable, withinTurnCap). Everything built and not shipped is banked in deliveryCarry (never discarded, capped at what the order still needs), with a carryReason naming the binding limit.

Settlement per delivery of recorded lots at grade g:

State arms industry (stateArmsIndustry.ts)#

Planned economies get state arms output outside tenders: STATE_ARMS_INDUSTRY = { RU: 3, DD: 1 } lots per turn. Every other country has an emergency floor: MATERIEL_FLOOR_LOTS = 1 lot per turn, only into a domain whose store is at zero with a need above zero, so it can refuse to leave a store empty but cannot fill one.

Data#

Collection Access Fields and notes
governmentTenders (GovernmentTender) read and written terms (component, lots, grade, maximumPricePerLot), closesTurn, awardDeadlineTurn, status (publishing, open, awarding, awarded, canceled), bids, bidHistory, reservedAmount, allocationWindowId, contractId, awardSelfDealing. Bids are sealed to other parties until closesTurn; the board, winning reason and awarded contract are public.
defenceContracts (DefenceContract, ) read and written countryId, corporationId, sectorId, frozen component, lotsOrdered, lotsDelivered, deliveryCarry, pricePerLot, encumberedAmount, amountPaid, productionCostPaid, gradeCeiling, assignedFactories, carryReason, supplierFaultTurns, selfDealing, termination, costBasis, status. Order books show the contract, carry reason, margin and termination record.
defenceProcurementAllocations read and written One doc per country and window (<countryId>:<index>): countryAmount, supplierAmounts, per-tender hold markers. Enforces the window and supplier caps atomically.
federalBudget written defenseAppropriation.balance, .encumbered, .governmentTenderReservations; the delivery debit and the termination fee. gdp and militaryPriceBaselineGdp set the lot price anchor.
corporations and corporateSectors read; liquidCapital and militaryDivertedFraction written Supplier eligibility, research ceiling, plant output (rawLotsFromSector), margin credit.
nationalArsenal written depositLots increments stock and grade by component.
bankMoneyMoves written Idempotency records for delivery and refund moves.
commodityPrices read globalPrice per commodity for live ratios.
gameState read defenceProcurementPaused, preset (era grade ceiling).
procurementRestrictions read Demilitarisation bar.
characters written favorability penalty for self-dealing and termination.
financialTxLog written defence_contract_payment entry per delivery.

Configuration#

Setting Default Where set
gameState.defenceProcurementPaused absent (false) , flipped by an admin action; read by procurementGate.ts
Era grade ceiling by preset maxTechTierForPreset in , passed as maxGrade by processMinisterialOrders
SEED_UPKEEP_TARGET_SHARE 0.55 (the one balance dial; procurement share is 1 - 0.55)
DEFENCE_CONTRACT_SUPPLIER_SHARE, DEFENCE_TURN_SPEND_BURST, TARGET_SUPPLIER_MARGIN, MIN_CONTRACT_MARGIN, MAX_CONTRACT_MARGIN, GRADE_PRICE_SCALE, DEFENCE_FACTORY_SLOTS_PER_PLANT 1/3, 3, 0.15, 0.12, 1.0, see Rules, 4 defenceContractLimits.ts, defenceTurnSpendCap.ts, defenceLotEconomics.ts
STATE_ARMS_INDUSTRY, MATERIEL_FLOOR_LOTS {RU: 3, DD: 1}, 1
Tender timing 6 to 48 bidding turns (default 24), 24 award turns
Demilitarisation bar none procurementRestrictions, written by peace settlements

There are no per-country overrides of the window, caps or margins. Country differences come from the defence line (resolveDefenseLine), the currency and the state-owned status of the supplier.

Timing#

every turn:
  resourceAndFinanceStart group (after commodityPrices)
    governmentContractExpiry         tenders past award deadline -> Canceled
    governmentContractMaximaRefresh  open tender maxima re-checked vs live floor
  stateEffectsAndNationalAggregation group, ministerialOrders phase
  (after crisisTurn, intelligenceTurn, navairOperations; before policyEffects):
    processMinisterialOrders, per country:
    applyDefenseAppropriation        accrue the appropriation
    applyDefenceDeliveries           settle contracts (this page)
    applyStateArmsProduction         planned-economy and floor lots
    applyNavalRepair -> applyDefenceRefit -> nuclear production -> doctrine income
    battle declarations resolve

Worked trace#

A country has an annual defence line of 48,000,000,000 and a lot price of 150,000,000 (grade 2, so the grade scale is 1.0, and a calm market so the cost index is 1.0).

Step Calculation Result
Window procurement notional 48,000,000,000 x (1 - 0.55) x (12 / 48) 5,400,000,000
Country cap floor(5,400,000,000 / 150,000,000) 36 lots
Private supplier cap max(1, floor(36 x 1/3)) 12 lots
State-owned supplier cap full window 36 lots
Accrual per turn 48,000,000,000 x 0.45 / 48 450,000,000
Country turn spend cap 450,000,000 x 3 1,350,000,000 (9 lots)
Private supplier turn cap 1,350,000,000 x 1/3 450,000,000 (3 lots)
Production cost 150,000,000 x (1 - 0.15) 127,500,000
Price floor ceil(127,500,000 x 1.12) 142,800,000
Price ceiling min(anchor 150,000,000, cost x 2 = 255,000,000) 150,000,000
Suggested price 127,500,000 / 0.85 150,000,000

So a private plant awarded the full 12 lots delivers 3 per turn and finishes in 4 turns. If the minister owns that plant and awards 1,800,000,000 (one third of the tranche), the self-dealing penalty is 1.5 + (1/3) x (8 - 1.5) = 3.67, shown as 3.7 favorability points. Cancelling that order for convenience after 3 of 12 lots delivered pays a fee of 9 x 150,000,000 x 0.15 = 202,500,000.

Settlement of one delivery of 3 lots (contract struck at 150,000,000, grade 2 delivered, index 1.0):

Step Calculation Result
Actual cost 3 x 150,000,000 450,000,000 (exactly the private supplier turn cap)
Unit cost 150,000,000 x min(0.85 x 1.0, 0.8929) 127,500,000
Build cost round(127,500,000 x 1.0 x 3) 382,500,000
Margin 450,000,000 - 382,500,000 67,500,000
Money move debit appropriation 450,000,000; credit supplier 67,500,000; burn 382,500,000 nets to 0

With a commodity shock at index 1.5 the unit cost share would be min(1.275, 0.8929) = 0.8929, so build cost is 3 x 133,928,571 = 401,785,714 and the margin falls to 48,214,286 (10.7% of price), never negative at grade 2.

Edge cases and limits#

Invariants#

Failure and recovery#

Connections#

Driven by:

Affects:

Tests#

Known issues and history#

Last checked: 2026-10-29, version 1.18.0

Ask