canopycms 0.8.0 → 0.8.2

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 (86) hide show
  1. package/CHANGELOG.md +112 -47
  2. package/dist/api/admin-branch-health.d.ts +11 -0
  3. package/dist/api/admin-branch-health.js +36 -0
  4. package/dist/api/admin.d.ts +8 -1
  5. package/dist/api/branch-merge.js +1 -1
  6. package/dist/api/branch-review.js +20 -3
  7. package/dist/api/branch-status.js +30 -19
  8. package/dist/api/branch.d.ts +8 -3
  9. package/dist/api/branch.js +32 -3
  10. package/dist/api/client.d.ts +3 -1
  11. package/dist/api/client.js +4 -0
  12. package/dist/api/github-sync.d.ts +2 -0
  13. package/dist/api/github-sync.js +6 -1
  14. package/dist/api/pr-comment-sync.js +3 -1
  15. package/dist/branch-metadata-file.d.ts +66 -0
  16. package/dist/branch-metadata-file.js +14 -0
  17. package/dist/branch-metadata.d.ts +4 -2
  18. package/dist/branch-metadata.js +10 -2
  19. package/dist/branch-schema-cache.d.ts +22 -2
  20. package/dist/branch-schema-cache.js +88 -12
  21. package/dist/cli/cli.js +91 -18
  22. package/dist/cli/generate-ai-content.js +72 -11
  23. package/dist/cli/init.js +2 -2
  24. package/dist/content-reader.d.ts +24 -10
  25. package/dist/content-reader.js +43 -6
  26. package/dist/context.js +43 -41
  27. package/dist/editor/BranchManager.d.ts +8 -4
  28. package/dist/editor/BranchManager.js +43 -18
  29. package/dist/editor/Editor.js +3 -2
  30. package/dist/editor/admin/SystemHealthPanel.js +65 -31
  31. package/dist/editor/admin/UnpublishedAtMergeAlert.d.ts +16 -0
  32. package/dist/editor/admin/UnpublishedAtMergeAlert.js +50 -0
  33. package/dist/editor/admin/useSystemHealth.d.ts +2 -0
  34. package/dist/editor/admin/useSystemHealth.js +21 -0
  35. package/dist/editor/branch-lock.d.ts +2 -0
  36. package/dist/editor/branch-lock.js +5 -3
  37. package/dist/editor/branch-status.d.ts +25 -1
  38. package/dist/editor/branch-status.js +75 -0
  39. package/dist/editor/components/EditorHeader.d.ts +6 -2
  40. package/dist/editor/components/EditorHeader.js +51 -30
  41. package/dist/editor/components/EntryHeader.d.ts +3 -1
  42. package/dist/editor/components/EntryHeader.js +2 -1
  43. package/dist/editor/components/TooltipDetail.d.ts +14 -0
  44. package/dist/editor/components/TooltipDetail.js +18 -0
  45. package/dist/editor/copy.d.ts +7 -0
  46. package/dist/editor/copy.js +9 -0
  47. package/dist/editor/hooks/useBranchManager.d.ts +8 -3
  48. package/dist/editor/hooks/useBranchManager.js +48 -5
  49. package/dist/pr-comments.d.ts +2 -0
  50. package/dist/pr-comments.js +20 -14
  51. package/dist/resource-generation.js +2 -3
  52. package/dist/server.d.ts +6 -1
  53. package/dist/server.js +6 -1
  54. package/dist/submission-attribution.d.ts +1 -1
  55. package/dist/submission-attribution.js +20 -2
  56. package/dist/task-queue/task-queue.d.ts +5 -1
  57. package/dist/task-queue/task-queue.js +4 -2
  58. package/dist/types.d.ts +61 -0
  59. package/dist/version.d.ts +1 -1
  60. package/dist/version.js +1 -1
  61. package/dist/worker/branch-merge.d.ts +68 -0
  62. package/dist/worker/branch-merge.js +228 -0
  63. package/dist/worker/canopy-state.d.ts +2 -0
  64. package/dist/worker/canopy-state.js +1 -1
  65. package/dist/worker/cms-worker.d.ts +1 -0
  66. package/dist/worker/cms-worker.js +5 -3
  67. package/dist/worker/git-sync.js +15 -8
  68. package/dist/worker/github-commits.d.ts +106 -0
  69. package/dist/worker/github-commits.js +485 -0
  70. package/dist/worker/github-gateway-http.js +3 -2
  71. package/dist/worker/github-gateway-wire.d.ts +24 -15
  72. package/dist/worker/github-gateway-wire.js +4 -1
  73. package/dist/worker/github-gateway.d.ts +16 -5
  74. package/dist/worker/github-gateway.js +22 -5
  75. package/dist/worker/github-mirror.d.ts +8 -0
  76. package/dist/worker/github-mirror.js +12 -1
  77. package/dist/worker/github-transfer.d.ts +3 -1
  78. package/dist/worker/github-transfer.js +3 -2
  79. package/dist/worker/history-rewrite.d.ts +13 -1
  80. package/dist/worker/history-rewrite.js +27 -3
  81. package/dist/worker/rebase.d.ts +13 -7
  82. package/dist/worker/rebase.js +351 -95
  83. package/dist/worker/task-runner.d.ts +1 -1
  84. package/dist/worker/task-runner.js +172 -34
  85. package/dist/worker/worker-context.d.ts +2 -0
  86. 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.0`, built from [`f47713d`](https://github.com/safeinsights/canopycms/tree/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a).
8
+ Version `0.8.2`, built from [`74c7565`](https://github.com/safeinsights/canopycms/tree/74c756559271d91a988cf1ce2d250720062efd59).
9
9
 
10
- Its entries are [0.8.0](#080), under **Released**.
10
+ Its entries are [0.8.2](#082), 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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/.changeset/README.md) until a stable release
27
+ every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/.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,71 @@ entries under **Released**.
62
62
 
63
63
  ## Released
64
64
 
65
+ ### 0.8.2
66
+
67
+ #### The editor says when a pull request is stuck, and what to do
68
+
69
+ <!-- changeset: editor-shows-held-prs -->
70
+
71
+ _First in 0.8.2._
72
+
73
+ **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.
74
+
75
+ - A branch in review that conflicts with its base: the line gives its author, a reviewer and anyone else their own way forward.
76
+ - 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.
77
+ - A branch force-pushed on GitHub: submit is blocked, as nothing can reach GitHub until an admin sorts it out.
78
+ - 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.
79
+ - A branch in review with a failed sync now says it won't update from its base until it syncs.
80
+
81
+ #### Commits made on a pull request's branch on GitHub now reach the editor
82
+
83
+ <!-- changeset: github-commits-into-clones -->
84
+
85
+ _First in 0.8.2._
86
+
87
+ **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.
88
+
89
+ - If both sides changed a file, the editor's version is kept and the pull request lists the file.
90
+ - A commit that isn't the base catching up sends an approved branch back to review.
91
+ - 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.
92
+ - 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.
93
+ - A submit or push GitHub rejects because its branch moved runs again after the next sync, unless the branch has moved on since.
94
+
95
+ **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.
96
+
97
+ #### Pull requests from the editor stay up to date with their base
98
+
99
+ <!-- changeset: keep-editor-prs-current -->
100
+
101
+ _First in 0.8.2._
102
+
103
+ **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.
104
+
105
+ - Each update is a new commit, so required checks run again.
106
+ - 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.
107
+ - A pull request that conflicts with its base stays as it is. Withdraw it from review to resolve the conflict.
108
+ - Repositories that don't require up-to-date branches see no change.
109
+
110
+ #### A branch whose submit failed can't be approved, and a merge that may miss commits is flagged
111
+
112
+ <!-- changeset: unfinished-submit-rulings -->
113
+
114
+ _First in 0.8.2._
115
+
116
+ **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.
117
+
118
+ 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.
119
+
120
+ ### 0.8.1
121
+
122
+ #### Content reads stop re-reading and re-parsing the schema cache
123
+
124
+ <!-- changeset: schema-cache-read-once -->
125
+
126
+ _First in 0.8.1._
127
+
128
+ **What changed.** An adopter's request measured every `read()` and `readByUrlPath()` reading and parsing the branch's whole schema cache file, up to five times per page. Each process now keeps the schema it parsed and reuses it while the file is unchanged, still checking its freshness on every read. `readByUrlPath()` resolves the branch's schema once for both of the paths it tries. A build resolves the schema once per process instead of on every read. The cache file is written without indentation, under half its former size.
129
+
65
130
  ### 0.8.0
66
131
 
67
132
  <!-- changeset: merge-main-0-7-1-into-int-e -->
@@ -251,7 +316,7 @@ _First in 0.7.0._
251
316
 
252
317
  **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.
253
318
 
254
- **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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
319
+ **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/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#rolling-the-worker-from-ci).
255
320
 
256
321
  #### Pull request bodies link back to the editor
257
322
 
@@ -261,7 +326,7 @@ _First in 0.7.0._
261
326
 
262
327
  **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.
263
328
 
264
- **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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#definecanopyconfig-options).
329
+ **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/74c756559271d91a988cf1ce2d250720062efd59/README.md#definecanopyconfig-options).
265
330
 
266
331
  #### CloudFront origin read timeout accepted up to 120 s; the editor waits 135 s
267
332
 
@@ -347,7 +412,7 @@ _First in 0.6.0._
347
412
 
348
413
  **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.
349
414
 
350
- **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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md).
415
+ **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/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md).
351
416
 
352
417
  ### 0.5.0
353
418
 
@@ -359,7 +424,7 @@ _First in 0.5.0._
359
424
 
360
425
  **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.
361
426
 
362
- **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#field-types).
427
+ **To adopt.** Set `maxItems: 3` on the list field in its entry schema. See [Field Types](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#field-types).
363
428
 
364
429
  #### SEO field location moves into config; reference pickers mark hidden entries and take a sort order — **breaking: `createNextCanopyContext({ seo })` and `AIContentConfig.seo` are removed**
365
430
 
@@ -369,7 +434,7 @@ _First in 0.5.0._
369
434
 
370
435
  **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.
371
436
 
372
- **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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#how-references-work-in-the-editor).
437
+ **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/74c756559271d91a988cf1ce2d250720062efd59/README.md#sitemap-and-seo-metadata) and [How References Work in the Editor](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#how-references-work-in-the-editor).
373
438
 
374
439
  **Now deletable.** A shared `seo` constant passed separately to the Next context and the AI content config.
375
440
 
@@ -397,7 +462,7 @@ resolved without it.
397
462
  **To adopt.** Where a reference renders its target's prose, set `includeBody: true` on that
398
463
  reference field. Code that reads the body from a link-only reference's resolved type now sees
399
464
  `string | undefined`; either set `includeBody: true` or handle the missing value. See
400
- [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#resolving-references-in-a-listing).
465
+ [Resolving References in a Listing](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#resolving-references-in-a-listing).
401
466
 
402
467
  ### 0.3.3
403
468
 
@@ -814,7 +879,7 @@ URL.
814
879
  2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
815
880
  `app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
