|
| 1 | +--- |
| 2 | +description: Source-file knowledge for agents_engine/agntcy/OasfRecord.kt + OasfTaxonomy.kt + OasfLocator.kt — OASF 1.0.0 record export (#4518, PRD §12.6), AGNTCY's content-addressed discovery metadata. Agent<*,*>.toOasfRecord(version, authors, locators, domains, description, createdAt, annotations) is the third discovery exporter beside A2A toAgentCard() and native agent.json. Skills become OASF skills[] only when annotated with .oasf("path"); the vendored OasfTaxonomy resolves path -> uid (lookup, not formula). Deterministic/byte-stable; createdAt/authors/locators caller-supplied (no hidden now()). Call when the IDE LLM reasons about exporting an agent into the AGNTCY directory. |
| 3 | +--- |
| 4 | + |
| 5 | +# `agents_engine/agntcy/OasfRecord.kt` — OASF 1.0.0 record export (#4518) |
| 6 | + |
| 7 | +The **third discovery exporter** over the native typed agent, beside `A2AServer`/`toAgentCard()` (§12.5) |
| 8 | +and `toAgentJson()` (§12.2). AGNTCY's [OASF](https://github.com/agntcy/oasf) record is the discovery |
| 9 | +metadata that the DIR directory (a later subtask of epic #4517) stores content-addressed. The native |
| 10 | +agent stays the source of truth; this is a projection, exactly parallel to `toAgentCard()`. |
| 11 | + |
| 12 | +```kotlin |
| 13 | +val record: String = agent.toOasfRecord( |
| 14 | + version = "1.2.0", |
| 15 | + authors = listOf("Ada Lovelace <ada@example.com>"), |
| 16 | + locators = listOf(OasfLocator("source_code", listOf("https://example.com/agent"))), |
| 17 | + createdAt = "2026-06-15T00:00:00Z", // RFC3339, caller-supplied — see Determinism |
| 18 | +) |
| 19 | +``` |
| 20 | + |
| 21 | +## Skills are taxonomy entries, not free text |
| 22 | + |
| 23 | +Only skills annotated with `.oasf("agent_orchestration/multi_agent_planning")` (the `Skill.oasf(path)` |
| 24 | +mutator, `core/Skill.kt`) become OASF `skills[]`. Each path resolves to its uid via `OasfTaxonomy`. |
| 25 | +Un-annotated skills — and annotated paths absent from the vendored taxonomy — are **omitted** with a |
| 26 | +`java.util.logging` warning (they remain in `agent.json`, which carries free-form skills). This is why |
| 27 | +an agent with no `.oasf(...)` annotations exports an empty `skills[]`. |
| 28 | + |
| 29 | +## OasfTaxonomy — vendored lookup, not a formula |
| 30 | + |
| 31 | +OASF uids are **explicitly assigned per node**: top-level categories are multiples of 100, but level-2 |
| 32 | +is `category + n` while level-3 is `level2*100 + nn` — there is *no* single formula. So `OasfTaxonomy` |
| 33 | +is a `path -> uid` lookup loaded from `resources/oasf/skills-1.0.0.tsv` (+ `domains-1.0.0.tsv`). |
| 34 | +- **Slice 1 (#4518, this change):** seeds the confirmed core of the skills tree; domains TSV is unseeded |
| 35 | + (records emit an empty `domains[]`). |
| 36 | +- **Slice 2 (follow-up in #4518):** vendor the complete `agntcy/oasf` skills+domains trees and add a |
| 37 | + build-time cross-check against `schema.oasf.outshift.com/api/skills`. |
| 38 | + |
| 39 | +## Determinism |
| 40 | + |
| 41 | +Fixed key order; same inputs → byte-identical JSON (like `toAgentJson`). Wall-clock and authorship |
| 42 | +(`createdAt`, `authors`, `locators`) are **caller-supplied**, never sampled — no hidden `now()`, so the |
| 43 | +record is reproducible and CI-stable. Record key order: `name, version, schema_version, description?, |
| 44 | +authors, created_at?, skills, domains, locators, modules, annotations`. |
| 45 | + |
| 46 | +## Shared provenance with agent.json |
| 47 | + |
| 48 | +`toAgentJson(..., authors, createdAt, locators)` gained the same optional provenance fields (additive, |
| 49 | +omitted when not supplied → existing callers stay byte-identical): `metadata.authors`, |
| 50 | +`metadata.createdAt`, `spec.locators`. `OasfLocator` (its own file for the one-type-per-file guard, |
| 51 | +#3199) is the shared `{type, urls}` value. |
| 52 | + |
| 53 | +## Out of scope (deferred, PRD §12.6) |
| 54 | + |
| 55 | +Record **signing** (Sigstore/cosign over OCI) is external to the record JSON. OASF **import/validate**, |
| 56 | +the **DIR** gRPC client, and **Identity-verify** are the other subtasks of epic #4517. |
| 57 | + |
| 58 | +## Related files |
| 59 | + |
| 60 | +- `core/AgentJson.kt` — sibling exporter; shares the provenance fields and `OasfLocator`. |
| 61 | +- `a2a/A2AAgentCard.kt` — the structural sibling discovery exporter (`toAgentCard()`). |
| 62 | +- `core/Skill.kt` — `oasf(path)` annotation + `oasfPath`. |
| 63 | +- `resources/oasf/skills-1.0.0.tsv` — the vendored taxonomy. |
0 commit comments