canopycms 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +120 -47
  2. package/dist/ai/resolve-branch.js +2 -1
  3. package/dist/api/admin-branch-health.d.ts +11 -0
  4. package/dist/api/admin-branch-health.js +36 -0
  5. package/dist/api/admin.d.ts +8 -1
  6. package/dist/api/branch-merge.js +1 -1
  7. package/dist/api/branch-review.js +20 -3
  8. package/dist/api/branch-status.js +30 -19
  9. package/dist/api/branch.d.ts +8 -3
  10. package/dist/api/branch.js +32 -3
  11. package/dist/api/client.d.ts +3 -1
  12. package/dist/api/client.js +4 -0
  13. package/dist/api/github-sync.d.ts +2 -0
  14. package/dist/api/github-sync.js +6 -1
  15. package/dist/api/pr-comment-sync.js +3 -1
  16. package/dist/authorization/branch.d.ts +10 -4
  17. package/dist/authorization/branch.js +24 -4
  18. package/dist/authorization/types.d.ts +1 -1
  19. package/dist/branch-metadata-file.d.ts +66 -0
  20. package/dist/branch-metadata-file.js +14 -0
  21. package/dist/branch-metadata.d.ts +4 -2
  22. package/dist/branch-metadata.js +10 -2
  23. package/dist/cli/cli.js +1913 -1606
  24. package/dist/cli/configured-asset-store.js +2 -8
  25. package/dist/cli/generate-ai-content.js +17 -4
  26. package/dist/cli/init.js +2 -2
  27. package/dist/cli/site-config.d.ts +9 -0
  28. package/dist/cli/site-config.js +17 -0
  29. package/dist/cli/sync.js +226 -74
  30. package/dist/editor/BranchManager.d.ts +8 -4
  31. package/dist/editor/BranchManager.js +43 -18
  32. package/dist/editor/Editor.js +3 -2
  33. package/dist/editor/admin/SystemHealthPanel.js +65 -31
  34. package/dist/editor/admin/UnpublishedAtMergeAlert.d.ts +16 -0
  35. package/dist/editor/admin/UnpublishedAtMergeAlert.js +50 -0
  36. package/dist/editor/admin/useSystemHealth.d.ts +2 -0
  37. package/dist/editor/admin/useSystemHealth.js +21 -0
  38. package/dist/editor/branch-lock.d.ts +2 -0
  39. package/dist/editor/branch-lock.js +5 -3
  40. package/dist/editor/branch-status.d.ts +25 -1
  41. package/dist/editor/branch-status.js +75 -0
  42. package/dist/editor/components/EditorHeader.d.ts +6 -2
  43. package/dist/editor/components/EditorHeader.js +51 -30
  44. package/dist/editor/components/EntryHeader.d.ts +3 -1
  45. package/dist/editor/components/EntryHeader.js +2 -1
  46. package/dist/editor/components/TooltipDetail.d.ts +14 -0
  47. package/dist/editor/components/TooltipDetail.js +18 -0
  48. package/dist/editor/copy.d.ts +7 -0
  49. package/dist/editor/copy.js +9 -0
  50. package/dist/editor/hooks/useBranchManager.d.ts +8 -3
  51. package/dist/editor/hooks/useBranchManager.js +48 -5
  52. package/dist/pr-comments.d.ts +2 -0
  53. package/dist/pr-comments.js +20 -14
  54. package/dist/resource-generation.js +2 -3
  55. package/dist/services.d.ts +3 -2
  56. package/dist/submission-attribution.d.ts +1 -1
  57. package/dist/submission-attribution.js +20 -2
  58. package/dist/system-users.d.ts +2 -0
  59. package/dist/system-users.js +6 -1
  60. package/dist/task-queue/task-queue.d.ts +5 -1
  61. package/dist/task-queue/task-queue.js +4 -2
  62. package/dist/types.d.ts +61 -0
  63. package/dist/version.d.ts +1 -1
  64. package/dist/version.js +1 -1
  65. package/dist/worker/branch-merge.d.ts +68 -0
  66. package/dist/worker/branch-merge.js +228 -0
  67. package/dist/worker/canopy-state.d.ts +2 -0
  68. package/dist/worker/canopy-state.js +1 -1
  69. package/dist/worker/cms-worker.d.ts +1 -0
  70. package/dist/worker/cms-worker.js +5 -3
  71. package/dist/worker/git-sync.js +15 -8
  72. package/dist/worker/github-commits.d.ts +106 -0
  73. package/dist/worker/github-commits.js +485 -0
  74. package/dist/worker/github-gateway-http.js +3 -2
  75. package/dist/worker/github-gateway-wire.d.ts +22 -13
  76. package/dist/worker/github-gateway-wire.js +4 -1
  77. package/dist/worker/github-gateway.d.ts +16 -5
  78. package/dist/worker/github-gateway.js +22 -5
  79. package/dist/worker/github-mirror.d.ts +8 -0
  80. package/dist/worker/github-mirror.js +12 -1
  81. package/dist/worker/github-transfer.d.ts +3 -1
  82. package/dist/worker/github-transfer.js +3 -2
  83. package/dist/worker/history-rewrite.d.ts +13 -1
  84. package/dist/worker/history-rewrite.js +27 -3
  85. package/dist/worker/rebase.d.ts +13 -7
  86. package/dist/worker/rebase.js +351 -95
  87. package/dist/worker/task-runner.d.ts +1 -1
  88. package/dist/worker/task-runner.js +172 -34
  89. package/dist/worker/worker-context.d.ts +2 -0
  90. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,9 +5,9 @@ packages release together, at one version.
