Repin bc3 to 2c0dafba13 and absorb the Folders API it brings into range

Merged
JE
4mo ago
+6721-812

Repins bc3 provenance d0edc1283b → 2c0dafba13 and absorbs the Folders API
that repin brings into range, as one change. 238 → 243 operations.

Why these are coupled

doc/api/sections/folders.md does not exist at the old pin, so the five
/stacks routes are absent from spec/bc3-routes.json today. Repinning alone
makes them appear in the route table with no operation modelling them, and the
#586 parity gate (direction 2) then demands a disposition for five routes we
have every reason to model. Absorbing alone would model a contract the pin says
isn't there. Doing both is the only coherent order.

The repin — 11 commits, one API-surface change

CommitWhatAction
dc6cd10714 #12384Folders APIabsorbed (below)
344581a379 #12494Drafts keep subscribers when an update doesn't address themrepin only
2c0dafba13 #12501Screen a drafted entry's participants before subscribingrepin only
19956c5579 #12488Web deprioritize goes exact-targetrepin only — see below
845df62b6b #12487action_push_native structured errorsnot API surface
112c1664bf 63a34abe30 5f889d8365 faf5fe9dfcpre-commit hook harnessdev tooling
1fad1ef608 c664cdc9deTurbo-morph controller splitweb only

#12494 / #12501 are behaviour fixes to endpoints the SDK already models.
They add prose to five doc/api sections but no route and no payload field —
proven, not assumed: regenerating spec/bc3-routes.json at the new pin yields
exactly five new entries, all /stacks.

#12488 verified independently, and the brief's read of it holds. It deletes
a request.format.json? branch, which looks like an API change. It isn't. The
removed branch returned nil for JSON when the recording's own assignment
wasn't prioritized; the replacement returns that same assignment unconditionally
and &.unprioritize is a no-op when there's no priority to remove. Both
spellings target exactly the id in the URL and both answer 204. What changed
is that the web path stopped cascading to a sibling step — it adopted the
contract the JSON API has had since bc3#12483 (absorbed in SDK #528).

The absorption — FoldersService

ListFolders    GET    /{accountId}/stacks.json        200  bare array of Folder
GetFolder      GET    /{accountId}/stacks/{folderId}  200  FolderWithProjects
CreateFolder   POST   /{accountId}/stacks.json        201  FolderWithProjects
UpdateFolder   PUT    /{accountId}/stacks/{folderId}  200  FolderWithProjects
DeleteFolder   DELETE /{accountId}/stacks/{folderId}  204  no body

The wire type stays Stack. The product was renamed, the payload was not.
The operations, structures and generated methods use Folder; the URI segment
and the type discriminator keep stack/Stack. Anything matching on type
must match "Stack".

Two output structures, not one. Folder is what the list returns;
only FolderWithProjects carries the expanded projects. A single shape with
an optional member would make every generated list-item type declare a field the
list response never populates.

Three required-and-nullable fields. gauges_url, color and image_url
are emitted unconditionally by app/views/api/stacks/_stack.json.jbuilder and
are commonly null, so @required models the presence and smithy-build.json
jsonAdd layers type: ["string","null"] on top — SPEC §"A third wire state",
the same treatment Wormhole.color/destination_url already get. Go types them
*string because the value is nullable, not because the key is optional.

project_ids doesn't round-trip. Create takes it; the response reports the
same ids as bucket_ids and expands them as projects. Three names, one
relationship. An unreachable id fails the whole request with 404 and writes
nothing, so CreateFolder lists NotFoundError. UpdateFolder lists
ValidationError because a blank name is a real 422 — create defaults it to
New folder instead. UpdateFolder/DeleteFolder are naturally idempotent;
CreateFolder is not.

Generator overrides: one. The Folders tag resolves to FoldersService
through every generator's default fallback (zero service-group overrides), and
ListFolders infers the folder resource type cleanly. The one addition is
GetFolder → getFolder in TS/Kotlin/Swift: the bare rule collapses it to
folder(id), a noun with no verb, while Ruby and Python already emit
get_folder. Same shape as the GetBookmark override — all six SDKs now agree.

Go note. FolderWithProjects repeats the base fields rather than embedding
Folder. Embedding promotes them correctly at runtime but hides them from
check-wrapper-drift, which walks declared fields and reported all twelve as
missing. Repeating them keeps the guard able to verify every field.

