@its-not-rocket-science/ananke 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +5 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,27 @@ Versioning follows [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ---
8
8
 
9
+ ## [0.1.28] — 2026-03-26
10
+
11
+ ### Added
12
+
13
+ - **Phase 83 · Trade Routes & Inter-Polity Commerce** (`src/trade-routes.ts`)
14
+ - `TradeRoute { routeId, polityAId, polityBId, baseVolume_cu, efficiency_Q, establishedTick }` — bilateral route; both polities earn income.
15
+ - `TradeRegistry { routes: Map<string, TradeRoute> }` — canonical sorted-pair key; symmetric lookup.
16
+ - `ROUTE_VIABLE_THRESHOLD = q(0.10)` — below this `isRouteViable` returns false.
17
+ - `ROUTE_DECAY_PER_DAY = q(0.001)` — slow natural decay without maintenance.
18
+ - `TREATY_TRADE_BONUS_Q = q(0.20)` — Phase-80 trade pact adds 20% income multiplier.
19
+ - `computeDailyTradeIncome(route, hasTradePact?, seasonalMul_Q?)` → `TradeIncome { incomeA_cu, incomeB_cu }` — zero for non-viable routes.
20
+ - `applyDailyTrade(polityA, polityB, route, ...)` — mutates both treasuries.
21
+ - `stepRouteEfficiency(route, boostDelta_Q?)` — daily decay with optional maintenance boost.
22
+ - `reinforceRoute(route, deltaQ)` / `disruptRoute(route, disruption_Q)` — clamped efficiency adjustments; `disruptRoute` integrates with Phase-82 espionage results.
23
+ - `abandonRoute(registry, A, B)` — removes route, returns boolean.
24
+ - `computeAnnualTradeVolume(registry, polityId)` → integer — sum of viable route volumes at current efficiency.
25
+ - Added `./trade-routes` subpath export to `package.json`.
26
+ - 50 new tests; 4,427 total. Coverage maintained above all thresholds.
27
+
28
+ ---
29
+
9
30
  ## [0.1.27] — 2026-03-26
10
31
 
11
32
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@its-not-rocket-science/ananke",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "description": "Deterministic lockstep-friendly SI-units RPG/physics core (fixed-point TS)",
6
6
  "license": "MIT",
@@ -94,6 +94,10 @@
94
94
  "./espionage": {
95
95
  "import": "./dist/src/espionage.js",
96
96
  "types": "./dist/src/espionage.d.ts"
97
+ },
98
+ "./trade-routes": {
99
+ "import": "./dist/src/trade-routes.js",
100
+ "types": "./dist/src/trade-routes.d.ts"
97
101
  }
98
102
  },
99
103
  "files": [