Type an emitting rule's binding from its status equations - #94
Merged
Conversation
Cross-module witnessing credits a transition when an importer's rule handles an imported event and moves the imported entity. That relies on the emitted event carrying its payload entity type across the boundary. The producer-side collector typed the emitting rule's binding only from a transition trigger or a surface parameter, so a rule whose binding is typed only by a status equation (requires/ensures binding.status = value) contributed no payload type. The importer's witness was then not credited, and a lifecycle whose exit spans the two modules was falsely reported as a deadlock, status.noExit or status.unreachableValue. Enrich the emitting rule's binding types with status-equation inference, using the same case-insensitive and unique-target fallbacks the consumer-side resolvers already apply (resolve_binding_entity_from_status). Multi-file only; single-file analysis is unchanged, and genuine dead ends are still reported. Covered by a new witness_matrix scenario (emission_status_typed) that fails without this change (SPLIT != SINGLE) and passes with it. Spec updated.
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.
Why
When a system is split into one spec per service, the checker reads them together and one service's rule can move something another service defined. For that to be recognised, the event carrying the item across has to know its type. If the sending rule only knew the item's type from a status check, that type was lost at the boundary, and the receiving service's step was not counted. The lifecycle then looked stuck, so the checker wrongly warned of a dead end.
What I did
The sending rule now works out the item's type from its status checks too, the same way the rest of the checker already does. So the event carries the type across, the receiving step counts, and a lifecycle that spans two specs is no longer flagged as stuck. Checking a single spec is unchanged, and real dead ends are still caught.
Covered by a new test that fails without the change and passes with it.