Added per operation cue changes mechanism. - #68
Merged
Merged
Conversation
Cues and the modifier-success check read a change set scoped to the operation, so nested effects, rebuilds after a set change and outer pending deltas no longer leak into each other.
AttributeValueChange and RequireModifierSuccessToTriggerCue now judge the effect's own operation only.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Cue magnitudes can still leak across callbacks, and removed or replaced attributes lose their recorded deltas.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Adds per-operation attribute change tracking so cues only observe changes from their originating effect operation.
Changes:
- Introduces pooled
AttributeChangeSetscopes. - Integrates change sets into effect application, execution, rebuilding, and cue evaluation.
- Adds reentrancy tests and updates cue documentation.
| File | Description |
|---|---|
Forge/Effects/EffectsManager.cs |
Tracks changes during application and rebuilding. |
Forge/Effects/Effect.cs |
Tracks execution-specific changes. |
Forge/Effects/ActiveEffect.cs |
Tracks reapplication and stacking changes. |
Forge/Cues/CuesManager.cs |
Evaluates cues from operation change sets. |
Forge/Core/EntityAttributes.cs |
Manages change scopes and pooling. |
Forge/Attributes/EntityAttribute.cs |
Records value deltas in its container. |
Forge/Attributes/AttributeChangeSet.cs |
Implements operation-level delta storage. |
Forge.Tests/Cues/CueMagnitudeReentrancyTests.cs |
Tests nested operations and rebuild behavior. |
docs/effects/README.md |
Clarifies modifier-success semantics. |
docs/cues.md |
Documents operation-specific cue magnitudes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
All cue magnitudes are read once, right after the operation writes, and dispatched after its hooks; deltas are looked up by attribute key so a departed or swapped attribute keeps its change.
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.


Ensure cues tally attribute changes per individual operation so effects, rebuilds after a set change, and outer pending deltas don't leak into each other- modifier-success check so AttributeChange and RequireModifierSuccessToTriggerCue judge only the effect's own operation.