Repository navigation
feat(core,api,ui-react)!: default flow Draft → Pending Review → Approved → Published; PRM's owner-direct strategy; S3 restated (4d) - #37
Merged
Conversation
🦋 Changeset detectedLatest commit: df9b7ed 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 |
|
Caution Review failedThe pull request is closed. TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
|
cursor
Bot
force-pushed
the
cursor/phase-4d-default-flow-02f8
branch
from
November 6, 2026 04:56
132dccc to
029b9bf
Compare
cursor
Bot
force-pushed
the
cursor/phase-4d-default-flow-02f8
branch
from
November 6, 2026 14:50
029b9bf to
b27fa37
Compare
cursor
Bot
changed the base branch from
cursor/phase-4c-parallel-approval-02f8
to
main
November 6, 2026 14:55
jherr
force-pushed
the
cursor/phase-4d-default-flow-02f8
branch
from
November 6, 2026 15:08
b27fa37 to
df9b7ed
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 (4d):
starters/ARCHITECTURE.md.It also covers § 7 layer 3.
Merge chain: step 14 of 24. Base:
main. Merge it right after #36. The branch ismain3b4a112, then one commit for each PR before this one in the merge order, then this PR's own commitb27fa37(tree403b9b6).What
reviewStrategy()runs Draft → Pending Review → Approved → Published.Draft,Pending Review(wasPending review),Approved,Published,Unpublished.review.decidebut notcontent.publishapproves intoapproved. That emitsreview.approved, is audited astransitioned, and leaves the live document untouched.publishcommits and publishes it. An approved deletion is offered as Delete and needscontent.delete. A scheduled change set takes the same path.approved. Publishers get Publish (or Delete), reviewers get Reject, and a reviewer can't approve twice.describe()adds the Approved node, and the regenerated chart is checked by 4c's drift test.directStrategy()now charts only its own states.collection.documentState, unchanged.approveChangepasses a reviewer withoutcontent.publishthrough to the strategy after a read check. Core re-checks access for any decision that writes live content./reviewshows non-publishing reviewers a single Approve button (review.approve). Publishers see Publish on approved changes, throughactOnChange.app/prm/src/document-state.tsexportsownerDirectAgentReview({ autoApprove }), which replacesreview.autoApprove.edit,submitandimportsaves directly.import_people, people without publish rights, and every change-set decision.review-queue.md(states, the reviewer/publisher split, areviewerrole example, the chart),terminology.md, and theapproveChangerows in the op tables.Breaking changes (
default-flow-approved.md: core, api and ui-react minor)Pending Reviewand the newApproved, andReviewStategains'approved'.approveChangewithout publish rights. When called by a reviewer withoutcontent.publish, it used to returnFORBIDDEN. It now moves the change to Approved.review.approved.directStrategy().describe()charts only Unpublished, Published and Draft.How verified
GitHub Actions is out of billing, so everything ran locally. On a scratch branch, I merged head
132dcccintoorigin/mainat3b4a112.pnpm install --frozen-lockfilepnpm test:ci@tanstack/cms-api:test:oxlintfails. The starters' seam suites, app/prm and app/base all pass.test:dts/test:dialects/test:scriptsPending Review); base 12/12tsc, oxlint, knip,test:docsand kiira (128/128) are clean.New tests:
content.delete;approveChange,reviewSnapshotandactOnChange.approvalRequiredon and off.Assumptions (tasks 8–12 defaults)
content.publishpermission. A collection rule that denies publishing makes core refuse the commit.review@1isn't bumped, because states were added and none were removed.collection.documentState.review.approvedfires at approval, not at publish.content.publishand non-user actors go through review.import_peoplestays reviewed.prm-owner-direct@1. Change sets written underreview@1by an unreleased 4b/4c build would be stranded and need a discard. Released PRM data has no stored strategy state.Divergence from plan
reviewer: ['content.read', 'review.decide']role.app/prm, composed from the two built-ins.directStrategy()has its own chart.Pending Review (…).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. One conflict:
app/prm/src/cms.config.tsis nowdefineCms(definition, { …, documentState: ownerDirectAgentReview({ autoApprove }) }).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.