docs(api): per-crate public API audit for 1.0 (#42)#116
Merged
joaquinbejar merged 1 commit intomainfrom May 6, 2026
Merged
Conversation
The 1.0 commitment per ADR-0007 is "the public API does not change
without a major bump." This audit pass freezes the public surface
across the four crates promoted to 1.0 (itch-protocol, itch-tcp,
itch-soup, itch-mold) and codifies the policy.
`#[non_exhaustive]` discipline:
- Added to error / event enums missing it:
- `itch_protocol::primitives::TimestampError`
- `itch_soup::LoginRejectReason`
- Already present (left intact): `ProtocolError`, `TransportError`,
`SoupError`, `MoldError`, `MoldEvent`, `ReplayError`,
`BookError`, `SourceError`, `RingBufferSeqStoreError`,
`RedisSeqStoreError`, `PostgresSeqStoreError`,
`KafkaSourceError`.
- Deliberately NOT applied to closed-set ITCH 5.0 enums:
`Message`, `EventCode`, `Side`, `CrossType`,
`ImbalanceDirection`, `MarketCategory`, `FinancialStatus`,
`Authenticity`, `YesNo`, `LuldTier`, `TradingState`,
`RegShoAction`, `MarketMakerMode`, `MarketParticipantState`,
`BreachedLevel`, `IpoReleaseQualifier`, `Printable`,
`PriceVariation`, `RpiInterestFlag`, `SoupPacket` (SoupBinTCP
3.00 wire shape), `CaptureFormat` (application flag).
Exhaustive `match` is intentional: a new ITCH revision lands
as a separate module; a new SoupBinTCP version ditto. The
codec must catch every new variant at compile time.
`itch-client::run_soup` updated with a fallback arm on
`LoginRejectReason` (`#[non_exhaustive]` requires it).
`API.md` (new, repo root): public-API manifest with the
`#[non_exhaustive]` policy, per-crate headline shapes, the
SemVer commitment in effect from 1.0, and the reproduction
recipe via `cargo public-api` + `cargo semver-checks`.
`Makefile` adds three new release-readiness targets:
- `make public-api` — print the full public surface for every
promoted crate.
- `make semver-check` — validate no breaking change since the
last published version (`cargo
semver-checks check-release`).
- `make check-msrv` — build + test every promoted crate
against the pinned MSRV (per #43).
- `make pre-publish` — composes pre-push + the three above.
The 1.0 release gate.
Both `cargo public-api` and `cargo semver-checks` are
opt-install (`cargo install cargo-public-api cargo-semver-checks
--locked`); the targets fail clearly if the tool is missing
rather than silently skipping the gate.
CHANGELOGs updated for `itch-protocol` and `itch-soup`. All
gates clean:
- `cargo build --workspace --all-features`
- `cargo clippy --workspace --all-targets --all-features -- -D warnings`
- `cargo test --workspace --all-features`
- `cargo fmt --all --check`
- `RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps`
Closes #42.
Signed-off-by: Joaquin Bejar <jb@taunais.com>
There was a problem hiding this comment.
Pull request overview
This PR codifies the workspace’s pre-1.0 public API audit and forward-compatibility policy (notably via #[non_exhaustive] discipline), and adds local release-readiness gates to help prevent accidental SemVer breaks as the promoted crates approach 1.0.
Changes:
- Add
#[non_exhaustive]toitch_soup::LoginRejectReasonanditch_protocol::primitives::TimestampError, plus updateitch-clientto handle forward-compatible matching. - Introduce
API.mdas a tracked workspace-level API/policy artifact, and update per-crate changelogs to record the audit decisions. - Add Makefile “1.0 release gates” targets (
public-api,semver-check,check-msrv,pre-publish) for repeatable pre-release validation.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Adds new release-readiness targets for API surface, SemVer checks, and MSRV checks (but check-msrv parsing is currently broken). |
| crates/itch-soup/src/lib.rs | Marks LoginRejectReason as #[non_exhaustive] and documents the forward-compat rationale. |
| crates/itch-soup/CHANGELOG.md | Records the #[non_exhaustive] change and downstream fallback update for 1.0 audit. |
| crates/itch-protocol/src/primitives.rs | Marks TimestampError as #[non_exhaustive] with rationale. |
| crates/itch-protocol/CHANGELOG.md | Records the TimestampError #[non_exhaustive] policy decision for the audit. |
| crates/itch-client/src/main.rs | Adds a fallback match arm to handle LoginRejectReason becoming #[non_exhaustive]. |
| Cargo.lock | Updates lockfile (removes async-trait from itch-source-kafka dependencies). |
| API.md | Adds workspace-level API audit/policy document and reproduction instructions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+123
to
+124
| @MSRV=$$(grep -E '^rust-version' crates/itch-protocol/Cargo.toml | head -1 | sed -E 's/.*"([0-9.]+)".*/\1/'); \ | ||
| if [ -z "$$MSRV" ]; then echo "could not detect MSRV from crates/itch-protocol/Cargo.toml"; exit 1; fi; \ |
Comment on lines
+5
to
+7
| root (the canonical `docs/` folder is local-only per | ||
| `.git/info/exclude`); when a crate is published to crates.io, the | ||
| audit captured here is what its 1.0.0 promises. |
Comment on lines
+159
to
+163
| - Renaming, removing, or changing the signature of any item in | ||
| this manifest is **breaking** (major bump). | ||
| - Raising MSRV is **breaking-by-policy** (see `MSRV.md`) — a | ||
| one-minor-version deprecation window applies. | ||
| - Changing wire format (`Message::encode` / `decode` byte shape) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42.
Summary
The 1.0 commitment per ADR-0007 is "the public API does not change without a major bump." This audit pass freezes the public surface across the four crates promoted to 1.0 and codifies the policy.
`#[non_exhaustive]` discipline
Added to error / event enums missing it:
Already present and left intact across every other error / event enum (12 total — see `API.md`).
Deliberately not applied to closed-set ITCH 5.0 enums (`Message`, `EventCode`, `Side`, …) and `SoupPacket` / `CaptureFormat`. Exhaustive `match` is intentional: a new ITCH revision lands as a separate module; a new SoupBinTCP version ditto. The codec must catch every new variant at compile time.
New tracked artifact: `API.md`
Repo-root manifest with the `#[non_exhaustive]` policy, per-crate headline shapes, the SemVer commitment in effect from 1.0, and the reproduction recipe via `cargo public-api` + `cargo semver-checks`.
Makefile gates for 1.0 release-readiness
`cargo public-api` and `cargo semver-checks` are opt-install; the targets fail clearly if the tool is missing.
Other changes
Test plan