Point RepositionTodolistGroup and ListForwards at routes bc3 actually serves
Fixes two shipped operations that pointed at URLs bc3 does not serve, and adds the gate that finds the rest.
| Fixed here | ListForwards, RepositionTodolistGroup — non-breaking URL corrections |
| New gate | make bc3-route-parity, offline, on the check: line and in the spec-gates CI job |
| Found, not fixed | 11 more operations pointing at nonexistent URLs → #583, #584, #588 (all breaking) |
| Also filed | #581, #582 (coverage), #585 (TrashTodo semantics), #587 (harness), #589 (freshness) |
1. The two defects
| Operation | SDK declared | bc3 actually routes |
|---|---|---|
RepositionTodolistGroup | PUT /{accountId}/todolists/{groupId}/position.json | /todolists/groups/{id}/position.json |
ListForwards | GET /{accountId}/inboxes/{inboxId}/forwards.json | /inboxes/{id}/inbox_forwards.json |
Evidence at the pinned revision d0edc1283b:
doc/api/sections/todolist_groups.md:274, corroborated by thegroup_position_urlfield bc3 emits in its own todolist-group payloads (:84).doc/api/sections/forwards.md:14, carrying a<!-- START -->example marker — bc3 regenerated that example from a live BC5 response.
Bugfix, not a break: a 404 cannot be depended upon. Both keep their parameters, so no generated signature moves. The emitted URL does change, so it needs a release note. ListForwards is plainly a typo — every other forwards operation already used inbox_forwards (spec/basecamp.smithy:4050, :4079, :4108, :4136). Go's hand-written wrappers delegate to the generated client, so no call site needed rewiring.
Four tests were pinning the wrong paths — encoding the bug. Two fail on this branch until corrected:
× typescript/tests/services/forwards.test.ts > should list all forwards in an inbox
× typescript/tests/services/todolistGroups.test.ts > should change the position of a group
The Ruby todolist-groups stub is worth a look: it matched on todolists/\d+/position\.json, which cannot match todolists/groups/2/position, so it surfaced only in the full suite as a WebMock NetConnectNotAllowedError — never in a targeted grep. A response fixture whose group_position_url lacked the groups segment is corrected too.
2. Why nothing caught it
Nothing compared the SDK's paths to bc3's route table. make url-routes-check only proves url-routes.json regenerates from openapi.json — a self-consistency check that an internally-consistent wrong route passes. Neither operation was in the live-canary fixture set either.
| File | Role |
|---|---|
spec/bc3-routes.json | vendored table of the 364 routes bc3 documents (133 backed by live-response markers) |
scripts/generate-bc3-routes | extractor; reads git show <pin>:<file>, so a dirty bc3 checkout cannot poison it |
scripts/check-bc3-route-parity | the comparison, both directions |
scripts/bc3_route_normalizer.rb | one canonicalization + fingerprint, shared — two copies drift |
spec/bc3-route-allowlist.yml | waivers, with evidence requirements the gate enforces |
Vendoring the derived table rather than reading bc3 in CI is the pattern the repo already uses for openapi.json and url-routes.json, and it is the point: the gate runs offline in make check and in every CI job with no bc3 checkout and no secret, so it cannot skip. A gate that skips when its input is missing is how this shipped.
3. Matching is asymmetric, and that's deliberate
Review caught the first version stripping /buckets/:id on both sides, which made distinct routes equivalent and silently accepted 12 operations. My justification was wrong: check-bucket-flat-parity covers only GETs returning lists, and it checks SDK-internal consistency, never bc3's truth.
- Direction 1 (SDK → bc3) is EXACT. A wrong spelling is a live 404.
- Direction 2 (bc3 → SDK) collapses bucket scoping. It's a coverage ledger asking "do we model this resource+verb at all"; the spelling is a design choice, not a reachability risk. Measured: exact matching there reports 143 unmodeled routes of which 125 (87%) are just the other spelling of something already modeled. Collapsing gives 18 real ones.
4. Fail-closed, each demonstrated failing
| Condition | Why it matters |
|---|---|
| table revision != provenance pin | else it silently compares against stale bc3 truth |
| table's generator fingerprint != current extractor | the pin can be right while the logic that read it moved |
| extracted routes < floor | a broken regex yields an empty set → nothing unmatched → vacuous pass |
| allowlist entry matching nothing | a stale waiver reads exactly like a covered case |
scope_aliases entry without routes_rb: + (api_test:|api_view:) | this list asserts undocumented routes exist — the exact mistake behind all 13 defects |
| direction-2 entry with no structured disposition | prose can't discharge "absorbed or registered" |
registry: pointing at a nonexistent file | |
| entry claiming two dispositions | |
known-defect entry without a numeric issue: | an untracked defect |
Floors are pinned literals in the style of expected_idempotent=77 in check-idempotency-parity.
5. Red proof
Swapping c74709220's openapi.json under the finished gate names both defects and nothing else:
==> bc3 route parity FAILED:
ListForwards: SDK declares GET /inboxes/:id/forwards, which bc3 does not document.
RepositionTodolistGroup: SDK declares PUT /todolists/:id/position, which bc3 does not document.
REAL_EXIT=1
After the fix, neither is reported. Two new conformance/tests/paths.json cases pin the corrected segments on the wire in all six runners, each verified directly:
go 0 · typescript 0 · python 0 · ruby 0 · kotlin 0 · swift 0 (REAL_EXIT)
PASS: ListForwards uses the inbox_forwards segment, not forwards
PASS: RepositionTodolistGroup uses the todolists/groups segment
Swift confirmed to have actually run, not hit its IS_MACOS skip. Full suites: Ruby 1080 runs / 0 failures / 0 errors; Go, Python, TypeScript exit 0.
6. Eleven more defects — filed, not fixed
Once direction 1 became exact, triage against routes.rb, controllers, API views and test/api found 13 operations total declaring URLs bc3 does not serve. Two are fixed here. The other 11 all need a breaking change, so they are queued rather than smuggled in:
| Issue | Operations | Why it fails | Fix |
|---|---|---|---|
| #588 | 5 chatbot ops | the only integrations resource is bucket-scoped (routes.rb:956); the flat chats draw nests only lines/uploads | add bucketId |
| #588 | ListClientApprovals, ListClientCorrespondences | drawn-but-wrong-action — flat draw is only: %i[show], so no collection path | add bucketId |
| #588 | ListClientReplies, GetClientReply | flat client namespace has neither replies nor recordings | add bucketId |
| #583 | CreateForwardReply | flat create never drawn (routes.rb:150 is only: %i[index show]) | add bucketId, or remove |
| #584 | GetRecording | no correct path exists in any shape | remove |
All 11 are carried in sdk_routes_known_defective, which requires a numeric issue per entry and which the gate prints loudly on every run:
==> 11 KNOWN-DEFECTIVE routes still shipping (green only because the fix is breaking and queued):
CreateChatbot (POST /chats/:id/integrations) — known defect, see #588
...
The three tool-position verbs are legitimate and are in scope_aliases with evidence: resource :position (routes.rb:226) is included flat at :273 under a comment reading "CANONICAL: Top-level unscoped routes", with test/api/recordings/positions_controller_api_test.rb:36/45/54 each named "via unscoped", answering head :created/:ok/:no_content to match the declared 201/200/204.
⚠️ GetClientApproval (spec/basecamp.smithy:5713) and GetClientCorrespondence (:5775) are correct as flat — only the list operations are wrong. Don't sweep them along.
7. Direction 2 rediscovered the coverage backlog
16 dispositions, and it independently found the same gaps a manual survey did — reasonable evidence the gate works: cloud_files + google_documents → #551; dock door show → spec/api-gaps/external-links-doors.md (partial-coverage); gauge needle CRUD → #581; recording timesheet read + entry writes → #582.
Absorbing any of them must delete its entry — the gate fails on a stale one. This mechanizes the rule AGENTS.md already states and nothing enforced: a repin is valid exactly when every drift item is either absorbed into the spec or registered. Before this, advancing the pin required no triage at all.
8. Two things worth carrying forward
doc/api is not authoritative in the affirmative direction. tools.md documents only the bucket-scoped position endpoints even though bc3 draws and tests the flat form — so a docs-derived extractor like this one misclassifies those three as defects. Docs are safe as negative evidence only when routes.rb and test/api agree. bc3 signals "flat is canonical" with a Legacy project-scoped routes doc section; its absence (chatbots.md, client_replies.md) means flat was never offered.
A corroborating signal, correctly scoped: bc3's flat URL helper usage. Zero git grep hits for every defect; recording_position_url appears four times in test/api for the legitimate ones. That correlated perfectly here, but it does not prove absence — git grep measures whether any checked-in source uses a helper, not whether Rails generated one. An unused-but-real route greps to zero.
The sound mechanization is to enumerate the router itself — bin/rails routes, or Rails.application.routes.routes — matching verb, path, controller and action. That is a bc3-side artifact this SDK cannot produce, which is the honest reason this gate reads doc/api instead. Helper usage and the presence of a Legacy project-scoped routes docs section are both corroboration; neither is proof.
The same caution applies in the other direction: the absence of a Legacy project-scoped routes section suggests flat was never offered, but it is a documentation convention, not a routing fact.
Related: bc3's API boundary is not route scope. api_request? keys on request.host == BC3.api_host, then restrict_view_paths_to_api_root limits view paths to app/views/api. So a route is a real API route iff it is drawn and renderable under that restriction — the second half is what condemns GetRecording.
9. Known limits
bc3-routes-checkis not in CI. No workflow checks out bc3, and provisioning a secret is a decision beyond this PR. The generator fingerprint closes the extractor-drift half offline; a hand-editedsource.revisionmatching the pin without regeneration still needs bc3. Stated in the Makefile, specified in #589.- Drawn-but-wrong-action is invisible to a path comparison.
only: %i[show]produces a matching path with no matching action; that'sListClientApprovals,ListClientCorrespondences,CreateForwardReply. The gate found them only because triage readroutes.rb. - The per-section floor catches a section yielding zero routes, not partial loss within one. If a layout change drops half a section's routes while the rest still parse, the section stays non-empty and the check passes. Catching that needs a per-section count baseline, which is a heavier invariant than this PR takes on.
- A path-less
requestBodyconformance assertion isn't supported by any runner, thoughconformance/schema.jsondeclarespathoptional. Hit while writing these fixtures; narrowed them topath: "position"rather than grow whole-body comparison across six runners here. #587.
Summary by cubic
Fix two routes that 404’d in production by pointing ListForwards and RepositionTodolistGroup at the URLs bc3 actually serves. Add an offline bc3 route parity gate, wire assertions, and run it in CI to prevent future drift.
-
Bug Fixes
- ListForwards: GET /inboxes/{inboxId}/inbox_forwards.json (was /forwards.json).
- RepositionTodolistGroup: PUT /todolists/groups/{groupId}/position.json (was /todolists/{groupId}/position.json).
- Updated generated clients and tests in Go, TypeScript, Python, Ruby, Kotlin, and Swift.
- Fixed TS fixture group_position_url and Ruby stubs to match the real path.
- Bugfix only: URLs change on the wire; no signature changes.
-
New Features
- Add bc3 route parity gate that compares SDK routes vs bc3 docs (both directions), runs offline in
make check, and now runs in CI. - Vendored route table: spec/bc3-routes.json; scripts:
scripts/generate-bc3-routes,scripts/check-bc3-route-parity, sharedscripts/bc3_route_normalizer.rb; allowlist: spec/bc3-route-allowlist.yml. - Make targets:
bc3-routes(refresh table),bc3-route-parity(in check and CI),bc3-routes-check(freshness). - Conformance tests pin corrected segments; runners updated across all languages.
- Comparison tightened: SDK→bc3 is exact; bc3→SDK collapses bucket scoping for coverage.
- Extraction guard: fail if any bc3 doc section yields zero routes (explicit allowlist for
basecamps.mdandrich_text.md), and fail if a listed zero-route section starts documenting routes. - Gate flags known defects queued for the breaking window: CreateForwardReply (POST /inbox_forwards/:id/replies, #583), GetRecording (GET /recordings/:id, #584), and nine flat spellings bc3 only serves bucket-scoped (chatbots and client list/replies, #588).
- Add bc3 route parity gate that compares SDK routes vs bc3 docs (both directions), runs offline in