Skip to content

Public client and runtime APIs are missing @throws documentation #42

@nficano

Description

@nficano

Several public methods that form the SDK's main surface throw typed ARCP exceptions or transport exceptions but do not declare them in PHPDoc. Examples include ARCPClient::open(), ARCPClient::invokeTool(), ARCPClient::subscribe(), ARCPClient::listJobs(), ARCPClient::fetchArtifact(), ARCPClient::ping(), ARCPClient::putArtifact(), ARCPRuntime::setDefaultToolVersion(), JobContext::requestHumanInput(), JobContext::requestHumanChoice(), and JobContext::requestPermission(). The Transport interface explains failures in prose but also omits concrete @throws tags on send() and receive().

Native return and parameter types are strong, but callers still need PHPDoc for the exception contract because PHP cannot express checked exceptions. The class-level note on ARCPClient says every command returns a typed response or raises a typed ARCP exception, yet individual methods do not tell users which exceptions to catch or when transport and cancellation failures can escape.

Fix prompt: Add precise @throws tags to the public API methods and interfaces, using the narrowest meaningful exception types where possible and ARCPExceptionInterface where the method maps protocol errors broadly. Keep existing native type declarations, preserve array-shape PHPDoc, and add or adjust documentation tests or static analysis rules so future public throwing methods do not omit exception documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationseverity:lowLow severity

    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