Skip to content

docs: RA/TL OpenAPI and served TL event schemas drift from shipped behavior #59

Closed

Description

@kperry-godaddy

Found during the spec-conformance review of agentnameservice/ans-spec#32 (review). Evidence pinned to 974ca94. Line refs to spec/api-spec-v2.yaml unless noted; the docsui mirrors (internal/adapter/docsui/openapi/*.yaml) need the same edits.

Collection of places where the published OpenAPI/JSON-schema contracts and the shipped behavior disagree. Each is small; batched here so they can be triaged together.

Contract says one thing, code does another

  1. Register prose: "The request MUST include an identity CSR" (api-spec-v2.yaml:181-183). The schema itself marks identityCsrPEM optional ("When omitted, the agent registers without an identity certificate", :1566-1572) and the code enforces exactly-one-of serverCsrPEM/serverCertificatePEM instead (registration.go#L423-L430). The prose predates identity-optional registration. (The registration schema also lacks the oneOf the renewal schema has at :2008-2010.)
  2. Enum casing: responses violate the published enums. The yaml declares Protocol: [A2A, MCP, HTTP-API] (:1473-1475) and hyphenated transports [STREAMABLE-HTTP, SSE, JSON-RPC, ...] (:1886-1890), but the RA canonicalizes, stores, and emits the underscore forms HTTP_API, STREAMABLE_HTTP, JSON_RPC (protocol.go#L11-L15, #L50-L57). Parsers accept both on input; output should match the declared enum (or the enum should match the output).
  3. TL yaml still lists the retired event model. spec/api-spec-tl-v2.yaml:1000 — eventType: [AGENT_REGISTRATION, DOMAIN_VALIDATION, AGENT_ACTIVE, AGENT_REVOCATION]. Shipped enums are AGENT_REGISTERED / AGENT_RENEWED / AGENT_DEPRECATED / AGENT_REVOKED (event.go#L72-L102).
  4. V2.json omits dnssecVerified. The V2 builder seals per-record dnssecVerified (lifecycle.go#L1060-L1078; event.go:201-213), but the served DNSRecord schema (internal/tl/service/schemas/V2.json:107-129) has no such property.
  5. revocationReasonCode enum mismatch, unenforced. The served schemas allow 11 tokens including UNSPECIFIED, REMOVE_FROM_CRL, CA_COMPROMISE, EXPIRED_CERT (V2.json:184-196), the RA emits only the 7-token set (status.go:141-149; api-spec-v2.yaml:1526-1535), and TL ingest validates the field not at all (event.go:263-283 requires only eventType/ansId/ansName/timestamp — any string seals). Worth deciding the canonical set and enforcing it at ingest.

Constraint drift within the request schema

  1. AgentFunction: yaml caps id/name at 64 chars and tags at 5 (:1895-1912); Go enforces none of those, instead non-blank id/name, unique ids per endpoint, and ≤20 tags of ≤20 chars (endpoint.go#L31-L53, #L103-L116).
  2. AgentLifecycleStatusFilter enum is [PENDING_DNS, ACTIVE, DEPRECATED, REVOKED, ALL] (:1740-1742) — PENDING_VALIDATION/FAILED/EXPIRED are unfilterable per the contract, and the handler doesn't validate the value at all (arbitrary strings pass through).
  3. Enforced in code, absent from the contract: at most one endpoint per protocol (422 DUPLICATE_PROTOCOL, endpoint.go#L191-L197); metaDataHash requires metaDataUrl (endpoint.go:88-94).
  4. Declared in the contract, unenforced in code: agentDisplayName required (:1605-1609 — code checks only the 64-char max and accepts empty, agent.go:124-129); revocation comments maxLength: 200 (:1616-1618 — no runtime check at any layer).

Suggest one pass that picks the source of truth per item (mostly: make the yaml match shipped behavior; for 5 and 9, decide whether to enforce).

Activity

  1. jhateley-godaddy commented on Jul 14, 2026

    @jhateley-godaddy
    Contributor

    Looking into this

  2. moved this from Backlog to Ready in Agent Name Serviceon Jul 15, 2026
  3. linked a pull request that will close this issueFix/align specs with implementation #68on Jul 16, 2026
  4. moved this from Ready to In progress in Agent Name Serviceon Jul 16, 2026
  5. moved this from In progress to Done in Agent Name Serviceon Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions