Skip to content

feat(core): derive every operation schema from Rust models; retire schemas.rs (WI-1749) - #1076

Merged
thedancingdeveloper merged 5 commits into
rust-corefrom
wi-1749-schemas-from-models
Oct 17, 2026
Merged

thedancingdeveloper merged 5 commits into
rust-corefrom
wi-1749-schemas-from-models

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Contributor

Ports the remaining 140 operation schemas to schemars-derived Rust types in engine/core/src/application/models/, so all 144 are derived. Deletes the recorded registry/schemas.rs table, and simplifies validate_schemas and scripts/gen_registry.py to match. tests/test_rust_schemas.py still compares every schema against Python's live registry.

Reviewed: no blockers at 2211282. The branch rebases cleanly onto rust-core cf2d3ca, and these gates pass on the rebased tree: fmt, clippy -D warnings, cargo test -p vogt-core, ruff, gen_registry.py --check, and test_rust_schemas.py.

🤖 Generated with Claude Code

sprooty and others added 5 commits October 17, 2026 06:27
…1749)

Nine chat operations move from the recorded table in schemas.rs to
schemars-derived types in application/models/chat.rs, listed in DERIVED.
The derive output is reshaped to pydantic's dialect (nullable as anyOf,
no integer format, titles on properties and definitions), so each schema
matches Python's live registry.dump; the parity test passes.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: sprooty <sprooty@sprooty.com>
… Rust models (WI-1749)

Sixteen more operations move from the recorded table in schemas.rs to
schemars-derived types under application/models/: mcp.stdio, contract
adopt and decline, project.scaffold, the forge account and onboard
operations, the session token, log tail and commit operations, and
export, backup, restore, serve and connect. Each schema matches Python's
live registry.dump; the parity test passes.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: sprooty <sprooty@sprooty.com>
… from Rust models (WI-1749)

Twenty more operations move from the recorded table in schemas.rs to
schemars-derived types: workflow.list, label, preference, why, actor,
user, token, auth and suppression operations. The shared entity views
(Label, Actor, PasswordCredential, Token, AuthDecision, Suppression) and
the view types are ported once in application/models/entities.rs.

The nullable layout now follows pydantic's: T | None is an anyOf with the
constraints on the value's branch, and a float has no format. Each schema
matches Python's live registry.dump; the parity test passes.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: sprooty <sprooty@sprooty.com>
…WI-1749)

The seven project.* operations (register, create, import, get, list,
update, transition) take their schemas from schemars types now, and their
rows leave the recorded table. The Project entity and its agent policy
types live in entities.rs, shared like the other entities.

Two shared changes this needs, both checked by the golden and the Python
parity test:

- pydantic_shape keeps a `[]` default a field declares with the
  x-keep-default marker. The Python fields that record `default: []`
  need it; the existing default_factory fields still have it stripped.
- canonical keeps the key order of a `default` value, as serde serialised
  it, the way Python lays out a default object.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: sprooty <sprooty@sprooty.com>
…the recorded table (WI-1749)

The 88 remaining operations take their parameter and result schemas from
schemars types now, so every operation in registry::dump is derived and
schemas.rs, the table recorded from pydantic, is gone.

The types live in three operation modules and one shared module:

- views.rs: the $defs the operations share (the work item, the session
  summary, the brief's ranking views and the rest).
- work.rs: work items, boards, initiatives, backlog, observations,
  dependencies, contracts, compliance, drift and the project brief.
- session_ops.rs: sessions, agent CLIs, agent activity and decisions.
- system.rs: status, instance, engine, places, forge, events,
  notifications, deployed versions, inbox, audit and the rest.

Freshness joins the hand-written entities, since its status default is
the object the brief reports when a project has never been swept.

registry.rs builds its schema map from derived_schemas() alone, and
validate_schemas refuses an operation with no derived schema. The golden
registry.json stays, and gen_registry.py now records only that dump.

Three shared changes the port needs, each checked by the golden and the
Python parity test:

- pydantic_shape moves exclusiveMinimum/Maximum and minItems/maxItems into
  a nullable value branch, and drops a float's "double" format the way it
  drops an integer's format.
- An explicit empty default (`[]` or `{}`) is kept when the field marks it
  with x-keep-default; the default_factory fields still have it stripped.
- A field with a `default_factory` is optional, not required, with no
  default recorded.

cargo fmt also reformats openapi.rs, which was already out of format on
main and blocked the fmt gate.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: sprooty <sprooty@sprooty.com>
@thedancingdeveloper
thedancingdeveloper merged commit d6ddc05 into rust-core Oct 17, 2026
11 of 14 checks passed
@thedancingdeveloper
thedancingdeveloper deleted the wi-1749-schemas-from-models branch October 17, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant