Skip to content

agent-registry empty-bucket path mislabels an unknown name as AGENT_VERSION_NOT_AVAILABLE (§7.5) #125

@nficano

Description

@nficano

Category: spec-conformance Severity: minor
Location: packages/runtime/src/agent-registry.ts:167-207
Spec: ARCP v1.1 §7.5

What

§7.5 says an unknown name must yield AGENT_NOT_AVAILABLE. resolveFromState guards bucket.size === 0 first, so the empty-bucket branch is unreachable today — but if reached it emits AGENT_VERSION_NOT_AVAILABLE with an empty version, the wrong §7.5 code. Latent misclassification masked only by an external guard.

Evidence

const first = bucket.entries().next().value;
  if (first === undefined) return { missingVersion: "" };
...
  if ("missingVersion" in picked) {
    return Effect.fail(
      new TaggedAgentVersionNotAvailable({

Proposed fix

Have pickFromBucket distinguish 'empty bucket' from 'missing version' and map the empty case to AGENT_NOT_AVAILABLE regardless of caller guards.

Acceptance criteria

  • Resolving a name whose bucket is empty yields AGENT_NOT_AVAILABLE, never AGENT_VERSION_NOT_AVAILABLE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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