P2E_Buddy System Wireframe (High-Level)

Updated: 2026-03-05 Owner: Zack / Rack

1) Architecture Overview

                 ┌──────────────────────────────────────────────┐
                 │ Discord (PF group)                           │
                 │ - #aoa-chronicles                            │
                 │ - DM (allowlisted users only)                │
                 └──────────────────────┬───────────────────────┘
                                        │ mention / message

                           ┌────────────────────────┐
                           │ OpenClaw Gateway       │
                           │ Discord channel plugin │
                           └────────────┬───────────┘
                                        │ routing binding

                          ┌───────────────────────────┐
                          │ Agent: pathfinder-buddy   │
                          │ Workspace: p2ebuddy       │
                          │ Skill: narrator-guide     │
                          └────────────┬──────────────┘
                                       │ reads

      ┌────────────────────────────────────────────────────────────────────┐
      │ Obsidian Vault (/srv/docs/homelab-vault/pathfinder)                │
      │ - 01_Campaigns/.../Discord/exports/md (timeline, denizens)         │
      │ - 01_Campaigns/.../01_Sessions (CATCH UP, RECAP, session files)    │
      │ - 01_Campaigns/.../02_NPCs                                         │
      │ - 02_Characters                                                    │
      │ - 03_Rules_Quickrefs + PF2e_Core_Search_Index                      │
      │ - 99_P2E_Workshop                                                  │
      └────────────────────────────────────────────────────────────────────┘

2) Ingest + Prep Pipeline (Automated)

Entry point (daily cron):

  • /home/zack/.openclaw/workspace/scripts/discord-export/game_night_refresh.sh

Pipeline steps:

  1. export_and_transform.sh
    • pulls Discord thread exports (timeline + denizens)
    • regenerates markdown artifacts
    • regenerates session files
    • regenerates 01_CATCHUP.md + 00_RECAP.md
  2. sync_npcs.py
    • conservative NPC intake from denizens
    • writes review stubs to 01_Campaigns/Age of Ashes/02_NPCs/20_Inbox_Review
  3. build-index.mjs
    • rebuilds rules search index from books
    • updates 03_Rules_Quickrefs/PF2e_Core_Search_Index.md
  4. Writes readiness report:
    • 99_P2E_Workshop/Game_Night_Readiness.md

Sanity checks included:

  • required config files present
  • timeline/recap outputs not unexpectedly tiny
  • large output regressions flagged
  • remaster source markers present in rules index

3) Query/Response Flow (Runtime)

User mentions @P2E_Buddy
  -> Discord allowlist + channel policy check
  -> routed to agent pathfinder-buddy
  -> narrator skill applies source priority + weighting
  -> agent reads relevant vault docs
  -> concise spoiler-safe answer returned to Discord

Access + Safety Gates

  • Guild policy: allowlist
  • Channel allowlist: only configured PF channel(s)
  • DM policy: allowlist (specific user IDs)
  • Mention required in guild channel
  • Bot ignores non-allowlisted users

Session Model

  • One agent (pathfinder-buddy)
  • Isolated session contexts per Discord conversation scope (channel/thread/DM)

4) Data Priority + Reasoning Policy

Campaign/Narrative priority

  1. aoa-timeline.md
  2. aoa-denizens/*
  3. 03_Rules_Quickrefs/ + PF2e_Core_Search_Index
  4. 02_Characters/
  5. 01_Sessions/ (weighted by in-game relevance)
  6. 01_Campaigns/Age of Ashes/02_NPCs/
  7. 99_P2E_Workshop/

NPC relevance weighting

  • in-game recency (not IRL session date)
  • interaction intensity (fight/interrogation > mention)
  • thread state (unresolved/escaped > closed/dead)

Rules precedence (locked)

  1. Player Core / Player Core 2 / GM Core / Monster Core (remaster-authoritative)
  2. Advanced Player Guide (legacy-secondary unless superseded)

5) Canonical Path Governance

Path indexes enforce write placement:

  • Pathfinder: /srv/docs/homelab-vault/pathfinder/00_Admin/Vault_Path_Index.md
  • Homelab: /srv/docs/homelab-vault/homelab/00_Dashboard/Vault_Path_Index.md
  • Ideas: /srv/docs/homelab-vault/ideas/Vault_Path_Index.md

Rule: Do not create alternate top-level structures when canonical targets already exist.


6) Ops / Usage Impact

Token and cost profile

  • Daily refresh pipeline is mostly local compute (low/no model token usage).
  • Token usage mainly comes from live Discord Q&A interactions.

Logging / observability

  • Cron log: scripts/discord-export/cron.log
  • Refresh run log: scripts/discord-export/logs/game-night-refresh.log
  • Readiness status: 99_P2E_Workshop/Game_Night_Readiness.md

7) Future Enhancements

  1. Safer timeline-based NPC intake (pattern-gated, review-only)
  2. Auto-promote reviewed NPC inbox stubs into tiered folders
  3. Optional fast local-model route for low-risk quick lookups
  4. Add one-page “player quickstart” pinned message template updates