5
5
 
6
6
  ## This build
7
7
 
8
- Version `0.8.1`, built from [`67d7e59`](https://github.com/safeinsights/canopycms/tree/67d7e59ebd472b09175d09c620d8e2d06d333496).
8
+ Version `0.8.3`, built from [`e5dcfc6`](https://github.com/safeinsights/canopycms/tree/e5dcfc6cc5de00a6e5f215986f460645110fd71c).
9
9
 
10
- Its entries are [0.8.1](#081), under **Released**.
10
+ Its entries are [0.8.3](#083), under **Released**.
11
11
 
12
12
  If you upgraded from a build on another branch, compare the `<!-- changeset: … -->` slugs in your previous build's `CHANGELOG.md` (`npm pack canopycms@<old>` fetches it) with this one's: entries whose slug your old file lacks are new to you.
13
13
 
@@ -24,7 +24,7 @@ Each entry has up to three parts:
24
24
  `node_modules/canopycms/CHANGELOG.md`, assembled for that build: its **This build** section lists
25
25
  what is new since the previous int on the same branch, or on a stable release links its entries, and its links point at the commit the build
26
26
  came from. The copy in the repository holds released history and the entries from before changesets;
27
- every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/.changeset/README.md) until a stable release
27
+ every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/.changeset/README.md) until a stable release
28
28
  moves it here.
29
29
 
30
30
  **Find your starting point.** From a stable pin, start at the first version under **Released**
@@ -62,6 +62,79 @@ entries under **Released**.
62
62
 
63
63
  ## Released
64
64
 
65
+ ### 0.8.3
66
+
67
+ #### Dev pages load for non-admin users under `defaultBranchAccess: 'deny'`
68
+
69
+ <!-- changeset: dev-active-branch-readable-under-deny -->
70
+
71
+ _First in 0.8.3._
72
+
73
+ **What changed.** In `dev` mode with `defaultBaseBranch` set, a page rendered on a git branch other than the base failed with `Forbidden: branch access denied (no_acl)` for any user outside `admins` and `reviewers`, because CanopyCMS provisions that branch's workspace itself and so nobody counted as its creator. The active branch the dev server provisions now passes branch access the way the base branch does: readable and, subject to path permissions, editable, but not submittable by a user who has no other grant. Prod and branches people create are unchanged.
74
+
75
+ #### `canopycms sync` reaches the workspace the dev server reads for a branch with a slash
76
+
77
+ <!-- changeset: sync-resolves-branch-like-dev-server -->
78
+
79
+ _First in 0.8.3._
80
+
81
+ **What changed.** `sync` resolves a branch name the way the dev server does. On a branch such as `fix/header`, `push` used to report success but write to a nested `.canopy-dev/content-branches/fix/header` that nothing reads, so the dev site never changed; it now writes to `fix-header`, the workspace the dev server serves, and `pull`, `both` and `abort` read from it. `--branch` also takes an editor branch's short name or its workspace directory name. `sync` refuses a workspace that belongs to a different branch, and a directory under `content-branches/` that is not its own git repository. Short names honour `branchNamespace` from `canopycms.config.ts`; if the config cannot be used, `sync` warns and uses the defaults.
82
+
83
+ ### 0.8.2
84
+
85
+ #### The editor says when a pull request is stuck, and what to do
86
+
87
+ <!-- changeset: editor-shows-held-prs -->
88
+
89
+ _First in 0.8.2._
90
+
91
+ **What changed.** A branch could sit stuck with nothing in the editor to say why. The branch bar and the branch card now show a "Needs action" badge, with what's wrong and what this person can do about it, and System health shows the same.
92
+
93
+ - A branch in review that conflicts with its base: the line gives its author, a reviewer and anyone else their own way forward.
94
+ - A pull request retargeted to another base on GitHub that has fallen behind it or conflicts with it: update it on the pull request, or ask an admin.
95
+ - A branch force-pushed on GitHub: submit is blocked, as nothing can reach GitHub until an admin sorts it out.
96
+ - A submit that failed before its pull request step ran: the line says the pull request may not have the latest changes, and how to finish it. The failure now stays until the submit is retried or made again, where another task's success could clear it.
97
+ - A branch in review with a failed sync now says it won't update from its base until it syncs.
98
+
99
+ #### Commits made on a pull request's branch on GitHub now reach the editor
100
+
101
+ <!-- changeset: github-commits-into-clones -->
102
+
103
+ _First in 0.8.2._
104
+
105
+ **What changed.** After Update branch or a maintainer's fix on GitHub, submitting a branch that had returned to editing failed for good with a 409 saying to try again shortly. Each sync now brings those commits into the branch's workspace, so the submit goes through.
106
+
107
+ - If both sides changed a file, the editor's version is kept and the pull request lists the file.
108
+ - A commit that isn't the base catching up sends an approved branch back to review.
109
+ - A branch that has merged GitHub's commits catches up with its base by merging it rather than rebasing, so nothing it settled is undone. So does a branch whose push failed for good, whose commits GitHub never received.
110
+ - A branch force-pushed on GitHub is left alone, and nothing more is pushed for it, so a commit removed there stays removed. System health says what a developer needs to do.
111
+ - A submit or push GitHub rejects because its branch moved runs again after the next sync, unless the branch has moved on since.
112
+
113
+ **Rolling back.** Don't roll the worker back past this version once it has run. An older worker rebases editing branches, and a rebase drops the merge commits this one makes: a version kept over GitHub's is replaced by GitHub's, and the result is force-pushed to the pull request. If you have to, first merge or delete every editing branch holding a merge commit, and let the task queue drain.
114
+
115
+ #### Pull requests from the editor stay up to date with their base
116
+
117
+ <!-- changeset: keep-editor-prs-current -->
118
+
119
+ _First in 0.8.2._
120
+
121
+ **What changed.** Where a repository requires branches to be up to date before merging, a pull request from the editor no longer waits behind its base for someone to click Update branch. When GitHub reports it behind, the next sync merges the base into it.
122
+
123
+ - Each update is a new commit, so required checks run again.
124
+ - An approval in CanopyCMS stays, because the pull request's changes are the same. In our test, GitHub kept an approval through a merge of the base that left the diff unchanged, under both "dismiss stale approvals" and "require approval of the most recent push". That test used a person's push under classic branch protection, so check it against your own rules.
125
+ - A pull request that conflicts with its base stays as it is. Withdraw it from review to resolve the conflict.
126
+ - Repositories that don't require up-to-date branches see no change.
127
+
128
+ #### A branch whose submit failed can't be approved, and a merge that may miss commits is flagged
129
+
130
+ <!-- changeset: unfinished-submit-rulings -->
131
+
132
+ _First in 0.8.2._
133
+
134
+ **What changed.** Approve is disabled while a branch's last submit has failed, with the reason beside it, and the API refuses it with a 409, because what's approved may not be what the pull request holds. Request changes stays open. A submit that fails after an approval sends the branch back to review and clears the verdict from the pull request. A submit that couldn't be queued counts as failed, and says to submit again.
135
+
136
+ If a pull request merges before a submit finishes, commits from that submit may not be in the merge. Archiving now records that. System health's Overview names the branch until an admin dismisses the warning or deletes the branch, the branch shows "Needs action", and only an admin can delete it meanwhile.
137
+
65
138
  ### 0.8.1
66
139
 
67
140
  #### Content reads stop re-reading and re-parsing the schema cache
@@ -261,7 +334,7 @@ _First in 0.7.0._
261
334
 
262
335
  **What changed.** The pull request a submit opens now lists the branch's unresolved editor comment threads: where each one is, the first line of its first comment (80 characters at most) and a link to it in the editor. Once every thread is resolved, it says so. The list is updated whenever a comment is added, replied to or resolved, as well as on submit. Comment excerpts are visible to everyone who can read the pull request, which on a public repository means everyone. Open threads do not block the merge or keep the pull request in draft. A pull request opened before this release shows no list until its branch is next submitted.
263
336
 
264
- **To adopt.** Nothing, if your deploy replaces the worker along with the CMS, as `cdk deploy` of the canopycms-cdk stack does with the default `workerCode`. A worker on an earlier release fails each update of the list and marks the branch's sync failed until a later task succeeds, so a pipeline that leaves the worker behind must roll it no later than the CMS: see [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
337
+ **To adopt.** Nothing, if your deploy replaces the worker along with the CMS, as `cdk deploy` of the canopycms-cdk stack does with the default `workerCode`. A worker on an earlier release fails each update of the list and marks the branch's sync failed until a later task succeeds, so a pipeline that leaves the worker behind must roll it no later than the CMS: see [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
265
338
 
266
339
  #### Pull request bodies link back to the editor
267
340
 
@@ -271,7 +344,7 @@ _First in 0.7.0._
271
344
 
272
345
  **What changed.** The pull request a submit opens links to the branch in the editor, and each changed entry to that entry. A notice tells reviewers that comments on the pull request do not reach the editor, so the author will not see them. The links use the editor's URL from the submit, accepted only when its host is the one the request was addressed to (`X-Forwarded-Host`, else `Host`), which holds behind `canopycms-cdk`'s CloudFront distribution as it stands.
273
346
 
274
- **To adopt.** Nothing, unless a proxy in front of the CMS sets neither header to the editor's public host: then set `editorUrl` in your Canopy config to the editor page's URL, e.g. `editorUrl: 'https://cms.example.org/edit'`. See [the config reference](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#definecanopyconfig-options).
347
+ **To adopt.** Nothing, unless a proxy in front of the CMS sets neither header to the editor's public host: then set `editorUrl` in your Canopy config to the editor page's URL, e.g. `editorUrl: 'https://cms.example.org/edit'`. See [the config reference](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#definecanopyconfig-options).
275
348
 
276
349
  #### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
277
350
 
@@ -357,7 +430,7 @@ _First in 0.6.0._
357
430
 
358
431
  **What changed.** `CanopyCmsService` takes `clerkOrganizationsAsGroups` (default `true`, unchanged), which the worker honours; in a deployment it, not the plugin's `useOrganizationsAsGroups`, decides the groups. When Clerk refuses the organization list with a 403 (Organizations disabled), the refresh now writes users with no groups and logs a warning, instead of failing whole; any other failure still keeps the last snapshot. Memberships are fetched instance-wide rather than per user. The scaffolds write `false` explicitly: `useOrganizationsAsGroups` in `canopycms init`'s `canopy.ts`, and `clerkOrganizationsAsGroups` in `canopycms init-deploy aws`'s CDK stack.
359
432
 
360
- **To adopt.** On a Clerk instance without Organizations, set `clerkOrganizationsAsGroups: false` on `CanopyCmsService` and `useOrganizationsAsGroups: false` in `createClerkAuthPlugin`. See [Deploying to AWS](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md).
433
+ **To adopt.** On a Clerk instance without Organizations, set `clerkOrganizationsAsGroups: false` on `CanopyCmsService` and `useOrganizationsAsGroups: false` in `createClerkAuthPlugin`. See [Deploying to AWS](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md).
361
434
 
362
435
  ### 0.5.0
363
436
 
@@ -369,7 +442,7 @@ _First in 0.5.0._
369
442
 
370
443
  **What changed.** A `type: 'reference', list: true` field now edits as rows in stored order, like an `object` list: drag a row or use its "…" menu to move or remove it, open a row to swap its entry in place, and pick from Add under the rows to append. Neither control offers an entry the list already holds. Any `list: true` field, and any `block` field, takes `maxItems`. The editor stops adding at the cap and says why, a save over it is refused, and a production build fails on an entry over it, naming the entry, field, count and cap. Adding `maxItems` to a list that already holds more therefore fails the build until an editor removes the extra items. `maxItems` on a field that holds no items is refused when the entry schema registry is created.
371
444
 
372
- **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#field-types).
445
+ **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#field-types).
373
446
 
374
447
  #### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
375
448
 
@@ -379,7 +452,7 @@ _First in 0.5.0._
379
452
 
380
453
  **What changed.** `defineCanopyConfig` takes `seo: { group?, fields? }`, the one place every surface reads an entry's `noindex` flag: the sitemap and `entryToMetadata` that `createNextCanopyContext` returns, AI content and the editor's reference picker. A per-call `seo`/`group`/`fields` still overrides it. The free `generateContentSitemap` takes `seo` as an argument and refuses to run without it when the config sets one; `createNextCanopyContext` and the AI content config refuse a leftover `seo`. A reference picker now badges an entry hidden from search as "Hidden from search", and picking one adds a note naming the setting on that entry's form, since a page listing only indexed entries won't show it. A reference field takes `optionSort`: `'label'` (the default), `'collection'`, or `{ field, direction }`. Point `field` at an ISO date, since strings compare as text.
381
454
 
382
- **To adopt.** Move `seo` from `createNextCanopyContext({ seo })` and from `defineAIContentConfig({ seo })` into `defineCanopyConfig({ seo })`. See [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#how-references-work-in-the-editor).
455
+ **To adopt.** Move `seo` from `createNextCanopyContext({ seo })` and from `defineAIContentConfig({ seo })` into `defineCanopyConfig({ seo })`. See [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#how-references-work-in-the-editor).
383
456
 
384
457
  **Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
385
458
 
@@ -407,7 +480,7 @@ resolved without it.
407
480
  **To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
408
481
  reference field. Code that reads the body from a link-only reference's resolved type now sees
409
482
  `string | undefined`; either set `includeBody: true` or handle the missing value. See
410
- [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#resolving-references-in-a-listing).
483
+ [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#resolving-references-in-a-listing).
411
484
 
412
485
  ### 0.3.3
413
486
 
@@ -824,7 +897,7 @@ URL.
824
897
  2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
825
898
  `app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
826
899
  route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
827
- [Live Preview](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#live-preview)).
900
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#live-preview)).
828
901
  3. A test reading view content from the route's server HTML must load the page in a browser.
829
902
  Server output rendered during a preview request carries the signed-in asset prefix; keep it out
830
903
  of cross-request caches (`unstable_cache`, module memos).
@@ -839,7 +912,7 @@ kept site styles ahead of Mantine's in the preview.
839
912
  server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
840
913
  path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
841
914
  refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
842
- [Live Preview](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#live-preview).
915
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#live-preview).
843
916
 
844
917
  **To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
845
918
  as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
@@ -921,7 +994,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
921
994
  fields are nested or renamed, pass the AI config's `seo` the same object you pass
922
995
  `createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
923
996
  place. A field that links to a hidden section by plain URL needs a field transform; the README
924
- shows [the recipe](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#ai-content-configuration).
997
+ shows [the recipe](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#ai-content-configuration).
925
998
 
926
999
  **Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
927
1000
 
@@ -943,7 +1016,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
943
1016
  field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
944
1017
  `MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
945
1018
  `{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
946
- [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#mdx-content-cannot-run-code).
1019
+ [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#mdx-content-cannot-run-code).
947
1020
 
948
1021
  **To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
949
1022
  `mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
@@ -1080,7 +1153,7 @@ a format check.
1080
1153
 
1081
1154
  - (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
1082
1155
  re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
1083
- ([reference](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#definecanopyconfig-options)).
1156
+ ([reference](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#definecanopyconfig-options)).
1084
1157
  - (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
1085
1158
  the PR-body section every user who edited the branch, not only the submitter; settings commits
1086
1159
  (permissions, groups) carry the acting user's trailer.
@@ -1104,7 +1177,7 @@ saves only push the branch, and no failing PR task lands in System health.
1104
1177
  that entry type goes unavailable: the editor says so, and its entries answer 503 with
1105
1178
  `code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
1106
1179
  worker holds the base branch for up to 30 minutes while that lasts; see
1107
- [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
1180
+ [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
1108
1181
  Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
1109
1182
  `ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
1110
1183
 
@@ -1142,7 +1215,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
1142
1215
  new stack needs no steps.
1143
1216
 
1144
1217
  **What changed.** (int.109) Detailed in
1145
- [The worker instance](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
1218
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
1146
1219
  bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
1147
1220
  refusing clients without TLS or IAM, replacing the worker's
1148
1221
  `AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
@@ -1196,10 +1269,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
1196
1269
  with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
1197
1270
  unchanged.
1198
1271
  - `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
1199
- [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#worker-down-alarm).
1272
+ [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#worker-down-alarm).
1200
1273
 
1201
1274
  **To adopt.** Optional. For parameter-only change sets, see
1202
- [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
1275
+ [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
1203
1276
  `alarmTopic`.
1204
1277
 
1205
1278
  **Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
@@ -1210,7 +1283,7 @@ worker, and a hand-built alarm on the worker log group.
1210
1283
  **What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
1211
1284
  swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
1212
1285
  `alarmTopic` if set; a retried step names itself when it gives up. See
1213
- [The worker instance](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#the-worker-instance).
1286
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#the-worker-instance).
1214
1287
 
1215
1288
  **To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
1216
1289
  not Template first and the worker contract stays at 1.
@@ -1276,7 +1349,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
1276
1349
 
1277
1350
  **To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
1278
1351
  mirror, so the root volume needs room for two
1279
- ([details](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#the-worker-instance)).
1352
+ ([details](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#the-worker-instance)).
1280
1353
 
1281
1354
  #### The worker follows a rebased or deleted GitHub branch
1282
1355
 
@@ -1298,7 +1371,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
1298
1371
  bundle-only roll is safe.
1299
1372
 
1300
1373
  **To adopt.** Parameter mode: gate bundle-only rolls on the contract
1301
- ([recipe](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
1374
+ ([recipe](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
1302
1375
  `WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
1303
1376
  copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
1304
1377
 
@@ -1315,8 +1388,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
1315
1388
  template, then roll the bundle; on an older template it stops with `template too old for this
1316
1389
  bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
1317
1390
  takes `worker/`'s three units and `gateway.env.example`
1318
- ([steps](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1319
- [checklist](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#first-deploy-checklist).
1391
+ ([steps](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1392
+ [checklist](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#first-deploy-checklist).
1320
1393
 
1321
1394
  #### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
1322
1395
 
@@ -1327,7 +1400,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
1327
1400
  `X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
1328
1401
  its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
1329
1402
  marked `noindex`. The editor's default preview is same-origin and unaffected. See
1330
- [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
1403
+ [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
1331
1404
 
1332
1405
  **To adopt.** If you wired the Function URL into your own distribution by hand, delete those
1333
1406
  behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
@@ -1503,7 +1576,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
1503
1576
  **To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
1504
1577
  apply the same rule here, for example `referenceLink: (target, { body }) =>
1505
1578
  !body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
1506
- [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#ai-content-configuration).
1579
+ [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#ai-content-configuration).
1507
1580
 
1508
1581
  **Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
1509
1582
  change its link.
@@ -1578,7 +1651,7 @@ _First in int.115._
1578
1651
  entry the base branch also changed, the "updated on the base branch" notice and the branch's
1579
1652
  conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
1580
1653
  base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
1581
- and Unpublishing](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#drafts-and-unpublishing) section covers long-lived branches and
1654
+ and Unpublishing](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#drafts-and-unpublishing) section covers long-lived branches and
1582
1655
  unpublishing.
1583
1656
 
1584
1657
  #### The editor calls the content drawer "All content"
@@ -1890,7 +1963,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
1890
1963
  The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
1891
1964
 
1892
1965
  **To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
1893
- `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#stamping-a-publication-date).
1966
+ `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#stamping-a-publication-date).
1894
1967
 
1895
1968
  **Now deletable.** A build step or hook that writes a missing publication date into new entries.
1896
1969
 
@@ -1937,7 +2010,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
1937
2010
  stored at, and `react-split-pane` is no longer a dependency.
1938
2011
  `EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
1939
2012
  no longer exported from `canopycms/client`. See
1940
- [Your root layout](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#editor-customization).
2013
+ [Your root layout](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#editor-customization).
1941
2014
 
1942
2015
  **To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
1943
2016
  instead, which lays out its own panes. Hiding your site chrome on the editor route is now
@@ -2048,7 +2121,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
2048
2121
  **To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
2049
2122
  `ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
2050
2123
  own pages, mount the hook as in
2051
- [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
2124
+ [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
2052
2125
  Your own Server Actions in the CMS build still 403 behind OAC.
2053
2126
 
2054
2127
  **Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
@@ -2089,12 +2162,12 @@ fast naming the ARN, the field and the keys present, never a value.
2089
2162
  **To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
2090
2163
  prop. The scaffolded stack fills them from the repository _variables_
2091
2164
  `CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
2092
- ([why the prefix](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2165
+ ([why the prefix](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2093
2166
  adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
2094
2167
  lines to `.github/workflows/deploy-cms.yml`, or re-runs the generator and diffs. `cdk synth` refuses a `…JsonField` prop without its `…SecretArn`, and an ARN carrying the ECS `:KEY::` suffix
2095
2168
  (also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
2096
2169
  resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
2097
- key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#security-model)).
2170
+ key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#security-model)).
2098
2171
 
2099
2172
  **Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
2100
2173
  worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
@@ -2106,7 +2179,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
2106
2179
  `githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
2107
2180
  nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
2108
2181
  anyone holding an App's key can mint a token for any of its installations
2109
- ([why](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2182
+ ([why](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2110
2183
 
2111
2184
  **To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
2112
2185
  `githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
@@ -2119,7 +2192,7 @@ anyone holding an App's key can mint a token for any of its installations
2119
2192
  `verify` checks an existing installation's permissions: run it, since an App missing a
2120
2193
  permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
2121
2194
  never edits an existing JSON secret (create one and point the JSON-field prop at it)
2122
- ([details](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2195
+ ([details](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2123
2196
  2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
2124
2197
  of the three is refused at synth, and so is an App alongside a token.
2125
2198
  3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
@@ -2130,7 +2203,7 @@ anyone holding an App's key can mint a token for any of its installations
2130
2203
 
2131
2204
  The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
2132
2205
  IAM policy automatically, so you need not add it to `secretsArns`. See
2133
- [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2206
+ [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2134
2207
 
2135
2208
  ```bash
2136
2209
  canopycms init-github-app create -- \
@@ -2178,7 +2251,7 @@ downloads the `.pem` from the App's settings page.
2178
2251
 
2179
2252
  **What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
2180
2253
  key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
2181
- [Rotating a secret](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#rotating-a-secret).
2254
+ [Rotating a secret](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#rotating-a-secret).
2182
2255
 
2183
2256
  **To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
2184
2257
  GitHub App private key is still read only at boot: store the new key, replace the instance, and
@@ -2232,12 +2305,12 @@ also check the bucket policy for its grant.
2232
2305
  5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
2233
2306
  Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
2234
2307
  `webpack` and it can read your Next version. A webpack build still fails its image transforms
2235
- ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#dual-build-support)).
2308
+ ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#dual-build-support)).
2236
2309
 
2237
2310
  **Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
2238
2311
  function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
2239
2312
  function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
2240
- on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#where-the-image-is-built)).
2313
+ on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#where-the-image-is-built)).
2241
2314
 
2242
2315
  **To adopt.**
2243
2316
 
@@ -2266,7 +2339,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
2266
2339
 
2267
2340
  **What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
2268
2341
  replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
2269
- uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#media-configuration) for the
2342
+ uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#media-configuration) for the
2270
2343
  CloudFront behavior it expects.
2271
2344
 
2272
2345
  **To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
@@ -2291,7 +2364,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
2291
2364
  bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
2292
2365
  `Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
2293
2366
  `AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
2294
- pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#cross-account-asset-bucket).
2367
+ pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#cross-account-asset-bucket).
2295
2368
 
2296
2369
  **To adopt.** Optional:
2297
2370
 
@@ -2401,7 +2474,7 @@ public JWKS PEM, used only to verify signatures.
2401
2474
  to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
2402
2475
  deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
2403
2476
  `clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
2404
- `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/docs/deploying-to-aws.md#security-model)).
2477
+ `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/docs/deploying-to-aws.md#security-model)).
2405
2478
 
2406
2479
  #### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
2407
2480
 
@@ -2500,7 +2573,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
2500
2573
  Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
2501
2574
  no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
2502
2575
  `AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
2503
- is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#media-configuration)). Two traps:
2576
+ is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#media-configuration)). Two traps:
2504
2577
 
2505
2578
  - Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
2506
2579
  a nested route prefix and emits zero params, building green.
@@ -2659,7 +2732,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
2659
2732
  `withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
2660
2733
  `canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
2661
2734
  `createNextCanopyContext`'s result. See
2662
- [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2735
+ [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2663
2736
  the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
2664
2737
  sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
2665
2738
  filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
@@ -2716,7 +2789,7 @@ underscore-prefixed files are skipped.
2716
2789
 
2717
2790
  **What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
2718
2791
  `defaultPathAccess: { read: 'allow' }`
2719
- ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#public-read-on-server-deployments)).
2792
+ ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#public-read-on-server-deployments)).
2720
2793
 
2721
2794
  **To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
2722
2795
  consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
@@ -2769,7 +2842,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
2769
2842
  **What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
2770
2843
  gives one template's value type) requires exactly
2771
2844
  one component per block template name when written as an object literal. See
2772
- [Block Component Registries](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#block-component-registries) and
2845
+ [Block Component Registries](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#block-component-registries) and
2773
2846
  `apps/example1/app/components/PostView.tsx`.
2774
2847
 
2775
2848
  ```ts
@@ -2791,7 +2864,7 @@ templates against the schema.
2791
2864
 
2792
2865
  **What changed.** Spreading a `const` field array into several schemas, and nesting
2793
2866
  `defineInlineFieldGroup()` inside a block template, are documented
2794
- ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2867
+ ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2795
2868
  identity helper for them.
2796
2869
 
2797
2870
  ```ts
@@ -2810,7 +2883,7 @@ field by composing from the same `const` field object.
2810
2883
  A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
2811
2884
  it, and listings do with
2812
2885
  [`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
2813
- (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#shared--referenced-blocks).
2886
+ (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#shared--referenced-blocks).
2814
2887
 
2815
2888
  **Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
2816
2889
 
@@ -2832,7 +2905,7 @@ Not retro-documented, apart from these:
2832
2905
 
2833
2906
  #### The registry is keyed by entry-type name (0.0.42)
2834
2907
 
2835
- **What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/67d7e59ebd472b09175d09c620d8e2d06d333496/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2908
+ **What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/e5dcfc6cc5de00a6e5f215986f460645110fd71c/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2836
2909
 
2837
2910
  **To adopt.**
2838
2911
 
@@ -5,6 +5,7 @@
5
5
  import { loadOrCreateBranchContext } from '../branch-workspace.js';
6
6
  import { readsFromCheckout } from '../build-mode.js';
7
7
  import { GitManager } from '../git-manager.js';
8
+ import { AI_USER_ID } from '../system-users.js';
8
9
  import { baseBranchOf } from '../utils/base-branch.js';
9
10
  import { detectHeadBranch } from '../utils/git.js';
10
11
  /**
@@ -36,7 +37,7 @@ export async function resolveBranchRoot(config) {
36
37
  config: resolved,
37
38
  branchName: activeBranch,
38
39
  mode: config.mode,
39
- createdBy: 'canopycms-ai',
40
+ createdBy: AI_USER_ID,
40
41
  remoteUrl: config.defaultRemoteUrl,
41
42
  });
42
43
  return context.branchRoot;
@@ -75,6 +75,10 @@ interface RepairedContentDuplicate {
75
75
  interface RepairContentDuplicatesData {
76
76
  resolved: RepairedContentDuplicate[];
77
77
  }
78
+ /** Response type for POST /admin/branch-dirs/:dirName/dismiss-unpublished */
79
+ export type DismissUnpublishedResponse = ApiResponse<{
80
+ dismissed: true;
81
+ }>;
78
82
  /** Response type for POST /admin/branch-dirs/:dirName/repair-content-duplicates */
79
83
  export type RepairContentDuplicatesResponse = ApiResponse<RepairContentDuplicatesData>;
80
84
  /**
@@ -110,5 +114,12 @@ export declare const ADMIN_BRANCH_HEALTH_ROUTES: {
110
114
  }, {
111
115
  dirName: string;
112
116
  }>, undefined, RepairContentDuplicatesResponse>;
117
+ readonly dismissUnpublished: import("./route-builder.js").RouteDefinition<z.ZodObject<{
118
+ dirName: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ dirName: string;
121
+ }, {
122
+ dirName: string;
123
+ }>, undefined, DismissUnpublishedResponse>;
113
124
  };
114
125
  export {};
@@ -607,6 +607,41 @@ const repairBranchDir = defineEndpoint({
607
607
  guards: ['admin'],
608
608
  handler: repairBranchDirHandler,
609
609
  });
610
+ /**
611
+ * Stop listing a branch merged with an unfinished submit. Bookkeeping, so it leaves `updatedAt`.
612
+ * The same stat guard as purge: the update's lock would otherwise create the directory.
613
+ */
614
+ const dismissUnpublishedHandler = async (_gc, ctx, _req, params) => {
615
+ const baseRoot = getDefaultBranchBase(ctx.services.config.mode);
616
+ const dirPath = resolveDirWithinBase(baseRoot, params.dirName);
617
+ if (!dirPath) {
618
+ return { ok: false, status: 400, error: 'Invalid directory name' };
619
+ }
620
+ const dirExists = await fs
621
+ .stat(dirPath)
622
+ .then(() => true)
623
+ .catch(() => false);
624
+ if (!dirExists) {
625
+ return { ok: false, status: 404, error: 'Directory not found' };
626
+ }
627
+ const saved = await getBranchMetadataFileManager(dirPath, baseRoot).update((current) => current?.branch.unpublishedAtMerge ? { branch: { unpublishedAtMerge: undefined } } : null, { keepUpdatedAt: true });
628
+ if (saved === null) {
629
+ return { ok: false, status: 409, error: 'This warning was already dismissed.' };
630
+ }
631
+ return { ok: true, status: 200, data: { dismissed: true } };
632
+ };
633
+ const dismissUnpublished = defineEndpoint({
634
+ namespace: 'admin',
635
+ name: 'dismissUnpublished',
636
+ method: 'POST',
637
+ path: '/admin/branch-dirs/:dirName/dismiss-unpublished',
638
+ params: branchDirParamsSchema,
639
+ responseType: 'DismissUnpublishedResponse',
640
+ response: {},
641
+ defaultMockData: { dismissed: true },
642
+ guards: ['admin'],
643
+ handler: dismissUnpublishedHandler,
644
+ });
610
645
  /**
611
646
  * Repair duplicate content IDs in a healthy branch's content tree by
612
647
  * archiving the quarantined (losing) file(s) with a dot-prefixed name --
@@ -643,4 +678,5 @@ export const ADMIN_BRANCH_HEALTH_ROUTES = {
643
678
  purgeBranchDir,
644
679
  repairBranchDir,
645
680
  repairContentDuplicates,
681
+ dismissUnpublished,
646
682
  };
@@ -11,7 +11,7 @@ import type { Task, QueueStats, CorruptTaskFile } from '../task-queue/cms-task-q
11
11
  import type { BuildIdentity, WorkerStatusReport } from '../types.js';
12
12
  import { type OperatingMode } from '../operating-mode/index.js';
13
13
  import type { SchemaIssue } from '../schema/types.js';
14
- export type { BranchHealthResponse, PurgeBranchDirResponse, RepairBranchDirResponse, RepairContentDuplicatesResponse, } from './admin-branch-health.js';
14
+ export type { BranchHealthResponse, DismissUnpublishedResponse, PurgeBranchDirResponse, RepairBranchDirResponse, RepairContentDuplicatesResponse, } from './admin-branch-health.js';
15
15
  type WorkerLivenessState = 'alive' | 'stale' | 'absent';
16
16
  export interface WorkerLiveness {
17
17
  /**
@@ -145,6 +145,13 @@ export declare const ADMIN_ROUTES: {
145
145
  }, {
146
146
  dirName: string;
147
147
  }>, undefined, import("./admin-branch-health.js").RepairContentDuplicatesResponse>;
148
+ readonly dismissUnpublished: import("./route-builder.js").RouteDefinition<z.ZodObject<{
149
+ dirName: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ dirName: string;
152
+ }, {
153
+ dirName: string;
154
+ }>, undefined, import("./admin-branch-health.js").DismissUnpublishedResponse>;
148
155
  readonly status: import("./route-builder.js").RouteDefinition<undefined, undefined, AdminStatusResponse>;
149
156
  readonly listTasks: import("./route-builder.js").RouteDefinition<z.ZodObject<{
150
157
  status: z.ZodEnum<["pending", "processing", "completed", "failed", "corrupt"]>;
@@ -45,7 +45,7 @@ const markAsMergedHandler = async (gc, ctx, _req, params) => {
45
45
  }
46
46
  // Update branch status to 'archived'
47
47
  const meta = getBranchMetadataFileManager(branchContext.branchRoot, branchContext.baseRoot);
48
- await meta.save({ branch: buildMergedBranchUpdate() });
48
+ await meta.update((current) => current === null ? null : { branch: buildMergedBranchUpdate(current.branch) });
49
49
  // Optionally delete remote branch (disabled by default for safety)
50
50
  // if (ctx.services.githubService && req.body?.deleteRemoteBranch) {
51
51
  // try {