Commit 873d2ec
* ci(spec-drift): stop weekly/daily issue spam — ack/snooze, auto-close, content titles
The recurring #467 (nightly) / #470 (weekly) issues are two detectors on one
real, deterministic upstream drift — but the reporting mechanics amplified the
pain. Fix the mechanics without weakening the read-only security model.
Nightly (spec-drift.yml):
- Comment only when the failing-test-ID set changes (a fingerprint), not every
failing night — a deterministic upstream produced identical spam indefinitely.
- `spec-drift-ack` / `snoozed` label silences comments while a reconcile is in
flight, without closing the tracker.
- New report-success job auto-closes the tracker on a green scheduled run
(the workflow previously only ever opened/commented).
Weekly (spec-sync.yml):
- Title leads with a content signal ([content-changed] + path delta + short
fingerprint) instead of a bare version — Kalshi changes content in place
without bumping info.version, so "3.23.0 → 3.23.0" read as a false alarm.
- Supersede stale weekly snapshots so exactly one weekly drift issue stays open
instead of one per upstream micro-revision. Scoped to spec-sync-bot so the
nightly tracker is never touched.
Refs #467, #470
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(contracts): de-brittle drift suite + close false-negative gaps
Direction 1 — less brittle (stop benign churn redding CI against a fast-moving,
loosely-versioned upstream):
- Additive drift split: a spec-REQUIRED field the SDK lacks still hard-fails
(act now); a spec-OPTIONAL field becomes a non-blocking
AdditiveOptionalDriftWarning. It deliberately subclasses Warning (not
UserWarning) so the nightly `-W error::UserWarning` gate cannot promote benign
optional drift to a red build. +3 regression tests lock the contract.
- test_schema_coverage batches all unresolved schemas into one failure instead
of failing on the first (one-at-a-time reruns on multi-removal drift).
Direction 2 — close false-negatives (catch real drift the suite missed):
- test_every_spec_endpoint_is_mapped asserts every spec OPERATION
(core+perps+perps_scm) is in a METHOD_ENDPOINT_MAP, minus a reasoned
_UNIMPLEMENTED_ENDPOINTS allowlist. Catches ADDED endpoints/operations the
schema/path-count diff misses — verified against live 3.24.0, which had it
caught the two new /margin/* endpoints AND a new GET on an existing
/communications/rfqs/.../quotes path that the weekly path diff reported as
"Added endpoints: (none)".
- kwarg_rename exclusions are now spec-anchored (test_exclusion_map_is_current):
the spec-side param must still exist for the endpoint, so a rename can't go
stale and silently mask an upstream param removal/rename.
Docstring updated to the actual post-#171/#172 behavior and to document why
response-side field REMOVAL is intentionally NOT gated: the vendored "Kalshi
Trade API Manual Endpoints" spec is a curated subset, so SDK response models are
a superset by design; gating removals would red CI on every intentional SDK
field. Request-BODY drift already gates removals (_check_model_drift), which is
where a rename's dropped old name is caught.
Refs #467, #470
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent be0c5fb commit 873d2ec
3 files changed
Lines changed: 381 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
| |||
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
107 | | - | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
| |||
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
133 | 163 | | |
134 | | - | |
| 164 | + | |
135 | 165 | | |
136 | 166 | | |
137 | 167 | | |
| 168 | + | |
138 | 169 | | |
139 | | - | |
| 170 | + | |
140 | 171 | | |
141 | 172 | | |
142 | 173 | | |
143 | 174 | | |
144 | 175 | | |
145 | 176 | | |
146 | | - | |
| 177 | + | |
| 178 | + | |
147 | 179 | | |
| 180 | + | |
148 | 181 | | |
149 | 182 | | |
150 | 183 | | |
151 | 184 | | |
152 | 185 | | |
153 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | | - | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
| |||
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
250 | 261 | | |
251 | | - | |
| 262 | + | |
252 | 263 | | |
253 | 264 | | |
254 | 265 | | |
255 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
0 commit comments