Skip to content

Canonical §12 error codes mis-spelled or missing on the wire #161

@nficano

Description

@nficano

Category: spec-conformance Severity: blocker
Location: src/Errors/ErrorCode.php:16-56
Spec: ARCP v1.1 §12

What

§12 defines the canonical wire codes. The PHP enum diverges on multiple required entries: spec INVALID_REQUEST (PHP emits INVALID_ARGUMENT), spec INTERNAL_ERROR (PHP emits INTERNAL), spec RESUME_WINDOW_EXPIRED (absent; LifecycleHandler::handleResume emits DATA_LOSS), spec JOB_NOT_FOUND/AGENT_NOT_AVAILABLE/DUPLICATE_KEY/TIMEOUT are also absent.

Evidence

case Cancelled = 'CANCELLED';
case Unknown = 'UNKNOWN';
case InvalidArgument = 'INVALID_ARGUMENT';
case DeadlineExceeded = 'DEADLINE_EXCEEDED';
case NotFound = 'NOT_FOUND';
...
case Internal = 'INTERNAL';
...
case LeaseExpired = 'LEASE_EXPIRED';
case BudgetExhausted = 'BUDGET_EXHAUSTED';
case AgentVersionNotAvailable = 'AGENT_VERSION_NOT_AVAILABLE';

Proposed fix

Rename enum cases to the canonical strings (InvalidRequest='INVALID_REQUEST', InternalError='INTERNAL_ERROR') and add ResumeWindowExpired='RESUME_WINDOW_EXPIRED', JobNotFound='JOB_NOT_FOUND', AgentNotAvailable='AGENT_NOT_AVAILABLE', DuplicateKey='DUPLICATE_KEY', Timeout='TIMEOUT'.

Acceptance criteria

  • Every error payload emitted by the runtime uses one of the §12 wire strings verbatim.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions