Repository navigation
Description
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
- Register prose: "The request MUST include an identity CSR" (
api-spec-v2.yaml:181-183). The schema itself marksidentityCsrPEMoptional ("When omitted, the agent registers without an identity certificate", :1566-1572) and the code enforces exactly-one-ofserverCsrPEM/serverCertificatePEMinstead (registration.go#L423-L430). The prose predates identity-optional registration. (The registration schema also lacks theoneOfthe renewal schema has at :2008-2010.) - 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 formsHTTP_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). - 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 areAGENT_REGISTERED / AGENT_RENEWED / AGENT_DEPRECATED / AGENT_REVOKED(event.go#L72-L102). V2.jsonomitsdnssecVerified. The V2 builder seals per-recorddnssecVerified(lifecycle.go#L1060-L1078;event.go:201-213), but the servedDNSRecordschema (internal/tl/service/schemas/V2.json:107-129) has no such property.revocationReasonCodeenum mismatch, unenforced. The served schemas allow 11 tokens includingUNSPECIFIED,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-283requires only eventType/ansId/ansName/timestamp — any string seals). Worth deciding the canonical set and enforcing it at ingest.
Constraint drift within the request schema
AgentFunction: yaml capsid/nameat 64 chars andtagsat 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).AgentLifecycleStatusFilterenum is[PENDING_DNS, ACTIVE, DEPRECATED, REVOKED, ALL](:1740-1742) —PENDING_VALIDATION/FAILED/EXPIREDare unfilterable per the contract, and the handler doesn't validate the value at all (arbitrary strings pass through).- Enforced in code, absent from the contract: at most one endpoint per protocol (422
DUPLICATE_PROTOCOL,endpoint.go#L191-L197);metaDataHashrequiresmetaDataUrl(endpoint.go:88-94). - Declared in the contract, unenforced in code:
agentDisplayNamerequired (:1605-1609 — code checks only the 64-char max and accepts empty,agent.go:124-129); revocationcommentsmaxLength: 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).
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
None yet
Effort
None yet
Projects
- StatusShow more project fieldsDone
Activity
jhateley-godaddy commentedon Jul 14, 2026
Looking into this