@its-not-rocket-science/ananke 0.1.68 → 0.5.1
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 +274 -0
- package/README.md +150 -431
- package/STABLE_API.md +113 -490
- package/conformance/README.md +46 -44
- package/conformance/lockstep-sequence.json +395 -395
- package/conformance/phase-order.json +21 -0
- package/conformance/replay-parity.json +65 -65
- package/conformance/state-hash-regression.json +39 -0
- package/conformance/state-hash.json +23 -22
- package/dist/src/conformance.d.ts +8 -2
- package/dist/src/content/index.d.ts +3 -0
- package/dist/src/content/index.js +2 -0
- package/dist/src/content/injector.d.ts +19 -0
- package/dist/src/content/injector.js +61 -0
- package/dist/src/content/loader.d.ts +3 -0
- package/dist/src/content/loader.js +170 -0
- package/dist/src/content/types.d.ts +56 -0
- package/dist/src/content/types.js +1 -0
- package/dist/src/content/validator.d.ts +6 -0
- package/dist/src/content/validator.js +14 -0
- package/dist/src/content-pack.d.ts +3 -2
- package/dist/src/content-pack.js +205 -10
- package/dist/src/data-governance.d.ts +73 -0
- package/dist/src/data-governance.js +188 -0
- package/dist/src/debug.d.ts +6 -0
- package/dist/src/debug.js +9 -0
- package/dist/src/determinism.d.ts +12 -0
- package/dist/src/determinism.js +93 -0
- package/dist/src/dialogue.d.ts +41 -0
- package/dist/src/dialogue.js +113 -2
- package/dist/src/economy.d.ts +97 -3
- package/dist/src/economy.js +191 -37
- package/dist/src/history/autosave.d.ts +19 -0
- package/dist/src/history/autosave.js +98 -0
- package/dist/src/history/timetravel.d.ts +28 -0
- package/dist/src/history/timetravel.js +61 -0
- package/dist/src/index.d.ts +19 -31
- package/dist/src/index.js +20 -38
- package/dist/src/model3d.js +63 -2
- package/dist/src/narrative/combat-logger.d.ts +25 -0
- package/dist/src/narrative/combat-logger.js +97 -0
- package/dist/src/narrative/plausibility.d.ts +30 -0
- package/dist/src/narrative/plausibility.js +70 -0
- package/dist/src/narrative-layer.d.ts +2 -0
- package/dist/src/narrative-layer.js +2 -0
- package/dist/src/navigation/causal-chain.d.ts +26 -0
- package/dist/src/navigation/causal-chain.js +74 -0
- package/dist/src/netcode.d.ts +1 -1
- package/dist/src/netcode.js +1 -1
- package/dist/src/performance/adaptive-tick.d.ts +23 -0
- package/dist/src/performance/adaptive-tick.js +50 -0
- package/dist/src/plugins/loader.d.ts +23 -0
- package/dist/src/plugins/loader.js +86 -0
- package/dist/src/plugins/registry.d.ts +11 -0
- package/dist/src/plugins/registry.js +28 -0
- package/dist/src/plugins/types.d.ts +31 -0
- package/dist/src/plugins/types.js +7 -0
- package/dist/src/replay.js +5 -2
- package/dist/src/scenario.js +2 -1
- package/dist/src/serialization/binary.d.ts +5 -0
- package/dist/src/serialization/binary.js +193 -0
- package/dist/src/session.d.ts +115 -0
- package/dist/src/session.js +228 -0
- package/dist/src/sim/ai/decide.js +1 -1
- package/dist/src/sim/ai/personality.js +2 -2
- package/dist/src/sim/bodyplan.d.ts +30 -0
- package/dist/src/sim/context.d.ts +2 -0
- package/dist/src/sim/kernel.js +80 -1294
- package/dist/src/sim/normalization.d.ts +12 -0
- package/dist/src/sim/normalization.js +92 -0
- package/dist/src/sim/resolvers/attack-resolver.d.ts +30 -0
- package/dist/src/sim/resolvers/attack-resolver.js +310 -0
- package/dist/src/sim/resolvers/capability-resolver.d.ts +15 -0
- package/dist/src/sim/resolvers/capability-resolver.js +270 -0
- package/dist/src/sim/resolvers/grapple-resolver.d.ts +28 -0
- package/dist/src/sim/resolvers/grapple-resolver.js +70 -0
- package/dist/src/sim/resolvers/shoot-resolver.d.ts +27 -0
- package/dist/src/sim/resolvers/shoot-resolver.js +212 -0
- package/dist/src/sim/resolvers/treat-resolver.d.ts +16 -0
- package/dist/src/sim/resolvers/treat-resolver.js +77 -0
- package/dist/src/sim/step/apply/intents.d.ts +6 -0
- package/dist/src/sim/step/apply/intents.js +83 -0
- package/dist/src/sim/step/kernel-pipeline.d.ts +9 -0
- package/dist/src/sim/step/kernel-pipeline.js +15 -0
- package/dist/src/sim/step/phases/capability-phase.d.ts +8 -0
- package/dist/src/sim/step/phases/capability-phase.js +65 -0
- package/dist/src/sim/step/phases/cooldowns-phase.d.ts +3 -0
- package/dist/src/sim/step/phases/cooldowns-phase.js +37 -0
- package/dist/src/sim/step/phases/prepare-phase.d.ts +10 -0
- package/dist/src/sim/step/phases/prepare-phase.js +33 -0
- package/dist/src/sim/step/pipeline.d.ts +2 -0
- package/dist/src/sim/step/pipeline.js +15 -0
- package/dist/src/sim/step/resolvers/impact-resolver.d.ts +9 -0
- package/dist/src/sim/step/resolvers/impact-resolver.js +55 -0
- package/dist/src/sim/step/world-phases.d.ts +7 -0
- package/dist/src/sim/step/world-phases.js +15 -0
- package/dist/src/sim/step/world-step-context.d.ts +23 -0
- package/dist/src/sim/step/world-step-context.js +1 -0
- package/dist/src/sim/systemic-toxicology.js +1 -1
- package/dist/src/sim/team.js +2 -2
- package/dist/src/sim/testing.js +4 -3
- package/dist/src/sim/toxicology.d.ts +1 -1
- package/dist/src/sim/toxicology.js +1 -1
- package/dist/src/sim/world.d.ts +17 -24
- package/dist/src/snapshot.js +3 -6
- package/dist/src/tier2.d.ts +19 -0
- package/dist/src/tier2.js +21 -0
- package/dist/src/tier3.d.ts +10 -0
- package/dist/src/tier3.js +12 -0
- package/dist/src/version.d.ts +6 -0
- package/dist/src/version.js +8 -0
- package/dist/src/wasm/bridge.d.ts +14 -0
- package/dist/src/wasm/bridge.js +84 -0
- package/dist/src/wasm-kernel.d.ts +2 -0
- package/dist/src/wasm-kernel.js +1 -0
- package/dist/src/world-evolution-backend/engine.d.ts +4 -0
- package/dist/src/world-evolution-backend/engine.js +347 -0
- package/dist/src/world-evolution-backend/host-schema.d.ts +145 -0
- package/dist/src/world-evolution-backend/host-schema.js +375 -0
- package/dist/src/world-evolution-backend/index.d.ts +1 -0
- package/dist/src/world-evolution-backend/index.js +1 -0
- package/dist/src/world-evolution-backend/open-world-host-adapter.d.ts +96 -0
- package/dist/src/world-evolution-backend/open-world-host-adapter.js +208 -0
- package/dist/src/world-evolution-backend/profiles.d.ts +4 -0
- package/dist/src/world-evolution-backend/profiles.js +136 -0
- package/dist/src/world-evolution-backend/public.d.ts +11 -0
- package/dist/src/world-evolution-backend/public.js +7 -0
- package/dist/src/world-evolution-backend/reproducibility.d.ts +8 -0
- package/dist/src/world-evolution-backend/reproducibility.js +35 -0
- package/dist/src/world-evolution-backend/timeline.d.ts +6 -0
- package/dist/src/world-evolution-backend/timeline.js +337 -0
- package/dist/src/world-evolution-backend/types.d.ts +138 -0
- package/dist/src/world-evolution-backend/types.js +1 -0
- package/dist/src/world-evolution-host-backend.d.ts +51 -0
- package/dist/src/world-evolution-host-backend.js +97 -0
- package/dist/src/world-evolution.d.ts +201 -0
- package/dist/src/world-evolution.js +543 -0
- package/dist/src/world-factory.js +2 -1
- package/dist/tools/pack-cli.js +55 -2
- package/docs/bridge-contract.md +140 -332
- package/docs/completion-evidence-dashboard.md +63 -0
- package/docs/host-contract.md +86 -310
- package/docs/host-world-evolution-schema.md +155 -0
- package/docs/integration-primer.md +29 -22
- package/docs/migration-monolith-to-modular.md +102 -120
- package/docs/package-architecture.md +116 -323
- package/docs/plugins/README.md +42 -0
- package/docs/plugins/hooks.md +22 -0
- package/docs/plugins/publishing.md +29 -0
- package/docs/plugins/security-model.md +273 -0
- package/docs/project-overview.md +30 -30
- package/docs/release-dashboard.md +47 -0
- package/docs/session-api.md +127 -0
- package/docs/stable-api-manifest.json +52 -0
- package/docs/trust-dashboard.md +37 -0
- package/docs/versioning.md +256 -245
- package/docs/wire-protocol.md +140 -209
- package/docs/world-evolution-backend.md +200 -0
- package/docs/world-evolution-engine.md +150 -0
- package/docs/world-evolution-host-backend.md +70 -0
- package/docs/world-evolution-orchestration.md +248 -0
- package/package.json +125 -6
- package/schema/content-pack.schema.json +85 -0
- package/schema/plugin.schema.json +57 -0
- package/schema/world-evolution-input.schema.json +196 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## Purpose
|
|
8
8
|
|
|
9
9
|
> **New to Ananke?** Start with [`docs/host-contract.md`](host-contract.md) — it covers the
|
|
10
|
-
>
|
|
10
|
+
> current Tier 1 stable integration surface with working code examples. Return here for
|
|
11
11
|
> architecture diagrams, type glossary, and integration gotchas.
|
|
12
12
|
|
|
13
13
|
This document captures the technical insights, data‑flow diagrams, type glossaries, and gotchas discovered during the 2–4 week evaluation spike described in the ROADMAP’s **Deep Integration & Technical Onboarding** milestone. It is intended as an internal reference for engineers who will be integrating Ananke into a production game or simulation.
|
|
@@ -16,28 +16,29 @@ The spike consisted of three concrete experiments:
|
|
|
16
16
|
|
|
17
17
|
1. **Tracing the data flow of a simple melee attack** — from `Command` input through the kernel to injury output (`tools/trace‑attack.ts`).
|
|
18
18
|
2. **Building a minimal observer** that reads `WorldState` after each `stepWorld` call and prints entity positions, condition, and injury summaries (`tools/observer.ts`).
|
|
19
|
-
3. **Experimenting with saving and loading a
|
|
19
|
+
3. **Experimenting with saving and loading a full `WorldState` snapshot** to understand the serialisation format and any Map/BigInt round‑trip concerns (`tools/serialize.ts`).
|
|
20
20
|
|
|
21
21
|
Each experiment is documented below, followed by a glossary of critical types and a list of integration gotchas.
|
|
22
22
|
|
|
23
23
|
## Choose your entry point
|
|
24
24
|
|
|
25
25
|
Use the table below to find the right subpath export for your use case.
|
|
26
|
-
The full module index
|
|
26
|
+
The full module index is in [`docs/module-index.md`](module-index.md).
|
|
27
27
|
|
|
28
28
|
| I want to… | Start with | Then add |
|
|
29
29
|
|---|---|---|
|
|
30
30
|
| **Simulate a duel or battle** | `"@its-not-rocket-science/ananke"` (main) | `"…/combat"` for grapple, ranged, formation |
|
|
31
31
|
| **Run a campaign / world simulation** | `"…"` + `"…/polity"` | `"…/campaign"` + whichever campaign extensions you need |
|
|
32
32
|
| **Design a species or xenobiology** | `"…"` + `"…/species"` + `"…/anatomy"` | `"…/character"` for aging, sleep, disease |
|
|
33
|
-
| **Drive a 3D renderer** | `"
|
|
33
|
+
| **Drive a 3D renderer** | `"…/host-loop"` for stable wire frames | Add `"…/tier2"` only if you need experimental bridge internals (`BridgeEngine`, mapping helpers) — see [`docs/bridge-contract.md`](bridge-contract.md) |
|
|
34
34
|
| **Build a multiplayer host** | `"…"` (deterministic by design) | See [`docs/host-contract.md`](host-contract.md) for lockstep pattern |
|
|
35
|
+
| **Run host session workflows** | `"…/session"` | See [`docs/session-api.md`](session-api.md) for the Tier 2 / experimental session facade |
|
|
35
36
|
| **Add narrative / storytelling** | `"…/narrative"` + `"…/narrative-prose"` | `"…/renown"` for legend-building |
|
|
36
37
|
| **Craft / economic simulation** | `"…/crafting"` + `"…/catalog"` | `"…/social"` for trade and faction effects |
|
|
37
38
|
| **Grand strategy / 4X** | `"…/polity"` + `"…/campaign"` | Any combination of the 26 campaign extension modules |
|
|
38
39
|
|
|
39
|
-
**Stability:** `"."` and `"./polity"` are **Tier 1
|
|
40
|
-
All other subpaths are **
|
|
40
|
+
**Stability:** `"."` and `"./polity"` are **Tier 1 stable** — no breaking changes without a major version bump.
|
|
41
|
+
All other subpaths are **Experimental** — changelog documents any breaking changes.
|
|
41
42
|
See [`STABLE_API.md`](../STABLE_API.md) for the full tier table.
|
|
42
43
|
|
|
43
44
|
---
|
|
@@ -48,13 +49,19 @@ Ananke is a deterministic, lockstep‑friendly simulation kernel that models ent
|
|
|
48
49
|
|
|
49
50
|
### Core data structures
|
|
50
51
|
|
|
51
|
-
```typescript
|
|
52
|
+
```typescript no-check-example
|
|
52
53
|
interface WorldState {
|
|
53
54
|
tick: number;
|
|
54
55
|
seed: number;
|
|
55
56
|
entities: Entity[];
|
|
56
57
|
activeFieldEffects?: FieldEffect[];
|
|
57
|
-
|
|
58
|
+
runtimeState?: {
|
|
59
|
+
sensoryEnv?: SensoryEnvironment;
|
|
60
|
+
factionRegistry?: FactionRegistry;
|
|
61
|
+
partyRegistry?: PartyRegistry;
|
|
62
|
+
relationshipGraph?: RelationshipGraph;
|
|
63
|
+
nutritionAccum?: number;
|
|
64
|
+
}; // explicit host/runtime subsystem state
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
interface Entity {
|
|
@@ -78,7 +85,7 @@ type CommandMap = Map<number, Command[]>;
|
|
|
78
85
|
|
|
79
86
|
### Kernel entry point
|
|
80
87
|
|
|
81
|
-
```typescript
|
|
88
|
+
```typescript no-check-example
|
|
82
89
|
function stepWorld(
|
|
83
90
|
world: WorldState,
|
|
84
91
|
commands: CommandMap,
|
|
@@ -125,7 +132,7 @@ The observer (`tools/observer.ts`) demonstrates how to hook into the `stepWorld`
|
|
|
125
132
|
|
|
126
133
|
### Observer pattern
|
|
127
134
|
|
|
128
|
-
```typescript
|
|
135
|
+
```typescript no-check-example
|
|
129
136
|
for (let tick = 0; tick < maxTicks; tick++) {
|
|
130
137
|
// 1. Build indexes (required for AI decisions, but we hard‑code commands)
|
|
131
138
|
const index = buildWorldIndex(world);
|
|
@@ -161,7 +168,7 @@ The serialisation demo (`tools/serialize.ts`) shows how to round‑trip a `World
|
|
|
161
168
|
|
|
162
169
|
Optional Map fields on `Entity` (`foodInventory`, `armourState`, `reputations`) must be explicitly converted to an array of entries for JSON serialisation:
|
|
163
170
|
|
|
164
|
-
```typescript
|
|
171
|
+
```typescript no-check-example
|
|
165
172
|
function serializeEntity(e: Entity): unknown {
|
|
166
173
|
const obj: any = { ...e };
|
|
167
174
|
if (e.foodInventory instanceof Map) {
|
|
@@ -174,7 +181,7 @@ function serializeEntity(e: Entity): unknown {
|
|
|
174
181
|
|
|
175
182
|
On deserialisation, reconstruct the Map from the array:
|
|
176
183
|
|
|
177
|
-
```typescript
|
|
184
|
+
```typescript no-check-example
|
|
178
185
|
function deserializeEntity(e: any): Entity {
|
|
179
186
|
const entity = { ...e } as Entity;
|
|
180
187
|
if (Array.isArray(e.foodInventory)) {
|
|
@@ -189,24 +196,24 @@ function deserializeEntity(e: any): Entity {
|
|
|
189
196
|
|
|
190
197
|
After deserialisation, the simulation can be continued from the saved state and will produce **identical results** to the original run, provided the same seed and commands are used. This is a direct consequence of the kernel’s pure‑deterministic design.
|
|
191
198
|
|
|
192
|
-
> **Gotcha:**
|
|
199
|
+
> **Gotcha:** `runtimeState` and `activeFieldEffects` are optional host/runtime subsystem state; they can be omitted during serialisation for basic combat if unused.
|
|
193
200
|
|
|
194
201
|
---
|
|
195
202
|
|
|
196
203
|
## 5. Connecting to a Renderer (Bridge API)
|
|
197
204
|
|
|
198
|
-
Milestone 3 delivers a
|
|
205
|
+
Milestone 3 delivers a Tier 1 stable bridge module (`src/bridge/`) that handles tick‑rate conversion, segment‑to‑bone mapping, and deterministic interpolation between simulation ticks. The bridge is a double‑buffered engine that ingests simulation snapshots at 20 Hz and provides smooth interpolated state at render frequency (60 Hz or higher).
|
|
199
206
|
|
|
200
207
|
### Key features
|
|
201
208
|
|
|
202
209
|
- **Mapping system** – connect simulation segment IDs (`"leftArm"`, `"torso"`) to your skeleton’s bone names (`"arm_L"`, `"spine_02"`).
|
|
203
210
|
- **Fixed‑point interpolation** – deterministic linear interpolation of positions, velocities, animation weights, pose modifiers, and condition.
|
|
204
211
|
- **Extrapolation control** – optional velocity‑based prediction when render time runs ahead of simulation.
|
|
205
|
-
- **Full API documentation** – see [`bridge‑api.md`](./bridge
|
|
212
|
+
- **Full API documentation** – see [`bridge‑api.md`](./bridge-contract.md) for detailed reference and examples.
|
|
206
213
|
|
|
207
214
|
### Minimal setup example
|
|
208
215
|
|
|
209
|
-
```typescript
|
|
216
|
+
```typescript no-check-example
|
|
210
217
|
import { BridgeEngine } from "ananke";
|
|
211
218
|
import { extractRigSnapshots, extractMotionVectors, extractConditionSamples } from "ananke";
|
|
212
219
|
|
|
@@ -237,11 +244,11 @@ if (state) {
|
|
|
237
244
|
|
|
238
245
|
### Working demo
|
|
239
246
|
|
|
240
|
-
Run `npm run run:bridge
|
|
247
|
+
Run `npm run run:bridge-demo` to see an end-to-end bridge workflow with humanoid and quadruped body plans, simulation loop, render‑loop simulation, and determinism verification.
|
|
241
248
|
|
|
242
249
|
### Integration steps
|
|
243
250
|
|
|
244
|
-
1. Read the [bridge API documentation](./bridge
|
|
251
|
+
1. Read the [bridge API documentation](./bridge-contract.md) to understand mapping and interpolation details.
|
|
245
252
|
2. Author mappings for each body plan your game uses (humanoid, quadruped, avian, etc.).
|
|
246
253
|
3. Integrate the bridge into your simulation and render threads as shown above.
|
|
247
254
|
4. Use the `poseModifiers` array to drive vertex‑shader weights or morph targets for injury visualisation.
|
|
@@ -273,7 +280,7 @@ Run `npm run run:bridge‑demo` to see a complete bridge workflow with humanoid
|
|
|
273
280
|
|
|
274
281
|
TypeScript’s `exactOptionalPropertyTypes` is enabled in the project. This means an optional property set to `undefined` is **not** the same as omitting the property. For example:
|
|
275
282
|
|
|
276
|
-
```typescript
|
|
283
|
+
```typescript no-check-example
|
|
277
284
|
// ❌ Wrong – will cause type errors
|
|
278
285
|
entity.cognition = undefined;
|
|
279
286
|
|
|
@@ -317,11 +324,11 @@ When mapping injury regions to a 3D skeleton, note that region IDs are **camelCa
|
|
|
317
324
|
|
|
318
325
|
## 8. Recommended Integration Steps
|
|
319
326
|
|
|
320
|
-
1. **Start with the vertical slice** (`npm run run:vertical-slice`) to see
|
|
327
|
+
1. **Start with the vertical slice** (`npm run run:vertical-slice`) to see an end-to-end 1v1 duel.
|
|
321
328
|
2. **Trace a single attack** (`npm run run:trace-attack`) to internalise the data flow.
|
|
322
329
|
3. **Build an observer** that logs the state of your own entities each tick (copy `observer.ts`).
|
|
323
330
|
4. **Implement save/load** using the serialisation pattern (`serialize.ts`).
|
|
324
|
-
5. **Connect the 3D rig** using the bridge API (`npm run run:bridge
|
|
331
|
+
5. **Connect the 3D rig** using the bridge API (`npm run run:bridge-demo`). See [Bridge API documentation](./bridge-contract.md).
|
|
325
332
|
6. **Profile performance** with many entities (100+) to ensure your bridge does not become a bottleneck.
|
|
326
333
|
|
|
327
334
|
---
|
|
@@ -332,4 +339,4 @@ The evaluation spike confirms that Ananke’s deterministic, physics‑first sim
|
|
|
332
339
|
|
|
333
340
|
With this primer, a team can proceed to **Milestone 3 (Asset Pipeline & Renderer Bridge)** with a solid understanding of the kernel’s internals and the gotchas to avoid.
|
|
334
341
|
|
|
335
|
-
*Generated by Claude Code during Integration Milestone 2, March 2026.*
|
|
342
|
+
*Generated by Claude Code during Integration Milestone 2, March 2026.*
|
|
@@ -1,120 +1,102 @@
|
|
|
1
|
-
# Migration
|
|
2
|
-
|
|
3
|
-
This guide
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
| `@its-not-rocket-science/ananke
|
|
58
|
-
| `@its-not-rocket-science/ananke/
|
|
59
|
-
| `@its-not-rocket-science/ananke/
|
|
60
|
-
| `@its-not-rocket-science/ananke/
|
|
61
|
-
| `@its-not-rocket-science/ananke/
|
|
62
|
-
| `@its-not-rocket-science/ananke/
|
|
63
|
-
| `@its-not-rocket-science/ananke/
|
|
64
|
-
| `@its-not-rocket-science/ananke/
|
|
65
|
-
| `@its-not-rocket-science/ananke/
|
|
66
|
-
| `@its-not-rocket-science/ananke/
|
|
67
|
-
| `@its-not-rocket-science/ananke/
|
|
68
|
-
| `@its-not-rocket-science/ananke/
|
|
69
|
-
| `@its-not-rocket-science/ananke/
|
|
70
|
-
| `@its-not-rocket-science/ananke/
|
|
71
|
-
| `@its-not-rocket-science/ananke/
|
|
72
|
-
| `@its-not-rocket-science/ananke/
|
|
73
|
-
| `@its-not-rocket-science/ananke/
|
|
74
|
-
| `@its-not-rocket-science/ananke/
|
|
75
|
-
| `@its-not-rocket-science/ananke/
|
|
76
|
-
| `@its-not-rocket-science/ananke/military-campaign` | `@ananke/campaign` |
|
|
77
|
-
| `@its-not-rocket-science/ananke/governance` | `@ananke/campaign` |
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Run `npm update` when the new versions are published; your bundler will
|
|
105
|
-
automatically produce a smaller output.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Staying on the monolith
|
|
110
|
-
|
|
111
|
-
If you prefer to keep using `@its-not-rocket-science/ananke` directly, nothing
|
|
112
|
-
changes. The 41 subpath exports are stable and will not be removed.
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## See also
|
|
117
|
-
|
|
118
|
-
- [`docs/package-architecture.md`](package-architecture.md) — full design document and source file mapping
|
|
119
|
-
- [`docs/module-index.md`](module-index.md) — all exports with stability tiers and use cases
|
|
120
|
-
- [`STABLE_API.md`](../STABLE_API.md) — stable API surface (Tier 1)
|
|
1
|
+
# Migration guide: monolith to modular imports (state-aware)
|
|
2
|
+
|
|
3
|
+
This guide separates what is available **today** from what is **planned** so adopters can migrate with accurate expectations.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Current state (available now)
|
|
8
|
+
|
|
9
|
+
- `@its-not-rocket-science/ananke` is the primary shipped package.
|
|
10
|
+
- `@ananke/core`, `@ananke/combat`, `@ananke/campaign`, and `@ananke/content` are currently Phase 1 wrappers that re-export from the monolith.
|
|
11
|
+
- Result: changing imports can improve API clarity, but does not yet create full package isolation or guaranteed bundle-size reductions.
|
|
12
|
+
|
|
13
|
+
## In progress (partial implementation)
|
|
14
|
+
|
|
15
|
+
- Package-boundary definitions and checks exist and are actively used.
|
|
16
|
+
- Boundary cleanup and source ownership migration are still ongoing.
|
|
17
|
+
- Until that migration is complete, modular packages should be treated as compatibility entrypoints, not fully separated codebases.
|
|
18
|
+
|
|
19
|
+
## Target state (planned)
|
|
20
|
+
|
|
21
|
+
- Each `@ananke/*` package will own implementation and build artifacts.
|
|
22
|
+
- Dependency relationships between packages will match the declared modular DAG.
|
|
23
|
+
- The monolith remains as a compatibility/meta package for teams that prefer one dependency.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Should you migrate now?
|
|
28
|
+
|
|
29
|
+
| Situation | Recommendation today |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Existing project that already works on monolith imports | Staying on monolith is valid; no urgent change required. |
|
|
32
|
+
| New project that wants explicit domain-oriented imports | Use `@ananke/*` imports, understanding they are wrappers in Phase 1. |
|
|
33
|
+
| Team expecting immediate tree-shaking/size wins from modular packages | Wait for source-ownership migration milestones before expecting those gains. |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Migration steps you can do today
|
|
38
|
+
|
|
39
|
+
### 1) Install wrapper packages
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Example: combat-oriented app
|
|
43
|
+
npm install @ananke/core @ananke/combat
|
|
44
|
+
|
|
45
|
+
# Example: broader simulation app
|
|
46
|
+
npm install @ananke/core @ananke/combat @ananke/campaign @ananke/content
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
These packages currently peer on `@its-not-rocket-science/ananke`.
|
|
50
|
+
|
|
51
|
+
### 2) Update imports
|
|
52
|
+
|
|
53
|
+
Use modular package names instead of monolith subpaths where practical.
|
|
54
|
+
|
|
55
|
+
| Old import | Current modular import |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `@its-not-rocket-science/ananke` | `@ananke/core` |
|
|
58
|
+
| `@its-not-rocket-science/ananke/combat` | `@ananke/combat` |
|
|
59
|
+
| `@its-not-rocket-science/ananke/anatomy` | `@ananke/combat` |
|
|
60
|
+
| `@its-not-rocket-science/ananke/competence` | `@ananke/combat` |
|
|
61
|
+
| `@its-not-rocket-science/ananke/wasm-kernel` | `@ananke/combat` |
|
|
62
|
+
| `@its-not-rocket-science/ananke/species` | `@ananke/content` |
|
|
63
|
+
| `@its-not-rocket-science/ananke/catalog` | `@ananke/content` |
|
|
64
|
+
| `@its-not-rocket-science/ananke/character` | `@ananke/content` |
|
|
65
|
+
| `@its-not-rocket-science/ananke/crafting` | `@ananke/content` |
|
|
66
|
+
| `@its-not-rocket-science/ananke/campaign` | `@ananke/campaign` |
|
|
67
|
+
| `@its-not-rocket-science/ananke/polity` | `@ananke/campaign` |
|
|
68
|
+
| `@its-not-rocket-science/ananke/social` | `@ananke/campaign` |
|
|
69
|
+
| `@its-not-rocket-science/ananke/narrative` | `@ananke/campaign` |
|
|
70
|
+
| `@its-not-rocket-science/ananke/renown` | `@ananke/campaign` |
|
|
71
|
+
| `@its-not-rocket-science/ananke/kinship` | `@ananke/campaign` |
|
|
72
|
+
| `@its-not-rocket-science/ananke/succession` | `@ananke/campaign` |
|
|
73
|
+
| `@its-not-rocket-science/ananke/diplomacy` | `@ananke/campaign` |
|
|
74
|
+
| `@its-not-rocket-science/ananke/migration` | `@ananke/campaign` |
|
|
75
|
+
| `@its-not-rocket-science/ananke/trade-routes` | `@ananke/campaign` |
|
|
76
|
+
| `@its-not-rocket-science/ananke/military-campaign` | `@ananke/campaign` |
|
|
77
|
+
| `@its-not-rocket-science/ananke/governance` | `@ananke/campaign` |
|
|
78
|
+
|
|
79
|
+
> Note: for APIs not listed above, keep using monolith subpaths until corresponding modular wrapper/package coverage is explicitly documented.
|
|
80
|
+
|
|
81
|
+
### 3) Verify build and tests
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run build
|
|
85
|
+
npm test
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## What this means for adopters today
|
|
91
|
+
|
|
92
|
+
- Treat current migration as an import-surface alignment step.
|
|
93
|
+
- Do not treat it as proof that implementation has already moved out of the monolith.
|
|
94
|
+
- Adopting modular imports now can reduce future churn once target modular ownership lands.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Related docs
|
|
99
|
+
|
|
100
|
+
- [`docs/package-architecture.md`](package-architecture.md)
|
|
101
|
+
- [`docs/module-index.md`](module-index.md)
|
|
102
|
+
- [`STABLE_API.md`](../STABLE_API.md)
|