@its-not-rocket-science/ananke 0.1.0 → 0.1.2
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 +28 -0
- package/README.md +421 -2199
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/scenario.d.ts +37 -0
- package/dist/src/scenario.js +109 -0
- package/dist/src/world-factory.d.ts +33 -0
- package/dist/src/world-factory.js +132 -0
- package/docs/bridge-contract.md +332 -0
- package/docs/emergent-validation-report.md +209 -0
- package/docs/host-contract.md +310 -0
- package/docs/integration-primer.md +315 -0
- package/docs/performance.md +233 -0
- package/docs/project-overview.md +2227 -0
- package/docs/versioning.md +181 -0
- package/package.json +8 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Ananke — Versioning Policy
|
|
2
|
+
|
|
3
|
+
*Platform Hardening PH-2 — Versioning Policy Unification*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Which version do I use?
|
|
8
|
+
|
|
9
|
+
**Short answer: put the semver tag in your `package.json`.**
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{ "dependencies": { "ananke": "^0.1.0" } }
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If you need byte-for-byte replay determinism across patch releases, also record the
|
|
16
|
+
exact commit hash in your project's `UPSTREAM.md`. See [commit-hash pinning](#commit-hash-pinning) below.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Canonical versioning policy
|
|
21
|
+
|
|
22
|
+
Ananke uses **semantic versioning (semver)** as the public contract:
|
|
23
|
+
|
|
24
|
+
| Version change | Meaning |
|
|
25
|
+
|---------------|---------|
|
|
26
|
+
| Patch (`0.1.x`) | Bug fixes, documentation corrections, and internal refactors that do not change observable simulation output |
|
|
27
|
+
| Minor (`0.x.0`) | Additive changes: new exports, new optional fields, new simulation phases. **Tier 1 (Stable) exports are not broken.** Tier 2 (Experimental) exports may change with a `CHANGELOG.md` entry |
|
|
28
|
+
| Major (`x.0.0`) | Breaking changes to Tier 1 exports. A migration guide accompanies every major bump |
|
|
29
|
+
|
|
30
|
+
> **Pre-1.0 note:** The project is currently at `0.1.0`. Tier 1 exports will not break
|
|
31
|
+
> within the `0.x` line without a minor-version bump and a migration guide in `CHANGELOG.md`.
|
|
32
|
+
> The `1.0` release will lock the Tier 1 surface under full semver guarantees.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## API stability tiers
|
|
37
|
+
|
|
38
|
+
Every export in `src/index.ts` is tagged with a stability tier.
|
|
39
|
+
The full tier table is in [`STABLE_API.md`](../STABLE_API.md).
|
|
40
|
+
|
|
41
|
+
| Tier | Label | Guarantee |
|
|
42
|
+
|------|-------|-----------|
|
|
43
|
+
| 1 | **Stable** | No breaking changes without major version bump + migration guide |
|
|
44
|
+
| 2 | **Experimental** | May change between minor versions; `CHANGELOG.md` entry required |
|
|
45
|
+
| 3 | **Internal** | No stability guarantee; may change at any time |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Commit-hash pinning (supplementary)
|
|
50
|
+
|
|
51
|
+
Semver tags are the recommended pinning mechanism for most projects. For hosts that
|
|
52
|
+
require absolute replay determinism across patch releases (e.g. tournament servers, archived
|
|
53
|
+
experiment results), you may also pin to a specific commit hash.
|
|
54
|
+
|
|
55
|
+
### npm / package.json
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"ananke": "github:your-org/ananke#<commit-sha>"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Replace `<commit-sha>` with the full 40-character hash you have validated.
|
|
66
|
+
|
|
67
|
+
### Git submodule
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
git submodule add https://github.com/your-org/ananke.git vendor/ananke
|
|
71
|
+
cd vendor/ananke && git checkout <commit-sha>
|
|
72
|
+
git add vendor/ananke && git commit -m "pin ananke to <commit-sha>"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Why keep the option at all?
|
|
76
|
+
|
|
77
|
+
Semver patch releases may adjust a tuning constant in ways that are technically
|
|
78
|
+
non-breaking (same function signatures, same output format) but shift simulation
|
|
79
|
+
balance. If you run long-lived archived replays that must be reproduced identically
|
|
80
|
+
years later, commit-hash pinning is the stronger guarantee.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## What constitutes a breaking change
|
|
85
|
+
|
|
86
|
+
### Tier 1 — Always breaking (requires major version bump)
|
|
87
|
+
|
|
88
|
+
| Change | Example |
|
|
89
|
+
|--------|---------|
|
|
90
|
+
| Rename or remove a field on `Entity` | `entity.injury` → `entity.wounds` |
|
|
91
|
+
| Rename or remove a field on `WorldState` | `world.entities` array shape change |
|
|
92
|
+
| Change a field's unit or scale | `position_m` stored at a different `SCALE` |
|
|
93
|
+
| Remove or rename a Tier 1 exported function | `stepWorld` signature change |
|
|
94
|
+
| Change the interpretation of a constant | `SCALE.Q` value changed |
|
|
95
|
+
| Change determinism — same seed, different outcome | Any RNG, ordering, or arithmetic change |
|
|
96
|
+
|
|
97
|
+
### Tier 2 — Potentially breaking (noted in CHANGELOG.md, migration hint provided)
|
|
98
|
+
|
|
99
|
+
| Change | Example |
|
|
100
|
+
|--------|---------|
|
|
101
|
+
| Add a required field to `Entity` | New mandatory `age?: AgeState` that existing entity helpers don't initialise |
|
|
102
|
+
| Change a constant value that affects tuning | `SURF_J` adjusted |
|
|
103
|
+
| Add an optional field that changes default behaviour when absent | New optional context field with a non-neutral default |
|
|
104
|
+
| Change snapshot test output | Simulation output shifted for at least one seed |
|
|
105
|
+
|
|
106
|
+
### Tier 3 — Non-breaking (no migration required)
|
|
107
|
+
|
|
108
|
+
- Adding new exported functions or types
|
|
109
|
+
- Adding optional fields to interfaces (with `exactOptionalPropertyTypes`-safe defaults)
|
|
110
|
+
- Adding new built-in archetypes, weapons, or body plans
|
|
111
|
+
- Adding new `tools/` scripts or `docs/` files
|
|
112
|
+
- Improving test coverage without changing logic
|
|
113
|
+
- Fixing bugs where the previous behaviour was demonstrably wrong
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Changelog format
|
|
118
|
+
|
|
119
|
+
Breaking and potentially breaking changes are recorded in `CHANGELOG.md`.
|
|
120
|
+
Each entry follows:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
## <semver-tag> — <YYYY-MM-DD>
|
|
124
|
+
|
|
125
|
+
### Breaking
|
|
126
|
+
- `Entity.someField` renamed to `Entity.newField`.
|
|
127
|
+
Migration: search `.someField` and replace with `.newField`.
|
|
128
|
+
|
|
129
|
+
### Potentially breaking
|
|
130
|
+
- `SURF_J` constant changed from 120 to 110.
|
|
131
|
+
Re-run `npm run validation` to check calibration impact.
|
|
132
|
+
|
|
133
|
+
### Added
|
|
134
|
+
- `src/sim/widget.ts` — Widget System (Phase N).
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Upgrade review cadence
|
|
140
|
+
|
|
141
|
+
When upgrading your pinned semver tag or commit hash:
|
|
142
|
+
|
|
143
|
+
1. **Read the CHANGELOG** — check all entries since your previous version for Tier 1 / Tier 2 items
|
|
144
|
+
2. **Diff the source** — `git diff <old-tag>..<new-tag> -- src/` to see what changed
|
|
145
|
+
3. **Run your integration build** — `npm run build`
|
|
146
|
+
4. **Run the validation suite** — `npm run validation` to confirm calibration scenarios pass
|
|
147
|
+
5. **Run the full test suite** — `npm run test:coverage`
|
|
148
|
+
6. **Update your pin** — commit the new tag/hash to your dependency manifest
|
|
149
|
+
|
|
150
|
+
A quarterly review cadence is a reasonable default for a production project. Determinism
|
|
151
|
+
corrections warrant an out-of-cycle upgrade.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Snapshot tests and determinism
|
|
156
|
+
|
|
157
|
+
`test/snapshots/kernel_behaviour_snapshot.json` is a deterministic regression lock.
|
|
158
|
+
If it changes in an upstream commit, that commit has shifted simulation output for at
|
|
159
|
+
least one entity and seed combination. Treat snapshot changes as **Tier 2** by default;
|
|
160
|
+
verify they are intentional before upgrading.
|
|
161
|
+
|
|
162
|
+
To regenerate your snapshot baseline after a deliberate constant change:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
rm test/snapshots/kernel_behaviour_snapshot.json
|
|
166
|
+
npm run test:coverage
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Internal fork guidance
|
|
172
|
+
|
|
173
|
+
If you need to diverge from upstream (custom damage channels, proprietary AI, non-standard
|
|
174
|
+
body plan hooks):
|
|
175
|
+
|
|
176
|
+
1. Fork at a pinned tag (or commit hash) — do not fork from an untagged tip
|
|
177
|
+
2. Namespace your extensions: prefix custom fields and modules with your project identifier
|
|
178
|
+
(e.g. `entity.myproject_customField`) to avoid conflicts on upstream merges
|
|
179
|
+
3. Keep an `UPSTREAM.md` at your fork root noting your base version and a diff summary
|
|
180
|
+
4. Periodically rebase onto upstream Tier 3 commits to collect non-breaking improvements;
|
|
181
|
+
treat Tier 1/2 commits as explicit migration tasks to schedule
|
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.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deterministic lockstep-friendly SI-units RPG/physics core (fixed-point TS)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist/src",
|
|
17
|
+
"docs/project-overview.md",
|
|
18
|
+
"docs/host-contract.md",
|
|
19
|
+
"docs/integration-primer.md",
|
|
20
|
+
"docs/bridge-contract.md",
|
|
21
|
+
"docs/performance.md",
|
|
22
|
+
"docs/versioning.md",
|
|
23
|
+
"docs/emergent-validation-report.md",
|
|
17
24
|
"CHANGELOG.md",
|
|
18
25
|
"STABLE_API.md"
|
|
19
26
|
],
|