Skip to content

fix(irverify): tighten naming rules and quote messages - #740

Open
fuad-daoud wants to merge 4 commits into
mainfrom
fix/irverify-naming
Open

fuad-daoud wants to merge 4 commits into
mainfrom
fix/irverify-naming

Conversation

@fuad-daoud

Copy link
Copy Markdown
Collaborator

Summary

Batch PR A of two (B is #737). Three irverify changes:

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=1 and go 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 reach irverify).
  • Mutation probes: removing checkAliasClaims from walkChecks() reddens the shared-alias test; dropping ir.Service from namespaceOwners reddens the Service row; turning the namespace repeat rule off reddens the namespace-duplicate test; reverting the quote in appendContentViolations reddens the ill-formed-name test. All restored green.
  • make gate — exit 0, "Coverage gate passed: all 7632 statements covered."

Closes #398, #399
Refs #400

- #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
@fuad-daoud fuad-daoud self-assigned this Sep 30, 2026
fuad-daoud and others added 2 commits October 7, 2026 08:33
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>
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.

irverify: two entities may claim the same alias with nothing reporting it

1 participant