Skip to content

Document and tool the model-evolution loop (day-2 flows) - #36

Merged
aaylward merged 1 commit into
mainfrom
claude/issue-27-fix-42z1s0
Jul 7, 2026
Merged

aaylward merged 1 commit into
mainfrom
claude/issue-27-fix-42z1s0

Conversation

@aaylward

@aaylward aaylward commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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's gradle generateFixtures … && git diff --exit-code job plus a consumer-side CLI equivalent), a worked example adding chanceOfSnow to the weather fixture with its actual 22-line diff, and a wire/source compatibility cheat sheet (optional members, @default, new operations, @required promotion 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 requires bazel test //... to pass with handlers and tests untouched; stage 2 adds a ListTasks operation 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).
  • Cross-links: quickstart gets a "Day 2: evolving the model" pointer, development.md documents the goldens-regeneration convention, README's Phase 6 row and PLAN's follow-up entry reflect the delivered state.

Testing

  • examples/bazel-consumer/model-evolution-check.sh run end-to-end locally: stage 1 rebuilds green with the evolved model; stage 2 fails compilation with the error naming ListTasks; the model is restored afterward (clean tree).
  • The worked example was executed for real: evolved weather.smithy, ran gradle generateWeatherFixture, captured the diff shown in the doc, and verified bazel test //examples/weather/... passes with no hand-written code touched — then reverted (nothing generated changes in this PR).
  • .github/workflows/ci.yml parses cleanly; the new step reuses the existing consumer-job setup.
  • Docs-only otherwise: no generator, runtime, or generated-code changes, so the golden drift check is unaffected.

Checklist

  • Tests added/updated for the change (scripted evolve-and-rebuild check in the consumer CI job)
  • bazel test //... and (cd codegen && gradle build spotlessCheck) pass locally (Beast/benchmark targets excluded per docs — sandbox proxy blocks their archive fetches)
  • Formatting clean (no C++/Java/Starlark changes; workflow YAML validated)
  • Architectural decisions recorded as an ADR (not applicable — docs and CI tooling only)

🤖 Generated with Claude Code

https://claude.ai/code/session_01SyQAo21Pv6GYhHrkbQj8xQ


Generated by Claude Code

- 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
@aaylward
aaylward merged commit f880358 into main Jul 7, 2026
12 checks passed
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.

2 participants