Repository navigation
[TS] Preserve callback prefixes when reduce invariants fail - #530
Merged
Merged
Conversation
CaelmBleidd
force-pushed
the
caelmbleidd/stop-rejected-model-invariants
branch
from
October 16, 2026 12:58
0b85838 to
fbd802c
Compare
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.
After a reduce callback structurally changes its receiver, the internal requireDense helper can reject the model invariant. With FRESH fallback the old dispatcher invented a void helper result and continued executing the model on an invalid array shape. The new source regression on unchanged main returns from that invalid execution.
Let model-owned invariant helpers require STOP_PATH on their unsupported domain. Only requireDense opts into that policy, and only when both the source/helper owner and an owning active model match. The existing stopped-prefix callback runs before pruning, retaining mutations that already happened; reduce is neither completed with an invalid result nor restarted and allowed to repeat callback effects. Unrelated same-name declarations retain the globally configured fallback.
Validation: the FRESH-mode mutation regression fails for the intended reason on b29e7d0. With the fix it records exactly one callback return and the mutated receiver length 0 in the feasible stopped prefix, emits PATH_STOPPED, and produces no normal completion. Foreign helper ownership also has a regression. The combined hardening checkout passed 47 focused source-model, Date, callback, helper-owner and stopped-prefix tests and strict usvm-ts detektMain/detektTest. No full suite or native coverage claim is made. The source-model lookup isolation fix is a separate, independent PR.