Skip to content

[TS] Preserve callback prefixes when reduce invariants fail - #530

Merged
CaelmBleidd merged 1 commit into
mainfrom
caelmbleidd/stop-rejected-model-invariants
Oct 16, 2026
Merged

CaelmBleidd merged 1 commit into
mainfrom
caelmbleidd/stop-rejected-model-invariants

Conversation

@CaelmBleidd

Copy link
Copy Markdown
Member

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.

@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stop-rejected-model-invariants branch from 0b85838 to fbd802c Compare October 16, 2026 12:58
@CaelmBleidd
CaelmBleidd merged commit 588e261 into main Oct 16, 2026
6 checks passed
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/stop-rejected-model-invariants branch October 16, 2026 12:59
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.

1 participant