Skip to content

The error codes spin writes, held to spin's own list - #29

Merged
aledbf merged 1 commit into
mainfrom
error-codes
Nov 12, 2026
Merged

aledbf merged 1 commit into
mainfrom
error-codes

Conversation

@aledbf

@aledbf aledbf commented Nov 12, 2026

Copy link
Copy Markdown
Member

Part of #24. It unblocks the Add Key action in #27.

What spin writes now. spin v20261110.01, the release versions.yaml pins, writes key_not_enrolled (action add_key, with the keys page as url) and no_extension_release (details). It no longer writes access_needs_signature, keyring_needs_signature or no_key_held (spin 22c480b66, access: a passkey's assertion buys a key). The contract still had the old three. So a key_not_enrolled failed isErrorEnvelope, and the extension showed it as internal.

What changes:

  • src/cli/contract.ts, the errors module and the fake spin now have spin's codes.
    • key_not_enrolled gets what no_key_held had: Add Key runs spin ssh-key add <host> <key> in a terminal, which opens the passkey page and waits. It retries once the terminal ends with exit 0.
    • no_extension_release is shown with its message, as no_vscode_server is.
    • The keyring signing flow (signKeyring, KEYRING_SIGNED, the Sign in Browser button) and the sign/sign_keyring actions are removed.
  • Drift check: hack/errcodes compares ACTION_OF with errorActions in spin's cmd/cli/cmd/errcode.go, code and action, both ways.
    • task contract:spin reads that file at the pinned release (v20261110.01) over git; at the pin it is identical to spin main's.
    • The Bump spin workflow runs it right after the bump, with the read token. A spin release that adds or drops a code then fails the bump, instead of the extension quietly showing the code as internal.
    • Ordinary CI cannot read the private spin repo. Instead, go test ./hack/... in task test checks the comparison logic and that this repo's contract parses.
  • Run by hand:
    • against this branch: errcodes: the contract's codes are spin's;
    • against main's contract: it lists the five differences above.
  • CONTRIBUTING's bump steps list the new step.

Planted bugs, each red, then reverted with Edit:

  • the comparison skipping codes only the contract has;
  • the comparison skipping action mismatches;
  • key_not_enrolled offering Retry instead of Add Key.

🤖 Generated with Claude Code

spin v20261110.01, the release versions.yaml pins, writes key_not_enrolled
(add_key, with the keys page as url) and no_extension_release, and no longer
writes access_needs_signature, keyring_needs_signature or no_key_held (spin
22c480b66). The contract still had the old three, so key_not_enrolled was an
envelope isErrorEnvelope refused and the extension showed as internal.

The contract, the errors module and the fake spin now have spin's codes:
key_not_enrolled takes no_key_held's Add Key, `spin ssh-key add` in a
terminal, which has the passkey confirm the key; no_extension_release is shown
whole, as no_vscode_server is. The keyring signing flow and its button go.

hack/errcodes holds ACTION_OF to errorActions in spin's cmd/cli/cmd/errcode.go,
code and action both ways; task contract:spin reads that file at the pinned
release over git, and the Bump spin workflow runs it after the bump, with the
read token, so a release that adds or drops a code fails the bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 3c73475 into main Nov 12, 2026
3 checks passed
@aledbf
aledbf deleted the error-codes branch November 12, 2026 22:10
aledbf added a commit that referenced this pull request Nov 12, 2026
#27 and #29 merged from the same base, so main ran #27's tests against #29's
contract: connect.test failed with no_key_held, which the fake spin no longer
writes, and proxy.test still held key_not_enrolled to be a code the contract
does not know. The refusal is key_not_enrolled now, shown with its Add Key;
the unknown code is one no release writes yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant