create-ailk 0.37.1 → 0.38.0

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 (230) hide show
  1. package/README.md +129 -0
  2. package/component-catalog.json +44 -6
  3. package/component-catalog.md +6 -5
  4. package/dist/add-module.js +16 -1
  5. package/dist/add-route.d.ts +2 -2
  6. package/dist/add-route.js +18 -11
  7. package/dist/cli.js +52 -0
  8. package/dist/declined-routes.d.ts +13 -0
  9. package/dist/declined-routes.js +74 -0
  10. package/dist/derive-architecture.d.ts +0 -6
  11. package/dist/derive-architecture.js +9 -15
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +3 -0
  14. package/dist/language-import.d.ts +93 -0
  15. package/dist/language-import.js +270 -43
  16. package/dist/lib/import-mdx.js +1 -1
  17. package/dist/lib/scaffold-render-sweep.d.ts +6 -3
  18. package/dist/lib/scaffold-render-sweep.js +8 -4
  19. package/dist/migrate-content.d.ts +6 -2
  20. package/dist/migrate-content.js +62 -5
  21. package/dist/module-architecture.js +139 -103
  22. package/dist/paid-sections.d.ts +13 -0
  23. package/dist/paid-sections.js +35 -5
  24. package/dist/programmatic.js +6 -16
  25. package/dist/remove-module.js +67 -0
  26. package/dist/routes.d.ts +103 -0
  27. package/dist/routes.js +708 -0
  28. package/dist/site-manifest.js +1 -1
  29. package/dist/site-roster.d.ts +2 -1
  30. package/dist/site-roster.js +30 -8
  31. package/dist/spoke-checkout.d.ts +28 -27
  32. package/dist/spoke-checkout.js +71 -102
  33. package/dist/surfaces.d.ts +18 -0
  34. package/dist/surfaces.js +47 -282
  35. package/dist/sync-routes.d.ts +14 -1
  36. package/dist/sync-routes.js +86 -5
  37. package/dist/topology.d.ts +15 -1
  38. package/dist/topology.js +20 -4
  39. package/dist/update.d.ts +17 -2
  40. package/dist/update.js +480 -77
  41. package/package.json +3 -3
  42. package/templates/README.md +1 -1
  43. package/templates/apps/mcp/CLAUDE.md +5 -3
  44. package/templates/apps/web/CLAUDE.md +62 -20
  45. package/templates/apps/web/account.config.tsx +101 -0
  46. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +3 -161
  47. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +3 -139
  48. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +3 -406
  49. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +2 -190
  50. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +3 -182
  51. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +8 -420
  52. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
  53. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +8 -214
  54. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +8 -115
  55. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +2 -80
  56. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +8 -121
  57. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +3 -154
  58. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +7 -149
  59. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +3 -143
  60. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +3 -126
  61. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +8 -302
  62. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +2 -102
  63. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +3 -240
  64. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -131
  65. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +2 -24
  66. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +3 -60
  67. package/templates/apps/web/app/[locale]/layout.tsx +45 -28
  68. package/templates/apps/web/app/apple-icon.tsx +72 -0
  69. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
  70. package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
  71. package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
  72. package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
  73. package/templates/apps/web/app/og/route.tsx +155 -72
  74. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
  75. package/templates/apps/web/i18n/request.ts +44 -1
  76. package/templates/apps/web/jest.config.cjs +13 -1
  77. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
  78. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +70 -0
  79. package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
  80. package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
  81. package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
  82. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
  83. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
  84. package/templates/apps/web/lib/listings.tsx +2 -2
  85. package/templates/apps/web/lib/nav-label-keys.ts +16 -2
  86. package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
  87. package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
  88. package/templates/apps/web/lib/profile-back-link.ts +105 -32
  89. package/templates/apps/web/lib/served-pages.ts +95 -0
  90. package/templates/apps/web/lib/site-brand.tsx +3 -5
  91. package/templates/apps/web/messages/en.json +8 -684
  92. package/templates/apps/web/middleware.ts +3 -1
  93. package/templates/apps/web/next.config.mjs +27 -0
  94. package/templates/apps/web/package.json +1 -0
  95. package/templates/customizations.yaml +9 -0
  96. package/templates/package.json +3 -1
  97. package/templates/tools/lint-architecture.ts +164 -11
  98. package/versions.json +48 -47
  99. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
  100. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
  101. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
  102. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
  103. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
  104. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
  105. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
  106. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
  107. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
  108. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
  109. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
  110. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
  111. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
  112. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
  113. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
  114. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
  115. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
  116. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
  117. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
  118. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
  119. package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
  120. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
  121. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
  122. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
  123. package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
  124. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
  125. package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
  126. package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
  127. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
  128. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
  129. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
  130. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
  131. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
  132. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
  133. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
  134. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
  135. package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
  136. package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
  137. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
  138. package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
  139. package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
  140. package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
  141. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
  142. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
  143. package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
  144. package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
  145. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
  146. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
  147. package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
  148. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
  149. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
  150. package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
  151. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
  152. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
  153. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
  154. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
  155. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
  156. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
  157. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
  158. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
  159. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
  160. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
  161. package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
  162. package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
  163. package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
  164. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
  165. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
  166. package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
  167. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
  168. package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
  169. package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
  170. package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
  171. package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
  172. package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
  173. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
  174. package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
  175. package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
  176. package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
  177. package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
  178. package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
  179. package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
  180. package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
  181. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
  182. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
  183. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
  184. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
  185. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
  186. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
  187. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
  188. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
  189. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
  190. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
  191. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
  192. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
  193. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
  194. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
  195. package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
  196. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
  197. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
  198. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
  199. package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
  200. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
  201. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
  202. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
  203. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
  204. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
  205. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
  206. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
  207. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
  208. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
  209. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
  210. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
  211. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
  212. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
  213. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
  214. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
  215. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
  216. package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
  217. package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
  218. package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
  219. package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
  220. package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
  221. package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
  222. package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
  223. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
  224. package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
  225. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
  226. package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
  227. package/templates/apps/web/lib/account-config.ts +0 -678
  228. package/templates/apps/web/lib/checkout-config.ts +0 -16
  229. package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
  230. package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
package/dist/surfaces.js CHANGED
@@ -88,6 +88,40 @@ export function isRemovedPublicRoutePath(destRel) {
88
88
  return false;
89
89
  return !HUB_KEPT_ROUTE_DIRS.includes(rest[0]);
90
90
  }
91
+ /**
92
+ * The route trees a page package ships (ADR 0040): the package's pages
93
+ * mount through the route files `create-ailk routes` generates from its
94
+ * manifest, so `sync-routes` has nothing to sync under the prefix — the
95
+ * generator writes, checks and records those files, never the route copier.
96
+ * A `siteOwned` route under the prefix stays the site's own page (one the
97
+ * package leaves to a later slice) and `sync-routes` keeps it in scope. One
98
+ * entry per page package, mirroring its `routes.json` (`prefix`, and each
99
+ * `siteOwned` routing file's directory); `sync-routes.test.ts` pins
100
+ * `@working-theory/account`'s to the package's manifest.
101
+ */
102
+ export const PAGE_PACKAGE_ROUTES = [
103
+ { package: "@working-theory/account", prefix: "(authed)/account", siteOwned: ["(authed)/account/connect"] },
104
+ // #11251 — the flows pages; the snapshot carries none of the tree, so a
105
+ // scaffold has its route files only once the package is installed.
106
+ { package: "@working-theory/ui-signal-collectors", prefix: "flows", siteOwned: [] },
107
+ // #11252 — the booking pages; likewise absent from the snapshot. One entry
108
+ // per prefix of the package's two-prefix manifest.
109
+ { package: "@working-theory/ui-scheduling", prefix: "meet", siteOwned: [] },
110
+ { package: "@working-theory/ui-scheduling", prefix: "private", siteOwned: [] },
111
+ // #11253 — the checkout and purchase return pages; likewise absent from the
112
+ // snapshot, one entry per prefix of the package's two-prefix manifest.
113
+ { package: "@working-theory/ui-commerce", prefix: "checkout", siteOwned: [] },
114
+ { package: "@working-theory/ui-commerce", prefix: "purchase", siteOwned: [] },
115
+ // #11254 — the docs and blog catch-alls; likewise absent from the snapshot,
116
+ // one entry per prefix of the package's two-prefix manifest.
117
+ { package: "@working-theory/ui-docs-blog", prefix: "docs", siteOwned: [] },
118
+ { package: "@working-theory/ui-docs-blog", prefix: "blog", siteOwned: [] },
119
+ ];
120
+ /** The page package that ships `route` (a ROUTE_ROOT-relative dir), or `undefined` when no page package does. */
121
+ export function pagePackageOfRoute(route) {
122
+ const under = (dir) => route === dir || route.startsWith(`${dir}/`);
123
+ return PAGE_PACKAGE_ROUTES.find((entry) => under(entry.prefix) && !entry.siteOwned.some(under))?.package;
124
+ }
91
125
  /** Template-relative route directories that are always copied. */
