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

@Chloride233 Chloride233 commented Jul 8, 2026

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.

Verification details

  • Affected version: main; no released tag was used for this reproduction.
  • Steps to reproduce before this change: Call Service.Validate with a schema-valid entity_set that has no spec.fields, a metric_set metric that has neither unit nor data_format, or an entity_set_link whose type starts with candidate_ or maybe_.
  • Expected behavior: Validation remains successful and ValidationResult.Warnings identifies the relevant authoring field and explains why the missing or provisional metadata may reduce downstream usefulness.
  • Actual behavior before this change: Validation succeeds, but no authoring warning is returned for those cases, so callers cannot distinguish a minimally schema-valid element from one that lacks useful authoring guidance.
  • Logs/stack trace: No runtime error or stack trace occurs; this is a missing warning in a successful validation result. TestValidateReportsAuthoringWarnings reproduces the previous behavior and verifies the warning fields and non-blocking semantics added here.

Test plan

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

@qiansheng91 qiansheng91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

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

The changes appear reasonable. No critical issues found in the diff.


Automated review by github-manager-bot

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Needs Verification

Thank you for reporting this issue. The reported behavior is being reviewed against the current codebase.

Next Steps:

  • This issue has been flagged for code-level verification
  • If confirmed, an automated fix proposal may be generated
  • You can reply with additional context, reproduction steps, or logs to help speed up the analysis

Automated evaluation by github-manager-bot

@qiansheng91 qiansheng91 added the bug Something isn't working label Jul 25, 2026
@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Under Review

Thank you for reporting this issue. It has been classified as a potential bug and is being reviewed against the current codebase.

A deeper verification will be performed. If confirmed as a valid bug, an automated fix proposal may be generated.


Automated evaluation by github-manager

@qiansheng91

Copy link
Copy Markdown
Collaborator

Issue Evaluation

Category: bug | Status: Needs Info

Thank you for reporting this issue. To proceed with verification, please provide:

  • Version/tag where this occurs
  • Steps to reproduce
  • Expected vs actual behavior
  • Relevant logs or stack traces

Automated evaluation by github-manager-bot

@Chloride233

Copy link
Copy Markdown
Contributor Author

Added the requested version, reproduction steps, expected vs. actual behavior, and verification evidence to the PR description. This is a missing warning in an otherwise successful validation result on main, so there is no runtime stack trace; the regression test captures the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants