You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add class field discovery for computed selectors (#77)
## Summary
- Make `class fields --name <class>` the canonical field-inventory command.
- Include enabled shared and personal computed selectors with source, observed count, types, and examples.
- Retain `object fields --class <class>` as a deprecated compatibility alias that prints an exact, argument-preserving replacement.
- Add reusable command-deprecation metadata for future command-path and option migrations.
## Rationale and design decisions
Field discovery belongs to the class being described, so the canonical command moves under `class`. The shipped `object fields` spelling remains registered to avoid an abrupt command removal.
Deprecation behavior lives in the shared command builder rather than the individual field handler. A deprecated command declares its replacement path and option renames; the common runner then annotates help and emits a shell-safe replacement that preserves scoped invocations, options, positionals, pipelines, and the `--` boundary.
Computed definitions remain visible when enabled even if no sampled object produces a value. Counts, types, and examples are observation-based, while computed evaluation errors do not hide the definition row.
## Behavior notes
`class fields --name <class>` samples the class data paths and lists enabled shared selectors as `S:<key>` and enabled personal selectors as `P:<key>`. A `Source` column distinguishes data, shared-computed, and personal-computed rows.
The deprecated alias emits an exact replacement such as `class fields --name Hosts`, including rewritten `--class` or `-c` arguments and any trailing pipeline.
## User and compatibility impact
Existing field-inventory output has a breaking output-shape change: it gains a `Source` column and computed-selector rows. Structured consumers that validate the exact legacy column set or assume every row is a `data.*` path must accept the new column and either handle or filter the `S:` and `P:` rows.
No command is removed: `object fields --class <class>` continues to work. Users should migrate to `class fields --name <class>` using the exact replacement printed by the deprecation warning. There are no other breaking changes.
## Declared compatibility surface
The declared Hubuum server target remains 0.0.9, and `COMPATIBILITY.md` is unchanged. The OpenAPI surface and all request and response types are unchanged; the implementation composes existing typed gateway operations for computed definitions and computed object values.
Feature availability is unchanged, no MSRV is declared or changed, and dependencies and `Cargo.lock` are unchanged. The root manifest retains its exact `hubuum_client` 0.9.1 pin. No public workspace-crate API changes, so no Rust library semver migration is required.
This change makes no new cross-version server compatibility claim. The existing declared target remains backed by the immutable Hubuum v0.0.9 image recorded in `COMPATIBILITY.md` (`sha256:1f12baf882b6d3df5b4b2dbdf26aad0793274e57f86a2c186b8e1e68632db5db`).
## Changelog
`CHANGELOG.md` documents the canonical command, compatibility alias, exact migration, reusable warning behavior, computed-selector inventory, and breaking output-shape change under `[Unreleased]`.
0 commit comments