Problem
Neither scripts/check-openapi-drift.py nor spec_coverage_test.rs compares the values of inline enums (the spec's enum: [...] arrays) against the Rust enum variants. They track:
- enum/struct/type names (existence)
- struct fields
- field optionality (
Option<T> vs T)
…but a value added to or removed from a spec enum is invisible to both the daily drift check (reports 0) and the coverage test.
How it surfaced
In #273 (PR resolving #224), the spec dropped seekSnapshot and removed snapshot from the PubSub seekType enum (now ["latest","earliest","timestamp"]). The companion seekSnapshot field removal was caught, but the stale Snapshot variant on ClickPipePostPubSubSourceSeektype / ClickPipePubSubSourceSeektype was left behind and serialized to "snapshot" — a value the API now rejects. The drift check still reported 0. Caught only by Cursor Bugbot, fixed in #273.
Proposed fix
Extend drift detection to enum variant values, bidirectionally (mirroring the missing/extra split already used for methods and struct fields):
- spec → code: every spec
enum value has a matching Rust variant (catches added values)
- code → spec: every Rust variant (excluding the
Unknown(String) catch-all and #[serde(untagged)] arms) maps to a spec value (catches removed values, which is the case above)
Add the check to both check-openapi-drift.py (report section + the daily CI run) and a new spec_coverage_test.rs assertion against the vendored snapshot, keeping them in lockstep like the existing field checks. Compare against the #[serde(rename = "...")] values, not the variant identifiers.
Problem
Neither
scripts/check-openapi-drift.pynorspec_coverage_test.rscompares the values of inline enums (the spec'senum: [...]arrays) against the Rust enum variants. They track:Option<T>vsT)…but a value added to or removed from a spec enum is invisible to both the daily drift check (reports 0) and the coverage test.
How it surfaced
In #273 (PR resolving #224), the spec dropped
seekSnapshotand removedsnapshotfrom the PubSubseekTypeenum (now["latest","earliest","timestamp"]). The companionseekSnapshotfield removal was caught, but the staleSnapshotvariant onClickPipePostPubSubSourceSeektype/ClickPipePubSubSourceSeektypewas left behind and serialized to"snapshot"— a value the API now rejects. The drift check still reported 0. Caught only by Cursor Bugbot, fixed in #273.Proposed fix
Extend drift detection to enum variant values, bidirectionally (mirroring the missing/extra split already used for methods and struct fields):
enumvalue has a matching Rust variant (catches added values)Unknown(String)catch-all and#[serde(untagged)]arms) maps to a spec value (catches removed values, which is the case above)Add the check to both
check-openapi-drift.py(report section + the daily CI run) and a newspec_coverage_test.rsassertion against the vendored snapshot, keeping them in lockstep like the existing field checks. Compare against the#[serde(rename = "...")]values, not the variant identifiers.