@bevel-software/platform-core-backend 0.22.0 → 0.23.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 (325) hide show
  1. package/dist/core/core-ports.d.ts +11 -1
  2. package/dist/core/core-ports.d.ts.map +1 -1
  3. package/dist/core/core-ports.js.map +1 -1
  4. package/dist/core/create-core-server.d.ts +3 -3
  5. package/dist/core/create-core-server.d.ts.map +1 -1
  6. package/dist/core/create-core-server.js +30 -11
  7. package/dist/core/create-core-server.js.map +1 -1
  8. package/dist/core/create-core-services.d.ts +9 -2
  9. package/dist/core/create-core-services.d.ts.map +1 -1
  10. package/dist/core/create-core-services.js +112 -23
  11. package/dist/core/create-core-services.js.map +1 -1
  12. package/dist/core/lifecycle.d.ts +34 -1
  13. package/dist/core/lifecycle.d.ts.map +1 -1
  14. package/dist/core/lifecycle.js +89 -13
  15. package/dist/core/lifecycle.js.map +1 -1
  16. package/dist/core-config.d.ts +0 -12
  17. package/dist/core-config.d.ts.map +1 -1
  18. package/dist/core-config.js +11 -13
  19. package/dist/core-config.js.map +1 -1
  20. package/dist/index.d.ts +3 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +2 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/modules/access/access-control.interface.d.ts +42 -12
  25. package/dist/modules/access/access-control.interface.d.ts.map +1 -1
  26. package/dist/modules/access/access-control.service.d.ts +67 -10
  27. package/dist/modules/access/access-control.service.d.ts.map +1 -1
  28. package/dist/modules/access/access-control.service.js +214 -35
  29. package/dist/modules/access/access-control.service.js.map +1 -1
  30. package/dist/modules/access/access.routes.d.ts.map +1 -1
  31. package/dist/modules/access/access.routes.js +13 -15
  32. package/dist/modules/access/access.routes.js.map +1 -1
  33. package/dist/modules/auth/account-admission.d.ts +58 -7
  34. package/dist/modules/auth/account-admission.d.ts.map +1 -1
  35. package/dist/modules/auth/account-admission.js +44 -1
  36. package/dist/modules/auth/account-admission.js.map +1 -1
  37. package/dist/modules/auth/account.routes.d.ts +1 -1
  38. package/dist/modules/auth/account.routes.d.ts.map +1 -1
  39. package/dist/modules/auth/account.routes.js +61 -5
  40. package/dist/modules/auth/account.routes.js.map +1 -1
  41. package/dist/modules/auth/auth.middleware.d.ts +1 -1
  42. package/dist/modules/auth/auth.middleware.d.ts.map +1 -1
  43. package/dist/modules/auth/auth.middleware.js +18 -7
  44. package/dist/modules/auth/auth.middleware.js.map +1 -1
  45. package/dist/modules/auth/auth.routes.d.ts.map +1 -1
  46. package/dist/modules/auth/auth.routes.js +8 -0
  47. package/dist/modules/auth/auth.routes.js.map +1 -1
  48. package/dist/modules/auth/auth.service.d.ts +70 -2
  49. package/dist/modules/auth/auth.service.d.ts.map +1 -1
  50. package/dist/modules/auth/auth.service.js +176 -7
  51. package/dist/modules/auth/auth.service.js.map +1 -1
  52. package/dist/modules/auth/oidc-auth-provider.d.ts.map +1 -1
  53. package/dist/modules/auth/oidc-auth-provider.js +7 -2
  54. package/dist/modules/auth/oidc-auth-provider.js.map +1 -1
  55. package/dist/modules/database/core-schema.d.ts +41 -24
  56. package/dist/modules/database/core-schema.d.ts.map +1 -1
  57. package/dist/modules/database/core-schema.js +35 -27
  58. package/dist/modules/database/core-schema.js.map +1 -1
  59. package/dist/modules/kb-fs/branch-name.d.ts.map +1 -1
  60. package/dist/modules/kb-fs/branch-name.js +12 -2
  61. package/dist/modules/kb-fs/branch-name.js.map +1 -1
  62. package/dist/modules/kb-fs/repo-path.d.ts +11 -16
  63. package/dist/modules/kb-fs/repo-path.d.ts.map +1 -1
  64. package/dist/modules/kb-fs/repo-path.js +79 -0
  65. package/dist/modules/kb-fs/repo-path.js.map +1 -1
  66. package/dist/modules/kb-sync/kb-sync.routes.d.ts +2 -2
  67. package/dist/modules/kb-sync/kb-sync.routes.d.ts.map +1 -1
  68. package/dist/modules/kb-sync/kb-sync.routes.js +14 -3
  69. package/dist/modules/kb-sync/kb-sync.routes.js.map +1 -1
  70. package/dist/modules/kb-sync/sync-auth.d.ts +3 -1
  71. package/dist/modules/kb-sync/sync-auth.d.ts.map +1 -1
  72. package/dist/modules/kb-sync/sync-auth.js +1 -1
  73. package/dist/modules/kb-sync/sync-auth.js.map +1 -1
  74. package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
  75. package/dist/modules/mcp/mcp-auth.middleware.js +21 -6
  76. package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
  77. package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
  78. package/dist/modules/mcp/oauth/bevel-oauth-provider.js +3 -2
  79. package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
  80. package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
  81. package/dist/modules/settings/deployment-settings.service.js +8 -3
  82. package/dist/modules/settings/deployment-settings.service.js.map +1 -1
  83. package/dist/modules/settings/setup.routes.d.ts +52 -1
  84. package/dist/modules/settings/setup.routes.d.ts.map +1 -1
  85. package/dist/modules/settings/setup.routes.js +207 -19
  86. package/dist/modules/settings/setup.routes.js.map +1 -1
  87. package/dist/modules/skills/skills.contract.d.ts +90 -18
  88. package/dist/modules/skills/skills.contract.d.ts.map +1 -1
  89. package/dist/modules/skills/skills.contract.js +4 -1
  90. package/dist/modules/skills/skills.contract.js.map +1 -1
  91. package/dist/modules/skills/skills.service.d.ts +98 -9
  92. package/dist/modules/skills/skills.service.d.ts.map +1 -1
  93. package/dist/modules/skills/skills.service.js +239 -37
  94. package/dist/modules/skills/skills.service.js.map +1 -1
  95. package/dist/modules/skills/skills.tools.d.ts +7 -0
  96. package/dist/modules/skills/skills.tools.d.ts.map +1 -1
  97. package/dist/modules/skills/skills.tools.js +71 -7
  98. package/dist/modules/skills/skills.tools.js.map +1 -1
  99. package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
  100. package/dist/modules/tool-auth/external-api-key.service.js +4 -2
  101. package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
  102. package/dist/modules/tool-auth/internal-token.service.d.ts +3 -3
  103. package/dist/modules/tool-auth/tool-auth.middleware.d.ts +16 -7
  104. package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
  105. package/dist/modules/tool-auth/tool-auth.middleware.js +34 -12
  106. package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -1
  107. package/dist/modules/tool-helpers/tool-handler.d.ts +2 -1
  108. package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -1
  109. package/dist/modules/tool-helpers/tool-handler.js +25 -4
  110. package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
  111. package/dist/modules/tool-helpers/tool.contract.d.ts +3 -2
  112. package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
  113. package/dist/modules/tool-helpers/tool.contract.js.map +1 -1
  114. package/dist/modules/tool-helpers/validate-token.js +1 -1
  115. package/dist/modules/tool-helpers/validate-token.js.map +1 -1
  116. package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +98 -0
  117. package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -0
  118. package/dist/modules/workflow/agent-tools/change-request-summary.js +81 -0
  119. package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -0
  120. package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
  121. package/dist/modules/workflow/agent-tools/workflow.tools.js +75 -35
  122. package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
  123. package/dist/modules/workflow/file-lock.service.d.ts +24 -0
  124. package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
  125. package/dist/modules/workflow/file-lock.service.js +30 -0
  126. package/dist/modules/workflow/file-lock.service.js.map +1 -1
  127. package/dist/modules/workflow/git/git.service.d.ts +69 -0
  128. package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
  129. package/dist/modules/workflow/git/git.service.js +153 -2
  130. package/dist/modules/workflow/git/git.service.js.map +1 -1
  131. package/dist/modules/workflow/pending-commits.service.d.ts +38 -0
  132. package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
  133. package/dist/modules/workflow/pending-commits.service.js +55 -0
  134. package/dist/modules/workflow/pending-commits.service.js.map +1 -1
  135. package/dist/modules/workflow/workflow-hooks.d.ts +54 -32
  136. package/dist/modules/workflow/workflow-hooks.d.ts.map +1 -1
  137. package/dist/modules/workflow/workflow-hooks.js +16 -1
  138. package/dist/modules/workflow/workflow-hooks.js.map +1 -1
  139. package/dist/modules/workflow/workflow.service.d.ts +60 -6
  140. package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
  141. package/dist/modules/workflow/workflow.service.js +111 -4
  142. package/dist/modules/workflow/workflow.service.js.map +1 -1
  143. package/dist/modules/workspace/agent-access.gate.d.ts +94 -0
  144. package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -0
  145. package/dist/modules/workspace/agent-access.gate.js +123 -0
  146. package/dist/modules/workspace/agent-access.gate.js.map +1 -0
  147. package/dist/modules/workspace/routine-write-policy.d.ts +5 -6
  148. package/dist/modules/workspace/routine-write-policy.d.ts.map +1 -1
  149. package/dist/modules/workspace/routine-write-policy.js +5 -6
  150. package/dist/modules/workspace/routine-write-policy.js.map +1 -1
  151. package/dist/modules/workspace/session-sink.d.ts +5 -5
  152. package/dist/modules/workspace/set-aside-clone.d.ts +46 -0
  153. package/dist/modules/workspace/set-aside-clone.d.ts.map +1 -0
  154. package/dist/modules/workspace/set-aside-clone.js +92 -0
  155. package/dist/modules/workspace/set-aside-clone.js.map +1 -0
  156. package/dist/modules/workspace/startup/kb-startup-runner.d.ts +59 -9
  157. package/dist/modules/workspace/startup/kb-startup-runner.d.ts.map +1 -1
  158. package/dist/modules/workspace/startup/kb-startup-runner.js +65 -24
  159. package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
  160. package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
  161. package/dist/modules/workspace/workspace.routes.js +92 -3
  162. package/dist/modules/workspace/workspace.routes.js.map +1 -1
  163. package/dist/modules/workspace/workspace.service.d.ts +115 -5
  164. package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
  165. package/dist/modules/workspace/workspace.service.js +255 -25
  166. package/dist/modules/workspace/workspace.service.js.map +1 -1
  167. package/dist/modules/workspace/workspace.tools.d.ts +2 -2
  168. package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
  169. package/dist/modules/workspace/workspace.tools.js +309 -115
  170. package/dist/modules/workspace/workspace.tools.js.map +1 -1
  171. package/dist/modules/write-access/write-access.d.ts +60 -0
  172. package/dist/modules/write-access/write-access.d.ts.map +1 -0
  173. package/dist/modules/write-access/write-access.js +129 -0
  174. package/dist/modules/write-access/write-access.js.map +1 -0
  175. package/dist/shared/domain-errors.d.ts +25 -0
  176. package/dist/shared/domain-errors.d.ts.map +1 -1
  177. package/dist/shared/domain-errors.js +28 -0
  178. package/dist/shared/domain-errors.js.map +1 -1
  179. package/dist/shared/git.contract.d.ts +20 -0
  180. package/dist/shared/git.contract.d.ts.map +1 -1
  181. package/dist/shared/git.contract.js +26 -0
  182. package/dist/shared/git.contract.js.map +1 -1
  183. package/dist/tenancy/static-tenant-source.d.ts +0 -1
  184. package/dist/tenancy/static-tenant-source.d.ts.map +1 -1
  185. package/dist/tenancy/static-tenant-source.js +0 -2
  186. package/dist/tenancy/static-tenant-source.js.map +1 -1
  187. package/migrations/0014_change_request_closed_reason.sql +1 -0
  188. package/migrations/0015_account_deactivation.sql +3 -0
  189. package/migrations/meta/0014_snapshot.json +2265 -0
  190. package/migrations/meta/0015_snapshot.json +2271 -0
  191. package/migrations/meta/_journal.json +14 -0
  192. package/package.json +3 -3
  193. package/src/__tests__/kb-layout-config.test.ts +0 -2
  194. package/src/__tests__/retired-settings.test.ts +96 -0
  195. package/src/core/__tests__/gated-boot.test.ts +132 -0
  196. package/src/core/__tests__/lifecycle.test.ts +170 -1
  197. package/src/core/__tests__/set-aside-root-is-one-place.test.ts +63 -0
  198. package/src/core/core-ports.ts +11 -1
  199. package/src/core/create-core-server.ts +32 -14
  200. package/src/core/create-core-services.ts +129 -23
  201. package/src/core/lifecycle.ts +98 -13
  202. package/src/core-config.ts +13 -14
  203. package/src/index.ts +12 -1
  204. package/src/modules/access/__tests__/access-control.preview-relocation.test.ts +385 -0
  205. package/src/modules/access/__tests__/access-control.prospective.test.ts +94 -18
  206. package/src/modules/access/__tests__/access.routes.prospective.test.ts +6 -7
  207. package/src/modules/access/access-control.interface.ts +43 -12
  208. package/src/modules/access/access-control.service.ts +234 -36
  209. package/src/modules/access/access.routes.ts +13 -15
  210. package/src/modules/agent-instructions/__tests__/agent-instructions.route.test.ts +3 -1
  211. package/src/modules/auth/__tests__/account-deactivation.test.ts +252 -0
  212. package/src/modules/auth/__tests__/account.routes.test.ts +81 -3
  213. package/src/modules/auth/__tests__/auth.middleware.test.ts +45 -22
  214. package/src/modules/auth/__tests__/auth.service.test.ts +1 -1
  215. package/src/modules/auth/account-admission.ts +78 -9
  216. package/src/modules/auth/account.routes.ts +63 -7
  217. package/src/modules/auth/auth.middleware.ts +19 -8
  218. package/src/modules/auth/auth.routes.ts +8 -0
  219. package/src/modules/auth/auth.service.ts +179 -6
  220. package/src/modules/auth/oidc-auth-provider.ts +7 -2
  221. package/src/modules/database/core-schema.ts +35 -27
  222. package/src/modules/kb-fs/__tests__/branch-name.test.ts +10 -0
  223. package/src/modules/kb-fs/__tests__/repo-path.test.ts +123 -0
  224. package/src/modules/kb-fs/branch-name.ts +14 -1
  225. package/src/modules/kb-fs/repo-path.ts +85 -0
  226. package/src/modules/kb-sync/__tests__/kb-sync.routes.test.ts +26 -1
  227. package/src/modules/kb-sync/kb-sync.routes.ts +14 -4
  228. package/src/modules/kb-sync/sync-auth.ts +2 -2
  229. package/src/modules/mcp/__tests__/mcp-auth.middleware.test.ts +60 -3
  230. package/src/modules/mcp/__tests__/mcp.service.test.ts +68 -6
  231. package/src/modules/mcp/mcp-auth.middleware.ts +20 -6
  232. package/src/modules/mcp/oauth/bevel-oauth-provider.ts +3 -1
  233. package/src/modules/plugins/__tests__/plugins.tools.test.ts +2 -1
  234. package/src/modules/settings/__tests__/deployment-settings.service.test.ts +16 -0
  235. package/src/modules/settings/__tests__/setup.routes.git-mode.test.ts +91 -58
  236. package/src/modules/settings/__tests__/setup.routes.github-app.test.ts +25 -8
  237. package/src/modules/settings/__tests__/setup.routes.managed-phase.test.ts +14 -11
  238. package/src/modules/settings/__tests__/setup.routes.repository-change.test.ts +390 -0
  239. package/src/modules/settings/__tests__/setup.routes.test.ts +3 -0
  240. package/src/modules/settings/deployment-settings.service.ts +8 -3
  241. package/src/modules/settings/setup.routes.ts +263 -19
  242. package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +2 -1
  243. package/src/modules/skills/__tests__/branch-skills.tools.test.ts +218 -0
  244. package/src/modules/skills/__tests__/skills.service.test.ts +229 -5
  245. package/src/modules/skills/skills.contract.ts +91 -18
  246. package/src/modules/skills/skills.service.ts +278 -41
  247. package/src/modules/skills/skills.tools.ts +80 -8
  248. package/src/modules/tool-auth/__tests__/manual-auth.middleware.test.ts +14 -1
  249. package/src/modules/tool-auth/external-api-key.service.ts +4 -2
  250. package/src/modules/tool-auth/internal-token.service.ts +3 -3
  251. package/src/modules/tool-auth/tool-auth.middleware.ts +34 -11
  252. package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +5 -3
  253. package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +3 -3
  254. package/src/modules/tool-helpers/__tests__/validate-token.test.ts +11 -1
  255. package/src/modules/tool-helpers/tool-handler.ts +24 -4
  256. package/src/modules/tool-helpers/tool.contract.ts +3 -2
  257. package/src/modules/tool-helpers/validate-token.ts +1 -1
  258. package/src/modules/workflow/__tests__/pending-commits.repository-replaced.test.ts +111 -0
  259. package/src/modules/workflow/__tests__/workflow.routes.history-read-gate.test.ts +25 -0
  260. package/src/modules/workflow/__tests__/workflow.service.repository-replaced.test.ts +249 -0
  261. package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +264 -6
  262. package/src/modules/workflow/agent-tools/change-request-summary.ts +182 -0
  263. package/src/modules/workflow/agent-tools/workflow.tools.ts +86 -35
  264. package/src/modules/workflow/file-lock.service.ts +31 -0
  265. package/src/modules/workflow/git/__tests__/git.service.fileBytesAtCommit.test.ts +260 -0
  266. package/src/modules/workflow/git/git.service.ts +168 -0
  267. package/src/modules/workflow/pending-commits.service.ts +59 -1
  268. package/src/modules/workflow/workflow-hooks.ts +64 -26
  269. package/src/modules/workflow/workflow.service.ts +121 -4
  270. package/src/modules/workspace/__tests__/agent-access.gate.test.ts +208 -0
  271. package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +384 -0
  272. package/src/modules/workspace/__tests__/file-stat-access.test.ts +2 -1
  273. package/src/modules/workspace/__tests__/git-internals.security.test.ts +2 -1
  274. package/src/modules/workspace/__tests__/set-aside-clone.test.ts +52 -0
  275. package/src/modules/workspace/__tests__/workspace.routes.at-ref.test.ts +305 -0
  276. package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +2 -0
  277. package/src/modules/workspace/__tests__/workspace.service.forget-clone-races.test.ts +147 -0
  278. package/src/modules/workspace/__tests__/workspace.service.replaced-repository.test.ts +326 -0
  279. package/src/modules/workspace/__tests__/workspace.service.test.ts +20 -9
  280. package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +2 -3
  281. package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +2 -3
  282. package/src/modules/workspace/__tests__/workspace.tools.test.ts +685 -14
  283. package/src/modules/workspace/agent-access.gate.ts +164 -0
  284. package/src/modules/workspace/routine-write-policy.ts +5 -6
  285. package/src/modules/workspace/session-sink.ts +5 -5
  286. package/src/modules/workspace/set-aside-clone.ts +96 -0
  287. package/src/modules/workspace/startup/__tests__/kb-startup-runner.test.ts +86 -0
  288. package/src/modules/workspace/startup/kb-startup-runner.ts +115 -34
  289. package/src/modules/workspace/workspace.routes.ts +95 -3
  290. package/src/modules/workspace/workspace.service.ts +256 -24
  291. package/src/modules/workspace/workspace.tools.ts +338 -119
  292. package/src/modules/write-access/__tests__/write-access.test.ts +248 -0
  293. package/src/modules/write-access/write-access.ts +153 -0
  294. package/src/shared/domain-errors.ts +31 -0
  295. package/src/shared/git.contract.ts +27 -0
  296. package/src/tenancy/__tests__/static-tenant-source.test.ts +0 -1
  297. package/src/tenancy/static-tenant-source.ts +0 -3
  298. package/dist/modules/workflow/session-ontology.policy.d.ts +0 -52
  299. package/dist/modules/workflow/session-ontology.policy.d.ts.map +0 -1
  300. package/dist/modules/workflow/session-ontology.policy.js +0 -62
  301. package/dist/modules/workflow/session-ontology.policy.js.map +0 -1
  302. package/dist/modules/workflow/session-ontology.service.d.ts +0 -105
  303. package/dist/modules/workflow/session-ontology.service.d.ts.map +0 -1
  304. package/dist/modules/workflow/session-ontology.service.js +0 -147
  305. package/dist/modules/workflow/session-ontology.service.js.map +0 -1
  306. package/dist/modules/workspace/session-ontology.gate.d.ts +0 -114
  307. package/dist/modules/workspace/session-ontology.gate.d.ts.map +0 -1
  308. package/dist/modules/workspace/session-ontology.gate.js +0 -161
  309. package/dist/modules/workspace/session-ontology.gate.js.map +0 -1
  310. package/dist/shared/kb-layout.d.ts +0 -39
  311. package/dist/shared/kb-layout.d.ts.map +0 -1
  312. package/dist/shared/kb-layout.js +0 -103
  313. package/dist/shared/kb-layout.js.map +0 -1
  314. package/dist/shared/kb-layout.test.d.ts +0 -2
  315. package/dist/shared/kb-layout.test.d.ts.map +0 -1
  316. package/dist/shared/kb-layout.test.js +0 -75
  317. package/dist/shared/kb-layout.test.js.map +0 -1
  318. package/src/modules/workflow/__tests__/session-ontology.policy.test.ts +0 -62
  319. package/src/modules/workflow/__tests__/session-ontology.service.test.ts +0 -201
  320. package/src/modules/workflow/session-ontology.policy.ts +0 -70
  321. package/src/modules/workflow/session-ontology.service.ts +0 -183
  322. package/src/modules/workspace/__tests__/session-ontology.gate.test.ts +0 -239
  323. package/src/modules/workspace/session-ontology.gate.ts +0 -191
  324. package/src/shared/kb-layout.test.ts +0 -98
  325. package/src/shared/kb-layout.ts +0 -102
