Skip to content

feat(story-events): chain hidden events with revealed conditions - #102

Open
ackness wants to merge 1 commit into
mainfrom
feat/story-event-chains
Open

ackness wants to merge 1 commit into
mainfrom
feat/story-event-chains

Conversation

@ackness

@ackness ackness commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Let hidden story events build on each other, so world authors can write developments that keep unfolding without any model call. Follows #101.

  • revealed condition leaf. { revealed: <eventId> } holds once that event has fired. Optional turnsSinceGte / turnsSinceLte bound the turns elapsed since it last fired, and not expresses "has not happened yet". It needs no comparison operator. References to unknown event IDs never match and are reported in the cue's diagnostics (IDs only, never payloads).
  • Schema. story.events@1 accepts the new leaf; a leaf references exactly one of dimension, time, or revealed.
  • Bundled worlds. Each world gains one follow-up event built on its first hidden events:
    • Mistport: if the hero did not side with Iron Meg, the Salt Fangs come to collect three turns after her offer.
    • Lantern Barrow: two turns after the singing reaches the village, Keeper Ysolde's voice is heard holding the choir back (zh/en).
    • Haruka Academy: after the stage preview, Kaho finishes the last verse and asks the hero to name the song.
    • Emberback: one turn after the second echo, the Mile Seventeen repeater starts transmitting the 06:14 call live when the convoy reaches the arch.

Type of change

  • New feature (feat)
  • Bug fix (fix)
  • Refactor (refactor)
  • Documentation (docs)
  • Infra / CI (chore)
  • Performance (perf)
  • Breaking change (BREAKING CHANGE)

Verification

  • pnpm lint, pnpm check:plugins, pnpm release:preflight, pnpm validate:plugin plugins/story-events, prettier and oxlint on changed files.
  • story-events tests: 16 passed, including the revealed leaf, turns-since bounds, unknown references, and a two-step chain that only unlocks after its predecessor and the delay.
  • Server tests for hidden import, the world-data loader, and the hidden-event end-to-end flow: 68 passed.
  • All 21 bundled events (zh and en files) validate against story.events@1, reference only existing dimensions and events, stay unmet at the initial state, and are met once their conditions (including predecessor reveals) are applied.
  • Not run: real-model play reaching a chained event.

Related issue / context

Docs sync

  • plugins/story-events/README.md, docs/reference/world-data.md (bundled worlds), and the create-world skill.

Conditions gain a `revealed` leaf that holds once another event has
fired, optionally bounded by `turnsSinceGte` / `turnsSinceLte`. Combined
with `not`, authors can write multi-step developments ("three turns
after Meg's offer, if the hero sided against her, the Salt Fangs come to
collect") without any model call. References to unknown event IDs never
match and are reported as diagnostics.

Each bundled world gains one follow-up event built on its first hidden
events.

Refs #97

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant