Card-table wormholes across all six SDKs (#397)
Card-table wormholes (closes #397)
Models card-table wormholes across all six SDKs — the only mechanism for moving a card to a different project. Routing a move through an existing wormhole already worked (a wormhole id is a valid column_id for MoveCard), so the gap was purely discovering wormholes (decode wormholes[]) and managing them (CRUD). Cards().Move is unchanged.
The server contract is fully shipped and present in the pinned bc3 provenance (see spec/api-provenance.json); it shipped in BC3 #12144 and predates the current pin, so this is a pure absorption with no spec/api-provenance.json SHA bump. Operations 205 → 208; services 45 (account-scoped canonical set; +wormholes).
Contract
Three CRUD operations + one shared Wormhole shape (decode member + create/update outputs):
| Op | Method + route | Success | Failure |
|---|---|---|---|
| Create | POST /{account}/buckets/{bucket}/card_tables/{cardTable}/wormholes.json | 201 | 422 (4-per-board limit); 404 (invalid/inaccessible/inactive/same-board destination) |
| Update | PUT /{account}/buckets/{bucket}/card_tables/wormholes/{wormhole} | 200 | 404 |
| Delete | DELETE /{account}/buckets/{bucket}/card_tables/wormholes/{wormhole} | 204 | 403/404 |
Wormhole carries the full recording shape plus color, linked (always emitted — true only while the destination column, its board, and its bucket are all active), and destination_url (the only field identifying the destination; the wormhole's own url/app_url/parent point at the source board).
Nullability (destination_url + color)
destination_url is always emitted and null for an unlinked wormhole, so it's modeled as required-but-nullable: @required in Smithy + a 3.1 null-union OpenAPI override (type: ["string","null"] + x-go-type: "*string") via smithy-build.json jsonAdd, mirroring #404's SearchType.key. SDKs get string | null with no spurious | undefined:
- TypeScript
destination_url: string | null, Pythonstr | None, Go generated*string(hand converter copies the pointer), Kotlin/SwiftString?(required decode — rejects a missing key, accepts null). destination_urlis the first entity-level null-union field, so this PR also (a) teaches the Kotlin generator's entity path (ModelEmitter.resolvePropertyType) to handle null-union types, and (b) fixes a Swift generator bug: the required-nullable path emitted explicit snake_caseCodingKeysthat conflict with the.convertFromSnakeCasedecoder —SearchType(single-word fields) never hit it.coloris modeled the same way. The bc3 jbuilder emitsjson.color recording.colorunconditionally (null when unset), so it's wire-identical todestination_url— required-but-nullable. Both round-trip explicit null (Go clean*stringwith noomitempty; Rubyto_hkeep-list; TS/Python/Kotlin/Swift nullable types).- UpdateWormhole is 404-only — the 4-per-board 422 is create-only; update swaps a pre-validated destination id (filtered
.find→ 404), soValidationErrorwas removed from its error list.
Structure (commit per SDK)
- spec — Smithy ops +
Wormhole+wormholesonCardTable, tags, regenerated artifacts, fixtures (linked + unlinked), api-gaps registry (absorbed-in-sdk, additive), doc/count refresh. - Go / TypeScript / Ruby / Python / Kotlin / Swift — service + client wiring + tests, one commit each.
- Model wormhole destination_url as nullable — the null-union modeling + Kotlin entity-path fix + Go
*stringconverter.
Tests
Every operation: happy path + error case (Create 422/404, Update 404, Delete 403/404), empty-input guards (Go), and a linked + unlinked wormholes[] decode through each language's card_tables.get (including Python). The unlinked case reads null through the corrected string | null / str | None types — a compile-time proof of the nullability contract.
Verification
make check green end-to-end on main: smithy-check, all drift checks, provenance-check (no bump), every language's test/lint/build, full conformance, check-bucket-flat-parity, validate-api-gaps.
Downstream
Unblocks basecamp-cli#342 / draft PR #559: once released and re-pinned, the CLI wires cards move <id> --to-wormhole <id|dest-col-url> and cards wormholes --in <proj>.