Skip to content

feat(#4519): OASF record import + validate — fromOasfRecord()#220

Merged
Skobeltsyn merged 1 commit into
mainfrom
feat/4519-oasf-import
Jun 16, 2026
Merged

feat(#4519): OASF record import + validate — fromOasfRecord()#220
Skobeltsyn merged 1 commit into
mainfrom
feat/4519-oasf-import

Conversation

@Skobeltsyn

Copy link
Copy Markdown
Contributor

Summary

OASF record import + validatefromOasfRecord(json): OasfRecord — the read side of toOasfRecord() (#4518), closing the export → import loop on the AGNTCY discovery record. Round-trips at the JSON level.

Behavior

  • Fail-closed validation — rejects: missing name/schema_version, an unknown schema major (e.g. 2.0.0), a skill/domain entry with neither id nor name (OASF at_least_one: [id, name]), and an id that contradicts its name against the vendored OasfTaxonomy (exact-path, no fuzzy matching).
  • Resolution — when only one of id/name is given, the other is filled from the taxonomy; custom or newer-than-vendored paths are 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 (typed model), OasfClassification ({name?, id?}), OasfValidationException.

Gates

6 new tests (round-trip + every rejection path). Full ./gradlew build green except a pre-existing environmental failure in GeminiClientIntegrationTest (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.

CodeQL java-kotlin expected-red on Kotlin 2.4 (codeql#21938); build is the gate.

🤖 Generated with Claude Code

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>
@Skobeltsyn Skobeltsyn merged commit 813b390 into main Jun 16, 2026
3 of 4 checks passed
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