Repository navigation
feat(core,api,ui-react)!: ship the document state acceptance suite (XState parallel approval passes on all three stores); Mermaid from a strategy's graph; the review queue follows the strategy (4c) - #36
Merged
Conversation
🦋 Changeset detectedLatest commit: 4863e04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 58 minutes. View limit details
TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
|
cursor
Bot
force-pushed
the
cursor/phase-4c-parallel-approval-02f8
branch
from
November 6, 2026 14:50
092cbbb to
7c2edf0
Compare
cursor
Bot
force-pushed
the
cursor/phase-4b-change-sets-02f8
branch
from
November 6, 2026 14:50
4547327 to
730fd75
Compare
cursor
Bot
changed the base branch from
cursor/phase-4b-change-sets-02f8
to
main
November 6, 2026 14:55
…State parallel approval passes on all three stores); Mermaid from a strategy's graph; the review queue follows the strategy (4c) (#36) Chain step 13 of the linear merge chain onto main 3b4a112: this PR's own changes, resolved against the PRs before it in the merge order. Co-authored-by: jherr <jherr@pobox.com>
jherr
force-pushed
the
cursor/phase-4c-parallel-approval-02f8
branch
from
November 6, 2026 15:08
7c2edf0 to
4863e04
Compare
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.
Implements cms-refactor-plan.md § Phase 4 (4c):
Merge chain: step 13 of 24. Base:
main. Merge it right after #29. The branch ismain3b4a112, then one commit for each PR before this one in the merge order, then this PR's own commit7c2edf0(tree6ac2404).What
The phase 0 acceptance test is unskipped and passes. The XState parallel-approval example has:
migrate.It passes all eleven steps plus core's rules. The example lives in
packages/core/tests/document-state/legal-review.xstate.tsand is printed in full in the docs.The suite ships as
runDocumentStateAcceptance(name, { database, strategies }, runner)from@tanstack/cms-core/document-state/acceptance, likerunStorageConformance.defineCms, reopens storage to cover restarts, and reads the audit log and the events.document.*emit is rejected;editdecision that neither stages nor commits is rejected;Mermaid from a strategy's graph.
stateGraphToMermaid(graph)rendersdescribe()as astateDiagram-v2, including composite states, parallel regions and final states.review-queue.mdand the newcustom-strategies.mdembed the charts. A drift test fails if a chart or the printed source goes stale.Core now handles stranded change sets. It checks for one before asking the strategy, and refuses every action except
discard(rulestranded). It runs thatdiscarditself, for a reviewer (review.decide, not an agent).Audit
toon closing decisions records the returned state (e.g.published) instead ofnull.New server export:
readChangeSet(collection, id).The review UI follows the strategy:
reviewSnapshotitems carryreview: { label, actions, stranded? }.actOnChange({ id, action, publishAt?, reason?, expectedVersion? })op runs the offered actions that carry no document. It's also available as a Start server function./reviewshows the strategy's label as a badge, and a Publishes … badge for scheduled change sets. Its buttons come from the offered actions, with Schedule and Clear schedule whenscheduleis offered.review.stranded,review.scheduledFor,review.scheduleAt,review.schedule,review.clearSchedule.Docs: a new "Custom Document State Strategies" page, plus updates to
review-queue.mdand the op tables.Breaking changes
document-state-acceptance.md(core minor):torecords a closing decision's returned state instead ofnull.review-queue-strategy-actions.md(api and ui-react minor):reviewSnapshotalso lists stranded drafts.How verified
GitHub Actions is out of billing, so everything ran locally. On a scratch branch, I merged head
7073625intoorigin/mainat3b4a112.pnpm install --frozen-lockfilepnpm test:ci@tanstack/cms-api:test:oxlintfails. The first run also failedcms-api:buildbecauseChangeSetReviewwasn't exported;7073625exports it.test:dts/test:dialects/test:scriptstsc, knip,test:docsand kiira (128/128) are clean.On the first base E2E run, one flaky test clicked Approve & publish and read the result before the approval had finished. #41 fixes that test, and #41 is step 1 of the merge chain.
Assumptions (tasks 8–12 defaults)
review.decide.actOnChangeneeds onlycontent.read. What the caller may do comes from the strategy's offered actions, and core re-checks write and publish access whenever live content changes.actOnChangerefusesedit,submit,draftandimport, because those actions carry a document.Divergence from plan
document.updated, notdocument.published. The document is already live at those steps, and under the 2026-11-06 vocabulary rulingdocument.publishedfires only when a document goes live.toon closing decisions now records the returned state.tests/draft/moved totests/document-state/.tsconfig.docs.jsonmapsxstate.ai-images.mdmoved from docs order 4 to 5.Merge chain (local verification, CI down)
This PR's commits are squashed into one commit on the linear merge chain. That commit holds this PR's own changes, resolved against every PR before it, with the integration rehearsal's fixes for this PR applied. No conflicts.
The chain tip's tree is exactly the integration rehearsal plus #46 (
c4e6d7c), and the tip passes the full local suite. I simulated merging every PR in order, with a merge commit or a fast-forward at each step, and every step is clean. A plain squash of the next PR would conflict, because the squash commit isn't an ancestor of the next branch. To squash instead, first rebase the branch's one commit onto the newmain; that rebase is always clean.