Skip to content

Validate projection fields from a machine-discoverable schema #4836

Description

@Widthdom

Summary

Commands such as search, references, and map accept --fields bogus and succeed with rows like [{}]. At the same time, clients have no machine-readable catalog of valid projection fields.

Audit IDs: Q-02 and Q-18. Closed #1527 is adjacent schema/response work, but no exact issue covers this gap.

Expected behavior

Each command must validate requested fields against one authoritative registry and expose that registry to humans and automation.

PR scope

Keep this to the canonical projection-field registry, validation, and discovery. Row placement/JSON-mode serialization is a separate issue.

Implementation guide for Codex 5.6 sol xhigh

  • Inventory fields per command/result kind and represent aliases/deprecations explicitly.
  • Reuse the registry for validation, help, and either --fields list or a command-schema endpoint; do not maintain parallel lists.
  • Unknown fields should return one stable usage error with valid/nearby candidates, never an empty object.
  • Test command-specific fields, aliases, case behavior, multiple fields, JSON errors, and future extension.
  • Update help/docs/completions as needed, run full tests, and add a bilingual changelog fragment.

Acceptance criteria

  • Unknown fields fail deterministically with a typed error.
  • Valid fields remain backward compatible.
  • A machine client can discover the valid fields before executing the query.
  • Help and runtime validation cannot drift independently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions