Skip to content

Add per-NPC event history and injection - #83

Merged
RANGROO merged 3 commits into
unstablefrom
codex/npc-history-event-injection
Aug 11, 2026
Merged

Add per-NPC event history and injection#83
RANGROO merged 3 commits into
unstablefrom
codex/npc-history-event-injection

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What

  • adds exact-NPC recent event history to the Stobe NPC editor
  • keeps History aligned with the Stobe Adventure Log narrative event allow list
  • adds an NPC-scoped event-type filter and recent-events table capped at the latest 100 rows
  • places 📜 History last in the native Stobe editor tab order
  • lets users inject ordinary inputtext events for NPCs outside the current scene
  • supports optional additional NPC recipients and guarded shared-event deletion
  • keeps the existing profile rollback viewer under the clearer Profile Versions label

Why

NPCs need to retain cross-scene handoffs and other roleplay context even when they are not currently together.

Stobe persists event recipients as JSON strings such as Herika|hand_801757824. The initial port only split pipe-delimited routing, so every native Stobe event missed the exact-NPC predicate and History appeared empty. This branch now parses Stobe's native JSON roster, removes runtime handle/status suffixes for exact matching and display, and retains legacy pipe-format compatibility.

Maintainer Discussion

  • I discussed this PR with RANGROO or tyler.maister in Discord.

Related PRs

HerikaServer reference PR: abeiro/HerikaServer#689

Notes

  • No schema migration or new event type. Injected rows use the existing inputtext event/context path.
  • Existing save-load eventlog cleanup rolls these rows back when an older save predates them.
  • History reuses the Adventure Log allow list and respects Stobe's spoken-delivery visibility.
  • Exact JSON/pipe people-token matching avoids partial-name matches and ignores runtime |hand_... and audience-state suffixes.
  • New injected rows use Stobe's native JSON people format.
  • Deleting a shared event removes the single underlying row for every listed recipient.
  • Stobe's native editor does not have a separate Background Life tab, so this preserves its existing tab model and adds History last.

Validation

  • php -l lib/eventlog_helper.php
  • php -l ui/api/stobe_npc_history.php
  • php -l ui/adventurelog.php
  • php -l ui/stobenpcs.php
  • node --check ui/js/npc_event_history.js
  • git diff --check
  • focused helper checks for JSON/pipe recipient parsing, handle/status removal, exact matching, and partial-name rejection
  • STOBE_DB_NAME=stobe_test php tests/ingress_people_regression.php
  • STOBE_DB_NAME=stobe_test php tests/npc_history_snapshot_regression.php
  • prior isolated stobe_test API round trip covered inject/read/filter/delete; this follow-up did not insert or delete a new event, so the JSON write-format change is source-, lint-, and CI-validated
  • live API verification: Herika 100 rows, Plit 42 rows, and Getha 37 rows; Chapin correctly has no matching Adventure Log events
  • browser editor verification: selected History tab rendered 100 rows for Herika with normalized recipient names and no horizontal overflow
  • source inspection confirms the existing snapshot viewer is relabeled Profile Versions
  • GitHub PHP Regression Tests workflow

Local Deployment

  • deployed feature commit b5f62dc to /var/www/html/StobeServer in DwemerAI4Skyrim3
  • preserved logs, sound cache, voices, portraits, item images, database state, profiles, and settings
  • all six changed source files are deployed; the two recipient-matching fix files have matching SHA-256 hashes
  • DB updater completed; Apache is active and the background processor is listening on port 12346
  • deployed health page, NPC editor, and History API returned HTTP 200
  • deployed History tab visually verified at desktop and 390px mobile widths with no horizontal overflow

@RANGROO
RANGROO marked this pull request as ready for review August 11, 2026 01:27
@RANGROO
RANGROO merged commit 4eb8e6b into unstable Aug 11, 2026
1 check passed
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