Document and tool the model-evolution loop (day-2 flows) - #36
Merged
Merged
Conversation
- docs/model-evolution.md: the day-2 workflow for both consumption modes
(in-graph Bazel rules vs vendored generated output), how to review
regeneration diffs, CI drift detection (regenerate + git diff
--exit-code) with a consumer-side recipe, a worked example adding a
field to the weather fixture with its real 22-line diff, and a
wire/source compatibility cheat sheet for common model changes.
- examples/bazel-consumer/model-evolution-check.sh: scripted
evolve-and-rebuild against the out-of-tree consumer module — an
additive member must rebuild handlers and tests untouched, and a new
operation must fail compilation naming the unimplemented handler
method. Wired into the consumer CI job (linux) so the documented
properties cannot rot.
- Cross-links from quickstart.md ("Day 2"), development.md (goldens
regeneration convention), README Phase 6 row; PLAN Phase 6 follow-up
marked done.
Closes #28
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyQAo21Pv6GYhHrkbQj8xQ
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.
What
Implements the incremental-development follow-up from PLAN Phase 6, closing #28: document and tool the day-2 loop for consumers who evolve a Smithy model after the initial integration.
docs/model-evolution.md(new): the workflow for both consumption modes — in-graph generation via the Bazel rules (no drift possible; compile errors guide handler updates) and vendored/checked-in output (regenerate → review the diff → commit model + output together). Includes how to read a regeneration diff (types.h= API surface,serde.cc/server.cc= wire behavior), CI drift-detection recipes (this repo'sgradle generateFixtures … && git diff --exit-codejob plus a consumer-side CLI equivalent), a worked example addingchanceOfSnowto the weather fixture with its actual 22-line diff, and a wire/source compatibility cheat sheet (optional members,@default, new operations,@requiredpromotion via the evolution leniency, enum values, renames, constraint tightening).examples/bazel-consumer/model-evolution-check.sh(new): scripted evolve-and-rebuild against the out-of-tree consumer module, pinning the two properties the doc promises — stage 1 adds an optional member and requiresbazel test //...to pass with handlers and tests untouched; stage 2 adds aListTasksoperation and requires the integration test to fail compilation naming the new handler method. Restores the model on exit..github/workflows/ci.yml: the consumer job now runs the script (ubuntu leg only — the properties are platform-independent).Testing
examples/bazel-consumer/model-evolution-check.shrun end-to-end locally: stage 1 rebuilds green with the evolved model; stage 2 fails compilation with the error namingListTasks; the model is restored afterward (clean tree).weather.smithy, rangradle generateWeatherFixture, captured the diff shown in the doc, and verifiedbazel test //examples/weather/...passes with no hand-written code touched — then reverted (nothing generated changes in this PR)..github/workflows/ci.ymlparses cleanly; the new step reuses the existing consumer-job setup.Checklist
bazel test //...and(cd codegen && gradle build spotlessCheck)pass locally (Beast/benchmark targets excluded per docs — sandbox proxy blocks their archive fetches)🤖 Generated with Claude Code
https://claude.ai/code/session_01SyQAo21Pv6GYhHrkbQj8xQ
Generated by Claude Code