Repository navigation
fix(irverify): tighten naming rules and quote messages - #740
Open
fuad-daoud wants to merge 4 commits into
Open
fuad-daoud wants to merge 4 commits into
fuad-daoud wants to merge 4 commits into
Conversation
- #398: a new walk check rejects an alias that two type-registry Namings both claim. It is reported at the later alias, as ir/naming-alias-shared, and is scoped to TypeCommon.Name: an alias is a schema-resolution name and a source that writes one scopes it to its own record, so a document-wide compare would false-positive on two models stating the same short alias. - #399: the per-list alias switch becomes appendListViolations, and a TypeCommon or Service Namespace is held to its blank and repeat rules, reported as ir/namespace-blank and ir/namespace-duplicate. The verdicts for Tags, Scopes, content types, Server Enum, versions and FieldPath are recorded in the helper's doc comment rather than implemented. - #400 (message half): every document-derived fragment in a Violation.Message is quoted with strconv.Quote, so no message carries raw bytes. Violation.Path is out of scope. Closes #398, #399 Refs #400
Resolve the conflicts with main, keeping the generalized list rules and main's condensed wording, and bring the doc comments this branch adds under the 100-word cap main now enforces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCzyGPq9DQ7RLfagZm2JB5
Plans and agent working notes are not part of the repository; what a reviewer needs is in the PR body, the commits and the linked issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Batch PR A of two (B is #737). Three
irverifychanges:checkAliasClaims: two type-registry Namings claiming one alias (or aSourcean alias already claimed) now reportir/naming-alias-shared, at the later alias, naming the first claimant. Scoped toTypeCommon.Name: an Avro field alias is scoped to its own record, so a document-wide compare would false-positive;Canonical/Hintnever claim, andSource-vs-Sourcestays silent.appendAliasViolations' switch becomesappendListViolations; aTypeCommonorServiceNamespaceis held to blank and repeat (ir/namespace-blank,ir/namespace-duplicate). The helper's doc comment records one verdict per remaining[]stringfield: Tags/Scopes are the compiler's to deduplicate and diagnose (openapi: repeated tags and scopes pass into the IR undeduplicated #738), content types/encodings are undecided, ServerEnumtakes no blank rule,Versions/Added/Removedmay legally repeat,FieldPathis a path.Violation.Messageisstrconv.Quoted, so no message can carry ill-formed bytes; messages that decline to quote (ir/invalid-utf8, the alias blank/ill-formed arms,ir/namespace-blank) do so because their complaint is not the spelling.Violation.Pathis unchanged and split out to ir: Violation.Path carries raw bytes for an ill-formed ID or map key #739.Test plan
go test ./ir/irverify -run 'Alias|Namespace|WalkChecks' -count=1— the flipped shared-alias boundary, the namespace rules on both owners, the path-spelling pins.go test ./ir/irverify -count=1andgo test ./ir/irverify -run TestVerify_Corpus -count=1— clean.go test ./compilers/openapi -run TestConformance -count=1— no golden change.go run ./cmd/morphic-harness testdata— same as base (102 ok, 40 error-diagnostic, none of which reachirverify).checkAliasClaimsfromwalkChecks()reddens the shared-alias test; droppingir.ServicefromnamespaceOwnersreddens the Service row; turning the namespace repeat rule off reddens the namespace-duplicate test; reverting the quote inappendContentViolationsreddens the ill-formed-name test. All restored green.make gate— exit 0, "Coverage gate passed: all 7632 statements covered."Closes #398, #399
Refs #400