Repository navigation
fix: reject structurally invalid phrase directions - #1206
Merged
Merged
Conversation
…clared ends Signed-off-by: Virtue039 <virtue039@qq.com>
WaylandYang
approved these changes
Oct 12, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you for tracking this down to the exact gap: a candidate admitted in either orientation, then bound in the one that does not fit.
The check is in the right place, and sending an invalid direction to undecided with both votes kept is the conservative outcome; nothing is flipped on the model's behalf. I ran the alignment tests on a fresh database: 30 pass on the branch, and the three new regressions fail against dev's production code, as described. The person-decided case passes on both, which is what it should do.
Merging. Thanks again for the careful work.
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.
Two agreeing model votes could bind a direction that does not fit the selected property's declared ends. For a Person → Project property, the observed “林岚不再负责甲项目” replies selected
reverse / end, producing a Project → Person typed row. Candidate admission checked whether either orientation fit, but did not validate the orientation the model actually chose.Validate each vote's selected direction against the existing class hierarchy and entity/literal shape before committing a binding. Invalid directions become
undecidedwith both raw votes and aninvalid_directionreason retained; they create no typed row or implication question. The answer is not silently flipped or converted to semanticnone.Existing invalid agent bindings are redecided even when their fingerprint is current, including caches awaiting only a marks question. If the model fails or returns unreadable output, the invalid cached decision becomes undecided and its unsupported projection is retired. Human decisions, including decisions made while a request is in flight, retain their existing precedence. This uses the existing alignment snapshot contract; it adds no schema, public API, migration, or prompt change and is independent of #1203.
Validation:
status=undecided, and the human control was unchanged. This is recorded-vote replay, with zero new real-model calls; the original databases and original acceptance failures are preserved.Old bindings are repaired on their next normal alignment run. This enforces structural validity; when both orientations fit, semantic direction still depends on model or human judgment. The recorded case does not become a correct forward answer, and negative-case support remains outside this PR.