92
126
  export const CORE_ROUTE_DIRS = [
93
127
  `${ROUTE_ROOT}/about`,
@@ -113,19 +147,6 @@ export const CORE_ROUTE_DIRS = [
113
147
  // scaffold carrying it and no content is byte-for-byte a scaffold with one
114
148
  // more 404, nothing else.
115
149
  `${ROUTE_ROOT}/[slug]`,
116
- // #6084 D12 (the operator's shape-2 disposition) — the checkout return
117
- // pair. The launchers pointing at them (`apps/mcp/src/tools/purchase.ts`,
118
- // `apps/web/.../dev/purchase/purchase.actions.ts`) are ALREADY
119
- // unconditional base-tree code under D-64, so gating the return pages
120
- // behind a scaffold-time surface would leave a licence-added commerce
121
- // site with a working checkout and a 404 return page — the exact defect
122
- // this issue exists to close. `CORE_ROUTE_DIRS` is the right home for the
123
- // same reason `[slug]` immediately above is: inert (a request-time
124
- // `notFound()`, `src/lib/commerce-claim.ts`) for every scaffold that never
125
- // buys the `commerce` claim, so carrying it costs nothing beyond two more
126
- // 404s. Neither `GATEABLE_SURFACES` nor `MODULE_SURFACES.commerce` gains
127
- // an entry — the claim decides whether the pages serve, not the scaffold.
128
- `${ROUTE_ROOT}/purchase`,
129
150
  // #8438 D17/D21 — the one unsubscribe landing every signed link calls.
130
151
  // Consent logging is part of the never-gated privacy floor (CLAUDE.md §
131
152
  // License & tier hygiene's never-gate list), so this ships unconditionally
@@ -267,7 +288,10 @@ export const GATEABLE_SURFACES = [
267
288
  // schedule/ directory by #5563), and the private index `/private`
268
289
  // (#8843 D10), a second directory gated with it. API-backed like
269
290
  // `flows`: every meeting fact comes from apps/api's
270
- // `GET /v1/schedule/meetings`, so there is no MDX of its own.
291
+ // `GET /v1/schedule/meetings`, so there is no MDX of its own. Since
292
+ // #11252 the pages ship in `@working-theory/ui-scheduling` and the
293
+ // snapshot carries neither directory; the surface still gates the nav
294
+ // label and the Free placeholders.
271
295
  id: "meet",
272
296
  routes: [`${ROUTE_ROOT}/meet`, `${ROUTE_ROOT}/private`],
273
297
  content: [],
@@ -674,10 +698,9 @@ export const ROUTE_SINCE = {
674
698
  features: "0.27.0",
675
699
  "features/[slug]": "0.27.0",
676
700
  faq: "0.0.0",
677
- "flows/[slug]": "0.0.0",
678
- "flows/[slug]/results/[payload]": "0.14.0",
679
- "flows/[slug]/start": "0.18.0",
680
- "flows/[slug]/verify": "0.56.0",
701
+ // #11251 — no `flows/…` key: the flows route files are generated from
702
+ // `@working-theory/ui-signal-collectors`'s manifest (`create-ailk routes`),
703
+ // never synced from the snapshot.
681
704
  // #6658 — genuinely new route directories (D4, D5), attaching at today's
682
705
  // fixed-group version, the same "attach at today's version" rule #6084,
683
706
  // #5977, #5678, #5479, #5371 and #5048 applied. `book-a-call` was a third
@@ -688,12 +711,9 @@ export const ROUTE_SINCE = {
688
711
  integrations: "0.0.0",
689
712
  "integrations/[slug]": "0.0.0",
690
713
  "launch-service": "0.0.0",
691
- meet: "0.0.0",
692
- // #5563 — the genuinely new row: a per-booking-type page with no
693
- // predecessor, so it attaches at the create-ailk minor this rename ships
694
- // in rather than the "predates the manifest" 0.0.0 above.
695
- "meet/[slug]": "0.5.0",
696
- "meet/confirmed": "0.0.0",
714
+ // #11252 — no `meet…` or `private` key: the booking pages' route files are
715
+ // generated from `@working-theory/ui-scheduling`'s manifest (`create-ailk
716
+ // routes`), never synced from the snapshot.
697
717
  newsletter: "0.26.0",
698
718
  partners: "0.0.0",
699
719
  "partners/[slug]": "0.0.0",
@@ -717,11 +737,9 @@ export const ROUTE_SINCE = {
717
737
  // question set is the SITE's content. A scaffolded site adds its own route
718
738
  // beside this file and passes its own config.
719
739
  "projects/apply": "0.18.0",
720
- // #6084 — two genuinely new route directories, attaching at today's
721
- // fixed-group version, the same "attach at today's version" rule #5977,
722
- // #5678, #5479, #5371 and #5048 applied.
723
- "purchase/success": "0.24.0",
724
- "purchase/cancel": "0.24.0",
740
+ // #11253 — no `purchase/…` key: the checkout return pair's route files are
741
+ // generated from `@working-theory/ui-commerce`'s manifest (`create-ailk
742
+ // routes`), never synced from the snapshot.
725
743
  resources: "0.0.0",
726
744
  "resources/[slug]": "0.0.0",
727
745
  services: "0.0.0",
@@ -886,9 +904,6 @@ export const ROUTE_SINCE = {
886
904
  // new route directory, so it attaches at today's fixed-group version, the
887
905
  // same rule applied above.
888
906
  "[slug]/[detail]": "0.28.0",
889
- // #8843 D8 — the private meeting index, a new route directory gated with
890
- // `meet`, attached at today's fixed-group version by the same rule.
891
- private: "0.43.0",
892
907
  };
893
908
  /**
894
909
  * Surface id of the registry that owns `routeDir` (ROUTE_ROOT-relative): the
@@ -966,234 +981,6 @@ export const ROUTE_DEPENDENCIES = {
966
981
  "apps/web/lib/auth-routes.ts",
967
982
  "apps/web/lib/sign-up-agreements.ts",
968
983
  ],
969
- "(authed)/account": [
970
- "apps/web/lib/account-config.ts",
971
- "apps/web/lib/consent-policies.ts",
972
- "apps/web/lib/server-api.ts",
973
- "apps/web/lib/site-brand.tsx",
974
- "apps/web/lib/site-logo.tsx",
975
- // #8438 D13/D21, #8765 D7 — the agreements interstitial the layout shows
976
- // a member with no current grant (`agreements-prompt.tsx`), its accept
977
- // action (`agreements-actions.ts`) and the read the layout and the Inbox
978
- // share (`agreements-gate.ts`). Listed because a scaffold
979
- // whose `(authed)/account` predates #8438 needs them added, which the
980
- // directory-level sync alone would not do (sync never overwrites or adds
981
- // to a directory it already has). Both live in this directory, never in
982
- // `(auth)/**` — a sign-in seed a sign-in-less spoke drops, so a
983
- // cross-directory reach from here into it would dangle.
984
- `${ROUTE_ROOT}/(authed)/account/agreements-prompt.tsx`,
985
- `${ROUTE_ROOT}/(authed)/account/agreements-actions.ts`,
986
- `${ROUTE_ROOT}/(authed)/account/agreements-gate.ts`,
987
- ],
988
- // #7430 — the three child routes also import files in their PARENT's
989
- // directory. A scaffold whose `(authed)/account` predates #7430 keeps its
990
- // own copy of that route (sync-routes never overwrites), so the files the
991
- // children need travel with them: each is new in #7430, never a changed
992
- // file sync-routes could not update.
993
- "(authed)/account/inbox/[kind]/[id]": [
994
- "apps/web/lib/account-config.ts",
995
- "apps/web/lib/server-api.ts",
996
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
997
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
998
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
999
- // #8233 C9 — the New menu's files beside account-config.ts: new-popups.tsx
1000
- // binds the config's actions to the popups, which import the menu and its
1001
- // server actions. (account-config.ts itself imports none of them — a
1002
- // spoke without sign-in drops the `(authed)` group and keeps the config.)
1003
- // #11152 — Send message is a link to the thread page; its popup is gone.
1004
- `${ROUTE_ROOT}/(authed)/account/new-menu.tsx`,
1005
- `${ROUTE_ROOT}/(authed)/account/new-actions.ts`,
1006
- `${ROUTE_ROOT}/(authed)/account/new-popups.tsx`,
1007
- `${ROUTE_ROOT}/(authed)/account/components/request-quote.tsx`,
1008
- ],
1009
- // #7920 — the member file read re-serves the hub's bytes with the
1010
- // credential `forwardedCookieInit` returns.
1011
- "(authed)/account/inbox/message/[id]/file": ["apps/web/lib/server-api.ts"],
1012
- // #8232 D13 — the settings route is a redirect now. #11167 dropped its
1013
- // `theme-modes.ts` (Color mode renders on every site), so it imports
1014
- // nothing outside itself; the brand and theme files it once carried stay
1015
- // listed so an older scaffold's copies still compile.
1016
- "(authed)/account/settings": [
1017
- "apps/web/lib/site-brand.tsx",
1018
- "apps/web/lib/site-theme.ts",
1019
- ],
1020
- // #8232 D13 — General and Billing import files in their parent's directory
1021
- // too. Each listed parent file is new in #8232 or unchanged by it, so a
1022
- // scaffold that already has one keeps a copy that still compiles; the
1023
- // settings components General changed moved into `general/` instead (C3).
1024
- // `profile-actions.ts` imports `lib/hub-session/reseal.ts` by its own path,
1025
- // since a scaffold's existing `lib/hub-session/index.ts` is never updated.
1026
- //
1027
- // #8339 D11 — `settings/color-mode.tsx` drops: General's own color-mode
1028
- // control is now the shared `AccountSettings` composition's
1029
- // (@working-theory/templates/account). `sign-in-method.ts` stays: General no
1030
- // longer renders the Sign-in section itself (moved to Security), but it
1031
- // still imports `sign-in-method.ts` transitively through
1032
- // `profile-source.ts`'s `via` derivation.
1033
- "(authed)/account/general": [
1034
- "apps/web/lib/account-config.ts",
1035
- "apps/web/lib/auth-env.ts",
1036
- "apps/web/lib/server-api.ts",
1037
- "apps/web/lib/site-brand.tsx",
1038
- "apps/web/lib/site-theme.ts",
1039
- "apps/web/lib/hub-session/reseal.ts",
1040
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1041
- `${ROUTE_ROOT}/(authed)/account/settings-frame.tsx`,
1042
- `${ROUTE_ROOT}/(authed)/account/sign-in-method.ts`,
1043
- `${ROUTE_ROOT}/(authed)/account/profile-actions.ts`,
1044
- // #8233 C9 — the New menu's files beside account-config.ts: new-popups.tsx
1045
- // binds the config's actions to the popups, which import the menu and its
1046
- // server actions. (account-config.ts itself imports none of them — a
1047
- // spoke without sign-in drops the `(authed)` group and keeps the config.)
1048
- // #11152 — Send message is a link to the thread page; its popup is gone.
1049
- `${ROUTE_ROOT}/(authed)/account/new-menu.tsx`,
1050
- `${ROUTE_ROOT}/(authed)/account/new-actions.ts`,
1051
- `${ROUTE_ROOT}/(authed)/account/new-popups.tsx`,
1052
- `${ROUTE_ROOT}/(authed)/account/components/request-quote.tsx`,
1053
- ],
1054
- // #8339 D11 — Security holds the former Sign-in section, moved verbatim
1055
- // from General: `sign-in-method.ts` and what it imports. #8431 D8 — the
1056
- // tab's failed-read row (`error-row.tsx` and its `retry-button.tsx`); its
1057
- // own `security-source.ts` and `security-panel.tsx` live in the route dir
1058
- // and copy with it.
1059
- "(authed)/account/security": [
1060
- "apps/web/lib/account-config.ts",
1061
- "apps/web/lib/auth-env.ts",
1062
- "apps/web/lib/server-api.ts",
1063
- "apps/web/lib/hub-session/config.ts",
1064
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1065
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1066
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1067
- `${ROUTE_ROOT}/(authed)/account/settings-frame.tsx`,
1068
- `${ROUTE_ROOT}/(authed)/account/sign-in-method.ts`,
1069
- ],
1070
- // #8339 D11 — Notifications holds the former Privacy section's
1071
- // cookie-settings link, moved verbatim from General. #8438 D15 — that
1072
- // link moved on again, to Privacy; Notifications now reads the registry
1073
- // through `member.consents` instead, so it keeps the same dependency set.
1074
- "(authed)/account/notifications": [
1075
- "apps/web/lib/account-config.ts",
1076
- "apps/web/lib/server-api.ts",
1077
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1078
- `${ROUTE_ROOT}/(authed)/account/settings-frame.tsx`,
1079
- `${ROUTE_ROOT}/(authed)/account/privacy/actions.ts`,
1080
- ],
1081
- // #8438 D14 — Privacy reads the registry through `member.consents`;
1082
- // #11164 reshapes it (the lead, the data-use row, the training switch and
1083
- // the Your data table) and drops the deletion request, so General's
1084
- // deletion files are no longer its dependencies — only `profile-source.ts`
1085
- // (which decides whether Support may take an account-deletion request) and
1086
- // the `sign-in-method.ts` it imports, the same cross-directory rule #8339
1087
- // D11 applied to Notifications' cookie-settings link.
1088
- "(authed)/account/privacy": [
1089
- "apps/web/lib/account-config.ts",
1090
- "apps/web/lib/consent-policies.ts",
1091
- "apps/web/lib/server-api.ts",
1092
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1093
- `${ROUTE_ROOT}/(authed)/account/settings-frame.tsx`,
1094
- `${ROUTE_ROOT}/(authed)/account/sign-in-method.ts`,
1095
- `${ROUTE_ROOT}/(authed)/account/general/profile-source.ts`,
1096
- ],
1097
- // #11164 AC-3 — the export route re-serves the member API's attachment
1098
- // with the caller's own credential, the message file route's shape.
1099
- "(authed)/account/privacy/export": ["apps/web/lib/server-api.ts"],
1100
- "(authed)/account/billing": [
1101
- "apps/web/lib/account-config.ts",
1102
- // #9401 D7 — the site's own Billing sections, the frozen stub the page imports.
1103
- "apps/web/lib/site-contributions.ts",
1104
- "apps/web/lib/server-api.ts",
1105
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1106
- `${ROUTE_ROOT}/(authed)/account/actions.ts`,
1107
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1108
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1109
- `${ROUTE_ROOT}/(authed)/account/settings-frame.tsx`,
1110
- `${ROUTE_ROOT}/(authed)/account/billing-source.ts`,
1111
- // #8233 C9 — the New menu's files beside account-config.ts: new-popups.tsx
1112
- // binds the config's actions to the popups, which import the menu and its
1113
- // server actions. (account-config.ts itself imports none of them — a
1114
- // spoke without sign-in drops the `(authed)` group and keeps the config.)
1115
- // #11152 — Send message is a link to the thread page; its popup is gone.
1116
- `${ROUTE_ROOT}/(authed)/account/new-menu.tsx`,
1117
- `${ROUTE_ROOT}/(authed)/account/new-actions.ts`,
1118
- `${ROUTE_ROOT}/(authed)/account/new-popups.tsx`,
1119
- `${ROUTE_ROOT}/(authed)/account/components/request-quote.tsx`,
1120
- ],
1121
- // #8234 — the Artifacts pages import files in their parent's directory, as
1122
- // #7430's children do; the artifact page also imports its own parent's
1123
- // `artifact-data.ts` and `artifact-actions.ts`, which an older synced
1124
- // `artifacts/` might lack. The file route re-serves the hub's bytes with
1125
- // the credential `forwardedCookieInit` returns.
1126
- "(authed)/account/artifacts": [
1127
- "apps/web/lib/account-config.ts",
1128
- "apps/web/lib/server-api.ts",
1129
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1130
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1131
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1132
- ],
1133
- "(authed)/account/artifacts/[pieceId]": [
1134
- "apps/web/lib/account-config.ts",
1135
- "apps/web/lib/server-api.ts",
1136
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1137
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1138
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1139
- `${ROUTE_ROOT}/(authed)/account/artifacts/artifact-data.ts`,
1140
- `${ROUTE_ROOT}/(authed)/account/artifacts/artifact-actions.ts`,
1141
- ],
1142
- "(authed)/account/artifacts/[pieceId]/versions/[version]/file": ["apps/web/lib/server-api.ts"],
1143
- // #11154 — the Appointments pages import files in their parent's directory,
1144
- // as the Artifacts pages do; the booking page also imports its own parent's
1145
- // `appointments-data.ts`, which an older synced `appointments/` might lack.
1146
- "(authed)/account/appointments": [
1147
- "apps/web/lib/server-api.ts",
1148
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1149
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1150
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1151
- ],
1152
- "(authed)/account/appointments/[slug]": [
1153
- "apps/web/lib/server-api.ts",
1154
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1155
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1156
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1157
- `${ROUTE_ROOT}/(authed)/account/appointments/appointments-data.ts`,
1158
- ],
1159
- // #11152 — the member thread page imports its parent's reads, error row
1160
- // and the New menu's server actions (its composer posts through
1161
- // `sendMessage`), plus the account config the reads come from.
1162
- "(authed)/account/inbox/thread": [
1163
- "apps/web/lib/account-config.ts",
1164
- "apps/web/lib/server-api.ts",
1165
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1166
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1167
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1168
- `${ROUTE_ROOT}/(authed)/account/new-actions.ts`,
1169
- `${ROUTE_ROOT}/(authed)/account/new-popups.tsx`,
1170
- ],
1171
- // #8515 D12 — the onboarding page imports its parent's account-data.ts
1172
- // and error-row.tsx (which renders retry-button.tsx); its actions forward
1173
- // the credential `forwardedCookieInit` returns. account-data.ts reads the
1174
- // account config, as the Artifacts pages' does.
1175
- "(authed)/account/onboarding": [
1176
- "apps/web/lib/account-config.ts",
1177
- "apps/web/lib/server-api.ts",
1178
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1179
- `${ROUTE_ROOT}/(authed)/account/error-row.tsx`,
1180
- `${ROUTE_ROOT}/(authed)/account/retry-button.tsx`,
1181
- ],
1182
- "(authed)/account/support": [
1183
- "apps/web/lib/account-config.ts",
1184
- "apps/web/lib/server-api.ts",
1185
- `${ROUTE_ROOT}/(authed)/account/account-data.ts`,
1186
- `${ROUTE_ROOT}/(authed)/account/support-actions.ts`,
1187
- // #8233 C9 — the New menu's files beside account-config.ts: new-popups.tsx
1188
- // binds the config's actions to the popups, which import the menu and its
1189
- // server actions. (account-config.ts itself imports none of them — a
1190
- // spoke without sign-in drops the `(authed)` group and keeps the config.)
1191
- // #11152 — Send message is a link to the thread page; its popup is gone.
1192
- `${ROUTE_ROOT}/(authed)/account/new-menu.tsx`,
1193
- `${ROUTE_ROOT}/(authed)/account/new-actions.ts`,
1194
- `${ROUTE_ROOT}/(authed)/account/new-popups.tsx`,
1195
- `${ROUTE_ROOT}/(authed)/account/components/request-quote.tsx`,
1196
- ],
1197
984
  "(authed)/admin": [
1198
985
  "apps/web/lib/server-api.ts",
1199
986
  `${ROUTE_ROOT}/(authed)/waitlist/components/ForbiddenState.tsx`,
@@ -1234,11 +1021,6 @@ export const ROUTE_DEPENDENCIES = {
1234
1021
  // #9851 D7 — the Integrations tab: the nav plus the Slack bindings.
1235
1022
  "(authed)/admin/integrations": ADMIN_PANEL_ROUTE_DEPENDENCIES,
1236
1023
  "(authed)/waitlist": ["apps/web/lib/server-api.ts"],
1237
- // #8843 D6 — the booking pages share one builder over the meetings read;
1238
- // `/private` returns the index frame that lives under `meet/`.
1239
- meet: ["apps/web/lib/meetings.tsx"],
1240
- "meet/[slug]": ["apps/web/lib/meetings.tsx"],
1241
- private: ["apps/web/lib/meetings.tsx", `${ROUTE_ROOT}/meet/meeting-index.tsx`],
1242
1024
  // #8927 D8 — /pricing maps the Offerings shown set through the mapper.
1243
1025
  // #9480 — and reads its browser-facing API origin through the topology seam
1244
1026
  // (#7874 D12), so a spoke with /pricing reads no refused name. Every
@@ -1297,23 +1079,6 @@ export const ROUTE_MESSAGE_NAMESPACES = {
1297
1079
  "(auth)/reset-password": ["auth"],
1298
1080
  "(auth)/verify-email": ["auth"],
1299
1081
  "(auth)/consent": ["mcpConsent"],
1300
- "(authed)/account": ["account"],
1301
- "(authed)/account/inbox/[kind]/[id]": ["account"],
1302
- "(authed)/account/settings": ["account"],
1303
- "(authed)/account/support": ["account"],
1304
- "(authed)/account/general": ["account"],
1305
- "(authed)/account/security": ["account"],
1306
- "(authed)/account/notifications": ["account"],
1307
- "(authed)/account/privacy": ["account"],
1308
- "(authed)/account/billing": ["account"],
1309
- // #8234 — the two Artifacts pages; the file route renders no string.
1310
- "(authed)/account/artifacts": ["account"],
1311
- "(authed)/account/artifacts/[pieceId]": ["account"],
1312
- // #11154 — the two Appointments pages.
1313
- "(authed)/account/appointments": ["account"],
1314
- "(authed)/account/appointments/[slug]": ["account"],
1315
- // #8515 — the onboarding page.
1316
- "(authed)/account/onboarding": ["account"],
1317
1082
  // #9966 D2 — the hub's consent page reads its own namespace.
1318
1083
  "(authed)/account/connect": ["hubConnect"],
1319
1084
  "(authed)/admin": ["admin"],
@@ -92,6 +92,12 @@ export interface SyncRoutesResult {
92
92
  missingMessageNamespaces: string[];
93
93
  /** Gateable surface ids the target does not carry, sorted. */
94
94
  skippedSurfaces: string[];
95
+ /**
96
+ * In-scope template route dirs the site declined in `customizations.yaml`
97
+ * `declined_routes` (#11260), sorted by route: never missing, never
98
+ * modified, never copied.
99
+ */
100
+ declined: RouteReport[];
95
101
  /**
96
102
  * The template route dirs left out of scope because the site has dropped the
97
103
  * `marketing` module (#10040 D10): its manifest lists no `marketing`,
@@ -99,6 +105,13 @@ export interface SyncRoutesResult {
99
105
  * drift — not reported missing, not copied, `forceSurfaces` included.
100
106
  */
101
107
  publicTreeRemoved: string[];
108
+ /**
109
+ * The template route dirs a page package ships (ADR 0040,
110
+ * `PAGE_PACKAGE_ROUTES`), sorted: `create-ailk routes` writes their
111
+ * generated files, so they are out of this command's scope — never
112
+ * missing, never modified, never copied.
113
+ */
114
+ pagePackageRoutes: string[];
102
115
  /**
103
116
  * When `apply` added a route the template exempts in its structured-data
104
117
  * test and the site's copy of that test is site-edited (its bytes differ
@@ -204,7 +217,7 @@ export interface SyncRoutesArgs {
204
217
  apply: boolean;
205
218
  help: boolean;
206
219
  }
207
- export declare const SYNC_ROUTES_HELP = "create-ailk sync-routes \u2014 copy template routes an existing site is missing.\n\nUsage:\n create-ailk sync-routes [<target-dir>] [--apply]\n\nArguments:\n <target-dir> An already-scaffolded repo (contains\n architecture.yaml). Defaults to the current dir.\n\nOptions:\n --apply Copy the missing route directories into the target.\n Without it the command only reports: exit 1 when a\n route is missing, 0 when in sync.\n --help, -h Print this message.\n\nChecks every core route plus the routes of each surface the site carries; a\nsurface gated off at scaffold time is skipped, not drift. A route the site has\nchanged locally is reported and never overwritten. Nothing is deleted except,\non a spoke, the retired legacy checkout's files that still match create-ailk's\ncopy: --apply removes them and rewrites the generated billing action (#9142).\nEvery file --apply copies is recorded in .ailk-template-files.json, when the\nsite has one, so `create-ailk update` carries it forward (#11213).\n";
220
+ export declare const SYNC_ROUTES_HELP = "create-ailk sync-routes \u2014 copy template routes an existing site is missing.\n\nUsage:\n create-ailk sync-routes [<target-dir>] [--apply]\n\nArguments:\n <target-dir> An already-scaffolded repo (contains\n architecture.yaml). Defaults to the current dir.\n\nOptions:\n --apply Copy the missing route directories into the target.\n Without it the command only reports: exit 1 when a\n route is missing, 0 when in sync.\n --help, -h Print this message.\n\nChecks every core route plus the routes of each surface the site carries; a\nsurface gated off at scaffold time is skipped, not drift. A route the site lists\nin customizations.yaml declined_routes is reported as declined and never copied\n(#11260). A route the site has changed locally is reported and never\noverwritten. Nothing is deleted except,\non a spoke, the retired legacy checkout's files that still match create-ailk's\ncopy: --apply removes them and rewrites the generated billing action (#9142).\nEvery file --apply copies is recorded in .ailk-template-files.json, when the\nsite has one, so `create-ailk update` carries it forward (#11213).\n";
208
221
  /**
209
222
  * Parse the argv AFTER the `sync-routes` word. Strict `node:util` parseArgs,
210
223
  * like `parseCliArgs`; at most one positional.
@@ -30,6 +30,11 @@
30
30
  * byte-identical to the template record and rewrites the generated
31
31
  * billing action off them (`retireLegacySpokeCheckout`); an edited or
32
32
  * unrecorded file is reported and left alone.
33
+ * - A route the site declined is its decision, not drift (#11260). A
34
+ * `declined_routes` entry in `customizations.yaml` takes the route and
35
+ * its sub-routes out of scope: reported under "Declined by this site",
36
+ * never missing, and never copied — not by `--apply`, not by an
37
+ * ancestor's subtree copy, not as a file another route imports.
33
38
  * - What `--apply` copies, it records (#11213). Every recordable file it
34
39
  * writes gets a row in `.ailk-template-files.json` — the sha256 of the
35
40
  * bytes written and the create-ailk version doing the copy — so
@@ -46,12 +51,13 @@ import { tmpdir } from "node:os";
46
51
  import { basename, dirname, join, posix, resolve, sep } from "node:path";
47
52
  import { parseArgs } from "node:util";
48
53
  import { buildScaffoldMarkers, copyTemplate, renderTemplateFile } from "./copy.js";
54
+ import { declinedRouteFor, declinedRouteOfPath, readDeclinedRoutes } from "./declined-routes.js";
49
55
  import { SPOKE_BILLING_ACTION_PATH } from "./derive-architecture.js";
50
56
  import { appendEnvRows } from "./lib/declared-env.js";
51
57
  import { ENV_CATALOG } from "./lib/env-catalog.js";
52
58
  import { publicTreeRemoved } from "./lib/site-modules.js";
53
59
  import { BILLING_ACTION, BILLING_ACTION_MARKER, RETIRED_CHECKOUT_E2E_MARKER, RETIRED_CHECKOUT_E2E_WORKFLOW_PATH, RETIRED_SPOKE_CHECKOUT_PATHS, } from "./spoke-checkout.js";
54
- import { GATEABLE_SURFACES, HUB_KEPT_ROUTE_DIRS, NON_ROUTE_DIRS, ROUTE_DEPENDENCIES, ROUTE_MESSAGE_NAMESPACES, ROUTE_SINCE, surfaceForRouteDir, } from "./surfaces.js";
60
+ import { GATEABLE_SURFACES, HUB_KEPT_ROUTE_DIRS, NON_ROUTE_DIRS, pagePackageOfRoute, ROUTE_DEPENDENCIES, ROUTE_MESSAGE_NAMESPACES, ROUTE_SINCE, surfaceForRouteDir, } from "./surfaces.js";
55
61
  import { TEMPLATE_RECORD_PATH, parseTemplateRecord, recordCopiedFiles, serializeTemplateRecord, sha256Hex, } from "./template-record.js";
56
62
  import { SPOKE_SEAM_FILES, isSpokeExcluded, readSpokeShape, spokeExclusions, } from "./topology.js";
57
63
  /** Template-relative prefix every `apps/web` route directory sits under. */
@@ -183,10 +189,14 @@ function walkRouteImports(route, ctx) {
183
189
  // A file under a seed the spoke does not carry is never copied, so its
184
190
  // imports are not walked (the hub's consent page under a hub sign-in spoke's
185
191
  // account, #9966 D2).
192
+ // Nor is one under a route the site declined (#11260).
186
193
  const queue = regularFilesUnder(ctx.scratch, route)
187
194
  .map((rel) => `${ROUTE_ROOT}/${rel}`)
188
195
  .filter((path) => ownerRoute(path, ctx.missingRoutes) === route)
189
- .filter((path) => ctx.spoke === undefined || !isSpokeExcluded(path, ctx.spoke));
196
+ .filter((path) => ctx.spoke === undefined || !isSpokeExcluded(path, ctx.spoke))
197
+ .filter((path) => declinedRouteOfPath(path, ctx.declined) === undefined)
198
+ // Nor one a page package ships (ADR 0040): an ancestor's copy holds it back.
199
+ .filter((path) => pagePackageOfRoute(posix.dirname(path.slice(ROUTE_ROOT.length + 1))) === undefined);
190
200
  const visited = new Set(queue);
191
201
  for (let from = queue.shift(); from !== undefined; from = queue.shift()) {
192
202
  if (!SOURCE_FILE.test(from))
@@ -216,6 +226,11 @@ function walkRouteImports(route, ctx) {
216
226
  unresolved.push({ specifier, from: importer, reason: "the spoke does not carry it" });
217
227
  continue;
218
228
  }
229
+ const declinedBy = declinedRouteOfPath(path, ctx.declined);
230
+ if (declinedBy !== undefined) {
231
+ unresolved.push({ specifier, from: importer, reason: `it is under ${declinedBy}, which this site declined` });
232
+ continue;
233
+ }
219
234
  const routeRel = inScratch(path);
220
235
  const surface = routeRel === undefined ? "core" : surfaceForRouteDir(routeRel);
221
236
  if (surface === undefined || !ctx.carried.has(surface)) {
@@ -458,6 +473,21 @@ function spokeExcludedUnder(routeRoot, route, spoke) {
458
473
  });
459
474
  return walk("");
460
475
  }
476
+ /**
477
+ * The files under template route dir `route` that a page package ships
478
+ * (ADR 0040, `pagePackageOfRoute`), relative to `route`: an ancestor's
479
+ * subtree copy holds them back, and a route the package leaves to the site
480
+ * (its `siteOwned`) still lands.
481
+ */
482
+ function pagePackageFilesUnder(routeRoot, route) {
483
+ const walk = (rel) => readdirSync(join(routeRoot, route, rel), { withFileTypes: true }).flatMap((entry) => {
484
+ const child = rel === "" ? entry.name : `${rel}/${entry.name}`;
485
+ if (entry.isDirectory())
486
+ return walk(child);
487
+ return pagePackageOfRoute(posix.dirname(`${route}/${child}`)) === undefined ? [] : [child];
488
+ });
489
+ return walk("");
490
+ }
461
491
  /** The first line of a text file. */
462
492
  function firstLine(text) {
463
493
  const eol = text.indexOf("\n");
@@ -638,7 +668,20 @@ export function syncRoutes(opts) {
638
668
  // tree: every template route dir outside the kept set is out of scope.
639
669
  const publicTreeSkipped = [];
640
670
  const marketingRemoved = publicTreeRemoved(targetAbs);
671
+ // ADR 0040 — a page package's routes are the route generator's, not this copier's.
672
+ const pagePackageRoutes = [];
673
+ // #11260 — a route the site declined, and its sub-routes, leave scope
674
+ // after every other filter, so `declined` names only routes that would
675
+ // otherwise have been checked.
676
+ const declinedRoutes = readDeclinedRoutes(targetAbs);
677
+ const declined = [];
641
678
  const inScope = listTemplateRouteDirs(opts.templatesDir)
679
+ .filter((route) => {
680
+ if (pagePackageOfRoute(route) === undefined)
681
+ return true;
682
+ pagePackageRoutes.push(route);
683
+ return false;
684
+ })
642
685
  .filter((route) => {
643
686
  if (!marketingRemoved)
644
687
  return true;
@@ -652,7 +695,13 @@ export function syncRoutes(opts) {
652
695
  // every hub scaffold, the same as "core" — it is checked regardless of
653
696
  // `carried`, which only tracks GATEABLE_SURFACES opt-in.
654
697
  .filter((r) => r.surface === "core" || r.surface === "authed" || carried.has(r.surface))
655
- .filter((r) => spoke === undefined || !isSpokeExcluded(`${ROUTE_ROOT}/${r.route}`, spoke));
698
+ .filter((r) => spoke === undefined || !isSpokeExcluded(`${ROUTE_ROOT}/${r.route}`, spoke))
699
+ .filter((r) => {
700
+ if (declinedRouteFor(r.route, declinedRoutes) === undefined)
701
+ return true;
702
+ declined.push(r);
703
+ return false;
704
+ });
656
705
  // Identical to scaffoldSync's defaults, so a synced route matches a fresh
657
706
  // scaffold of the same target byte-for-byte.
658
707
  const markers = {
@@ -693,6 +742,7 @@ export function syncRoutes(opts) {
693
742
  markers,
694
743
  spoke,
695
744
  carried: new Set(["core", "authed", ...carried]),
745
+ declined: declinedRoutes,
696
746
  }));
697
747
  }
698
748
  finally {
@@ -703,6 +753,20 @@ export function syncRoutes(opts) {
703
753
  // refused route's copy would write, iterated to a fixpoint. Never upward:
704
754
  // an ancestor is still copied without the refused sub-tree.
705
755
  const missingRoutes = missing.map((r) => r.route);
756
+ // #11260 — a declared dependency under a declined route is never copied,
757
+ // so the route that needs it refuses, named like an unresolved import.
758
+ for (const walk of walks) {
759
+ const deps = missing.find((m) => m.route === walk.route)?.dependencies ?? [];
760
+ for (const dep of deps) {
761
+ const declinedBy = declinedRouteOfPath(dep, declinedRoutes);
762
+ if (declinedBy === undefined)
763
+ continue;
764
+ walk.unresolved = sortUnresolved([
765
+ ...walk.unresolved,
766
+ { specifier: dep, from: "ROUTE_DEPENDENCIES", reason: `it is under ${declinedBy}, which this site declined` },
767
+ ]);
768
+ }
769
+ }
706
770
  const refusedSet = new Set(walks.filter((w) => w.unresolved.length > 0).map((w) => w.route));
707
771
  for (let changed = true; changed;) {
708
772
  changed = false;
@@ -808,6 +872,12 @@ export function syncRoutes(opts) {
808
872
  ...refused
809
873
  .filter((r) => r.startsWith(route + "/"))
810
874
  .map((r) => r.slice(route.length + 1)),
875
+ // #11260 — and each declined sub-route.
876
+ ...declinedRoutes
877
+ .filter((r) => r.startsWith(route + "/"))
878
+ .map((r) => r.slice(route.length + 1)),
879
+ // ADR 0040 — and every file a page package ships (`create-ailk routes` writes those).
880
+ ...pagePackageFilesUnder(templateRouteRoot, route),
811
881
  ...(spokeShape === undefined
812
882
  ? []
813
883
  : spokeExcludedUnder(templateRouteRoot, route, spokeShape)),
@@ -852,7 +922,9 @@ export function syncRoutes(opts) {
852
922
  recorded,
853
923
  missingMessageNamespaces,
854
924
  skippedSurfaces,
925
+ declined,
855
926
  publicTreeRemoved: publicTreeSkipped,
927
+ pagePackageRoutes,
856
928
  structuredDataEntries: structuredDataEntriesFor(targetAbs, opts.templatesDir, applied),
857
929
  retiredCheckout: spoke !== undefined
858
930
  ? retireLegacySpokeCheckout(targetAbs, opts.apply === true)
@@ -928,9 +1000,16 @@ export function formatSyncRoutesReport(result, apply) {
928
1000
  if (result.skippedSurfaces.length > 0) {
929
1001
  lines.push(`[create-ailk] Surfaces this site does not carry (skipped): ${result.skippedSurfaces.join(", ")}`);
930
1002
  }
1003
+ if (result.declined.length > 0) {
1004
+ lines.push(`[create-ailk] Declined by this site (customizations.yaml declined_routes) — ${apply ? "not copied" : "not missing, never copied"}:`);
1005
+ lines.push(...result.declined.map((r) => ` ${r.route} (surface: ${r.surface})`));
1006
+ }
931
1007
  if (result.publicTreeRemoved.length > 0) {
932
1008
  lines.push(`[create-ailk] Public route tree not carried (marketing removed, #10040): ${result.publicTreeRemoved.length} template route(s) skipped`);
933
1009
  }
1010
+ if (result.pagePackageRoutes.length > 0) {
1011
+ lines.push(`[create-ailk] Shipped by a page package (ADR 0040), nothing to sync: ${result.pagePackageRoutes.length} route(s) — \`create-ailk routes --check\` checks their generated files`);
1012
+ }
934
1013
  // #9406 DD5 — per missing route, what its imports copy, leave, or cannot
935
1014
  // resolve; then the routes a dangling import holds back.
936
1015
  if (result.routeImports.length > 0) {
@@ -1020,8 +1099,10 @@ Options:
1020
1099
  --help, -h Print this message.
1021
1100
 
1022
1101
  Checks every core route plus the routes of each surface the site carries; a
1023
- surface gated off at scaffold time is skipped, not drift. A route the site has
1024
- changed locally is reported and never overwritten. Nothing is deleted except,
1102
+ surface gated off at scaffold time is skipped, not drift. A route the site lists
1103
+ in customizations.yaml declined_routes is reported as declined and never copied
1104
+ (#11260). A route the site has changed locally is reported and never
1105
+ overwritten. Nothing is deleted except,
1025
1106
  on a spoke, the retired legacy checkout's files that still match create-ailk's
1026
1107
  copy: --apply removes them and rewrites the generated billing action (#9142).
1027
1108
  Every file --apply copies is recorded in .ailk-template-files.json, when the