@@ -93,13 +93,20 @@ export type PathHolders = {
93
93
  write: HolderList;
94
94
  };
95
95
  /**
96
- * One file's holders where it is now and where a move would put it — see
97
- * {@link IAccessControl.prospectiveHolders}.
96
+ * One file's or folder's holders where it is now and where a move would put
97
+ * it — see {@link IAccessControl.prospectiveHolders}.
98
98
  */
99
99
  export type ProspectiveHolders = {
100
100
  before: PathHolders;
101
101
  after: PathHolders;
102
102
  };
103
+ /** One caller's own verdict per access verb on one path. */
104
+ export type PathVerbs = {
105
+ read: boolean;
106
+ write: boolean;
107
+ download: boolean;
108
+ owner: boolean;
109
+ };
103
110
  /**
104
111
  * Per-verb sources of a principal's access on a target. Only verbs the principal
105
112
  * actually holds (via a named file entry) appear; each maps to the closest-first
@@ -316,21 +323,44 @@ export interface IAccessControl {
316
323
  }[];
317
324
  }>;
318
325
  /**
319
- * Who can open and who can edit one file where it IS, and where a move
320
- * would put it. `toPath` names a path that does not exist yet — the point
321
- * of the call is to answer before the move happens — so the resolution
322
- * layers the file's OWN rules (its frontmatter, read from `fromPath`,
323
- * which travels with the bytes) over the destination's folder chain.
326
+ * Who can open and who can edit one file or folder where it IS, and where a
327
+ * move would put it. `toPath` names a path that does not exist yet — the
328
+ * point of the call is to answer before the move happens — so the
329
+ * resolution is over what travels with the bytes: a file's OWN rules (its
330
+ * frontmatter, read from `fromPath`) layered over the destination's folder
331
+ * chain, or a folder's `access.md` files keyed at the directories they
332
+ * land in. Either way the rules the source inherited from its old parent
333
+ * are left behind and the new parent's apply.
324
334
  *
325
335
  * Writes nothing and moves nothing. The move confirmation diffs the two
326
336
  * sides to name who loses and who gains access.
327
- *
328
- * A FILE question only: a `fromPath` that is a directory is refused with a
329
- * 400. A folder's access is its own `access.md` — which moves with it and
330
- * governs everything beneath it — so resolving it as a file would name the
331
- * wrong principals with the same confidence as the right ones.
332
337
  */
