@its-not-rocket-science/ananke 0.1.69 → 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 +254 -0
- package/README.md +150 -432
- 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
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { WORLD_EVOLUTION_BACKEND_SCHEMA_VERSION, type WorldEvolutionDelta, type WorldEvolutionMetrics, type WorldEvolutionRulesetId, type WorldEvolutionRulesetProfile, type WorldEvolutionRunResult, type WorldEvolutionSnapshot } from "./world-evolution-backend/index.js";
|
|
2
|
+
export declare const WORLD_EVOLUTION_ORCHESTRATION_SCHEMA_VERSION: "ananke.world-evolution-orchestration.v1";
|
|
3
|
+
export declare const WORLD_EVOLUTION_ENGINE_VERSION = "0.5.1";
|
|
4
|
+
export declare const WORLD_EVOLUTION_CHECKPOINT_SCHEMA_VERSION: "ananke.world-evolution-checkpoint.v1";
|
|
5
|
+
export type EvolutionRuleset = WorldEvolutionRulesetProfile;
|
|
6
|
+
export interface EvolutionSessionConfig {
|
|
7
|
+
seed: number;
|
|
8
|
+
canonicalSnapshot: WorldEvolutionSnapshot;
|
|
9
|
+
rulesetId?: WorldEvolutionRulesetId;
|
|
10
|
+
ruleset?: EvolutionRuleset;
|
|
11
|
+
checkpointInterval?: number;
|
|
12
|
+
includeDeltas?: boolean;
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface EvolutionRequest {
|
|
16
|
+
steps: number;
|
|
17
|
+
checkpointInterval?: number;
|
|
18
|
+
includeDeltas?: boolean;
|
|
19
|
+
includeCheckpointDiffs?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface EvolutionTimelineEvent {
|
|
22
|
+
step: number;
|
|
23
|
+
tick: number;
|
|
24
|
+
kind: "evolution.step";
|
|
25
|
+
summary: string;
|
|
26
|
+
tradeCount: number;
|
|
27
|
+
warCount: number;
|
|
28
|
+
migrationCount: number;
|
|
29
|
+
climateEventCount: number;
|
|
30
|
+
epidemicPopulationDelta: number;
|
|
31
|
+
metrics: WorldEvolutionMetrics;
|
|
32
|
+
}
|
|
33
|
+
export interface EvolutionCheckpoint {
|
|
34
|
+
step: number;
|
|
35
|
+
tick: number;
|
|
36
|
+
summary: string;
|
|
37
|
+
snapshot: WorldEvolutionSnapshot;
|
|
38
|
+
metadata: EvolutionCheckpointMetadata;
|
|
39
|
+
}
|
|
40
|
+
export interface EvolutionCheckpointMetadata {
|
|
41
|
+
engineVersion: string;
|
|
42
|
+
seed: number;
|
|
43
|
+
rulesetProfile: EvolutionRuleset;
|
|
44
|
+
step: number;
|
|
45
|
+
schemaVersion: typeof WORLD_EVOLUTION_BACKEND_SCHEMA_VERSION;
|
|
46
|
+
}
|
|
47
|
+
export interface EvolutionCheckpointDiff {
|
|
48
|
+
fromStep: number;
|
|
49
|
+
toStep: number;
|
|
50
|
+
fromTick: number;
|
|
51
|
+
toTick: number;
|
|
52
|
+
fromSnapshotHash: string;
|
|
53
|
+
toSnapshotHash: string;
|
|
54
|
+
worldChanges: Record<string, unknown>;
|
|
55
|
+
polityDeltas: Array<{
|
|
56
|
+
polityId: string;
|
|
57
|
+
populationDelta: number;
|
|
58
|
+
treasuryDelta_cu: number;
|
|
59
|
+
stabilityDelta_Q: number;
|
|
60
|
+
moraleDelta_Q: number;
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
export interface SerializedEvolutionCheckpoint {
|
|
64
|
+
schemaVersion: typeof WORLD_EVOLUTION_CHECKPOINT_SCHEMA_VERSION;
|
|
65
|
+
checkpoint: EvolutionCheckpoint;
|
|
66
|
+
}
|
|
67
|
+
export interface EvolutionRunResult {
|
|
68
|
+
schemaVersion: typeof WORLD_EVOLUTION_ORCHESTRATION_SCHEMA_VERSION;
|
|
69
|
+
engineVersion: string;
|
|
70
|
+
sessionId: string;
|
|
71
|
+
request: EvolutionRequest;
|
|
72
|
+
ruleset: EvolutionRuleset;
|
|
73
|
+
initialSnapshot: WorldEvolutionSnapshot;
|
|
74
|
+
finalSnapshot: WorldEvolutionSnapshot;
|
|
75
|
+
timeline: EvolutionTimelineEvent[];
|
|
76
|
+
metrics: WorldEvolutionMetrics;
|
|
77
|
+
checkpoints?: EvolutionCheckpoint[];
|
|
78
|
+
checkpointDiffs?: EvolutionCheckpointDiff[];
|
|
79
|
+
deltas?: WorldEvolutionDelta[];
|
|
80
|
+
}
|
|
81
|
+
export interface EvolutionSessionSummary {
|
|
82
|
+
schemaVersion: typeof WORLD_EVOLUTION_ORCHESTRATION_SCHEMA_VERSION;
|
|
83
|
+
sessionId: string;
|
|
84
|
+
label?: string;
|
|
85
|
+
engineVersion: string;
|
|
86
|
+
seed: number;
|
|
87
|
+
totalSteps: number;
|
|
88
|
+
ruleset: EvolutionRuleset;
|
|
89
|
+
initialSnapshot: WorldEvolutionSnapshot;
|
|
90
|
+
currentSnapshot: WorldEvolutionSnapshot;
|
|
91
|
+
metrics: WorldEvolutionMetrics;
|
|
92
|
+
timelineEvents: number;
|
|
93
|
+
checkpointCount: number;
|
|
94
|
+
}
|
|
95
|
+
export interface EvolutionSession {
|
|
96
|
+
readonly sessionId: string;
|
|
97
|
+
readonly schemaVersion: typeof WORLD_EVOLUTION_ORCHESTRATION_SCHEMA_VERSION;
|
|
98
|
+
readonly engineVersion: string;
|
|
99
|
+
readonly seed: number;
|
|
100
|
+
readonly label?: string;
|
|
101
|
+
readonly ruleset: EvolutionRuleset;
|
|
102
|
+
readonly canonicalInitialSnapshot: WorldEvolutionSnapshot;
|
|
103
|
+
readonly state: {
|
|
104
|
+
totalSteps: number;
|
|
105
|
+
currentSnapshot: WorldEvolutionSnapshot;
|
|
106
|
+
timeline: EvolutionTimelineEvent[];
|
|
107
|
+
checkpoints: EvolutionCheckpoint[];
|
|
108
|
+
lastMetrics: WorldEvolutionMetrics;
|
|
109
|
+
defaultCheckpointInterval?: number;
|
|
110
|
+
defaultIncludeDeltas: boolean;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export interface ResumeEvolutionOptions {
|
|
114
|
+
label?: string;
|
|
115
|
+
checkpointInterval?: number;
|
|
116
|
+
includeDeltas?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface EvolutionBranchMetadata {
|
|
119
|
+
name: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
seed: number;
|
|
122
|
+
rulesetProfile: EvolutionRuleset;
|
|
123
|
+
createdAtStep: number;
|
|
124
|
+
parentBranchId?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface EvolutionBranchSnapshotRef {
|
|
127
|
+
snapshot: WorldEvolutionSnapshot;
|
|
128
|
+
step: number;
|
|
129
|
+
tick: number;
|
|
130
|
+
snapshotHash: string;
|
|
131
|
+
}
|
|
132
|
+
export interface EvolutionBranchDerivedState {
|
|
133
|
+
totalSteps: number;
|
|
134
|
+
currentSnapshot: WorldEvolutionSnapshot;
|
|
135
|
+
timeline: EvolutionTimelineEvent[];
|
|
136
|
+
lastMetrics: WorldEvolutionMetrics;
|
|
137
|
+
}
|
|
138
|
+
export interface EvolutionBranch {
|
|
139
|
+
branchId: string;
|
|
140
|
+
schemaVersion: typeof WORLD_EVOLUTION_ORCHESTRATION_SCHEMA_VERSION;
|
|
141
|
+
baseSnapshotRef: EvolutionBranchSnapshotRef;
|
|
142
|
+
derivedState: EvolutionBranchDerivedState;
|
|
143
|
+
branchMetadata: EvolutionBranchMetadata;
|
|
144
|
+
}
|
|
145
|
+
export interface CreateEvolutionBranchInput {
|
|
146
|
+
baseSnapshot: WorldEvolutionSnapshot;
|
|
147
|
+
metadata: {
|
|
148
|
+
name: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
seed: number;
|
|
151
|
+
rulesetProfile?: EvolutionRuleset;
|
|
152
|
+
rulesetId?: WorldEvolutionRulesetId;
|
|
153
|
+
createdAtStep?: number;
|
|
154
|
+
parentBranchId?: string;
|
|
155
|
+
};
|
|
156
|
+
baseStep?: number;
|
|
157
|
+
}
|
|
158
|
+
export interface ForkEvolutionBranchInput {
|
|
159
|
+
metadata: {
|
|
160
|
+
name: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
seed?: number;
|
|
163
|
+
rulesetProfile?: EvolutionRuleset;
|
|
164
|
+
rulesetId?: WorldEvolutionRulesetId;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export interface EvolutionBranchDiff {
|
|
168
|
+
branchId: string;
|
|
169
|
+
baseSnapshotRef: Pick<EvolutionBranchSnapshotRef, "step" | "tick" | "snapshotHash">;
|
|
170
|
+
branchStep: number;
|
|
171
|
+
branchTick: number;
|
|
172
|
+
branchSnapshotHash: string;
|
|
173
|
+
worldChanges: Record<string, unknown>;
|
|
174
|
+
polityDeltas: Array<{
|
|
175
|
+
polityId: string;
|
|
176
|
+
populationDelta: number;
|
|
177
|
+
treasuryDelta_cu: number;
|
|
178
|
+
stabilityDelta_Q: number;
|
|
179
|
+
moraleDelta_Q: number;
|
|
180
|
+
}>;
|
|
181
|
+
}
|
|
182
|
+
export declare function createEvolutionSession(config: EvolutionSessionConfig): EvolutionSession;
|
|
183
|
+
export declare function runEvolution(session: EvolutionSession, request: EvolutionRequest): EvolutionRunResult;
|
|
184
|
+
export declare function stepEvolution(session: EvolutionSession, request?: Omit<EvolutionRequest, "steps"> & {
|
|
185
|
+
steps?: number;
|
|
186
|
+
}): EvolutionRunResult;
|
|
187
|
+
export declare function getEvolutionSummary(session: EvolutionSession): EvolutionSessionSummary;
|
|
188
|
+
export declare function resumeEvolutionSessionFromCheckpoint(checkpoint: EvolutionCheckpoint, options?: ResumeEvolutionOptions): EvolutionSession;
|
|
189
|
+
export declare function createEvolutionBranch(input: CreateEvolutionBranchInput): EvolutionBranch;
|
|
190
|
+
export declare function forkEvolutionBranch(branch: EvolutionBranch, input: ForkEvolutionBranchInput): EvolutionBranch;
|
|
191
|
+
export declare function runEvolutionOnBranch(branch: EvolutionBranch, request: EvolutionRequest): EvolutionRunResult;
|
|
192
|
+
export declare function diffBranchAgainstBase(branch: EvolutionBranch): EvolutionBranchDiff;
|
|
193
|
+
export declare function serializeEvolutionResult(result: EvolutionRunResult): string;
|
|
194
|
+
export declare function deserializeEvolutionResult(json: string): EvolutionRunResult;
|
|
195
|
+
export declare function serializeEvolutionCheckpoint(checkpoint: EvolutionCheckpoint): string;
|
|
196
|
+
export declare function deserializeEvolutionCheckpoint(json: string): EvolutionCheckpoint;
|
|
197
|
+
export declare function serializeEvolutionIntermediateState(session: EvolutionSession): string;
|
|
198
|
+
export declare function serializeEvolutionFinalState(result: Pick<EvolutionRunResult, "finalSnapshot" | "sessionId" | "engineVersion" | "ruleset">): string;
|
|
199
|
+
export declare function buildEvolutionCheckpointDiffs(checkpoints: readonly EvolutionCheckpoint[]): EvolutionCheckpointDiff[];
|
|
200
|
+
export type { WorldEvolutionSnapshot, WorldEvolutionMetrics, WorldEvolutionDelta, WorldEvolutionRulesetId, };
|
|
201
|
+
export type { WorldEvolutionRunResult as EvolutionBackendRunResult };
|