Repository navigation
[dotnet-port-api] Export skills ValidateName/ValidateDescription/ValidateCompatibility - #1347
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
API consistency review
Changed Go contractNew exports in Upstream evidence reviewed
AssessmentThe Go validators have the same rules and limits as the .NET static validators. The
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change exposing skill field validators as public APIs.
No open issues 🎉
What changed in this PR
Exposes the existing skill field validators as public APIs in agent/skills, allowing callers to validate individual fields without constructing Frontmatter.
Changes:
- Exports
ValidateName,ValidateDescription, andValidateCompatibility, with documented validation limits. - Updates
Frontmatter.Validateto use the exported functions without changing behavior. - Adds direct tests for valid and invalid inputs to the public validators.
| File | Description |
|---|---|
agent/skills/skills.go |
Exports and documents the validators and updates internal calls. |
agent/skills/frontmatter_source_test.go |
Adds direct coverage of the exported validators. |
Review effort: Balanced
Summary
Exports the existing skill field validators in
agent/skillsasValidateName,ValidateDescriptionandValidateCompatibility, each taking a string and returning anerror. They are the Go counterparts of the independent static validators onAgentSkillFrontmatter.Frontmatter.Validatenow calls the exported functions, so its behavior is unchanged.Ported .NET PRs
None specific. Pinned .NET SHA:
0c9944cc9f577d51277ac7c55dbc388b60a577af, fromdotnet/src/Microsoft.Agents.AI/Skills/AgentSkillFrontmatter.cs. I did not check inventoried package versions.Catalog leaves (namespace
Microsoft.Agents.AI), all currentlypartial:AgentSkillFrontmatter.ValidateName(string, out string) -> boolAgentSkillFrontmatter.ValidateDescription(string, out string) -> boolAgentSkillFrontmatter.ValidateCompatibility(string, out string) -> boolExpected assessment change after merge: these should move toward
adapted/mapped. Thebool/out reasoncontract becomes anerrorreturn. The 64-character name limit counts bytes, but the regex restricts names to ASCII, so this is equivalent. The 1024 and 500 limits count UTF-16 code units.Breaking Changes
None. Only new exports are added.
Tests and Examples
Added
TestExportedFieldValidatorstoagent/skills/frontmatter_source_test.go.gofmtclean;go vet ./agent/skillsandgo test ./agent/skillspass. I did not run E2E, replay-harness or benchmark suites.Notes
[Experimental].page.total676) and inspected three groups in depth.EdgeKind. The integrity filter hid#471(issue) and#633(PR); the visible PR is#1265(closed). Per the filtered-search rule this is treated as an assumed rejection, not a confirmed one.AllowWrappedgroup. The filter hid 6 issues in the issue search.#1333(closed) ("Add RequestPort.BindWithWrappedRequests (AllowWrapped parity)") also appears. Same assumption as above.AgentResponse<T>.IsWrappedInObjectunselected. Its issue search returned nothing and PR#1273(closed) covers structured output. Inspection found that Go keeps the wrapper state internal injsonformat. I did not go further, because this was the third and last group in the budget.