Registry and coordination

  • spec/api-gaps/folders-api.md → absorbed-in-sdk, seven smithy_refs.
  • spec/api-gaps/stack-doc-and-smithy.md keeps confirmed-not-api-resource
    on purpose. It records a decision that was correct when made; the supersession
    note in folders-api.md exists to preserve that history, not to be erased by
    it. Registration issue #559 is already closed.
  • spec/bc3-route-allowlist.yml needs no change — no /stacks entry existed
    (the routes weren't in the table), and no entry became redundant.
  • COORDINATION.md named pin 338b7a11, three repins stale. Now names
    2c0dafba13 and says the provenance file is the only authority.

Verification, with real exit codes

GateResult
make checkREAL_EXIT=0
BC3_REPO_PATH=… make bc3-routes-checkREAL_EXIT=0
make bc3-route-parityREAL_EXIT=0 — five /stacks routes matched both directions
Swift (macOS-gated, actually ran)swift build + swift test: 306 tests, 0 failures; swift run ConformanceRunner executed
Ruby1092 runs, 2572 assertions, 0 failures (make rb-check)
Python867 passed, mypy clean, ruff clean
Conformance147 passed, 0 failed, 1 skipped (pre-existing Go-runner origin case)

The five new paths.json cases PASS in all six runners — Go, Kotlin,
TypeScript, Ruby, Python and Swift each got a dispatch branch, so none silently
skips. Confirmed per-runner in the log, and for TypeScript (whose summary is
compact) by a --reporter=verbose run naming all five.

Counts bumped deliberately, each derived from behavior-model.json rather than
incremented by hand: check-idempotency-parity 77/199 → 79/203;
SPEC/SECURITY/AGENTS 238 → 243 operations, 122 → 124 GETs, 47 → 48
PUTs, 23 → 24 DELETEs, 39 → 40 single-attempt POSTs, 188 → 192
retry-eligible ops at max 3.

New hand-written tests: typescript/tests/services/folders.test.ts (11),
python/tests/services/test_folders_service.py (11),
ruby/test/basecamp/services/folders_service_test.rb (14). Each covers the
list-has-no-projects / get-has-projects split and the always-present-null
decode, plus a 4xx per operation.

The API version tracks the pin date, so every SDK's API_VERSION moves to
2026-08-02.


Summary by cubic

Repins BC3 to 2c0dafba13 and adds the Folders API (/stacks) across all SDKs, introducing 5 operations and moving the API version to 2026-08-02. Operation count increases 238 → 243 with updated retry/idempotency metadata.

  • New Features

    • Added FoldersService with List/Get/Create/Update/Delete at /stacks.json and /stacks/{folderId}.json.
    • Two shapes: Folder (list; no projects) and FolderWithProjects (get/create/update; includes projects). Wire type stays "Stack".
    • project_ids is input-only on create; responses return bucket_ids and expanded projects. gauges_url, color, image_url are required-and-nullable.
    • Idempotency: UpdateFolder/DeleteFolder idempotent; CreateFolder non-idempotent with standard retry. Naming override GetFolder → getFolder in TS/Kotlin/Swift.
    • Services, models, and tests added in Go/Kotlin/Python/Ruby/Swift/TypeScript.
  • Bug Fixes

    • Folder writes now return FieldValidationError (field-keyed 422) instead of ValidationError for create/update. Verified with new Go tests that assert JSON422 decoding.
    • SPEC §2 prose corrected: per-op retry.max distribution counts the five Folder ops (max:3 bucket 195 → 200; totals now match 243 ops).
    • Swift conformance: parse project_ids via the throwing intArray helper to avoid silent truncation.

Post-review correction to this description

Two statements above were written before review and are superseded by what shipped:

  • Both Folders writes declare FieldValidationError, not just UpdateFolder. bc3's stacks_controller.rb renders { errors: <ActiveModel::Errors> } on create (:27) as well as update (:51), via the RecordInvalid rescue — and ActiveModel::Errors serializes field-keyed, so the wire is {"errors":{"name":["can't be blank"]}} for both. The review only named UpdateFolder; CreateFolder had the identical defect. The TS/Python/Ruby tests already modelled the field-keyed body correctly — the spec was the wrong half. Verified by a Go test that pins the typed JSON422 field and is red-proofed by failing to compile against the previous generated client (*ValidationErrorResponseContent has no field or method Errors). Wrapper-level assertions here are vacuous, because checkResponse parses the raw body and never reads the typed field.
  • "One API-surface change" should read "one newly modeled API surface." The same section already acknowledges two API behavior fixes in the repin range (bc3 #12494 / #12501), so the original phrasing undercounts what the repin carries.