Repository navigation
Store: 'may' — the transitions the caller may run, on list and record answers (#873) - #884
Merged
Merged
Conversation
…cord answers (#873) Store list answers (collection and readers mounts) add `may: {<id>: [names]}` and single-record answers (GET/HEAD, readers GET, create/PUT/PATCH/increment/ transition) add the `Allow-Transitions` header, computed in the answer's own transaction from `from`, ownership against `by`, and the caller's own membership (at most one lookup per distinct gate, only when a listed record could take it; never another principal's). A caller with no principal is offered only ungated shared transitions. The ui crud script shows a transition button only when `may` names it for the row (write answers update it from Allow-Transitions), falling back to the `from` match when the API sends no `may`. A non-member no longer sees a gated button, and a reviewer's own request shows no `by: others` button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #873 item 2 (option 1).
{items, total, next?, may, etags}, withmay: {<id>: [transition names]}for every listed record.Allow-Transitions: a, b, like ETag. That covers GET/HEAD, readers GET, and the answers to create, PUT, PATCH, increment and transition.mayis decided: inside the answer's own transaction. The record must hold thefromvalues, theby:owner/others rule must hold, and the caller must pass themembersgate. AreadOnlycollection offers nothing.{"items":[],"total":0,"may":{},"etags":{}}. The store-crud recipe fixture is updated.may[id]includes it, and falls back to thefrommatch whenmayis absent. Per the Retire the ui kit, forms and form-records; frontends are ordinary builds over declared JSON routes (#841 order 4) #883 decisions the ui screens will be deleted later; the store'smayis the lasting API contract.Evidence (macOS, Node 26)
npm run verifypasses: root 1151, store 138, ui 113,test:addons6,test:proof12.npm run test:packagepasses. The browser test passes 7/7 on local Chrome.may.test.tscovers:🤖 Generated with Claude Code