@its-not-rocket-science/ananke 0.1.25 → 0.1.26
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.
- package/CHANGELOG.md +19 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,25 @@ Versioning follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.1.26] — 2026-03-26
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Phase 81 · Migration & Displacement** (`src/migration.ts`)
|
|
14
|
+
- `MigrationFlow { fromPolityId, toPolityId, population }` — a resolved daily population transfer.
|
|
15
|
+
- `MigrationContext { polityId, isAtWar?, lowestBondStr_Q? }` — optional per-polity war/feudal context passed by the host.
|
|
16
|
+
- `computePushPressure(polity, isAtWar?, lowestBondStr_Q?)` → Q — stability deficit + morale deficit + war bonus (`MIGRATION_WAR_PUSH_Q = q(0.20)`) + feudal-bond deficit below `MIGRATION_PUSH_FEUDAL_THRESHOLD = q(0.30)`.
|
|
17
|
+
- `computePullFactor(polity)` → Q — `stabilityQ × moraleQ / SCALE.Q`; both must be high to attract migrants.
|
|
18
|
+
- `computeMigrationFlow(from, to, push_Q, pull_Q)` → integer — 0 if push < `MIGRATION_PUSH_MIN_Q = q(0.05)` or pull = 0; floors to integer; max daily rate `MIGRATION_DAILY_RATE_Q = q(0.001)` (0.1% of population at full pressure).
|
|
19
|
+
- `resolveMigration(polities[], context?)` → `MigrationFlow[]` — collects all directed pair flows above threshold.
|
|
20
|
+
- `applyMigrationFlows(polityRegistry, flows)` — mutates `population` on sending and receiving polities; clamps to prevent negative populations.
|
|
21
|
+
- `estimateNetMigrationRate(polityId, flows, population)` → signed fraction — positive = net immigration, negative = net emigration.
|
|
22
|
+
- Integrates with Phase 61 (Polity), Phase 79 (Feudal bond strength), Phase 80 (Diplomacy) without direct imports — callers supply context.
|
|
23
|
+
- Added `./migration` subpath export to `package.json`.
|
|
24
|
+
- 41 new tests; 4,343 total. Coverage maintained above all thresholds.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
9
28
|
## [0.1.25] — 2026-03-26
|
|
10
29
|
|
|
11
30
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@its-not-rocket-science/ananke",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deterministic lockstep-friendly SI-units RPG/physics core (fixed-point TS)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -86,6 +86,10 @@
|
|
|
86
86
|
"./diplomacy": {
|
|
87
87
|
"import": "./dist/src/diplomacy.js",
|
|
88
88
|
"types": "./dist/src/diplomacy.d.ts"
|
|
89
|
+
},
|
|
90
|
+
"./migration": {
|
|
91
|
+
"import": "./dist/src/migration.js",
|
|
92
|
+
"types": "./dist/src/migration.d.ts"
|
|
89
93
|
}
|
|
90
94
|
},
|
|
91
95
|
"files": [
|