You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(uts-to-kotlin): spec-first fail-fast for UTS spec errors in Step 6
Align the skill's Step 6 with the spec manual (ably/specification#498) so a
diagnosed UTS spec error is handled spec-first instead of being quietly
adapted to green:
- Step 6 intro now names three acceptable end-states (spec-correct pass,
SDK deviation stays green, UTS spec error fails fast) — removes the
earlier "a red test is never acceptable" contradiction.
- Decision tree NO-branch: fix the spec at source + record under
deviations.md "UTS Spec Errors" + emit a fail-fast test.
- Add the "spec-error fail-fast" Kotlin pattern (mirrors the manual's JS
example) and retitle the section to "Test patterns for a diagnosed
failure" since fail-fast is not a deviation.
- Defer the deviations-file entry format to the manual's "Recording
deviations" sections (removes the divergent inline field list).
**Spec-error fail-fast***(UTS spec error — NOT an SDK deviation)* — when the decision tree's first branch is **NO** (the UTS spec contradicts the features spec, or is internally inconsistent), the spec is the fixable source of truth, so the test must **fail loudly** pointing at the deviation entry, rather than be quietly adapted to green. This is the opposite of the SDK-deviation patterns above (which stay green / assert actual behaviour) — failing fast is the forcing function that gets the spec fixed early.
fun`RTLC7c2 - LOCAL source does not write siteTimeserials`() = runTest {
493
+
// SPEC ERROR RTLC7c2: replayed ACK serial "t:1:0" contradicts the harness ("ack-0:0").
494
+
// Fix the UTS spec first — see deviations.md (UTS Spec Errors).
495
+
fail("UTS spec error RTLC7c2 — fix the spec first; see deviations.md")
496
+
}
497
+
```
498
+
477
499
**Never use the accommodate-both pattern** (accept either spec or SDK behaviour). Every test must assert either spec behaviour or the SDK's actual behaviour — never both at once.
478
500
479
501
### Deviations file
480
502
481
-
Append to `uts/src/test/kotlin/io/ably/lib/uts/deviations.md`. Each entry needs:
482
-
1. The spec point (e.g. `RSA4c2`)
483
-
2. What the spec says
484
-
3. What the SDK does
485
-
4. Which test is affected and how it was adapted
503
+
Append to `uts/src/test/kotlin/io/ably/lib/uts/deviations.md`, using the manual's **Recording deviations**
504
+
entry format and sections. The ably-java-specific mapping: a **UTS Spec Error** (test fails fast — fix in
505
+
the spec) goes under the manual's *UTS Spec Errors* section; an **SDK deviation** (env-gated/adapted — fix
506
+
in the SDK) goes under *Failing Tests* / *Adapted Tests*.
0 commit comments