Skip to content

feat(testing): spec-conformance test for AdcpError code names against error-code.json enum #416

Closed

Description

@bokelley

Context

The AGENT_SUSPENDED, AGENT_BLOCKED, REQUEST_AUTH_UNRECOGNIZED_AGENT, and INVALID_BILLING_MODEL codes shipped for months as non-spec (caught in #375 / fixed in PR #393). Drift was only caught by manual review.

Add an automated test that walks all AdcpError(\"CODE\", ...) raise sites in src/adcp/ (AST or grep) and asserts the code is in the canonical static/schemas/source/enums/error-code.json enum (or has the X_ vendor prefix). Catches future drift at PR time.

Acceptance Criteria

  • New tests/test_error_code_conformance.py
  • Walks all AdcpError(\"CODE\", ...) raise sites in src/adcp/
  • Asserts code is in static/schemas/source/enums/error-code.json enum or has X_ vendor prefix
  • Runs in CI; fails CI on any non-spec code

Refs

Activity

  1. added
    enhancementNew feature or request
    claude-triagingTriage routine is actively working on this issue (1-3 min)
    on May 3, 2026
  2. bokelley commented on May 3, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Feature request
    Bucket(s): client, handlers
    Status: drafting-pr
    Milestone: (omitted — no target version specified)

    What the experts said:

    • code-reviewer: approved — no blockers; stale comments and schema fixture hardening addressed in review→fix cycle
    • ad-tech-protocol-expert: approved — X_ prefix aligns with spec's extension model; AUTH_INVALID allowlist is protocol-correct given the spec's explicit forward declaration of the AUTH_REQUIRED split
    • dx-expert: AUTH_INVALID is a named future spec code — do not use X_AUTH_INVALID; allowlist approach preserves the semantic distinction the spec plans to formalize

    My take: Issue is clear-cut and all criteria for Execute are met. One design question (rename AUTH_INVALID → AUTH_REQUIRED vs. allowlist it as a provisional spec code) is surfaced in the PR body for reviewer decision; both approaches are valid and the PR uses the lower-scope one.

    PR: #436 — AST conformance test + rename INTERNAL_ERROR → X_INTERNAL_ERROR, BILLING_NOT_PERMITTED_FOR_AGENT → X_BILLING_NOT_PERMITTED_FOR_AGENT. 231 tests pass.


    Triaged by Claude Code. Session: https://claude.ai/code/session_01SpT9n4csqsXxbogX4q6GHo


    Generated by Claude Code

  3. added and removed
    claude-triagingTriage routine is actively working on this issue (1-3 min)
    on May 3, 2026
  4. bokelley commented on May 14, 2026

    @bokelley
    ContributorAuthor

    Shipped via #429 (merged). Closing as completed — the triage-bot draft was superseded by the merged PR but the issue was never closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions