Repository navigation
State the API governance policy and adopt the fleet lint table - #163
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🔵 Needs a closer look
The change set is broad (lint policy + generator + regenerated code + core crate edits), so a final human pass is warranted to confirm no subtle API/behavior regressions.
Pull request overview
This PR documents the Rust crate’s public API governance policy (versioning/MSRV and how request- vs response-side types evolve) and adopts the shared “fleet” lint configuration across rust/hey-sdk and rust/generator, with associated doc/pedantic cleanups and regenerated artifacts.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
Changes:
- Add/align versioning + API evolution policy documentation across
rust/hey-sdk/README.md,CONTRIBUTING.md, andAGENTS.md. - Adopt the shared Rust + Clippy lint tables in
rust/hey-sdk/Cargo.tomlandrust/generator/Cargo.toml, plus addrust/clippy.tomland regenerate Rust generated sources with a consistent lint header. - Apply rustdoc and clippy-driven refactors across the Rust crate, tests, and generator code.
File summaries
| File | Description |
|---|---|
| rust/hey-sdk/tests/support/mod.rs | Restrict test support helpers to crate visibility (pub(crate)). |
| rust/hey-sdk/tests/services_world.rs | Add module-level rustdoc for wire-level tests. |
| rust/hey-sdk/tests/services_workflows.rs | Add module rustdoc; improve numeric literal readability in tests. |
| rust/hey-sdk/tests/services_topics.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_time_tracks.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_time_track_categories.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_stickies.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_snippets.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_search.rs | Add module rustdoc; improve numeric literal readability in fixtures/asserts. |
| rust/hey-sdk/tests/services_publications.rs | Add module rustdoc; improve numeric literal readability. |
| rust/hey-sdk/tests/services_postings.rs | Add module rustdoc; update type usage to PostingChanges; make assertion explicit. |
| rust/hey-sdk/tests/services_journal.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_identity.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_habits.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_folders.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_extenzions.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_designations.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_contacts.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_collections.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_collections_writes.rs | Add module rustdoc; improve numeric literal readability in IDs. |
| rust/hey-sdk/tests/services_clips.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_clearances.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_calendars.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_calendar_todos.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_calendar_periods.rs | Add module rustdoc; improve numeric literal readability in JSON fixture. |
| rust/hey-sdk/tests/services_calendar_events.rs | Add module rustdoc; improve numeric literal readability; tighten comment formatting. |
| rust/hey-sdk/tests/services_calendar_changes.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_bulk_replies.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_boxes.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/services_attachments.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/routes.rs | Add module-level rustdoc describing route table coverage. |
| rust/hey-sdk/tests/resilience.rs | Add module rustdoc; make params type explicit in one call site. |
| rust/hey-sdk/tests/recordings.rs | Add module rustdoc; improve numeric literal readability. |
| rust/hey-sdk/tests/raw.rs | Add module rustdoc; make params type explicit in one call site. |
| rust/hey-sdk/tests/pagination.rs | Add module rustdoc; make params type explicit in one call site. |
| rust/hey-sdk/tests/observability.rs | Add module rustdoc; adjust internal recorder helper and formatting. |
| rust/hey-sdk/tests/get_all.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/form.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/errors.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/dates.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/config.rs | Add module rustdoc; handle poisoned mutex explicitly; allow unsafe env mutation in tests with rationale. |
| rust/hey-sdk/tests/client_pipeline.rs | Add module rustdoc; make params types explicit; adjust query string collection. |
| rust/hey-sdk/tests/cache.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/body_limit.rs | Add module-level rustdoc. |
| rust/hey-sdk/tests/account_scope.rs | Add module-level rustdoc. |
| rust/hey-sdk/src/url.rs | Add/adjust docs and targeted clippy allow for a provably-infallible expect. |
| rust/hey-sdk/src/types.rs | Add rustdoc; avoid lossy casts in date arithmetic. |
| rust/hey-sdk/src/services/world.rs | Add rustdoc for service and client accessor; document one targeted clippy allow. |
| rust/hey-sdk/src/services/workflows.rs | Add rustdoc on public fields; update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/topics.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/time_tracks.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/stickies.rs | Add rustdoc on enum + helpers; strengthen integer conversions and limit handling. |
| rust/hey-sdk/src/services/snippets.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/search.rs | Add rustdoc on results shape; update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/publications.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/postings.rs | Add rustdoc on enums/structs; adjust helper signature; update impl lifetime style. |
| rust/hey-sdk/src/services/messages.rs | Add rustdoc on message/draft structs; update impl lifetime style. |
| rust/hey-sdk/src/services/journal.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/identity.rs | Add rustdoc on enum; update impl lifetime style. |
| rust/hey-sdk/src/services/habits.rs | Add rustdoc on params; update impl lifetime style. |
| rust/hey-sdk/src/services/extenzions.rs | Add rustdoc on structs; update impl lifetime style. |
| rust/hey-sdk/src/services/entries.rs | Add rustdoc on reply recipients; update impl lifetime style. |
| rust/hey-sdk/src/services/designations.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/contacts.rs | Add rustdoc on structs; minor perf/style refactors (clone_from, i64::to_string). |
| rust/hey-sdk/src/services/collections.rs | Add rustdoc; simplify optional string handling via Option<&str>. |
| rust/hey-sdk/src/services/clips.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/clearances.rs | Add rustdoc; minor refactor (i64::to_string). |
| rust/hey-sdk/src/services/calendars.rs | Add rustdoc on decoded list structs; update impl lifetime style. |
| rust/hey-sdk/src/services/calendar_todos.rs | Add rustdoc on update struct; update impl lifetime style. |
| rust/hey-sdk/src/services/calendar_periods.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/calendar_events.rs | Add extensive rustdoc; adjust optional field encoding; update impl lifetime style; simplify helpers. |
| rust/hey-sdk/src/services/calendar_changes.rs | Add rustdoc on cursor/changes structs; update impl lifetime style. |
| rust/hey-sdk/src/services/bulk_replies.rs | Update impl lifetime style (impl X<'_>). |
| rust/hey-sdk/src/services/boxes.rs | Add rustdoc; refactor cache read flow; update impl lifetime style. |
| rust/hey-sdk/src/services/attachments.rs | Update impl lifetime style; add targeted cast allow with rationale. |
| rust/hey-sdk/src/security.rs | Add rustdoc to is_localhost. |
| rust/hey-sdk/src/route.rs | Expand rustdoc across route metadata types. |
| rust/hey-sdk/src/resilience/rate_limit.rs | Harden mutex poisoning behavior; add docs and targeted clippy allows in tests. |
| rust/hey-sdk/src/resilience/mod.rs | Add rustdoc and #[must_use] on builder methods; handle mutex poisoning. |
| rust/hey-sdk/src/resilience/circuit_breaker.rs | Handle mutex poisoning; add docs and a targeted cast precision allow. |
| rust/hey-sdk/src/resilience/bulkhead.rs | Make BulkheadConfig Copy; add docs. |
| rust/hey-sdk/src/raw.rs | Add rustdoc for raw HTTP helpers. |
| rust/hey-sdk/src/pagination.rs | Rename internal cursor storage; expose value accessors; factor next-page parsing into helper. |
| rust/hey-sdk/src/operation.rs | Add rustdoc; add targeted allow for struct bool count. |
| rust/hey-sdk/src/observability.rs | Expand rustdoc on hook types; adjust test helper signature. |
| rust/hey-sdk/src/oauth.rs | Add rustdoc on public OAuth types; avoid lossy cast when computing expires_at. |
| rust/hey-sdk/src/lib.rs | Add crate-level lint attributes and expand module-level rustdoc. |
| rust/hey-sdk/src/http/reqwest.rs | Add targeted allow + rationale for expect in Default. |
| rust/hey-sdk/src/http/mod.rs | Add docs and docsrs feature annotation for reqwest export. |
| rust/hey-sdk/src/generated/types.rs | Add generated-file lint allow header. |
| rust/hey-sdk/src/generated/services/workflows.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/topics.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/time_tracks.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/stickies.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/snippets.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/search.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/publications.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/postings.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/mod.rs | Add generated-module lint allow header. |
| rust/hey-sdk/src/generated/services/messages.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/journal.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/identity.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/habits.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/folders.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/extenzions.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/entries.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/designations.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/contacts.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/collections.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/clips.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/clearances.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/calendars.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/calendar_todos.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/calendar_periods.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/calendar_events.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/bulk_replies.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/boxes.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/services/attachments.rs | Replace per-file allow with standard generated lint allow header. |
| rust/hey-sdk/src/generated/routes.rs | Add generated-file lint allow header. |
| rust/hey-sdk/src/generated/mod.rs | Add generated-module lint allow header. |
| rust/hey-sdk/src/form.rs | Add rustdoc on FormResponse::status. |
| rust/hey-sdk/src/error.rs | Add rustdoc on error categories + helpers; minor refactors to match lint expectations. |
| rust/hey-sdk/src/config.rs | Add rustdoc and #[must_use] on config builders. |
| rust/hey-sdk/src/client.rs | Add extensive rustdoc and #[must_use] on builder methods; small clippy-driven refactors. |
| rust/hey-sdk/src/cache.rs | Add rustdoc; handle poisoned mutexes; refactor hex encoding implementation. |
| rust/hey-sdk/src/auth.rs | Add rustdoc on auth traits/types. |
| rust/hey-sdk/README.md | Add “Versioning” policy section (semver rules, MSRV, type evolution rules). |
| rust/hey-sdk/Cargo.toml | Add fleet [lints] tables for rust + clippy. |
| rust/generator/src/naming.rs | Reduce visibility to pub(crate); add targeted clippy allow for input checks. |
| rust/generator/src/model.rs | Reduce visibility to pub(crate); harden parsing for status/retry fields; rename retry field to on. |
| rust/generator/src/main.rs | Pass rendered file map by reference (avoid moves/clones). |
| rust/generator/src/emit/types.rs | Reduce visibility to pub(crate). |
| rust/generator/src/emit/services.rs | Reduce visibility; rely on common generated-file header instead of per-file allow. |
| rust/generator/src/emit/routes.rs | Update emitted retry list source to match model (on). |
| rust/generator/src/emit/mod.rs | Centralize generated-file header including lint allow; refactor doc comment rendering. |
| rust/generator/Cargo.toml | Add fleet [lints] tables for rust + clippy. |
| rust/clippy.toml | Add repository clippy configuration (MSRV, thresholds, exported API checks). |
| CONTRIBUTING.md | Document versioning policy and request-side vs response-side guidance for PRs. |
| AGENTS.md | Add Rust lint + generated-surface evolution documentation for contributors. |
Review details
- Files reviewed: 108/139 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 735c63a547
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
735c63a to
9cc320c
Compare
|
Rebased onto Adversarial review (Codex CLI, gpt-6-astra at xhigh, read-only, over the hand-written diff) raised seven points; six folded in 9cc320c, one declined:
|
9cc320c to
7309c87
Compare
4abcbb2 to
23a4ed6
Compare
23a4ed6 to
6c8fc16
Compare
Every public module, field, variant and method in the crate's plumbing — errors, routes, operations, types, config, security, the raw verbs, forms, pagination, auth, the cache and the HTTP seam — now says what it means. Builders that return Self are must_use. A poisoned cache lock is used as it stands rather than taking the client down, the exit-code match merges its equal arms, the month arithmetic converts rather than casts, and the Link-following helper drops the self it never read.
… clear their pedantic lints Every public constant, field and method in these files now says what it means in HEY's terms. The resilience layers survive a poisoned lock instead of panicking, BulkheadConfig is Copy so its constructor need not be handed a clone, an OAuth lifetime past i64 seconds is no lifetime rather than a wrapped one, and the jitter draw saturates rather than truncates. Builder methods are must_use.
Every public field, variant and method in the service modules says what it carries in HEY's terms, the enums naming HEY's own word where it differs from the Rust one. Service impl blocks elide their lifetime, the casts go through try_from or a targeted allow where the value provably fits, and the generator narrows its items to pub(crate), folds its status-code lists through one reader, and borrows the rendered files rather than taking them.
Every test crate says what it covers, the shared support module is crate-visible, long literals carry separators and a default is named by its type.
…omise A network error is retryable because the request can go out again, not because HEY never saw it; the doc said the latter. The default reqwest client and Match::operation carry their panic contracts rather than a claim of infallibility. The environment test states the condition its lock actually provides. The versioning text no longer asserts gates that land separately, calls out that a response field added without a decoding default is a break whatever the attribute says, and puts open enums on both sides of the wire since their declared variants remain constructible.
The examples and the no-default-features transport arrived after the table and read under it now: a map_or_else, a field that repeated its struct's name, a method path for the poison recovery, and crate-visible test support.
…ff Copy The trace helpers that only the feature's macros call are behind the feature, so a build without it has no dead code; the no-feature twins carry their shape for the call sites' sake. BulkheadConfig gaining Copy was a semver-checks major (copy_impl_added), so it stays Clone and the registry clones it as before.
6c8fc16 to
e42e451
Compare
|
Rebased onto Gate at e42e451: |
Tracking card: hey-sdk Rust: public API governance. First of two: this one states the policy and adopts the lint table; #166 applies
#[non_exhaustive]and carries the migration note. Merge order: this PR, then #166 (stacked on this branch; GitHub retargets it tomainon merge). Both are kept rebased onmainand converged together.Policy (bar section H). Three documents, one decision:
rust/hey-sdk/README.mdgains a Versioning section: pre-1.0 semver (0.MINORbreaking,0.x.PATCHadditive), the MSRV (1.88, stated asrust-version, moved only when a dependency or language feature requires it, as a minor release with a release-notes line, never required above stable minus eight), and How types evolve — the request-construction policy. Request-side types (bodies,*Params,Config, the resilience configs,ExchangeRequest/RefreshRequest) are built literally, keepDefaultand..Default::default(), and are never#[non_exhaustive], so a field added to one is a0.MINOR. Response-side types and open enums are#[non_exhaustive], so a field or variant added there is a0.x.PATCH. A type on both sides is request-side. Closed enums stay exhaustive. The generator applies the rule by reachability from request bodies, not by name. Enums, when the model declares them, are emitted withUnknown(String)so an undeclared value survives a read-modify-write; until then the generator invents none.CONTRIBUTING.mdgains a Versioning section pointing at the policy and asking a PR to say which side a touched type is on.AGENTS.md(Rust section) gains Lints and How the generated surface evolves, the generator-facing statement of the same rule.Lints (bar section G), the fleet table from the cross-repo Rust devex standard, verbatim in both
rust/hey-sdk/Cargo.tomlandrust/generator/Cargo.toml:missing_docs,unreachable_pub,unexpected_cfgswithcheck-cfg(docsrs), clippyall+pedanticat warn with the four reasoned allowances (module_name_repetitions,must_use_candidate,missing_errors_doc,missing_panics_doc);-D warningsstays in CI, not in the table.rust/clippy.tomlcarriesmsrv = "1.88", the argument and type-complexity thresholds andavoid-breaking-exported-api. One local deviation from the standard, recorded here:unsafe_codeisdenyin the table rather thanforbid, with#![forbid(unsafe_code)]inlib.rsholding the library to the stronger form —tests/config.rshas to callenv::set_var, which isunsafeunder edition 2024, andforbidin the table cannot be lifted for that one test.lib.rsalso carries#![cfg_attr(not(test), deny(clippy::unwrap_used, clippy::expect_used))], which reaches the library and nothing undertests/; the ~106unwrap/expecthits insrctriaged as: 20Mutex::lock().unwrap()→unwrap_or_else(PoisonError::into_inner)(a poisoned lock still holds usable state and must not take the client down), two provably-infallible sites kept behind a targeted allow with the reason on the line (ReqwestClient::defaultbuilding reqwest from its defaults;Match::operationon a match that always carries a route), the rest inside#[cfg(test)].Generated code is not lint-gated: every file the generator writes now starts with
#, which replaces the per-filetoo_many_argumentsallowance. Regenerated;rs-check-driftgreen.Docs. Every public item in hand-written code now has rustdoc, written in the crate's voice (what a thing means, not "gets the X"): 13 module lines in
lib.rs, every undocumented field, variant, method and constant across the core modules, the client, OAuth, observability, resilience and the 27 service modules. Every integration test crate says what it covers.Pedantic fixes, behavior identical, no public signature changed (
avoid-breaking-exported-apiholds):impl<'a> X<'a>→impl X<'_>across the services,#[must_use]on theSelf-returning builders,try_fromwhere a cast could lose bits,if let … elsefor single-arm matches, identical match arms merged,clone_from,Option<&str>over&Option<String>on a private helper, private field/function renames where a name repeated the type. Ten targeted#[allow]s remain, each with its reason on the line (listed in the diff by#[allow). One thing worth a reader's eye:oauth::expires_atreadsexpires_inthroughi64::try_from(..).ok()?, so a value pasti64::MAXyieldsNonewhere it used to wrap negative into an already-past instant.client.rs (Lane A is changing its retry and tracing code concurrently): the non-doc lines changed are the 13
#[must_use]attributes onClientBuilder, one#[allow(clippy::too_many_lines)]onattempt, amatch→if letinurl_for, thenonminimal_boolone-liner in the cache check (is_none_or), andu64::try_from(millis).unwrap_or(u64::MAX)inwait. Everything else there is///text.Not in here (Lane C's):
rustfmt.toml,rust-toolchain.toml,deny.toml, the CI matrix, Makefile targets. Not in here either: any version file (a 0.30.0 release is being cut).Local gate on Rust 1.98.1, at the current head (rebased onto
mainafter #165 and #170):make -C rust check(fmt, clippy--all-targets -D warnings, test — 48 suites, doc-D warnings,--no-default-features, examples, deny, publish dry run) exit 0;make rs-check-driftexit 0;make conformance-rs195/195;cargo check -p hey-sdkon 1.88.0 with--all-featuresand--no-default-featuresboth build.cargo semver-checksagainstmainreports nothing:BulkheadConfigbriefly gainedCopyhere and lost it again when the check named that a major (copy_impl_added).Review. Codex CLI adversarial pass done (seven findings: six folded in 9cc320c, one declined — the dispositions are in the rebase comment below). Copilot and Codex-bot threads answered inline. Babysitting the review loop to convergence.