Skip to content

Copy the Draw Steel negotiation tracker onto Foundry NPC sheets - #159

Merged
keyxmakerx merged 3 commits into
mainfrom
claude/project-thread-mu3i3i
Oct 4, 2026
Merged

keyxmakerx merged 3 commits into
mainfrom
claude/project-thread-mu3i3i

Conversation

@keyxmakerx

Copy link
Copy Markdown
Owner

Fixes: none
Security implication: The module reads the tracker's GM half only with the Owner sync key, and only the active GM's client acts on it. Nothing is shown to players.
Consumer-verified: Chronicle internal/plugins/syncapi/system_state_api.go (sync GET, gm only for Owner-level keys) and internal/app/system_state_adapters.go (system_state.updated payload {systemId,key}, requiresDm). Both are in keyxmakerx/Chronicle#1051, which has to merge first.
Foundry compatibility: Not verified live. It uses game.users.activeGM, as the spotlight relay in #149 does.
Mockup: Sign-offs card diff-npc-negotiation-panel (the Chronicle panel). There are no new on-screen parts in Foundry. The values land in the Draw Steel system's own negotiation fields.

What this changes

When the negotiation tracker changes on a Chronicle NPC page, the GM's Foundry client copies interest, patience, motivations, pitfalls and impression onto that NPC's actor. This only happens on Draw Steel worlds. The NPC sheet therefore matches the Chronicle tracker without the GM entering everything twice.

The copy goes one way only. Edits made on the Foundry sheet are not sent back to Chronicle.

How

  • Which actors get updated:
    • Actors linked to the page (by dropping its journal on a token) win.
    • Otherwise, exactly one unlinked NPC whose name matches the page.
    • Heroes are never touched.
  • What gets written:
    • Chronicle's higher-authority becomes the system's authority.
    • Unknown keys are dropped.
    • Points are clamped to 0..5.
    • Only changed fields are written.
  • When it runs: Linking a page by drop runs the copy once. An older Chronicle (404) is ignored quietly.
  • Allowlist: adds system_state. to the WebSocket allowlist.
  • Code:
    • The pure rules are in scripts/_negotiation-mirror.mjs.
    • The glue is in scripts/negotiation-mirror.mjs.
    • npc-presence.mjs exports syncedPages and onNpcLinked.

Test plan

  • node --test tools/test-*.mjs: 1286 tests, 1285 pass, 1 skipped, 0 fail. The new tools/test-negotiation-mirror.mjs is included.
  • node tools/check-package-descriptor.mjs OK. The error-catalog check matches.
  • Manual check in a Draw Steel world. Live-check rows have been added to TESTING.md under "NPC Tokens".
  • CI passes

Tenet self-check

  • T-B1: GM half read with the Owner key only, active GM only, no player-visible output
  • T-B2: changes stay within the module
  • T-B3: no new UI
  • T-B4: API-CONTRACT, .ai.md, CLAUDE.md and TESTING.md updated

Merge order: keyxmakerx/Chronicle#1051, then keyxmakerx/Chronicle-Draw-Steel#74, then this one. The feature needs a module release.


Generated by Claude Code

claude added 2 commits October 3, 2026 22:51
Chronicle announces `system_state.updated` when the negotiation tracker
changes. On Draw Steel worlds the active GM's client reads the page's
state and writes interest, patience, motivations, pitfalls and impression
onto the linked NPC actors, and once more when a page is linked by
dropping its journal on a token. One way only: sheet edits don't go back.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2N6zhGuT2DHzVoiFUMwv1
@keyxmakerx
keyxmakerx marked this pull request as ready for review October 3, 2026 23:53
@keyxmakerx
keyxmakerx merged commit f3dccb5 into main Oct 4, 2026
3 checks passed
@keyxmakerx
keyxmakerx deleted the claude/project-thread-mu3i3i branch October 4, 2026 03:21
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.

2 participants