816
881
  route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
817
- [Live Preview](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#live-preview)).
882
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#live-preview)).
818
883
  3. A test reading view content from the route's server HTML must load the page in a browser.
819
884
  Server output rendered during a preview request carries the signed-in asset prefix; keep it out
820
885
  of cross-request caches (`unstable_cache`, module memos).
@@ -829,7 +894,7 @@ kept site styles ahead of Mantine's in the preview.
829
894
  server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
830
895
  path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
831
896
  refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
832
- [Live Preview](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#live-preview).
897
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#live-preview).
833
898
 
834
899
  **To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
835
900
  as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
@@ -911,7 +976,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
911
976
  fields are nested or renamed, pass the AI config's `seo` the same object you pass
912
977
  `createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
913
978
  place. A field that links to a hidden section by plain URL needs a field transform; the README
914
- shows [the recipe](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#ai-content-configuration).
979
+ shows [the recipe](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#ai-content-configuration).
915
980
 
916
981
  **Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
917
982
 
@@ -933,7 +998,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
933
998
  field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
934
999
  `MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
935
1000
  `{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
936
- [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#mdx-content-cannot-run-code).
1001
+ [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#mdx-content-cannot-run-code).
937
1002
 
938
1003
  **To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
939
1004
  `mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
@@ -1070,7 +1135,7 @@ a format check.
1070
1135
 
1071
1136
  - (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
1072
1137
  re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
1073
- ([reference](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#definecanopyconfig-options)).
1138
+ ([reference](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#definecanopyconfig-options)).
1074
1139
  - (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
1075
1140
  the PR-body section every user who edited the branch, not only the submitter; settings commits
1076
1141
  (permissions, groups) carry the acting user's trailer.
@@ -1094,7 +1159,7 @@ saves only push the branch, and no failing PR task lands in System health.
1094
1159
  that entry type goes unavailable: the editor says so, and its entries answer 503 with
1095
1160
  `code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
1096
1161
  worker holds the base branch for up to 30 minutes while that lasts; see
1097
- [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
1162
+ [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
1098
1163
  Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
1099
1164
  `ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
1100
1165
 
@@ -1132,7 +1197,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
1132
1197
  new stack needs no steps.
1133
1198
 
1134
1199
  **What changed.** (int.109) Detailed in
1135
- [The worker instance](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
1200
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
1136
1201
  bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
1137
1202
  refusing clients without TLS or IAM, replacing the worker's
1138
1203
  `AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
@@ -1186,10 +1251,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
1186
1251
  with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
1187
1252
  unchanged.
1188
1253
  - `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
1189
- [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#worker-down-alarm).
1254
+ [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#worker-down-alarm).
1190
1255
 
1191
1256
  **To adopt.** Optional. For parameter-only change sets, see
1192
- [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
1257
+ [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
1193
1258
  `alarmTopic`.
1194
1259
 
1195
1260
  **Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
@@ -1200,7 +1265,7 @@ worker, and a hand-built alarm on the worker log group.
1200
1265
  **What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
1201
1266
  swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
1202
1267
  `alarmTopic` if set; a retried step names itself when it gives up. See
1203
- [The worker instance](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#the-worker-instance).
1268
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#the-worker-instance).
1204
1269
 
1205
1270
  **To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
1206
1271
  not Template first and the worker contract stays at 1.
@@ -1266,7 +1331,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
1266
1331
 
1267
1332
  **To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
1268
1333
  mirror, so the root volume needs room for two
1269
- ([details](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#the-worker-instance)).
1334
+ ([details](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#the-worker-instance)).
1270
1335
 
1271
1336
  #### The worker follows a rebased or deleted GitHub branch
1272
1337
 
@@ -1288,7 +1353,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
1288
1353
  bundle-only roll is safe.
1289
1354
 
1290
1355
  **To adopt.** Parameter mode: gate bundle-only rolls on the contract
1291
- ([recipe](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
1356
+ ([recipe](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
1292
1357
  `WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
1293
1358
  copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
1294
1359
 
@@ -1305,8 +1370,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
1305
1370
  template, then roll the bundle; on an older template it stops with `template too old for this
1306
1371
  bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
1307
1372
  takes `worker/`'s three units and `gateway.env.example`
1308
- ([steps](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1309
- [checklist](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#first-deploy-checklist).
1373
+ ([steps](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
1374
+ [checklist](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#first-deploy-checklist).
1310
1375
 
1311
1376
  #### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
1312
1377
 
@@ -1317,7 +1382,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
1317
1382
  `X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
1318
1383
  its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
1319
1384
  marked `noindex`. The editor's default preview is same-origin and unaffected. See
1320
- [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
1385
+ [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
1321
1386
 
1322
1387
  **To adopt.** If you wired the Function URL into your own distribution by hand, delete those
1323
1388
  behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
@@ -1493,7 +1558,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
1493
1558
  **To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
1494
1559
  apply the same rule here, for example `referenceLink: (target, { body }) =>
1495
1560
  !body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
1496
- [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#ai-content-configuration).
1561
+ [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#ai-content-configuration).
1497
1562
 
1498
1563
  **Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
1499
1564
  change its link.
@@ -1568,7 +1633,7 @@ _First in int.115._
1568
1633
  entry the base branch also changed, the "updated on the base branch" notice and the branch's
1569
1634
  conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
1570
1635
  base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
1571
- and Unpublishing](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#drafts-and-unpublishing) section covers long-lived branches and
1636
+ and Unpublishing](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#drafts-and-unpublishing) section covers long-lived branches and
1572
1637
  unpublishing.
1573
1638
 
1574
1639
  #### The editor calls the content drawer "All content"
@@ -1880,7 +1945,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
1880
1945
  The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
1881
1946
 
1882
1947
  **To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
1883
- `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#stamping-a-publication-date).
1948
+ `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#stamping-a-publication-date).
1884
1949
 
1885
1950
  **Now deletable.** A build step or hook that writes a missing publication date into new entries.
1886
1951
 
@@ -1927,7 +1992,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
1927
1992
  stored at, and `react-split-pane` is no longer a dependency.
1928
1993
  `EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
1929
1994
  no longer exported from `canopycms/client`. See
1930
- [Your root layout](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#editor-customization).
1995
+ [Your root layout](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#editor-customization).
1931
1996
 
1932
1997
  **To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
1933
1998
  instead, which lays out its own panes. Hiding your site chrome on the editor route is now
@@ -2038,7 +2103,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
2038
2103
  **To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
2039
2104
  `ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
2040
2105
  own pages, mount the hook as in
2041
- [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
2106
+ [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
2042
2107
  Your own Server Actions in the CMS build still 403 behind OAC.
2043
2108
 
2044
2109
  **Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
@@ -2079,12 +2144,12 @@ fast naming the ARN, the field and the keys present, never a value.
2079
2144
  **To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
2080
2145
  prop. The scaffolded stack fills them from the repository _variables_
2081
2146
  `CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
2082
- ([why the prefix](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2147
+ ([why the prefix](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
2083
2148
  adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
2084
2149
  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
2085
2150
  (also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
2086
2151
  resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
2087
- key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#security-model)).
2152
+ key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#security-model)).
2088
2153
 
2089
2154
  **Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
2090
2155
  worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
@@ -2096,7 +2161,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
2096
2161
  `githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
2097
2162
  nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
2098
2163
  anyone holding an App's key can mint a token for any of its installations
2099
- ([why](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2164
+ ([why](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
2100
2165
 
2101
2166
  **To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
2102
2167
  `githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
@@ -2109,7 +2174,7 @@ anyone holding an App's key can mint a token for any of its installations
2109
2174
  `verify` checks an existing installation's permissions: run it, since an App missing a
2110
2175
  permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
2111
2176
  never edits an existing JSON secret (create one and point the JSON-field prop at it)
2112
- ([details](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2177
+ ([details](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
2113
2178
  2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
2114
2179
  of the three is refused at synth, and so is an App alongside a token.
2115
2180
  3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
@@ -2120,7 +2185,7 @@ anyone holding an App's key can mint a token for any of its installations
2120
2185
 
2121
2186
  The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
2122
2187
  IAM policy automatically, so you need not add it to `secretsArns`. See
2123
- [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2188
+ [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#authenticating-as-a-github-app).
2124
2189
 
2125
2190
  ```bash
2126
2191
  canopycms init-github-app create -- \
@@ -2168,7 +2233,7 @@ downloads the `.pem` from the App's settings page.
2168
2233
 
2169
2234
  **What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
2170
2235
  key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
2171
- [Rotating a secret](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#rotating-a-secret).
2236
+ [Rotating a secret](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#rotating-a-secret).
2172
2237
 
2173
2238
  **To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
2174
2239
  GitHub App private key is still read only at boot: store the new key, replace the instance, and
@@ -2222,12 +2287,12 @@ also check the bucket policy for its grant.
2222
2287
  5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
2223
2288
  Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
2224
2289
  `webpack` and it can read your Next version. A webpack build still fails its image transforms
2225
- ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#dual-build-support)).
2290
+ ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#dual-build-support)).
2226
2291
 
2227
2292
  **Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
2228
2293
  function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
2229
2294
  function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
2230
- on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#where-the-image-is-built)).
2295
+ on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#where-the-image-is-built)).
2231
2296
 
2232
2297
  **To adopt.**
2233
2298
 
@@ -2256,7 +2321,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
2256
2321
 
2257
2322
  **What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
2258
2323
  replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
2259
- uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#media-configuration) for the
2324
+ uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#media-configuration) for the
2260
2325
  CloudFront behavior it expects.
2261
2326
 
2262
2327
  **To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
@@ -2281,7 +2346,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
2281
2346
  bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
2282
2347
  `Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
2283
2348
  `AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
2284
- pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#cross-account-asset-bucket).
2349
+ pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#cross-account-asset-bucket).
2285
2350
 
2286
2351
  **To adopt.** Optional:
2287
2352
 
@@ -2391,7 +2456,7 @@ public JWKS PEM, used only to verify signatures.
2391
2456
  to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
2392
2457
  deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
2393
2458
  `clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
2394
- `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/docs/deploying-to-aws.md#security-model)).
2459
+ `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/docs/deploying-to-aws.md#security-model)).
2395
2460
 
2396
2461
  #### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
2397
2462
 
@@ -2490,7 +2555,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
2490
2555
  Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
2491
2556
  no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
2492
2557
  `AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
2493
- is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#media-configuration)). Two traps:
2558
+ is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#media-configuration)). Two traps:
2494
2559
 
2495
2560
  - Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
2496
2561
  a nested route prefix and emits zero params, building green.
@@ -2649,7 +2714,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
2649
2714
  `withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
2650
2715
  `canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
2651
2716
  `createNextCanopyContext`'s result. See
2652
- [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2717
+ [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2653
2718
  the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
2654
2719
  sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
2655
2720
  filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
@@ -2706,7 +2771,7 @@ underscore-prefixed files are skipped.
2706
2771
 
2707
2772
  **What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
2708
2773
  `defaultPathAccess: { read: 'allow' }`
2709
- ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#public-read-on-server-deployments)).
2774
+ ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#public-read-on-server-deployments)).
2710
2775
 
2711
2776
  **To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
2712
2777
  consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
@@ -2759,7 +2824,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
2759
2824
  **What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
2760
2825
  gives one template's value type) requires exactly
2761
2826
  one component per block template name when written as an object literal. See
2762
- [Block Component Registries](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#block-component-registries) and
2827
+ [Block Component Registries](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#block-component-registries) and
2763
2828
  `apps/example1/app/components/PostView.tsx`.
2764
2829
 
2765
2830
  ```ts
@@ -2781,7 +2846,7 @@ templates against the schema.
2781
2846
 
2782
2847
  **What changed.** Spreading a `const` field array into several schemas, and nesting
2783
2848
  `defineInlineFieldGroup()` inside a block template, are documented
2784
- ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2849
+ ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2785
2850
  identity helper for them.
2786
2851
 
2787
2852
  ```ts
@@ -2800,7 +2865,7 @@ field by composing from the same `const` field object.
2800
2865
  A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
2801
2866
  it, and listings do with
2802
2867
  [`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
2803
- (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#shared--referenced-blocks).
2868
+ (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/74c756559271d91a988cf1ce2d250720062efd59/README.md#shared--referenced-blocks).
2804
2869
 
2805
2870
  **Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
2806
2871
 
@@ -2822,7 +2887,7 @@ Not retro-documented, apart from these:
2822
2887
 
2823
2888
  #### The registry is keyed by entry-type name (0.0.42)
2824
2889
 
2825
- **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/f47713db8d2e5c0dbb3b7ef77ea4b03c1939595a/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2890
+ **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/74c756559271d91a988cf1ce2d250720062efd59/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2826
2891
 
2827
2892
  **To adopt.**
2828
2893
 
@@ -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 {