Mark output-only pub structs non_exhaustive #191

Merged
natsukium merged 1 commit from api/output-structs into main 2026-10-19 17:08:49 +09:00
Owner

Pre-publish refactor for #160: #[non_exhaustive] on 52 output-only pub structs, so adding a field to one later is not a semver-major change.

The structs covered are the ones only ever handed out: decoded rows, search hits, mode snapshots, dial results, probes, captures, and the json_v1 DTO structs. The felis_json: 1 contract already allows those DTOs to gain optional fields.

Some structs stay exhaustive:

  • Structs a consumer builds with a literal or destructures without .., which includes the sibling repos (felis-tui, felis-reel, spoor, …). They take new fields as 0.x minor bumps.
  • AttributesJson, SizingJson, AttrRunJson and SizedCellJson, because the grid proptests build them.
  • Diagnostic, because the public ConfigDiagnostics::push takes it as an argument.

Enums are deliberately left exhaustive. In 0.x, a new variant is a cheap 0.(x+1) bump, and that keeps every in-workspace match checked by the compiler. With a #[non_exhaustive] enum, a crate could be built against a newer protocol minor, and then every _ arm would need designed handling for unknown variants.

just check and just check-windows pass.

Pre-publish refactor for #160: `#[non_exhaustive]` on 52 output-only pub structs, so adding a field to one later is not a semver-major change. The structs covered are the ones only ever handed out: decoded rows, search hits, mode snapshots, dial results, probes, captures, and the json_v1 DTO structs. The `felis_json: 1` contract already allows those DTOs to gain optional fields. Some structs stay exhaustive: - Structs a consumer builds with a literal or destructures without `..`, which includes the sibling repos (felis-tui, felis-reel, spoor, …). They take new fields as 0.x minor bumps. - `AttributesJson`, `SizingJson`, `AttrRunJson` and `SizedCellJson`, because the grid proptests build them. - `Diagnostic`, because the public `ConfigDiagnostics::push` takes it as an argument. Enums are deliberately left exhaustive. In 0.x, a new variant is a cheap 0.(x+1) bump, and that keeps every in-workspace `match` checked by the compiler. With a `#[non_exhaustive]` enum, a crate could be built against a newer protocol minor, and then every `_` arm would need designed handling for unknown variants. `just check` and `just check-windows` pass.
workspace: mark output-only pub structs non_exhaustive
Some checks failed
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 8s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 11s
windows / windows docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 1m11s
windows / cargo nextest (Windows) (pull_request) Successful in 2m55s
windows / frontend smoke (Windows) (pull_request) Successful in 43s
bench / instruction-count regression gate (pull_request) Successful in 1m56s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m38s
pr / nix flake check (pull_request) Successful in 1m1s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m41s
pr / wire schema is compatible with the base (pull_request) Successful in 3s
windows / cargo clippy (Windows cross) (pull_request) Successful in 32s
pr / frontend smoke (x86_64-linux) (pull_request) Has been cancelled
8fe08e62c4
For crates.io publishing, a struct no consumer builds with a literal can
gain a field in a minor release only if it is non_exhaustive. This
covers the structs that are only ever handed out (decoded rows, search
hits, mode snapshots, dial results, probes, captures) and the json_v1
DTO structs, whose felis_json: 1 contract already admits a new optional
field. Structs consumers construct stay exhaustive and take new fields
as 0.x minor bumps; the json_v1 row attribute and sizing DTOs stay
exhaustive because the grid property tests build them.

Assisted-by: Claude Code
Merge remote-tracking branch 'origin/main' into api/output-structs
Some checks failed
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Has been cancelled
fuzz / cargo fuzz smoke (per target) (pull_request) Has been cancelled
pr / nix flake check (pull_request) Has been cancelled
pr / cargo build / clippy / test / deny (pull_request) Has been cancelled
pr / wire schema is compatible with the base (pull_request) Has been cancelled
pr / frontend smoke (x86_64-linux) (pull_request) Has been cancelled
windows / detect relevant changes (pull_request) Has been cancelled
windows / cargo clippy (Windows cross) (pull_request) Has been cancelled
windows / cargo nextest (Windows) (pull_request) Has been cancelled
windows / frontend smoke (Windows) (pull_request) Has been cancelled
windows / windows docs-only no-op (pull_request) Has been cancelled
darwin / build felis (aarch64-darwin) (pull_request) Has been cancelled
7d3db06cbf
natsukium force-pushed api/output-structs from 7d3db06cbf
Some checks failed
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Has been cancelled
fuzz / cargo fuzz smoke (per target) (pull_request) Has been cancelled
pr / nix flake check (pull_request) Has been cancelled
pr / cargo build / clippy / test / deny (pull_request) Has been cancelled
pr / wire schema is compatible with the base (pull_request) Has been cancelled
pr / frontend smoke (x86_64-linux) (pull_request) Has been cancelled
windows / detect relevant changes (pull_request) Has been cancelled
windows / cargo clippy (Windows cross) (pull_request) Has been cancelled
windows / cargo nextest (Windows) (pull_request) Has been cancelled
windows / frontend smoke (Windows) (pull_request) Has been cancelled
windows / windows docs-only no-op (pull_request) Has been cancelled
darwin / build felis (aarch64-darwin) (pull_request) Has been cancelled
to 6b5f12c89a
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 8s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 11s
windows / windows docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 1m10s
windows / cargo nextest (Windows) (pull_request) Successful in 2m41s
windows / frontend smoke (Windows) (pull_request) Successful in 37s
bench / instruction-count regression gate (pull_request) Successful in 53s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 52s
pr / nix flake check (pull_request) Successful in 38s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m52s
pr / wire schema is compatible with the base (pull_request) Successful in 2s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 27s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
2026-10-19 14:17:46 +09:00
Compare
natsukium deleted branch api/output-structs 2026-10-19 17:08:49 +09:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
felis-terminal/felis!191
No description provided.