Canonicalize edit operations at ingress - #6
Merged
Conversation
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.
Summary
EditOperationthat validates target and operation combinations at constructionchangeset::wire, then normalize once before executionChangeOpfields private and expose invariant-preserving constructors, accessors, and mutatorsCompatibility
Valid changesets retain the same JSON shape and round-trip field-for-field. Existing empty move-preview placeholders remain accepted and normalize to the canonical move preview representation.
Invalid target/operation or preview-family combinations now fail during ingress normalization instead of later execution. They retain the
invalid_requestclassification, but diagnostic wording may change and no longer includes the later execution-stage operation index.Architecture
EditOperation::try_new->ChangeOp::try_new-> executionchangesetmodel-local algebrachangeset::wirePublic graph
EditOperation,OperationModelError, andFileMoveOperationRefChangeOpfield access removed in favor of invariant-preserving methodsOperationModelErrorintoIdenteditErrorVerification
cargo test --locked --all-targets --quiet(2,009 tests)cargo clippy --locked --all-targets -- -D warningsrustup run 1.88.0 cargo check --locked --all-targetscargo build --locked --releasecargo fmt --all -- --checkgit diff --check main...HEADResidual risk
The compatibility target is exact parity for valid serialized changesets and behavioral parity for invalid requests. Exact error-message parity for invalid payloads is intentionally not preserved because validation now occurs at the canonical ingress boundary.