333
338
  prospectiveHolders(workspaceId: string, fromPath: string, toPath: string): Promise<ProspectiveHolders>;
339
+ /**
340
+ * The CALLER'S OWN `{ read, write, download, owner }` at `toPath` as they
341
+ * will be once `fromPath` has been moved (`sourceRemains: false`, the
342
+ * default) or copied (`sourceRemains: true`) there — the question a move's
343
+ * or copy's dry run asks, which the same four gates at `toPath` cannot
344
+ * answer because what travels with the bytes is not at the destination yet:
345
+ * the `access.md` files inside a folder, keyed at the directories they land
346
+ * in, and a file's own frontmatter.
347
+ *
348
+ * What a single file's rules GOVERN follows the name it lands under, not the
349
+ * one it leaves: landing as a directory's `access.md` they are that
350
+ * directory's rules (so copying `Sales/access.md` to `Legal/access.md`
351
+ * previews the access `Legal/` is about to have), and landing under any
352
+ * other name they are the file's own and govern nothing but it. Either way
353
+ * the answer is the one the gates will give a moment later.
354
+ *
355
+ * PREVIEW ONLY. It describes a tree that does not exist, so it must never
356
+ * decide whether an operation may run: the gates keep resolving against the
357
+ * tree that does. It writes nothing and moves nothing, and it answers the
358
+ * caller's own verbs only — never the content of an `access.md` they may
359
+ * not read.
360
+ */
361
+ previewAccessAfterRelocation(workspaceId: string, userEmail: string, fromPath: string, toPath: string, opts?: {
362
+ sourceRemains?: boolean;
363
+ }): Promise<PathVerbs>;
334
364
  /**
335
365
  * Finite expanded email set for configured users who could approve this path
336
366
  * — role members + direct user grants, minus anyone denied. The built-in
@@ -1 +1 @@
1
- {"version":3,"file":"access-control.interface.d.ts","sourceRoot":"","sources":["../../../src/modules/access/access-control.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,EAAE,CAAC;AAExC,mFAAmF;AACnF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD,k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,MAAM,EACX,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAEjF;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9E;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,sBAAsB,CACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,uBAAuB,EAAE,MAAM,GAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;;;;;;OAOG;IACH,4BAA4B,CAC1B,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,GAAG,CACZ,MAAM,EACN;QACE,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzC,4EAA4E;QAC5E,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB;;;;;WAKG;QACH,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KAC9B,CACF,GAAG,IAAI,CAAC,CAAC;CACX"}
1
+ {"version":3,"file":"access-control.interface.d.ts","sourceRoot":"","sources":["../../../src/modules/access/access-control.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC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,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzC,4EAA4E;QAC5E,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB;;;;;WAKG;QACH,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KAC9B,CACF,GAAG,IAAI,CAAC,CAAC;CACX"}
@@ -1,7 +1,7 @@
1
1
  import { type ITreeWalker } from '../../shared/fs.contract.js';
2
2
  import { type IGitRunner } from '../../shared/git.contract.js';
3
3
  import type { WorkspaceService } from '../workspace/workspace.service.js';
4
- import type { IAccessControl, AccessDecision, AccessTargetKind, DenialSources, GrantPrincipal, GrantSources, ProspectiveHolders, ResolvedPrincipal } from './access-control.interface.js';
4
+ import type { IAccessControl, AccessDecision, AccessTargetKind, DenialSources, GrantPrincipal, GrantSources, PathVerbs, ProspectiveHolders, ResolvedPrincipal } from './access-control.interface.js';
5
5
  import type { KbContext } from '../../shared/kb-context.js';
6
6
  import { type GroupsIndex } from '../access-model/group-files.js';
7
7
  import { type Verb } from '../access-model/access-grammar.js';
@@ -235,18 +235,48 @@ export declare class AccessControlService implements IAccessControl {
235
235
  }[];
236
236
  }>;
237
237
  /**
238
- * The read and write holders of one file at its current path and at a path
239
- * it has not moved to yet (see the interface).
238
+ * The read and write holders of one file or folder at its current path and
239
+ * at a path it has not moved to yet (see the interface).
240
240
  *
241
- * A move changes nothing about the file's own frontmatter — that travels
242
- * with the bytes — and everything about the folder chain above it. So the
243
- * hypothetical side is the ordinary resolution with the destination path
244
- * substituted: the same model, the same own-entries (read from the SOURCE,
245
- * since nothing sits at the destination to read), resolved against the
246
- * destination's ancestors. One model load and one file read serve all four
247
- * lookups.
241
+ * A move changes nothing about what the thing itself carries — a file's
242
+ * frontmatter and a folder's `access.md` files travel with the bytes — and
243
+ * everything about the folder chain above it. So the hypothetical side is
244
+ * the ordinary resolution at the destination path, over what travels:
245
+ *
246
+ * - a FILE's own-entries, read from the SOURCE (nothing sits at the
247
+ * destination to read) and parsed as the name they LAND under, layered
248
+ * over the destination's ancestors — the two sides can differ, because
249
+ * the same frontmatter is a folder's rules in an `access.md` and the
250
+ * file's own anywhere else;
251
+ * - a FOLDER's `access.md` files, keyed at the directories they land in,
252
+ * and a file landing as a directory's `access.md` at the directory it
253
+ * lands in (`withRelocatedAccessFiles`). A folder has no frontmatter of
254
+ * its own, so it passes none.
255
+ *
256
+ * One model load and one file read serve all four lookups.
248
257
  */
