Commit 447d2e4
fix: describe the unpublished endpoints, and stop publishing other people's drafts
The defect reports kept landing on the same root cause, so this addresses that
rather than only its symptoms.
Forward's published endpoints have a description generated from its server, so a
parser cannot disagree with them for long. The unpublished ones had nothing:
their responses were read key by key, by hand, and their fixtures were written
from the same assumptions as the parsers. When both were wrong together nothing
noticed, which is how a commit id nested under lastCommit came to be read from a
flat key Forward never sends.
They now have real schemas, merged into the generated description, so models are
generated for them exactly as for published responses and parsing validates
against a declared shape. The recorded examples are run through the SDK's own
parsers, and an unpublished operation that documents no shape is a test failure.
Two behaviours found by running both clients against one fake Forward:
publish() staged over pre-existing drafts and committed them. A commit names
paths rather than changes, so an unrelated half-finished edit sitting on a path
being published was committed along with it, and neither party was told. It now
refuses, with overwrite_drafts to say otherwise deliberately.
The 409 strip-and-retry read its paths from the exception's display string when
the error body would not validate. That string embeds the raw body inside
formatting, so splitting it produced fragments matching nothing, only some paths
were stripped, and the retry failed again on a 409 that looked like a different
problem. It now reads the parsed body, or the raw body as JSON, and declines to
strip at all when the paths cannot be identified. This endpoint is unpublished,
so its error envelope is the least guaranteed anywhere in the SDK, which makes
it the worst possible place to key behaviour off a display string. That pattern
is one this SDK exists to remove from its consumers.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ERUwz8RFoDEdZfp4hFbGHz1 parent 3a69a4f commit 447d2e4
15 files changed
Lines changed: 1535 additions & 70 deletions
File tree
- scripts
- spec
- src/forward_sdk
- _async/services
- _generated
- _generated
- _sync/services
- _generated
- models
- nqe
- tests
- _async
- _sync
- spec
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| |||
248 | 254 | | |
249 | 255 | | |
250 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
251 | 289 | | |
252 | 290 | | |
253 | 291 | | |
| |||
269 | 307 | | |
270 | 308 | | |
271 | 309 | | |
| 310 | + | |
272 | 311 | | |
273 | 312 | | |
274 | 313 | | |
275 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
276 | 321 | | |
| 322 | + | |
277 | 323 | | |
278 | 324 | | |
279 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| |||
0 commit comments