feat(#4519): OASF record import + validate — fromOasfRecord()#220
Merged
Conversation
The read side of toOasfRecord() (#4518), closing the export -> import loop on the
AGNTCY OASF discovery record. Round-trips at the JSON level.
- fromOasfRecord(json): OasfRecord — parse + fail-closed validate. Rejects missing
name/schema_version, unknown schema major, a skill/domain with neither id nor name
(OASF at_least_one:[id,name]), and an id that contradicts its name vs the vendored
OasfTaxonomy (exact path, no fuzzy match). When only one of id/name is given the
other is resolved from the taxonomy (unknown paths kept, not invented).
- Recommended-but-missing fields (version/authors/created_at/description) only warn,
so a record this library exported imports cleanly.
- New types: OasfRecord (model), OasfClassification ({name?,id?}), OasfValidationException.
- 6 tests. CHANGELOG + PRD §12.6 + internals adjunct updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <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
OASF record import + validate —
fromOasfRecord(json): OasfRecord— the read side oftoOasfRecord()(#4518), closing the export → import loop on the AGNTCY discovery record. Round-trips at the JSON level.Behavior
name/schema_version, an unknown schema major (e.g.2.0.0), a skill/domain entry with neither id nor name (OASFat_least_one: [id, name]), and an id that contradicts its name against the vendoredOasfTaxonomy(exact-path, no fuzzy matching).version,authors,created_at,description) only warn — so a record this library exported imports cleanly.OasfRecord(typed model),OasfClassification({name?, id?}),OasfValidationException.Gates
6 new tests (round-trip + every rejection path). Full
./gradlew buildgreen except a pre-existing environmental failure inGeminiClientIntegrationTest(FAILED_PRECONDITION: User location is not supported— a Gemini API geo-block, nothing to do with this change; the test self-skips on CI where no Gemini key is present). All OASF/detekt/DocsConsistency gates pass.Remaining AGNTCY epic (#4517): DIR gRPC client (#4520). OASF export/import (#4518/#4519) and Identity-verify (#4521) now shipped.
🤖 Generated with Claude Code