@its-not-rocket-science/ananke 0.1.51 → 0.1.53

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.
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://its-not-rocket-science.github.io/ananke/schema/replay.schema.json",
4
+ "title": "Replay",
5
+ "description": "Ananke deterministic replay — an initial WorldState plus a sequence of command frames. Replaying all frames against the initial state must reproduce the exact final state (same tick, same entity conditions, same RNG sequence).",
6
+ "type": "object",
7
+ "required": ["initialState", "frames"],
8
+ "properties": {
9
+ "_ananke_version": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$",
12
+ "description": "Schema version stamped by stampSnapshot()."
13
+ },
14
+ "_schema": {
15
+ "type": "string",
16
+ "const": "replay",
17
+ "description": "Schema discrimination tag — always \"replay\" for Replay snapshots."
18
+ },
19
+ "initialState": {
20
+ "$ref": "world.schema.json",
21
+ "description": "The WorldState at tick 0 (or whatever tick the recording began). Must itself be a valid world snapshot."
22
+ },
23
+ "frames": {
24
+ "type": "array",
25
+ "items": { "$ref": "#/$defs/ReplayFrame" },
26
+ "description": "Ordered sequence of command frames. Frame indices correspond to ticks relative to initialState.tick."
27
+ }
28
+ },
29
+ "unevaluatedProperties": true,
30
+ "$defs": {
31
+ "ReplayFrame": {
32
+ "title": "ReplayFrame",
33
+ "type": "object",
34
+ "required": ["tick", "commands"],
35
+ "properties": {
36
+ "tick": {
37
+ "type": "integer",
38
+ "minimum": 0,
39
+ "description": "Absolute simulation tick this frame was recorded at."
40
+ },
41
+ "commands": {
42
+ "type": "array",
43
+ "items": { "$ref": "#/$defs/Command" },
44
+ "description": "Commands dispatched during this tick. May be empty."
45
+ }
46
+ }
47
+ },
48
+ "Command": {
49
+ "title": "Command",
50
+ "description": "A single world-mutating command dispatched to stepWorld(). Commands are discriminated by their `kind` field.",
51
+ "type": "object",
52
+ "required": ["kind"],
53
+ "properties": {
54
+ "kind": {
55
+ "type": "string",
56
+ "description": "Command type identifier, e.g. \"attack\", \"move\", \"grapple\"."
57
+ },
58
+ "entityId": {
59
+ "type": "integer",
60
+ "description": "Issuing entity id (where applicable)."
61
+ },
62
+ "targetId": {
63
+ "type": "integer",
64
+ "description": "Target entity id (where applicable)."
65
+ }
66
+ },
67
+ "unevaluatedProperties": true
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://its-not-rocket-science.github.io/ananke/schema/world.schema.json",
4
+ "title": "WorldState",
5
+ "description": "Ananke world snapshot — the complete state required to resume or replay a simulation. See docs/wire-protocol.md for serialisation rules.",
6
+ "type": "object",
7
+ "required": ["tick", "seed", "entities"],
8
+ "properties": {
9
+ "_ananke_version": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$",
12
+ "description": "Schema version stamped by stampSnapshot(), e.g. \"0.1\". Absent on legacy saves."
13
+ },
14
+ "_schema": {
15
+ "type": "string",
16
+ "const": "world",
17
+ "description": "Schema discrimination tag — always \"world\" for WorldState snapshots."
18
+ },
19
+ "tick": {
20
+ "type": "integer",
21
+ "minimum": 0,
22
+ "description": "@core — Current simulation tick. Incremented by stepWorld() each call."
23
+ },
24
+ "seed": {
25
+ "type": "integer",
26
+ "description": "@core — Deterministic RNG seed. Same seed + same commands → identical output."
27
+ },
28
+ "entities": {
29
+ "type": "array",
30
+ "items": { "$ref": "#/$defs/EntityCore" },
31
+ "description": "@core — All live and dead entities."
32
+ },
33
+ "activeFieldEffects": {
34
+ "type": "array",
35
+ "items": { "type": "object" },
36
+ "description": "@subsystem(capability) — Active suppression zones and field-effect modifiers."
37
+ },
38
+ "__sensoryEnv": {
39
+ "type": "object",
40
+ "description": "@subsystem(sensory) — Ambient lighting and visibility environment."
41
+ },
42
+ "__factionRegistry": {
43
+ "type": "object",
44
+ "description": "@subsystem(faction) — Global faction standing registry."
45
+ },
46
+ "__partyRegistry": {
47
+ "type": "object",
48
+ "description": "@subsystem(party) — Global party registry for morale and formation bonuses."
49
+ },
50
+ "__relationshipGraph": {
51
+ "type": "object",
52
+ "description": "@subsystem(relationships) — Inter-entity relationship graph."
53
+ },
54
+ "__nutritionAccum": {
55
+ "type": "number",
56
+ "description": "@subsystem(nutrition) — Cross-tick nutrition accumulator (scalar)."
57
+ }
58
+ },
59
+ "unevaluatedProperties": true,
60
+ "$defs": {
61
+ "EntityCore": {
62
+ "title": "Entity (@core fields)",
63
+ "description": "Core entity fields required by stepWorld() every tick. Subsystem and host-extension fields are permitted but not listed here — see src/sim/entity.ts.",
64
+ "type": "object",
65
+ "required": ["id", "teamId", "attributes", "energy", "loadout", "traits"],
66
+ "properties": {
67
+ "id": {
68
+ "type": "integer",
69
+ "minimum": 0,
70
+ "description": "Unique entity identifier (positive I32)."
71
+ },
72
+ "teamId": {
73
+ "type": "integer",
74
+ "description": "Team allegiance. Entities on the same teamId do not auto-target each other."
75
+ },
76
+ "attributes": {
77
+ "type": "object",
78
+ "description": "IndividualAttributes — physical and cognitive stats. All Q values are fixed-point integers scaled by SCALE.Q = 10 000."
79
+ },
80
+ "energy": {
81
+ "type": "object",
82
+ "description": "EnergyState — current stamina and metabolic state."
83
+ },
84
+ "loadout": {
85
+ "type": "object",
86
+ "description": "Loadout — equipped weapons and armour."
87
+ },
88
+ "traits": {
89
+ "type": "array",
90
+ "items": { "type": "string" },
91
+ "description": "Trait string identifiers, e.g. [\"leader\", \"berserker\"]."
92
+ },
93
+ "condition": {
94
+ "type": "object",
95
+ "description": "@subsystem(condition) — fear, morale, consciousness, surrender state."
96
+ },
97
+ "injury": {
98
+ "type": "object",
99
+ "description": "@subsystem(injury) — per-region damage fractions (all Q values)."
100
+ }
101
+ },
102
+ "unevaluatedProperties": true
103
+ }
104
+ }
105
+ }