From c8e9534d9f5d6d149b218eb2b8d94a5dfb5d7b1f Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Wed, 9 Sep 2026 14:09:18 +0100 Subject: [PATCH 1/2] fix: re-use InsufficientStorage error instead of creating new error --- commands/routing/use.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/commands/routing/use.go b/commands/routing/use.go index 45c783f..55068ef 100644 --- a/commands/routing/use.go +++ b/commands/routing/use.go @@ -16,18 +16,15 @@ type UseOK = commands.Unit // CandidateUnavailable when none can serve it. Without a policy the reference // is cleared and the space returns to default routing. // -// The space MUST be provisioned with a provider (SpaceNotProvisioned) and the -// policy MUST be known to the upload service, i.e. have a stored candidate set -// (UnknownPolicy). +// The space MUST be provisioned with a provider (InsufficientStorage, see the +// access package) and the policy MUST be known to the upload service, i.e. have +// a stored candidate set (UnknownPolicy). // // The receipt carries no payload (Unit). var Use = binding.Bind[*UseArguments, *UseOK](command.MustParse("/routing/use")) -const ( - // UnknownPolicyErrorName is the stable receipt-failure name when the - // referenced policy has no stored candidate set. - UnknownPolicyErrorName = "UnknownPolicy" - // SpaceNotProvisionedErrorName is the stable receipt-failure name when the - // subject space has no service provider. - SpaceNotProvisionedErrorName = "SpaceNotProvisioned" -) +// UnknownPolicyErrorName is the stable receipt-failure name when the +// referenced policy has no stored candidate set. A space with no service +// provider fails with the shared InsufficientStorage name from the access +// package, as every other capability on an unprovisioned space does. +const UnknownPolicyErrorName = "UnknownPolicy" From 507ffc0ab7172f6c7eb75a15c9a52f7562dc5a34 Mon Sep 17 00:00:00 2001 From: ash Date: Wed, 9 Sep 2026 14:22:46 +0100 Subject: [PATCH 2/2] fix: update comments on space provisioning and policy Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- commands/routing/use.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/routing/use.go b/commands/routing/use.go index 55068ef..32ba7ac 100644 --- a/commands/routing/use.go +++ b/commands/routing/use.go @@ -16,9 +16,10 @@ type UseOK = commands.Unit // CandidateUnavailable when none can serve it. Without a policy the reference // is cleared and the space returns to default routing. // -// The space MUST be provisioned with a provider (InsufficientStorage, see the -// access package) and the policy MUST be known to the upload service, i.e. have -// a stored candidate set (UnknownPolicy). +// The space MUST be provisioned with a provider; otherwise the invocation fails +// with InsufficientStorage (see access.InsufficientStorageErrorName). The policy +// MUST be known to the upload service, i.e. have a stored candidate set +// (UnknownPolicy). // // The receipt carries no payload (Unit). var Use = binding.Bind[*UseArguments, *UseOK](command.MustParse("/routing/use"))