Repository navigation
Show each Chronicle transformation layer as one Active Effect - #316
Draft
keyxmakerx wants to merge 1 commit into
Draft
keyxmakerx wants to merge 1 commit into
keyxmakerx wants to merge 1 commit into
Conversation
A layer the Director puts on a hero in Chronicle (a vampire's bite, rising as a revenant) becomes one effect on the linked actor, named after the layer. A set or add on a mapped system field is an effect change; an object set is one override per member; the rest is listed in the effect's description. Only effects sync made are ever changed or removed, an unchanged layer writes nothing, and fields a layer changes are left out of pushes so the layer never lands in the hero's own fields. The module re-reads on hero_layers.changed and at connect for the heroes the change feed lists. Part of keyxmakerx/Chronicle#2025. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZefPjAyBR36R6s4Ju2m6c
8 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Key Maker · project thread
Fixes: none
Security implication: a read only (
GET /entities/:id/layers) with the existing key. Layers are visible to anyone who can see the page, so no GM-only content goes into the effect. The layer's note is escaped before it goes into the effect description.Consumer-verified: keyxmakerx/Chronicle#2232. It serves
internal/plugins/syncapi/layers_api.goGetEntityLayers(route ininternal/plugins/syncapi/routes.go,layersGroup.GET), publisheshero_layers.changed(internal/app/transformations_adapters.gotransformationsLayersPublisher) and records the feed typehero_layers(internal/plugins/syncapi/sync_change_bus.go). It is verified by this repo's sync bench, run against that branch.Foundry compatibility: written to the v12 to v14 Active Effect shape (
name,img,description,changes,disabled,transfer). Not yet run in a live Foundry; see the live check.Mockup: n/a. The signed mockup
transformations-preview-2025(option A) says "Foundry gets one effect per layer"; this is that.What this changes
When the Director puts a transformation on a hero in Chronicle (a vampire's bite, rising as a revenant), the linked Foundry actor now gets one Active Effect named after it. Taking the layer off in Chronicle removes that effect. The actor's own data is never written, so it ends up exactly as it was, the same rule Chronicle keeps for the hero's own fields.
setoraddon a field whosefoundry_pathis undersystem.becomes an override or an add. Asetof an object (a revenant's immunities) becomes one override per member, and"@level"becomes the hero's level. Anything that can't be an effect is listed in the effect's description: an ancestry (that's an item), or a trait added or set aside.hero_layers.changedmessage arrives.hero_layers, or for every linked hero without the feed."@level"follows the hero.layerflag are ever changed or deleted. An unchanged layer writes nothing. A rewrite keeps the GM's on/off choice.Load-bearing lines
scripts/_layer-effects.mjsplanLayerEffects: duplicates and gone layers are deleted, an unchanged signature is skipped, anddisabledis dropped on a rewrite.scripts/actor-sync.mjs:_syncLayers: 404 or 403addon_disabledmeans off until the next message, kept out of the error log._withoutLayered: in_pushActorUpdateandrepushActor._replanLayers: in_updateActorFromEntity.scripts/api-client.mjs: thehero_layers.allowlist prefix.scripts/adapters/generic-adapter.mjs: exposesfieldDefs.Why
This is part of keyxmakerx/Chronicle#2025, the last item of the signed mockup.
Honest deviations
chr-layer-effectpins this).setoverrides only the members it names. Other immunities the hero has are kept, not cleared.ActiveEffect. The items bench is green after the change.Test plan
node --test tools/test-*.mjs: 1723 tests, 1719 pass, 0 fail (the rest are skips).tools/test-layer-effects.mjsadds 14:addon_disabledstopping readsCHRONICLE_DIR=../Chronicle bench/run.sh actorsagainst Transformations: let Foundry read a hero's layers and hear when they change Chronicle#2232: 13 of 13 pass, including the newchr-layer-effectandchr-layer-offline. The bench is what found the 403addon_disabledanswer.CHRONICLE_DIR=../Chronicle bench/run.sh items: green after the fake's change../tools/check-comment-clutter.sh: OK.Tenet self-check
.ai.md(sync rules and files) andAPI-CONTRACT.md(route, message, what the module does with it).Live check (after this and keyxmakerx/Chronicle#2232 are deployed)
<your Chronicle>/campaigns/<campaign id>/addons/settingsand make sure Transformations is on.Generated by Claude Code