249
258
  prospectiveHolders(workspaceId: string, fromPath: string, toPath: string): Promise<ProspectiveHolders>;
259
+ /**
260
+ * The caller's own verbs at `toPath` as they will be once `fromPath` has
261
+ * been moved or copied there (see the interface).
262
+ *
263
+ * Identical to asking `canRead`/`canWrite`/`canDownload`/`canOwner` at
264
+ * `toPath` whenever nothing travels — an ordinary file with no rules of its
265
+ * own, or a folder with no `access.md` of its own — so the cases this was
266
+ * not written for answer exactly as they always did.
267
+ *
268
+ * What travels is what `prospectiveHolders` says travels, and for the same
269
+ * reason: the preview and the dialog's holder lists must not disagree about
270
+ * one move. A file's own-entries come from the SOURCE, where the bytes
271
+ * carrying them still are — asking the destination, which does not exist
272
+ * yet, always answered null and so dropped the frontmatter a rename hands
273
+ * straight back (requirement 6: what the caller has afterwards equals what
274
+ * the preview said) — and they are parsed as the name they LAND under,
275
+ * because that is the parse the gates will use a moment later.
276
+ */
277
+ previewAccessAfterRelocation(workspaceId: string, userEmail: string, fromPath: string, toPath: string, opts?: {
278
+ sourceRemains?: boolean;
279
+ }): Promise<PathVerbs>;
250
280
  eligibleWriterEmails(workspaceId: string, relativePath: string): Promise<Map<string, {
251
281
  name: string;
252
282
  email: string;
@@ -327,6 +357,33 @@ export declare class AccessControlService implements IAccessControl {
327
357
  * its frontmatter IS the folder rules the dir chain already applies.
328
358
  */
329
359
  private readOwnEntries;
360
+ /**
361
+ * What a move or a copy of `fromPath` to `toPath` CARRIES — the one disk
362
+ * read both preview surfaces need:
363
+ *
364
+ * - `isFolder`: the source is a folder, so the `access.md` files under it
365
+ * travel, keyed at the directories they land in;
366
+ * - `ownHere` / `ownThere`: a file's own-entries as the SOURCE's name reads
367
+ * them and as the DESTINATION's name will. They differ because the same
368
+ * frontmatter means two things by name (see `ownEntriesFromText`), so
369
+ * `Sales/access.md` copied to `Legal/rules-copy.md` arrives as an
370
+ * ordinary file whose frontmatter is its own — reading it as the source's
371
+ * name had the preview contradict the copy it was previewing;
372
+ * - `landing`: the folder rules the bytes WILL be, when they land under the
373
+ * name `access.md`. Parsed as the destination path, so the directory it
374
+ * governs is already the right one. An `access.md` that will not parse
375
+ * travels as nothing, as the loader treats it.
376
+ *
377
+ * `lstat`, not `stat`: a SYMLINK is none of this. `move_file` refuses a
378
+ * symlink source outright, so a link to a directory must not be previewed
379
+ * as a folder taking access files along, and nothing is read THROUGH the
380
+ * link either — the link's target is not what would move.
381
+ *
382
+ * Only absence is an answer (see `isAbsence`): a probe that failed on
383
+ * permissions or I/O does not say "this is a file", and reading a folder as
384
+ * one would resolve it through frontmatter it does not have.
385
+ */
386
+ private relocationSubject;
330
387
  /**
331
388
  * Same as `readOwnEntries` but reads the file at a specific git ref. The ref
332
389
  * MUST be the same one the dir model was loaded at — otherwise a user could
@@ -1 +1 @@
1
- {"version":3,"file":"access-control.service.d.ts","sourceRoot":"","sources":["../../../src/modules/access/access-control.service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEd,gBAAgB,EAChB,aAAa,EACb,cAAc,EAEd,YAAY,EAEZ,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,+BAA+B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AO,CAAC;IAuCb,4BAA4B,CAChC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,GAAG,CACZ,MAAM,EACN;QACE,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KAC9B,CACF,GAAG,IAAI,CAAC;YA+CK,SAAS;YAuGT,OAAO;IAKrB;;;;;;;OAOG;YACW,cAAc;IAe5B;;;;;OAKG;YACW,mBAAmB;IAYjC;;;;;;;OAOG;YACW,wBAAwB;IAqBtC;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAKrB;;;;;;OAMG;YACW,SAAS;IAKvB;;;;;;OAMG;YACW,gBAAgB;IAmB9B;;;;;;OAMG;YACW,oBAAoB;IAuBlC;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,cAAc;IAwC5B,iFAAiF;YACnE,cAAc;IAoB5B,OAAO,CAAC,aAAa;IAQrB;;;;;;;OAOG;YACW,kBAAkB;CAoGjC"}
1
+ {"version":3,"file":"access-control.service.d.ts","sourceRoot":"","sources":["../../../src/modules/access/access-control.service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAsC,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAGnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEd,gBAAgB,EAChB,aAAa,EACb,cAAc,EAEd,YAAY,EAEZ,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,+BAA+B,CAA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E,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IAe1E,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK7E,sBAAsB,CAC1B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,uBAAuB,EAAE,MAAM,GAC9B,OAAO,CAAC,OAAO,CAAC;IAuCb,4BAA4B,CAChC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,GAAG,CACZ,MAAM,EACN;QACE,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KAC9B,CACF,GAAG,IAAI,CAAC;YA+CK,SAAS;YAuGT,OAAO;IAKrB;;;;;;;OAOG;YACW,cAAc;IAc5B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;YACW,iBAAiB;IAoC/B;;;;;OAKG;YACW,mBAAmB;IAYjC;;;;;;;OAOG;YACW,wBAAwB;IAqBtC;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAKrB;;;;;;OAMG;YACW,SAAS;IAKvB;;;;;;OAMG;YACW,gBAAgB;IAmB9B;;;;;;OAMG;YACW,oBAAoB;IAuBlC;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,cAAc;IAwC5B,iFAAiF;YACnE,cAAc;IAoB5B,OAAO,CAAC,aAAa;IAQrB;;;;;;;OAOG;YACW,kBAAkB;CAoGjC"}
@@ -3,12 +3,11 @@ import path from 'node:path';
3
3
  import { logger } from '../../shared/logging.js';
4
4
  const log = logger('access');
5
5
  import { isAbsence } from '../../shared/fs.contract.js';
6
- import { isGitTimeout } from '../../shared/git.contract.js';
6
+ import { assertOneSpecPerLine, isGitTimeout } from '../../shared/git.contract.js';
7
7
  import { hashEmail } from '../../shared/email-identity.js';
8
8
  import { NodeGitRunner } from '../workflow/git/node-git-runner.js';
9
9
  import { DEFAULT_KB_LAYOUT, PLUGIN_MANIFEST_FILE, isPersonalPluginDir, pluginIdentityOf, platformRestoreDestination, } from '@bevel-software/platform-shared';
10
10
  import { AccessConfigError, AccessUnreadableError } from '../access-model/access-errors.js';
11
- import { WorkflowDomainError } from '../../shared/domain-errors.js';
12
11
  import { synthesizePluginPrincipals } from '../access-model/plugin-principals.js';
13
12
  import { GROUPS_YAML, SYNCED_GROUPS_YAML, parseGroupsFile, } from '../access-model/group-files.js';
14
13
  import { ADMIN_CANONICAL, EVERYONE_CANONICAL, EVERYONE_DISPLAY, KNOWN_VERBS, ROLE_TOKEN_PREFIX, accessMdSelfEntries, canonicalEmail, canonicalRoleName, isAccessMdPath, mergeGroupsIntoRoles, parseAccessFile, parseOwnAccessEntries, parseRolesYaml, requiredVerbsFor, sourceVerbsFor, } from '../access-model/access-grammar.js';
@@ -24,6 +23,12 @@ import { DIRECTORY_SYNC_BOT_EMAIL, DIRECTORY_SYNC_BOT_NAME, } from './directory-
24
23
  async function catFileBatch(runner, repoDir, specs) {
25
24
  // Bytes, not text: every `<size>` in the header counts bytes, and the walk
26
25
  // below has to step by that count through content that is not all ASCII.
26
+ // One spec per LINE is the protocol, and this walk depends on getting back
27
+ // exactly as many answers as it sent: a spec carrying a line break would
28
+ // insert an extra answer and shift every result after it, so each directory
29
+ // would be handed the NEXT one's `access.md`. Paths are refused a control
30
+ // character at the normaliser; this is the fence at the protocol.
31
+ assertOneSpecPerLine(specs);
27
32
  const { stdout: out } = await runner.run(repoDir, ['cat-file', '--batch'], {
28
33
  input: `${specs.join('\n')}\n`,
29
34
  encoding: 'buffer',
@@ -723,6 +728,95 @@ function resolveDenialSourcesForVerb(model, verb, kind, relativePath, principal,
723
728
  }
724
729
  return out;
725
730
  }
731
+ /**
732
+ * The model as it will be once `fromPath` has been moved or copied to
733
+ * `toPath`: every `access.md` the operation carries, keyed at the directory
734
+ * it lands in, since the rules a folder carries travel with its bytes.
735
+ *
736
+ * What travels is BYTES, and the name they land under decides what they
737
+ * govern — `landing` is the caller's answer to that (see
738
+ * `relocationSubject`), already parsed as the destination path:
739
+ *
740
+ * - a FOLDER takes every `access.md` at or under it, each re-keyed to the
741
+ * directory it lands in, and `landing` plays no part;
742
+ * - a FILE governs a directory exactly when it lands as that directory's
743
+ * `access.md`, whatever it was called before — a copy `copy_file` allows,
744
+ * and one that governs the destination folder the moment it lands. Its key
745
+ * is a PARENT directory, never a path under `fromPath`, which is why the
746
+ * prefix walk above cannot see it.
747
+ *
748
+ * The emptied side is the mirror: an `access.md` that MOVES stops governing
749
+ * the directory it left, whether or not it governs anything where it lands.
750
+ *
751
+ * PREVIEW ONLY. Nothing here reads disk and nothing here decides whether an
752
+ * operation may run — the gates resolve against the model as it IS. This
753
+ * answers the other question, the one a dry run asks: what will be true
754
+ * afterwards. Judging the destination as it stands today is what made a
755
+ * rename warn about losing the owner access the folder's own `access.md` was
756
+ * about to hand straight back.
757
+ *
758
+ * `sourceRemains` is the difference between a copy and a move: a copy leaves
759
+ * the rules where they were, a move takes them away. It changes the answer
760
+ * only when the destination resolves through a directory the source
761
+ * occupied; nothing else consults those keys.
762
+ */
763
+ function withRelocatedAccessFiles(model, fromPath, toPath, opts) {
764
+ /** Directories the operation takes an `access.md` AWAY from. */
765
+ const emptied = [];
766
+ /** Directories it leaves one IN, with the file as it will be read there. */
767
+ const landing = [];
768
+ if (opts.sourceIsFolder) {
769
+ for (const [dir, file] of model.accessFilesByDir) {
770
+ if (dir !== fromPath && !dir.startsWith(`${fromPath}/`))
771
+ continue;
772
+ emptied.push(dir);
773
+ landing.push({ toDir: `${toPath}${dir.slice(fromPath.length)}`, file });
774
+ }
775
+ }
776
+ else {
777
+ const fromDir = parentDirOf(fromPath);
778
+ if (isAccessMdPath(fromPath) && model.accessFilesByDir.has(fromDir))
779
+ emptied.push(fromDir);
780
+ if (opts.landing)
781
+ landing.push({ toDir: parentDirOf(toPath), file: opts.landing });
782
+ }
783
+ if (emptied.length === 0 && landing.length === 0)
784
+ return model;
785
+ const accessFilesByDir = new Map(model.accessFilesByDir);
786
+ if (!opts.sourceRemains)
787
+ for (const dir of emptied)
788
+ accessFilesByDir.delete(dir);
789
+ for (const { toDir, file } of landing) {
790
+ // A directory that already has an `access.md` keeps it. The operation
791
+ // would be refused for landing on something that exists long before the
792
+ // two files could meet, so the model must not invent a merge either.
793
+ if (accessFilesByDir.has(toDir))
794
+ continue;
795
+ accessFilesByDir.set(toDir, {
796
+ ...file,
797
+ dir: toDir,
798
+ path: toDir ? `${toDir}/access.md` : 'access.md',
799
+ });
800
+ }
801
+ return { ...model, accessFilesByDir };
802
+ }
803
+ /** The directory a repo-relative file path sits in; `''` for the repo root. */
804
+ function parentDirOf(relativePath) {
805
+ const cut = relativePath.lastIndexOf('/');
806
+ return cut === -1 ? '' : relativePath.slice(0, cut);
807
+ }
808
+ /**
809
+ * One file's own-entries, parsed as the path `asName` would be read.
810
+ *
811
+ * The same frontmatter means two different things by name: in an `access.md`
812
+ * it is the FOLDER's rules (and the file governs itself only through the
813
+ * body format — see {@link accessMdSelfEntries}), and anywhere else it is the
814
+ * file's own. Which is why a preview must read the bytes as the name they
815
+ * LAND under, not the one they are leaving.
816
+ */
817
+ function ownEntriesFromText(text, asName) {
818
+ return isAccessMdPath(asName) ? accessMdSelfEntries(text) : parseOwnAccessEntries(text);
819
+ }
726
820
  /**
727
821
  * Build the repo-root → path chain of directory scopes that govern
728
822
  * `relativePath`, e.g. `Knowledge/Sales/Foo.md` →
@@ -1230,43 +1324,73 @@ export class AccessControlService {
1230
1324
  return eligibleHoldersResolved(model, 'download', relativePath, own);
1231
1325
  }
1232
1326
  /**
1233
- * The read and write holders of one file at its current path and at a path
1234
- * it has not moved to yet (see the interface).
1327
+ * The read and write holders of one file or folder at its current path and
1328
+ * at a path it has not moved to yet (see the interface).
1329
+ *
1330
+ * A move changes nothing about what the thing itself carries — a file's
1331
+ * frontmatter and a folder's `access.md` files travel with the bytes — and
1332
+ * everything about the folder chain above it. So the hypothetical side is
1333
+ * the ordinary resolution at the destination path, over what travels:
1235
1334
  *
1236
- * A move changes nothing about the file's own frontmatter — that travels
1237
- * with the bytes — and everything about the folder chain above it. So the
1238
- * hypothetical side is the ordinary resolution with the destination path
1239
- * substituted: the same model, the same own-entries (read from the SOURCE,
1240
- * since nothing sits at the destination to read), resolved against the
1241
- * destination's ancestors. One model load and one file read serve all four
1242
- * lookups.
1335
+ * - a FILE's own-entries, read from the SOURCE (nothing sits at the
1336
+ * destination to read) and parsed as the name they LAND under, layered
1337
+ * over the destination's ancestors — the two sides can differ, because
1338
+ * the same frontmatter is a folder's rules in an `access.md` and the
1339
+ * file's own anywhere else;
1340
+ * - a FOLDER's `access.md` files, keyed at the directories they land in,
1341
+ * and a file landing as a directory's `access.md` at the directory it
1342
+ * lands in (`withRelocatedAccessFiles`). A folder has no frontmatter of
1343
+ * its own, so it passes none.
1344
+ *
1345
+ * One model load and one file read serve all four lookups.
1243
1346
  */
1244
1347
  async prospectiveHolders(workspaceId, fromPath, toPath) {
1245
1348
  const model = await this.loadModel(workspaceId);
1246
1349
  const repoDir = await this.repoDir(workspaceId);
1247
- // A FILE question only. A folder carries its own `access.md` — which moves
1248
- // with it and governs everything under it — so resolving it as a file
1249
- // would read frontmatter it does not have and omit the rules it does,
1250
- // naming principals that are not the ones a folder move changes. Refuse
1251
- // rather than answer the wrong question convincingly.
1252
- //
1253
- // Only absence is an answer here (see `isAbsence`): a probe that failed on
1254
- // permissions or I/O does not say "this is a file", and folding it into
1255
- // one would let the very case above through on an unreadable source.
1256
- const fromStat = await fs.stat(path.join(repoDir, fromPath)).catch((err) => {
1257
- if (isAbsence(err))
1258
- return null;
1259
- throw err;
1350
+ const { isFolder, ownHere, ownThere, landing } = await this.relocationSubject(repoDir, fromPath, toPath);
1351
+ const after = withRelocatedAccessFiles(model, fromPath, toPath, {
1352
+ sourceRemains: false,
1353
+ sourceIsFolder: isFolder,
1354
+ landing,
1260
1355
  });
1261
- if (fromStat?.isDirectory()) {
1262
- throw new WorkflowDomainError('prospective access answers for a file, not a folder', 400);
1263
- }
1264
- const own = await this.readOwnEntries(repoDir, fromPath);
1265
- const holdersAt = (relativePath) => ({
1266
- read: eligibleHoldersResolved(model, 'read', relativePath, own),
1267
- write: eligibleHoldersResolved(model, 'write', relativePath, own),
1356
+ const holdersAt = (m, relativePath, own) => ({
1357
+ read: eligibleHoldersResolved(m, 'read', relativePath, own),
1358
+ write: eligibleHoldersResolved(m, 'write', relativePath, own),
1268
1359
  });
1269
- return { before: holdersAt(fromPath), after: holdersAt(toPath) };
1360
+ return {
1361
+ before: holdersAt(model, fromPath, ownHere),
1362
+ after: holdersAt(after, toPath, ownThere),
1363
+ };
1364
+ }
1365
+ /**
1366
+ * The caller's own verbs at `toPath` as they will be once `fromPath` has
1367
+ * been moved or copied there (see the interface).
1368
+ *
1369
+ * Identical to asking `canRead`/`canWrite`/`canDownload`/`canOwner` at
1370
+ * `toPath` whenever nothing travels — an ordinary file with no rules of its
1371
+ * own, or a folder with no `access.md` of its own — so the cases this was
1372
+ * not written for answer exactly as they always did.
1373
+ *
1374
+ * What travels is what `prospectiveHolders` says travels, and for the same
1375
+ * reason: the preview and the dialog's holder lists must not disagree about
1376
+ * one move. A file's own-entries come from the SOURCE, where the bytes
1377
+ * carrying them still are — asking the destination, which does not exist
1378
+ * yet, always answered null and so dropped the frontmatter a rename hands
1379
+ * straight back (requirement 6: what the caller has afterwards equals what
1380
+ * the preview said) — and they are parsed as the name they LAND under,
1381
+ * because that is the parse the gates will use a moment later.
1382
+ */
1383
+ async previewAccessAfterRelocation(workspaceId, userEmail, fromPath, toPath, opts) {
1384
+ const repoDir = await this.repoDir(workspaceId);
1385
+ const { isFolder, ownThere: own, landing } = await this.relocationSubject(repoDir, fromPath, toPath);
1386
+ const model = withRelocatedAccessFiles(await this.loadModel(workspaceId), fromPath, toPath, { sourceRemains: opts?.sourceRemains === true, sourceIsFolder: isFolder, landing });
1387
+ const machineOwned = this.machineOwnedWriteRule(userEmail, toPath);
1388
+ return {
1389
+ read: canReadResolved(model, userEmail, toPath, own),
1390
+ write: machineOwned ?? hasPermissionResolved(model, 'write', userEmail, toPath, own),
1391
+ download: hasPermissionResolved(model, 'download', userEmail, toPath, own),
1392
+ owner: hasPermissionResolved(model, 'owner', userEmail, toPath, own),
1393
+ };
1270
1394
  }
1271
1395
  async eligibleWriterEmails(workspaceId, relativePath) {
1272
1396
  const model = await this.loadModel(workspaceId);
@@ -1744,9 +1868,64 @@ export class AccessControlService {
1744
1868
  catch {
1745
1869
  return null;
1746
1870
  }
1747
- if (isAccessMdPath(relativePath))
1748
- return accessMdSelfEntries(text);
1749
- return parseOwnAccessEntries(text);
1871
+ return ownEntriesFromText(text, relativePath);
1872
+ }
1873
+ /**
1874
+ * What a move or a copy of `fromPath` to `toPath` CARRIES — the one disk
1875
+ * read both preview surfaces need:
1876
+ *
1877
+ * - `isFolder`: the source is a folder, so the `access.md` files under it
1878
+ * travel, keyed at the directories they land in;
1879
+ * - `ownHere` / `ownThere`: a file's own-entries as the SOURCE's name reads
1880
+ * them and as the DESTINATION's name will. They differ because the same
1881
+ * frontmatter means two things by name (see `ownEntriesFromText`), so
1882
+ * `Sales/access.md` copied to `Legal/rules-copy.md` arrives as an
1883
+ * ordinary file whose frontmatter is its own — reading it as the source's
1884
+ * name had the preview contradict the copy it was previewing;
1885
+ * - `landing`: the folder rules the bytes WILL be, when they land under the
1886
+ * name `access.md`. Parsed as the destination path, so the directory it
1887
+ * governs is already the right one. An `access.md` that will not parse
1888
+ * travels as nothing, as the loader treats it.
1889
+ *
1890
+ * `lstat`, not `stat`: a SYMLINK is none of this. `move_file` refuses a
1891
+ * symlink source outright, so a link to a directory must not be previewed
1892
+ * as a folder taking access files along, and nothing is read THROUGH the
1893
+ * link either — the link's target is not what would move.
1894
+ *
1895
+ * Only absence is an answer (see `isAbsence`): a probe that failed on
1896
+ * permissions or I/O does not say "this is a file", and reading a folder as
1897
+ * one would resolve it through frontmatter it does not have.
1898
+ */
1899
+ async relocationSubject(repoDir, fromPath, toPath) {
1900
+ const nothing = { isFolder: false, ownHere: null, ownThere: null, landing: null };
1901
+ const fromStat = await fs.lstat(path.join(repoDir, fromPath)).catch((err) => {
1902
+ if (isAbsence(err))
1903
+ return null;
1904
+ throw err;
1905
+ });
1906
+ if (fromStat?.isSymbolicLink() === true)
1907
+ return nothing;
1908
+ if (fromStat?.isDirectory() === true)
1909
+ return { ...nothing, isFolder: true };
1910
+ // `roles.yaml` carries no own-entries wherever it sits, exactly as
1911
+ // `readOwnEntries` has it; a read that fails for any reason is no rules,
1912
+ // which is what the gates would say about the same file.
1913
+ if (fromPath === 'roles.yaml' || toPath === 'roles.yaml')
1914
+ return nothing;
1915
+ let text;
1916
+ try {
1917
+ text = await fs.readFile(path.join(repoDir, fromPath), 'utf-8');
1918
+ }
1919
+ catch {
1920
+ return nothing;
1921
+ }
1922
+ const parsed = isAccessMdPath(toPath) ? parseAccessFile(text, toPath) : null;
1923
+ return {
1924
+ isFolder: false,
1925
+ ownHere: ownEntriesFromText(text, fromPath),
1926
+ ownThere: ownEntriesFromText(text, toPath),
1927
+ landing: parsed?.ok === true ? parsed.file : null,
1928
+ };
1750
1929
  }
1751
1930
  /**
1752
1931
  * Same as `readOwnEntries` but reads the file at a specific git ref. The ref