Skip to content

fix(umodel): surface authoring warnings during validation#98

Open
Chloride233 wants to merge 1 commit into
alibaba:mainfrom
Chloride233:umodel-authoring-warnings
Open

fix(umodel): surface authoring warnings during validation#98
Chloride233 wants to merge 1 commit into
alibaba:mainfrom
Chloride233:umodel-authoring-warnings

Conversation

@Chloride233

Copy link
Copy Markdown
Contributor

Summary

Service.Validate now surfaces warning-only authoring hints for UModel elements that are schema-valid but may be less useful for downstream writes, filters, query display, or topology traversal.

The hints are intentionally narrow:

  • entity_set without spec.fields gets a schema-guidance warning.
  • metric_set metrics without both unit and data_format get a display-formatting warning.
  • entity_set_link types prefixed with candidate_ or maybe_ get a provisional-link warning.

These warnings reuse the existing ValidationResult.Warnings field and do not reject model elements.

What stays unchanged

  • Valid model elements remain valid.
  • No REST, CLI, MCP schema, SDK, model schema, import, or graphstore behavior changes.
  • Existing schema validation errors still come from the schema validator.
  • Normal relation types such as related_to are not warned.
  • Metrics with data_format but no unit are not warned.

Test plan

go test ./internal/umodel -run TestValidate -count=1
go test ./internal/agentgateway -count=1
git diff --check

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