feat: deliver emergent Jajce commitments

This commit is contained in:
Rijad Zuzo
2026-08-12 21:15:58 +02:00
parent dc0f59fcf0
commit 6b50580598
28 changed files with 2145 additions and 206 deletions
+78 -24
View File
@@ -3,7 +3,7 @@
## Current contract
`SimulationStateRecord` is the versioned JSON boundary for the current
simulation. The current world schema is v14 and captures:
simulation. The current world schema is v15 and captures:
- simulation seed, tick interval, tick count, clock remainder, and elapsed
clock ticks;
@@ -18,19 +18,25 @@ simulation. The current world schema is v14 and captures:
and next routine tick;
- pantry contents, carried NPC inventory, the ordered economic event stream,
and its next stable event ID;
- directed relationship records with familiarity, trust, and the stable event
ID that last changed trust;
- per-NPC known-event records that reference objective event history without
copying it, including first-acquisition method, acquisition tick, and
historical communicator provenance;
- sparse directed relationship records for familiarity, trust, affection,
respect, fear, obligation, and hostility, with the exact causal event for
every non-neutral change;
- player and NPC known-event records that reference objective event history
without copying it, including acquisition source, hop count, confidence,
salience, pin state, acquisition tick, and historical communicator
provenance;
- opportunity records with stable type/status, interested NPC, trigger event,
target storage/resource/amount, exact later resolution event identity, or a
deterministic invalidation reason and close tick;
- world-backed situations, player journal discovery/tracking state, social
commitments, and bounded semantic conversation acts. These records retain
definition IDs and exact causal event references, never rendered dialogue
prose or copied quest progress;
- a player record holding the player-citizen's hunger, energy, health,
downed state, and carried inventory. The player's world position remains
presentation-owned and is intentionally not serialized;
- combatant records (health, weapon, faction, position, hostility) for NPC
defenders and standalone raiders/wolves;
- combatant records (health, weapon, faction, position, hostility, and enemy
definition ID) for NPC defenders and standalone hostile archetypes;
- faction records (food, warriors, aggression, morale, stance, war plan) for
the village and the hill tribe.
@@ -39,7 +45,7 @@ The top-level identity is:
```json
{
"schema": "the_steward.simulation",
"schema_version": 14
"schema_version": 15
}
```
@@ -74,7 +80,9 @@ round-tripping, divergent known-event state, communicated provenance, and
deterministic retention boundaries, and rejection of unsupported schemas.
Active, resolved, and invalidated opportunity round-tripping, contradictory
target state, invalid resource sources, and cross-record event references are
covered too.
covered too. The emergent slice additionally verifies that situation evidence,
journal links, commitment participants/outcomes, and semantic conversation
history survive a save between accepting and completing real work.
NPCStateRecord v2 adds the resolved travel destination and whether it is
active. Nested v1 NPC records migrate explicitly with no invented active
@@ -182,13 +190,11 @@ Communicated and ambiguous legacy facts receive a fresh retention lease at the
saved simulation tick because their exact acquisition time was not previously
stored. The v6 source record supplies the persisted direct-method snapshot.
Importance is intentionally derived rather than duplicated: a fact is
`lasting` while it is the current trust cause for one of that knower's directed
relationships; every other fact is `recent`. Current causal facts are protected
so relationship state remains explainable. Each NPC keeps at most three recent
facts, and recent facts at least one simulated day old are removed at the next
deterministic daily-sized review. The objective event stream is never pruned by
this rule.
Importance combines persisted salience/pinning with current causal use. A fact
is protected while it explains any relationship dimension, an open situation,
journal discovery, or commitment. Unpinned ordinary memories remain bounded and
age through deterministic reviews. The objective event stream is never pruned
by this rule.
SimulationStateRecord v8 adds the top-level `opportunities` array and
`simulation.next_opportunity_id`. The first nested `OpportunityStateRecord`
@@ -255,6 +261,50 @@ records migrate to full health and standing. The player combatant used by the
conflict system is derived state and is never serialized; hostile attacks
reduce the authoritative player health through the ordered event stream.
SimulationStateRecord v15 adds top-level `situations`, `quest_journal`,
`commitments`, and `conversation_history` arrays plus monotonic next-ID counters
for each family. World schemas v1-v14 migrate to empty emergent collections and
zero counters. On manager restore, a compatible legacy pantry opportunity can
be imported once into the new situation system when no situation history is
present; the two records are not independently generated substitutes for world
state.
`SituationStateRecord` stores the definition and dedupe IDs, trigger event,
stable primitive context, selected objective alternative, lifecycle, and exact
resolution event. Live progress remains derived from the definition, ordinary
event store, and current authoritative facts. `QuestJournalEntryStateRecord`
stores discovery, tracking preference, selected alternative, and archive/close
state only; it neither copies objectives nor owns progress. The player therefore
cannot discover a journal entry until knowledge reaches them through an actual
conversation or other ordinary knowledge path.
`CommitmentStateRecord` links one situation to typed debtor and creditor entity
references, semantic terms, a deadline, lifecycle, and exact outcome event.
Acceptance does not reserve stock or prevent other actors from resolving the
situation. A matching outcome performed by the debtor fulfills it; another
actor's outcome supersedes it; a still-achievable missed deadline breaks it at
the due tick. Release remains an explicit social action. Consequence application
is keyed by commitment/outcome identity so replay or restore cannot award it
twice.
`ConversationActStateRecord` stores only a bounded semantic history: stable act
ID, tick, typed speaker/listener references, supported intent ID, and at most
eight topic IDs. Conversation IDs, current turns, option revisions, rendered
templates, balloon state, and prose are transient. Reopening dialogue plans from
current facts plus the retained semantic acts, so wording can evolve without
changing authoritative history.
Nested `KnownEventStateRecord` v4 adds the player as a valid knower/source and
records hop count, confidence, salience, and explicit pinning. Communicated
facts remain exactly one hop from a performed or witnessed source. Nested
`RelationshipStateRecord` v2 adds affection, respect, fear, obligation, and
hostility, makes either player or NPC a valid endpoint, and stores a causal
event ID for all seven dimensions. Nested `AnimalStateRecord` v3 persists an
`animal_definition_id`; older records migrate to the goat definition. Nested
`CombatantStateRecord` v2 persists `enemy_definition_id`; legacy hostile kinds
map to their current raider or wolf definitions, while NPC defenders retain an
empty enemy definition.
Current-schema parsing requires unique animal IDs that do not collide with
resource or storage IDs. An animal reservation must belong to an existing NPC
whose active feed task targets that exact animal. Every `animal_fed` event
@@ -389,13 +439,17 @@ This phase does not yet provide:
- a save-slot menu, metadata, thumbnails, autosaves, or multiple profiles;
- migrations from any historical world schema other than the explicitly
supported v1v10 layouts;
- player inventory or player relationship records;
- broader relationship dimensions, line-of-sight/hearing evidence,
continuous or personalized memory decay, reinforcement, false beliefs, or
multi-hop rumours;
- generalized opportunity/quest definitions, acceptance, rewards, assignment,
dialogue, or player-facing quest-log state;
supported v1-v14 layouts;
- line-of-sight/hearing evidence, personalized confidence decay,
reinforcement, false beliefs, or multi-hop rumours;
- the full regional situation predicate library, regional quest bounds,
contracts beyond the first social commitment consumer, or generated
free-form prose;
- persistence of a currently open dialogue UI/turn. Semantic conversation
history and commitment authority persist, while a balloon is regenerated
after restore;
- chunked regional saves, lazy location loading, or aggregate population
persistence;
- persistence for the player transform or presentation-only scene state.
Those features should build on this boundary rather than inventing parallel