Repository navigation
docs(demo): answer errors as problems, invite as "invited", read without changing - #72
Merged
Merged
Conversation
…ut changing
- The stub answers errors as RFC 9457 problems (application/problem+json,
field errors as JSON Pointers), as the API does, so demos of a refusal
go through the CLI's problem parsing rather than the legacy branch.
- POST /memberships creates an invitation in state "invited".
- /memberships/{id} changes the record only on PATCH; other methods than
GET get the stub's 404.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @alukach's task in 10s —— View job ✅ No blocking issues — safe to merge. I read the diff and checked Non-blocking notes:
Simplify (ponytail)
💰 Estimated review cost: $0.11 · 0m09s · 5 turns |
4 tasks done
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.
The stub fixes from the code review of
demo/(#59, #60, #69): three places wheredemo/stub.pyanswered in ways the real API doesn't, so a demo would show behaviour real users never see. The recorder fixes are in #71.What changes
{"error": {code, message, field_errors}}body, so demos went throughApiError::from_response's legacy branch, which real users don't hit.error()now returns a problem (type,title,status,detail,code, anderrorsas JSON Pointers) withContent-Type: application/problem+json. Both 409s (a taken product ID, a taken service-account ID) use it.AGENTS.md's stub section now says the same."invited".POST /membershipscreated memberships already in state"member", so a demo ofmember inviteshowed the invitee as a member straight away, andmember acceptcouldn't be demoed. Memberships created along with a service account stay"member", which they are./memberships/{id}ranupdate()for every method, so a GET bumpedstate_changed, and a DELETE answered 200 as if it had worked. Now only PATCH changes it, GET reads, and anything else gets the stub's usual 404 (The demo stub has no METHOD PATH).Testing
Against the stub on a spare port:
POST /products/demo-orgwith a taken ID returns 409,application/problem+json,errors: [{"pointer": "#/product_id", "detail": "is taken"}].product create demo-org/climate-grid --json(prompts off, a throwawayHOMEand its own environment) prints{"error":{"code":"conflict","field_errors":{"product_id":["is taken"]},…,"type":"https://source.coop/api/problems/conflict"}}and exits 3.state_changedthe same, and a DELETE answers 404.POST /membershipsanswers"state": "invited".cargo test: 165 pass. No Rust changes.🤖 Generated with Claude Code