Skip to content

Fix the build after DIDDocument's optional relaxation - #59

Merged
germ-mark merged 1 commit into
mainfrom
llm/fix-optional-diddoc-members
Aug 18, 2026
Merged

Fix the build after DIDDocument's optional relaxation#59
germ-mark merged 1 commit into
mainfrom
llm/fix-optional-diddoc-members

Conversation

@germ-mark

Copy link
Copy Markdown
Contributor

main is currently red

swift build fails on main (8a0248f):

Sources/AtprotoTypesVerify/Signing/RepoSigningKey.swift:53:26: error: value of optional type
'[Atproto.DIDDocument.VerificationMethod]?' must be unwrapped to refer to member 'first'

#58 made verificationMethod and publicKeyMultibase optional to match the canonical DID schema. #54 added RepoSigningKey, which unwraps both. Each was green on its own base, and the two merge cleanly as text — nothing conflicts — so the breakage only appears once they're compiled together. #54's CI last ran against a base predating #58.

The fix

Both absent cases refuse with noAtprotoSigningKey — the same answer an empty verificationMethod list already gave. A document that publishes no key material for this DID proves nothing about its repo, so refusing is the only sound reading; treating absent as "skip the check" would let a document with no key silently pass verification.

controller stayed non-optional, so the existing empty-controller handling is untouched.

Tests

Adds one regression test per branch. These are reachable only from hand-written JSON (the fixture builder always emits both fields), so without them the nil behaviour is decided by whoever next touches the unwrap rather than by a test.

The publicKeyMultibase case is mutation-verified — swapping the thrown error to .badMultibaseKey makes the test fail with expected error ".noAtprotoSigningKey" ... but ".badMultibaseKey" ... was thrown instead, confirming it exercises the new branch rather than passing incidentally.

  • swift build clean
  • swift test: 83 verify tests in 10 suites + 56 core in 14, all passing

🤖 Generated with Claude Code

#58 made `verificationMethod` and `publicKeyMultibase` optional to match the
canonical DID schema; #54 added RepoSigningKey, which unwraps both. Each PR
was green on its own base and they merge cleanly as text, so main landed
broken — `swift build` fails at RepoSigningKey.swift:53.

Both absent cases now refuse with noAtprotoSigningKey, the same answer an
empty method list already gave: a document that publishes no key material for
this DID proves nothing about its repo, so the only sound response is to
refuse. Adds a regression test for each, since these branches are reachable
only from hand-written JSON and would otherwise be settled by whoever next
touches the unwrap. The multibase case is mutation-verified.
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8adbeca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@germ-network/atprototypes Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@germ-mark
germ-mark merged commit 8a1ab3e into main Aug 18, 2026
6 checks passed
@germ-mark
germ-mark deleted the llm/fix-optional-diddoc-members branch August 18, 2026 22:53
@github-actions github-actions Bot mentioned this pull request Aug 18, 2026
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