Repository navigation
feat(core): derive every operation schema from Rust models; retire schemas.rs (WI-1749) - #1076
Merged
Merged
Conversation
…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>
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.
Ports the remaining 140 operation schemas to schemars-derived Rust types in
engine/core/src/application/models/, so all 144 are derived. Deletes the recordedregistry/schemas.rstable, and simplifiesvalidate_schemasandscripts/gen_registry.pyto match.tests/test_rust_schemas.pystill 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