@mastra/factory 0.27.0-alpha.1 → 0.27.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/README.md +181 -52
  2. package/dist/boards/card-facts.d.ts +5 -3
  3. package/dist/boards/card-facts.d.ts.map +1 -1
  4. package/dist/boards/card-facts.js +9 -4
  5. package/dist/boards/card-facts.js.map +1 -1
  6. package/dist/boards/define-board.d.ts +2 -0
  7. package/dist/boards/define-board.d.ts.map +1 -1
  8. package/dist/boards/define-board.js +1 -0
  9. package/dist/boards/define-board.js.map +1 -1
  10. package/dist/boards/index.d.ts +2 -2
  11. package/dist/boards/index.d.ts.map +1 -1
  12. package/dist/boards/index.js +2 -2
  13. package/dist/boards/index.js.map +1 -1
  14. package/dist/boards/intake-routing.d.ts +37 -0
  15. package/dist/boards/intake-routing.d.ts.map +1 -0
  16. package/dist/boards/intake-routing.js +70 -0
  17. package/dist/boards/intake-routing.js.map +1 -0
  18. package/dist/boards/phase-automation.d.ts +4 -4
  19. package/dist/boards/phase-automation.d.ts.map +1 -1
  20. package/dist/boards/phase-automation.js.map +1 -1
  21. package/dist/boards/pull-request-review.d.ts +14 -0
  22. package/dist/boards/pull-request-review.d.ts.map +1 -0
  23. package/dist/boards/pull-request-review.js +81 -0
  24. package/dist/boards/pull-request-review.js.map +1 -0
  25. package/dist/boards/relocate.d.ts +4 -4
  26. package/dist/boards/relocate.d.ts.map +1 -1
  27. package/dist/boards/relocate.js +1 -1
  28. package/dist/boards/relocate.js.map +1 -1
  29. package/dist/boards/review.d.ts +0 -2
  30. package/dist/boards/review.d.ts.map +1 -1
  31. package/dist/boards/review.js +2 -77
  32. package/dist/boards/review.js.map +1 -1
  33. package/dist/boards/semantics.d.ts +28 -8
  34. package/dist/boards/semantics.d.ts.map +1 -1
  35. package/dist/boards/semantics.js +21 -1
  36. package/dist/boards/semantics.js.map +1 -1
  37. package/dist/boards/transition-policy.d.ts +7 -0
  38. package/dist/boards/transition-policy.d.ts.map +1 -1
  39. package/dist/boards/transition-policy.js.map +1 -1
  40. package/dist/boards/work.d.ts +8 -2
  41. package/dist/boards/work.d.ts.map +1 -1
  42. package/dist/boards/work.js +81 -23
  43. package/dist/boards/work.js.map +1 -1
  44. package/dist/factory.d.ts +4 -2
  45. package/dist/factory.d.ts.map +1 -1
  46. package/dist/factory.js +24 -42
  47. package/dist/factory.js.map +1 -1
  48. package/dist/index.d.ts +3 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +3 -2
  51. package/dist/integrations/github/acceptance-labels.d.ts +2 -2
  52. package/dist/integrations/github/acceptance-labels.d.ts.map +1 -1
  53. package/dist/integrations/github/acceptance-labels.js +2 -2
  54. package/dist/integrations/github/acceptance-labels.js.map +1 -1
  55. package/dist/integrations/github/default-rules.d.ts +19 -25
  56. package/dist/integrations/github/default-rules.d.ts.map +1 -1
  57. package/dist/integrations/github/default-rules.js +40 -41
  58. package/dist/integrations/github/default-rules.js.map +1 -1
  59. package/dist/integrations/github/issue-reconciler.js +6 -4
  60. package/dist/integrations/github/issue-reconciler.js.map +1 -1
  61. package/dist/integrations/github/provenance.d.ts +2 -2
  62. package/dist/integrations/github/provenance.d.ts.map +1 -1
  63. package/dist/integrations/github/provenance.js.map +1 -1
  64. package/dist/integrations/github/routes.d.ts.map +1 -1
  65. package/dist/integrations/github/routes.js +46 -1
  66. package/dist/integrations/github/routes.js.map +1 -1
  67. package/dist/integrations/github/rules.d.ts +3 -3
  68. package/dist/integrations/github/rules.d.ts.map +1 -1
  69. package/dist/integrations/github/rules.js +45 -39
  70. package/dist/integrations/github/rules.js.map +1 -1
  71. package/dist/integrations/gitlab/default-rules.d.ts +9 -16
  72. package/dist/integrations/gitlab/default-rules.d.ts.map +1 -1
  73. package/dist/integrations/gitlab/default-rules.js +29 -32
  74. package/dist/integrations/gitlab/default-rules.js.map +1 -1
  75. package/dist/integrations/gitlab/issue-reconciler.js +2 -2
  76. package/dist/integrations/gitlab/issue-reconciler.js.map +1 -1
  77. package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -1
  78. package/dist/integrations/gitlab/merge-request-reconciler.js +11 -11
  79. package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -1
  80. package/dist/integrations/gitlab/rules.d.ts.map +1 -1
  81. package/dist/integrations/gitlab/rules.js +2 -1
  82. package/dist/integrations/gitlab/rules.js.map +1 -1
  83. package/dist/integrations/incidentio/rules.d.ts.map +1 -1
  84. package/dist/integrations/incidentio/rules.js +1 -0
  85. package/dist/integrations/incidentio/rules.js.map +1 -1
  86. package/dist/integrations/issue-reconciler.d.ts +7 -7
  87. package/dist/integrations/issue-reconciler.d.ts.map +1 -1
  88. package/dist/integrations/issue-reconciler.js +11 -14
  89. package/dist/integrations/issue-reconciler.js.map +1 -1
  90. package/dist/integrations/jira/rules.d.ts.map +1 -1
  91. package/dist/integrations/jira/rules.js +1 -0
  92. package/dist/integrations/jira/rules.js.map +1 -1
  93. package/dist/integrations/linear/issue-reconciler.js +2 -2
  94. package/dist/integrations/linear/issue-reconciler.js.map +1 -1
  95. package/dist/integrations/linear/routes.d.ts.map +1 -1
  96. package/dist/integrations/linear/routes.js +1 -1
  97. package/dist/integrations/linear/routes.js.map +1 -1
  98. package/dist/integrations/linear/rules.d.ts.map +1 -1
  99. package/dist/integrations/linear/rules.js +2 -1
  100. package/dist/integrations/linear/rules.js.map +1 -1
  101. package/dist/integrations/slack/feed-publisher.d.ts +2 -2
  102. package/dist/integrations/slack/feed-publisher.d.ts.map +1 -1
  103. package/dist/integrations/slack/feed-publisher.js.map +1 -1
  104. package/dist/integrations/slack/slack.d.ts.map +1 -1
  105. package/dist/integrations/slack/slack.js.map +1 -1
  106. package/dist/packages/_internals/workspace/dist/index.js +1 -1
  107. package/dist/packages/_internals/workspace/dist/index.js.map +1 -1
  108. package/dist/routes/attention-activity.js +1 -1
  109. package/dist/routes/attention-activity.js.map +1 -1
  110. package/dist/routes/attention-parked.js.map +1 -1
  111. package/dist/routes/attention-providers.d.ts +4 -4
  112. package/dist/routes/attention-providers.d.ts.map +1 -1
  113. package/dist/routes/attention-providers.js +2 -2
  114. package/dist/routes/attention-providers.js.map +1 -1
  115. package/dist/routes/boards.js +1 -1
  116. package/dist/routes/config.d.ts +4 -4
  117. package/dist/routes/config.d.ts.map +1 -1
  118. package/dist/routes/config.js +6 -5
  119. package/dist/routes/config.js.map +1 -1
  120. package/dist/routes/contracts.d.ts +228 -5
  121. package/dist/routes/contracts.d.ts.map +1 -1
  122. package/dist/routes/contracts.js +118 -5
  123. package/dist/routes/contracts.js.map +1 -1
  124. package/dist/routes/intake-routes.d.ts +28 -0
  125. package/dist/routes/intake-routes.d.ts.map +1 -0
  126. package/dist/routes/intake-routes.js +199 -0
  127. package/dist/routes/intake-routes.js.map +1 -0
  128. package/dist/routes/intake.d.ts.map +1 -1
  129. package/dist/routes/intake.js +10 -1
  130. package/dist/routes/intake.js.map +1 -1
  131. package/dist/routes/projects.js +3 -2
  132. package/dist/routes/projects.js.map +1 -1
  133. package/dist/routes/surface.d.ts.map +1 -1
  134. package/dist/routes/surface.js +18 -7
  135. package/dist/routes/surface.js.map +1 -1
  136. package/dist/routes/work-items.d.ts +3 -0
  137. package/dist/routes/work-items.d.ts.map +1 -1
  138. package/dist/routes/work-items.js +10 -3
  139. package/dist/routes/work-items.js.map +1 -1
  140. package/dist/rules/binding-context.js +1 -1
  141. package/dist/rules/binding-context.js.map +1 -1
  142. package/dist/rules/decision-applicability.d.ts +2 -2
  143. package/dist/rules/decision-applicability.d.ts.map +1 -1
  144. package/dist/rules/decision-applicability.js +1 -1
  145. package/dist/rules/decision-applicability.js.map +1 -1
  146. package/dist/rules/dispatcher.d.ts +6 -8
  147. package/dist/rules/dispatcher.d.ts.map +1 -1
  148. package/dist/rules/dispatcher.js +109 -34
  149. package/dist/rules/dispatcher.js.map +1 -1
  150. package/dist/rules/processor.d.ts +2 -2
  151. package/dist/rules/processor.d.ts.map +1 -1
  152. package/dist/rules/processor.js +9 -4
  153. package/dist/rules/processor.js.map +1 -1
  154. package/dist/rules/review-source-tool.d.ts.map +1 -1
  155. package/dist/rules/review-source-tool.js +2 -4
  156. package/dist/rules/review-source-tool.js.map +1 -1
  157. package/dist/rules/rule-group.d.ts +1 -1
  158. package/dist/rules/rule-group.d.ts.map +1 -1
  159. package/dist/rules/rule-group.js +1 -0
  160. package/dist/rules/rule-group.js.map +1 -1
  161. package/dist/rules/start-coordinator.d.ts.map +1 -1
  162. package/dist/rules/start-coordinator.js +5 -2
  163. package/dist/rules/start-coordinator.js.map +1 -1
  164. package/dist/rules/tools.d.ts.map +1 -1
  165. package/dist/rules/tools.js +17 -14
  166. package/dist/rules/tools.js.map +1 -1
  167. package/dist/rules/transition-service.d.ts +8 -16
  168. package/dist/rules/transition-service.d.ts.map +1 -1
  169. package/dist/rules/transition-service.js +21 -28
  170. package/dist/rules/transition-service.js.map +1 -1
  171. package/dist/rules/types.d.ts +12 -4
  172. package/dist/rules/types.d.ts.map +1 -1
  173. package/dist/rules/types.js +9 -5
  174. package/dist/rules/types.js.map +1 -1
  175. package/dist/session/resource-migration.d.ts +3 -3
  176. package/dist/session/resource-migration.d.ts.map +1 -1
  177. package/dist/session/resource-migration.js.map +1 -1
  178. package/dist/session/self-review-gate.d.ts +13 -0
  179. package/dist/session/self-review-gate.d.ts.map +1 -0
  180. package/dist/session/self-review-gate.js +37 -0
  181. package/dist/session/self-review-gate.js.map +1 -0
  182. package/dist/session/work-item-repository.d.ts +4 -2
  183. package/dist/session/work-item-repository.d.ts.map +1 -1
  184. package/dist/session/work-item-repository.js +2 -2
  185. package/dist/session/work-item-repository.js.map +1 -1
  186. package/dist/skills/catalog.js +1 -1
  187. package/dist/storage/domains/audit/actions.d.ts +1 -0
  188. package/dist/storage/domains/audit/actions.d.ts.map +1 -1
  189. package/dist/storage/domains/audit/actions.js +7 -1
  190. package/dist/storage/domains/audit/actions.js.map +1 -1
  191. package/dist/storage/domains/boards/base.d.ts +72 -1
  192. package/dist/storage/domains/boards/base.d.ts.map +1 -1
  193. package/dist/storage/domains/boards/base.js +292 -8
  194. package/dist/storage/domains/boards/base.js.map +1 -1
  195. package/dist/storage/domains/boards/schemas.d.ts +8 -0
  196. package/dist/storage/domains/boards/schemas.d.ts.map +1 -1
  197. package/dist/storage/domains/boards/schemas.js +64 -1
  198. package/dist/storage/domains/boards/schemas.js.map +1 -1
  199. package/dist/storage/domains/comments/base.d.ts.map +1 -1
  200. package/dist/storage/domains/comments/base.js +15 -8
  201. package/dist/storage/domains/comments/base.js.map +1 -1
  202. package/dist/storage/domains/comments/domain.d.ts +2 -2
  203. package/dist/storage/domains/comments/domain.d.ts.map +1 -1
  204. package/dist/storage/domains/comments/domain.js +1 -1
  205. package/dist/storage/domains/comments/domain.js.map +1 -1
  206. package/dist/storage/domains/comments/feed-sync.d.ts +2 -2
  207. package/dist/storage/domains/comments/feed-sync.d.ts.map +1 -1
  208. package/dist/storage/domains/projects/base.d.ts +0 -3
  209. package/dist/storage/domains/projects/base.d.ts.map +1 -1
  210. package/dist/storage/domains/projects/base.js +0 -3
  211. package/dist/storage/domains/projects/base.js.map +1 -1
  212. package/dist/storage/domains/work-items/base.d.ts +94 -34
  213. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  214. package/dist/storage/domains/work-items/base.js +313 -161
  215. package/dist/storage/domains/work-items/base.js.map +1 -1
  216. package/dist/storage/domains/work-items/board-version.d.ts +2 -2
  217. package/dist/storage/domains/work-items/board-version.d.ts.map +1 -1
  218. package/dist/storage/domains/work-items/board-version.js +16 -5
  219. package/dist/storage/domains/work-items/board-version.js.map +1 -1
  220. package/dist/storage/domains/work-items/cards.d.ts +50 -0
  221. package/dist/storage/domains/work-items/cards.d.ts.map +1 -0
  222. package/dist/storage/domains/work-items/cards.js +284 -0
  223. package/dist/storage/domains/work-items/cards.js.map +1 -0
  224. package/dist/storage/domains/work-items/metrics.d.ts +2 -2
  225. package/dist/storage/domains/work-items/metrics.d.ts.map +1 -1
  226. package/dist/storage/domains/work-items/metrics.js.map +1 -1
  227. package/dist/storage/domains/work-items/work-item-schema.d.ts +117 -0
  228. package/dist/storage/domains/work-items/work-item-schema.d.ts.map +1 -0
  229. package/dist/storage/domains/work-items/work-item-schema.js +300 -0
  230. package/dist/storage/domains/work-items/work-item-schema.js.map +1 -0
  231. package/dist/tools/permissions.d.ts.map +1 -1
  232. package/dist/tools/permissions.js +2 -1
  233. package/dist/tools/permissions.js.map +1 -1
  234. package/dist/tools/read-tools.d.ts +4 -4
  235. package/dist/tools/read-tools.d.ts.map +1 -1
  236. package/dist/tools/read-tools.js +19 -9
  237. package/dist/tools/read-tools.js.map +1 -1
  238. package/dist/tools/sandbox-tools.d.ts +5 -0
  239. package/dist/tools/sandbox-tools.d.ts.map +1 -1
  240. package/dist/tools/sandbox-tools.js +68 -30
  241. package/dist/tools/sandbox-tools.js.map +1 -1
  242. package/dist/tools/session-tools.d.ts.map +1 -1
  243. package/dist/tools/session-tools.js.map +1 -1
  244. package/dist/tools/side-sessions.d.ts +2 -2
  245. package/dist/tools/side-sessions.d.ts.map +1 -1
  246. package/dist/tools/side-sessions.js.map +1 -1
  247. package/dist/tools/work-item-tools.d.ts +3 -0
  248. package/dist/tools/work-item-tools.d.ts.map +1 -1
  249. package/dist/tools/work-item-tools.js +14 -18
  250. package/dist/tools/work-item-tools.js.map +1 -1
  251. package/dist/work-items/create-work-item.d.ts +8 -5
  252. package/dist/work-items/create-work-item.d.ts.map +1 -1
  253. package/dist/work-items/create-work-item.js +54 -3
  254. package/dist/work-items/create-work-item.js.map +1 -1
  255. package/dist/work-items/providers/base.d.ts +22 -0
  256. package/dist/work-items/providers/base.d.ts.map +1 -0
  257. package/dist/work-items/providers/base.js +44 -0
  258. package/dist/work-items/providers/base.js.map +1 -0
  259. package/dist/work-items/providers/factory.d.ts +4 -0
  260. package/dist/work-items/providers/factory.d.ts.map +1 -0
  261. package/dist/work-items/providers/factory.js +13 -0
  262. package/dist/work-items/providers/factory.js.map +1 -0
  263. package/dist/work-items/providers/github.d.ts +3 -0
  264. package/dist/work-items/providers/github.d.ts.map +1 -0
  265. package/dist/work-items/providers/github.js +30 -0
  266. package/dist/work-items/providers/github.js.map +1 -0
  267. package/dist/work-items/providers/gitlab.d.ts +3 -0
  268. package/dist/work-items/providers/gitlab.d.ts.map +1 -0
  269. package/dist/work-items/providers/gitlab.js +35 -0
  270. package/dist/work-items/providers/gitlab.js.map +1 -0
  271. package/dist/work-items/providers/incidentio.d.ts +3 -0
  272. package/dist/work-items/providers/incidentio.d.ts.map +1 -0
  273. package/dist/work-items/providers/incidentio.js +23 -0
  274. package/dist/work-items/providers/incidentio.js.map +1 -0
  275. package/dist/work-items/providers/index.d.ts +8 -0
  276. package/dist/work-items/providers/index.d.ts.map +1 -0
  277. package/dist/work-items/providers/index.js +34 -0
  278. package/dist/work-items/providers/index.js.map +1 -0
  279. package/dist/work-items/providers/jira.d.ts +3 -0
  280. package/dist/work-items/providers/jira.d.ts.map +1 -0
  281. package/dist/work-items/providers/jira.js +16 -0
  282. package/dist/work-items/providers/jira.js.map +1 -0
  283. package/dist/work-items/providers/linear.d.ts +3 -0
  284. package/dist/work-items/providers/linear.d.ts.map +1 -0
  285. package/dist/work-items/providers/linear.js +24 -0
  286. package/dist/work-items/providers/linear.js.map +1 -0
  287. package/dist/work-items/providers/metadata-keys.d.ts +24 -0
  288. package/dist/work-items/providers/metadata-keys.d.ts.map +1 -0
  289. package/dist/work-items/providers/metadata-keys.js +84 -0
  290. package/dist/work-items/providers/metadata-keys.js.map +1 -0
  291. package/dist/work-items/providers/slack.d.ts +6 -0
  292. package/dist/work-items/providers/slack.d.ts.map +1 -0
  293. package/dist/work-items/providers/slack.js +15 -0
  294. package/dist/work-items/providers/slack.js.map +1 -0
  295. package/dist/work-items/providers/types.d.ts +23 -0
  296. package/dist/work-items/providers/types.d.ts.map +1 -0
  297. package/dist/work-items/providers/types.js +1 -0
  298. package/dist/work-items/split-migration.d.ts +51 -0
  299. package/dist/work-items/split-migration.d.ts.map +1 -0
  300. package/dist/work-items/split-migration.js +293 -0
  301. package/dist/work-items/split-migration.js.map +1 -0
  302. package/factory-skills/configure-factory-rules/SKILL.md +13 -17
  303. package/factory-skills/factory-self-review/SKILL.md +1 -1
  304. package/factory-skills/factory-triage/SKILL.md +3 -3
  305. package/package.json +12 -12
  306. package/dist/boards/work-transition-policy.d.ts +0 -3
  307. package/dist/boards/work-transition-policy.d.ts.map +0 -1
  308. package/dist/boards/work-transition-policy.js +0 -56
  309. package/dist/boards/work-transition-policy.js.map +0 -1
package/README.md CHANGED
@@ -29,6 +29,49 @@ A host application calls `MastraFactory.prepare()`, constructs its `Mastra` inst
29
29
 
30
30
  `prepare()` initializes the Factory-owned resources needed before Mastra is constructed. `finalize()` connects those resources to the completed host, including Factory routes, integrations, storage-backed behavior, and agent-controller features. Consumers should keep frontend concerns in `factory-ui` and host-specific environment or deployment wiring in `web` rather than adding them to this package.
31
31
 
32
+ ### Work items and board items
33
+
34
+ Factory stores provider facts separately from board activity:
35
+
36
+ - A **work item** stores provider-independent identity, title, and parent linkage in `factory_work_items`.
37
+ - A **source** stores provider identity, key, URL, state, labels, and author in `factory_work_item_sources`. A work item can have several sources; Factory-native work items have none.
38
+ - A **board item** tracks Factory's board, stages, sessions, revision, and process metadata in `factory_board_items`. Trust stamps such as `authorTrusted` and `factoryAuthored` stay here, not on the source.
39
+
40
+ Storage returns a `Card` that joins these records. Read sources from `card.workItem.sources`; read Factory process state from placement fields such as `card.acceptedAt`, `card.plansPreapprovedAt`, and `card.metadata`. A provider-only refresh updates the source's revision without changing the board item's revision, so it doesn't invalidate a pending stage move. Changes to any of these records invalidate the board list cache.
41
+
42
+ ```typescript
43
+ import type { Card } from '@mastra/factory';
44
+
45
+ function summarizeCard(card: Card) {
46
+ return {
47
+ id: card.id,
48
+ key: card.workItem.key,
49
+ title: card.workItem.title,
50
+ state: card.workItem.state,
51
+ labels: card.workItem.labels,
52
+ author: card.workItem.author,
53
+ board: card.board,
54
+ stages: card.stages,
55
+ };
56
+ }
57
+ ```
58
+
59
+ Each work item has one board item. Factory's card-to-card parent link is `parentBoardItemId`. Provider sub-issue ancestry is not populated into `card.workItem.parentWorkItemId`; migrated work items leave that field null. Existing card IDs, comments, subscriptions, run bindings, and `/work-items/:id` URLs stay unchanged. The work item gets its own ID. For one release, work-item API responses also retain the legacy top-level title, external source, and merged metadata fields.
60
+
61
+ #### Migration and dry run
62
+
63
+ Factory migrates existing cards before the work-items storage domain becomes ready. It keeps the legacy `work_items` table, copies each card into the new tables, and checks again on every startup. Unchanged legacy rows are no-ops; newer legacy rows are recopied. Deleted board items have tombstones so a later startup doesn't resurrect them. A legacy row whose source conflicts with another card ID is skipped and logged rather than preventing startup. Review the `skipped` entries in the boot log and reconcile those card IDs before retiring the legacy data; comments and subscriptions linked to a skipped ID won't have a visible card until the conflict is resolved.
64
+
65
+ For a database that has not cut over yet, inspect the migration without switching storage by setting this environment variable before starting Factory:
66
+
67
+ ```bash
68
+ MASTRA_FACTORY_WORK_ITEM_SPLIT=dry-run
69
+ ```
70
+
71
+ Dry-run mode is only for pre-cutover databases. Once any split board items exist, startup fails in dry-run mode rather than serving stale legacy rows. Before cutover, dry-run mode logs the planned copies and keeps reads and writes on the legacy table. Remove the variable and restart to perform the migration and switch to the new tables. Normal operation doesn't write back to the legacy table, so rolling back to an older Factory version hides cards and changes created after cutover.
72
+
73
+ During mixed-version deployments, a changed legacy row is recopied only while its split records still match the migration baseline. Conflicting split-side edits are skipped and logged rather than overwritten. Legacy claim values remain inert and are not copied into split storage. Avoid simultaneous writes from old and new versions during the cutover.
74
+
32
75
  ### Product telemetry
33
76
 
34
77
  Factory records `factory_web_activity` in Mastra's existing PostHog project for users signed in through the default `mastra-studio` auth provider. The browser sends only a known page category and an activity type to the authenticated `/web/telemetry/activity` endpoint. The server adds the verified account and deployment context.
@@ -55,6 +98,16 @@ MASTRA_TELEMETRY_DISABLED=true
55
98
 
56
99
  `1`, `true`, and `yes` are accepted, ignoring case and surrounding whitespace. Older servers without the explicit capability do not receive browser telemetry requests. Custom auth providers are outside this initial measurement scope until they have a stable identity namespace. No names, emails, tokens, prompts, input values, raw URLs, session replay, or anonymous browser identity are collected by this event. Account IDs are identifiable account data, not anonymous data.
57
100
 
101
+ ### Work items, sources and board placements
102
+
103
+ Factory separates the work (`factory_work_items`) from external facts (`factory_work_item_sources`) and placement/process state (`factory_board_items`). A work item can have several sources; current intake still creates separate work items for an issue and its pull request. Native cards have no external source. Sources are deduplicated per organization, project, provider and external ID, not claimed across projects. Board placements do not acquire, adopt, look up or release claims.
104
+
105
+ The split migration preserves legacy card IDs for comments, subscriptions, runs and URLs. It never rewrites the legacy `work_items` table. Board placements store `triage_type`, `accepted_at`, `autonomy_armed_at` and `plans_preapproved_at`; the existing consent and plan-grant rules apply to them unchanged. The unused `claim_key` column stays only in legacy storage and is never copied into the new tables. A deterministic legacy fingerprint detects changes even when an older replica does not update `updated_at`; conflicting newer split-side changes are reported rather than overwritten.
106
+
107
+ Board placements store `comment_count`, maintained by the comments domain's recount after creates, edits and soft deletes. Card reads, transitions and session cleanup do not load comment rows. Recounts invalidate the board-list cache without changing the placement revision or `updated_at`. The migration copies the legacy count; its first recount can correct that baseline. `feed_activity_at` remains an internal stale-recount guard and is not returned on `Card`.
108
+
109
+ There is no dual-write rollback: an older Factory version sees the legacy snapshot, not cards created or changed after cutover. Operators must inspect migration reports for skipped IDs before retiring old replicas.
110
+
58
111
  ### Stored boards
59
112
 
60
113
  Each project has two kinds of boards:
@@ -64,7 +117,7 @@ Each project has two kinds of boards:
64
117
 
65
118
  A project's boards are its code boards followed by its stored boards. The catalog, card creation through the API and Factory tools, transitions, the dispatcher, phase runs and the attention views all read that list. When a stored board has the same key as a code board, the code board wins: the stored board is hidden and the catalog reports `Stored board "<key>" is hidden by the code board with the same key.` Existing apps need no change, and Factory writes nothing to the database at startup.
66
119
 
67
- **Data model.** A stored board has a `key` (the ID cards reference as `board`), `name`, optional `description`, and ordered phases. A phase has a `key` (the stage ID), `name`, optional `description`, `kind`, and for working phases `runner` (`{ skill?, context?, instructions? }`), `autoStart`, `autoStartWhen` and `exitTool`, plus `nextPhases`. The first phase is the initial phase and must be `resting`. Saved boards pass the same checks `defineBoard()` applies, with the same messages. A stored board has no code behaviors: no handlers, transition policy, `sourceClosed`, or tool and event rules. Its working phases start their `runner` on entry.
120
+ **Data model.** A stored board has a `key` (the ID cards reference as `board`), `name`, optional `description`, and ordered phases. A phase has a `key` (the stage ID), `name`, optional `description`, `kind`, and for working phases `runner` (`{ skill?, context?, instructions? }`), `autoStart`, `autoStartWhen` and `exitTool`, plus `nextPhases` on any phase. The first phase is the initial phase and must be `resting`. Saved boards pass the same checks `defineBoard()` applies, with the same messages. A stored board has no code behaviors: no handlers, transition policy, `sourceClosed`, or tool and event rules. Its working phases start their `runner` on entry.
68
121
 
69
122
  `nextPhases` on a stored board: leaving it out (or `null`) on a resting or working phase allows moves to every other phase, `[]` allows none, and a terminal phase allows none unless it lists some.
70
123
 
@@ -78,7 +131,7 @@ A project's boards are its code boards followed by its stored boards. The catalo
78
131
 
79
132
  **Replicas.** Each board write replaces the project's board version. The replica that wrote it sees the change at once; other replicas notice within a second, the next time they touch that project.
80
133
 
81
- **Integrations.** Integration event rules, reconcilers and the code that files new cards from integrations read only the code boards. Intake bindings and label routes can target only code boards. Every card move goes through the transition service, which checks it against the project's boards.
134
+ **Integrations.** Integration event rules and reconcilers read only the code boards. Intake bindings and label routes can target only code boards. A project's [intake routes](#intake-routes) can also send new cards to its stored boards. Every card move goes through the transition service, which checks it against the project's boards.
82
135
 
83
136
  **Routes.** All need project membership; changes need an organization admin when auth is enabled, and are recorded in the audit log as `factory.board.created`, `updated` and `deleted`.
84
137
 
@@ -184,7 +237,7 @@ const intakeRule = context =>
184
237
 
185
238
  **Migration:** Remove former global `rules.work` and `rules.review` configuration. To customize Work or Review, set `includeDefaultBoards: false` and install a same-ID replacement, following the compatibility guidance above. Define lifecycle handlers on the replacement board's phases. Deployments that relied on automatic issue triage or review proposals on arrival should add an appropriate handler to the installed board.
186
239
 
187
- There is no global rules object. Every rule has one owner: boards own lifecycle handlers, transition policy, phase semantics, tool-result rules, and how their cards react to integration events; integrations own their default event handlers. The runtime only executes rules.
240
+ There is no global rules object. Every rule has one owner: boards own lifecycle handlers, topology (`nextPhases`), phase semantics, tool-result rules, and how their cards react to integration events; integrations own their default event handlers. The runtime only executes rules.
188
241
 
189
242
  ### Closing cards when their source closes
190
243
 
@@ -272,7 +325,7 @@ const deliveryBoard = defineBoard({
272
325
  });
273
326
  ```
274
327
 
275
- A board handler runs only for events bound to a card on that board. Events without a card yet — issue intake and filing a pull request's own Review card — always use the integration's handlers.
328
+ A board handler runs only for events bound to a card on that board. Events without a card yet — issue intake and filing a pull request's own card — always use the integration's handlers.
276
329
 
277
330
  For each event, Factory picks the handler in this order:
278
331
 
@@ -305,42 +358,43 @@ new MastraFactory({ storage, configVersion: 'v2', boards: [defineBoard({ ..., to
305
358
 
306
359
  Contexts that carried `ruleSetVersion` now carry `configVersion`. To add a tool-result rule to Work, declare it under `tools` on the installed replacement `work` board.
307
360
 
308
- ### Board transition policy
361
+ ### Where cards can move
309
362
 
310
- Boards own three separate concerns: topology declares which moves exist, `transitionPolicy` restricts those moves, and lifecycle handlers return entry/exit effects. The transition service uses the policy on the item's persisted, installed board, with no fallback to Work policy.
363
+ Boards own two separate concerns: topology (`nextPhases`) declares which moves exist, and lifecycle handlers return entry/exit effects. `nextPhases` binds everyone: people dragging cards on the Factory board, agents calling `factory_transition_work_item`, and board rules. A move it does not list is rejected with `invalid_transition`. Staying in the same phase is always allowed.
311
364
 
312
- Work automatically supplies its classification requirement, non-bug human-approval gate, and acceptance decision. Classified non-bug items without recorded acceptance require a human transition into Planning or Execute, regardless of their previous phase. Passing through Review does not grant approval. Historical items without an acceptance stamp also require this human transition; once acceptance is recorded, agents can continue the work. Review has no additional transition policy. Custom boards without a policy do not inherit Work's classification requirements or acceptance stamping, even if they use Work phase names or an agent role named `triage`.
365
+ The built-in Work board lists these moves:
313
366
 
314
- ```typescript
315
- import { defineBoard } from '@mastra/factory/boards';
316
- import type { BoardTransitionPolicy } from '@mastra/factory/boards';
367
+ | From | To | Why |
368
+ | --------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
369
+ | Intake | Triage, Planning, PR review, Done, Canceled | Never straight to Building or Review: a plan comes first, and Review is self-review of a build. PR review takes a pull request's own card; Done is where a completed source closes it. |
370
+ | Triage | Intake, Planning, Done, Canceled | A confirmed bug goes to Planning; any other open issue waits in Intake for a person. |
371
+ | Planning | Building, Intake, Done, Canceled | Into Building only through the approved plan (see `exitTool` below). |
372
+ | Building | Review, Planning, Done, Canceled | Planning again when the build shows the plan was wrong. |
373
+ | Review | Building, Intake, Done, Canceled | Self-review of the build: only Building leads here. It sends the card back to Building, or parks it in Intake at its round limit; a parked card resumes through Planning. |
374
+ | PR review | Intake, Done, Canceled | A pull request's own card: merged, closed, or set aside in Intake. It never reaches the builder's lanes. |
375
+ | Done | PR review | A review request on a finished pull request reopens its review. |
376
+ | Canceled | Intake, PR review | A canceled card is reopened in Intake; a reopened pull request goes back to PR review. |
317
377
 
318
- const releasePolicy: BoardTransitionPolicy = context => {
319
- if (context.toStage === 'build' && !context.isHumanTransition) {
320
- return { type: 'reject', code: 'approval_required', reason: 'A person must approve this release.' };
321
- }
322
- };
378
+ A pull request card only enters Intake, PR review, Done and Canceled, and only a pull request card enters PR review, for people too; Intake leads to both Triage and PR review and which one fits depends on the card, so this one rule stays in code (`workPullRequestCardRejection`). Planning ends with `submit_plan`, its exit tool: a plan waits for a person to approve it, and the approved plan moves the card to Building. Whether work is finished (no open pull request, no review asking for changes, an approving self-review) is not checked by the board: the build and self-review instructions tell the agent when to move a card to Done. Intake is resting, so nothing runs on a card parked there; an agent in another session could still move it.
323
379
 
324
- const releaseBoard = defineBoard({
325
- id: 'release',
326
- name: 'Release',
327
- initialPhase: 'approval',
328
- transitionPolicy: releasePolicy,
329
- phases: {
330
- approval: { name: 'Approval', kind: 'resting', nextPhases: ['build'] },
331
- build: { name: 'Build', kind: 'working', runner: { context: 'release' } },
332
- },
333
- });
334
- // Install through new MastraFactory({ storage, boards: [releaseBoard] }).
335
- ```
380
+ The Review board's `done` follows the same topology. Its review instructions keep Done for the merge: a reviewer records its verdict and leaves the card in Reviewing, and the merge event moves it to Done.
336
381
 
337
- A policy receives a deeply readonly snapshot of the item and transition, including actor, ingress, source, revision, persisted classification and acceptance, requested classification, and initial-entry/reentry flags. Dates are ISO strings. `isHumanTransition` requires both a human actor and human ingress; a deferred rule with a human actor is not a human transition.
382
+ **Triage.** The triage agent sends a confirmed bug to Planning, an open non-bug back to Intake, and closures to Done or Canceled. A person moving the card on from Intake is the approval; Factory records no classification or acceptance, and that move removes the `status: needs approval` label from the GitHub issue. On boot, Factory moves any card left in Triage by the old classify-and-accept rule back to Intake, once.
338
383
 
339
- Return `undefined` for no additional restriction, `{ type: 'allow' }` with optional `triageType` and `accept: true` intents, or `{ type: 'reject', code, reason }`. Policies cannot return lifecycle effects or arbitrary patches. Classification intents must come from the existing triage-agent path and match its requested verdict; acceptance intents require a human transition. Runtime validates these intents and applies them only in the revision-checked transaction after all lifecycle handlers allow the move.
384
+ **Migration:** `transitionPolicy` on `defineBoard()` is deprecated. It still runs for boards that set it, and `defineBoard()` logs one warning per board. Its context no longer carries a requested classification, and `triageType` and `accept` on an `allow` are ignored. Express the flow with each phase's `nextPhases` and `exitTool` instead:
340
385
 
341
- Policies must be side-effect-free. They run on initial entry, reentry, and same-stage requests, but completed replays use the stored result. Concurrent attempts can evaluate more than once. Policy and lifecycle evaluation share one timeout budget; a timeout does not cancel arbitrary work started by a callback.
386
+ ```typescript
387
+ // before
388
+ transitionPolicy: context => {
389
+ if (context.fromStage === 'backlog' && context.toStage === 'done') {
390
+ return { type: 'reject', code: 'invalid_transition', reason: 'Build before closing.' };
391
+ }
392
+ },
393
+ // after, on the backlog phase
394
+ nextPhases: ['build'],
395
+ ```
342
396
 
343
- A policy cannot bypass topology, ingress authorization, board ownership, external-author safety, revision checks, decision validation, replay handling, or atomic persistence. Returning `allow` is not an authorization override.
397
+ Rule contexts still carry `acceptedAt`, deprecated: it is the stamp on older cards and `null` for cards since.
344
398
 
345
399
  ### Board phase semantics
346
400
 
@@ -365,9 +419,11 @@ const releaseBoard = defineBoard({
365
419
 
366
420
  Work declares `intake` resting; `triage`, `planning`, `execute`, and `review` working with contexts `triage`, `work`, `work`, and `work`; `done` and `canceled` terminal. Review declares `intake` resting, `review` working with context `review`, and `done`/`canceled` terminal. The definition exposes the derived helpers `phaseKind`, `isWorking`, `isTerminal`, `roleForPhase`, and `phaseForRole`.
367
421
 
422
+ New pull requests and merge requests get their own card in Work Intake. The card's Review action moves it into Work's PR review phase (`pr-review`), where an independent reviewer runs `factory-review` (`factory-gitlab-review` for GitLab) in the card's own `review` session, or the re-review skill once a verdict is recorded. Work's Review phase is the builder's self-review of its own work, so a pull request card never enters it, and only pull request cards enter PR review. A pull request card only enters Intake, PR review, Done, and Canceled; merging moves it to Done and closing it unmerged to Canceled. Cards filed on the Review board before pull requests moved to Work stay there and keep working as before.
423
+
368
424
  Planning and Building on Work share the `work` session, so the builder keeps the planner's reasoning, branch and sandbox. Self-review still runs in its own `review` session. When the planner moves the card to Building, the build prompt is queued onto its own run, and the planner's run binding ends at that point: Factory tools it calls later in the same turn are rejected. When the builder moves a card back from Building to Planning, no new planning run starts; the builder keeps working in its run. When a person moves it back, Planning starts again, in the same `work` session. The old `plan` role still names Planning: a run requested or queued for `plan` starts Planning in a `plan` session, and the build then continues in that session. Cards planned before this change do the same.
369
425
 
370
- Consent, the external-author guard, kickoff seating, run-start lanes, terminal cleanup, and the closed-PR and issue sweeps all read the project's board; nothing name-matches phases. A board that reuses Work's phase names gets exactly what it declared. Persisted `board` is authoritative; rows without one are read as Review for pull requests and Work otherwise.
426
+ Consent, kickoff seating, run-start lanes, terminal cleanup, and the closed-PR and issue sweeps all read the project's board; nothing name-matches phases. A board that reuses Work's phase names gets exactly what it declared. Persisted `board` is authoritative; rows without one are read as Review for pull requests and Work otherwise.
371
427
 
372
428
  Unknown semantics fail closed. When the board is not installed or the phase is not declared: external-event transitions ask for consent, no sweep or cleanup treats the card as finished, and a rule-started run from rest with no lane for its role is rejected.
373
429
 
@@ -390,10 +446,12 @@ phases: {
390
446
  Boards and phases take `name` and an optional `description`. A phase lists the phases a card may move to in `nextPhases`. A working phase can also declare:
391
447
 
392
448
  - `runner` — `{ agentId?, skill?, context?, instructions? }`. `context` names the session the phase runs in (defaults to `work`); phases that share a context share a session. When the agent moves its own card into another phase of its context, that phase's `skill` still starts: its prompt is queued onto the agent's run. `skill` starts that skill when a card enters the phase from a source the phase has no `onEnter` handler for. It names a built-in Factory skill or one of your app's skills (see [Skills for custom boards](#skills-for-custom-boards)). `instructions` (up to 1,000 characters) are added to every run the phase starts. `agentId` defaults to `code-agent`, the only agent Factory runs today.
393
- - `autoStart` and `autoStartWhen` — the phase's runs start without a person's approval, for every card or only for cards matching the rule. Cards from outside the write-access circle still wait for a person.
394
- - `exitTool` — a tool name, or `{ id, autoApprove, autoApproveWhen }`, that ends the phase. The factory-phase signal tells the agent the phase ends when that tool succeeds and lists `nextPhases`; the agent then moves the card itself with `factory_transition_work_item`, so it picks where the card goes. The phase needs at least one next phase. `autoApprove` answers the person's approval the tool waits for, for every card or only cards matching `autoApproveWhen`. Factory sessions already run tools without asking, so today this matters for `submit_plan`: an auto-approved plan is accepted without a person. `defineBoard()` accepts `autoApprove` on any exit tool, and the catalog reports it, but on other tools it has no effect yet.
449
+ - `autoStart` and `autoStartWhen` — the phase's runs start without a person's approval, for every card or only for cards matching the rule. To start only trusted authors' cards, add `author.trusted equals true` to `autoStartWhen`; by default, [intake routes](#intake-routes) file GitHub and GitLab cards from outside the write-access circle in Work › Intake, where nothing starts on its own.
450
+ - `exitTool` — a tool name, or `{ id, autoApprove, autoApproveWhen }`, that ends the phase. The factory-phase signal tells the agent the phase ends when that tool succeeds and lists `nextPhases`; the agent then moves the card itself with `factory_transition_work_item`, so it picks where the card goes. When the board also has a tool rule for the exit tool (`tools`), the tool's success moves the card instead, and only a person can otherwise move it on to another working phase: an agent or board rule asking for that is rejected with `approval_required` unless the tool is auto-approved for the card. The phase needs at least one next phase. `autoApprove` answers the person's approval the tool waits for, for every card or only cards matching `autoApproveWhen`; it is the only way plans are approved without a person. Factory sessions already run tools without asking, so for `submit_plan` this means an auto-approved plan is accepted without a person. On other exit tools with a tool rule, `autoApprove` decides whether an agent may move the card on to another working phase without the tool. Work's Planning declares `{ id: 'submit_plan', autoApprove: false }`: every plan waits for a person, who moves the card or approves `submit_plan` in a signed-in chat.
395
451
 
396
- Rules test a card's facts: `item.labels`, `item.title`, `item.author`, `source.kind` and `source.integration`.
452
+ Rules test a card's facts: `item.labels`, `item.title`, `item.author`, `author.trusted`, `source.kind` and `source.integration`.
453
+
454
+ The example below is a custom board, not Work's behavior: it auto-starts and auto-approves planning only for cards labelled `effort:low`.
397
455
 
398
456
  ```typescript
399
457
  const LOW_EFFORT = {
@@ -413,7 +471,7 @@ const releaseBoard = defineBoard({
413
471
  runner: { context: 'build', skill: 'factory-plan' },
414
472
  autoStart: true,
415
473
  autoStartWhen: LOW_EFFORT,
416
- exitTool: { id: 'submit_plan', autoApprove: true },
474
+ exitTool: { id: 'submit_plan', autoApprove: true, autoApproveWhen: LOW_EFFORT },
417
475
  nextPhases: ['build', 'canceled'],
418
476
  },
419
477
  build: { name: 'Build', kind: 'working', runner: { context: 'build' }, nextPhases: ['done'] },
@@ -512,15 +570,6 @@ const releaseBoard = defineBoard<'release', Record<ReleasePhase, BoardPhaseDefin
512
570
  id: 'release',
513
571
  name: 'Release',
514
572
  initialPhase: 'backlog',
515
- transitionPolicy: context => {
516
- if (context.fromStage === 'backlog' && context.toStage === 'preparing' && !context.isHumanTransition) {
517
- return {
518
- type: 'reject',
519
- code: 'approval_required',
520
- reason: 'A person must start the release rehearsal.',
521
- };
522
- }
523
- },
524
573
  phases: {
525
574
  backlog: { name: 'Backlog', kind: 'resting', nextPhases: ['preparing'] },
526
575
  preparing: {
@@ -584,7 +633,7 @@ export function createFactory(config: Omit<MastraFactoryConfig, 'boards' | 'incl
584
633
 
585
634
  Use the host's normal `prepare()`, `new Mastra(...)`, and `finalize()` sequence. Change the hardcoded `includeDefaultBoards: true` in `createFactory` to `false` to run without Work or Review. Working roles name bindings on the shared Code Agent; they do not register separate agents. Factory has no per-role agent configuration option. The board's kickoff prompts supply the role-specific instructions.
586
635
 
587
- Create a card with `POST /web/factory/projects/:id/work-items`, passing `board: 'release'`, a title, and the GitHub issue's `externalSource`. The card starts in `backlog`. Then use `POST /web/factory/projects/:id/work-items/:workItemId/transition` with `board: 'release'`, `stage: 'preparing'`, the returned `expectedRevision`, a unique `requestId`, and a `cause`. Send these requests as an authorized user using the host's authentication. The human transition satisfies this board's policy and starts the preparer. Its bound tool advances to `build`; the publisher's completed check produces a deferred transition to `done`. Terminal entry revokes the binding and releases the sandbox. The Factory UI performs the same operations against installed boards (see below); verify the persisted card's board, phase, and deferred decision status either way.
636
+ Create a card with `POST /web/factory/projects/:id/work-items`, passing `board: 'release'`, a title, and the GitHub issue's `externalSource`. The card starts in `backlog`. Then use `POST /web/factory/projects/:id/work-items/:workItemId/transition` with `board: 'release'`, `stage: 'preparing'`, the returned `expectedRevision`, a unique `requestId`, and a `cause`. Send these requests as an authorized user using the host's authentication. The move starts the preparer. Its bound tool advances to `build`; the publisher's completed check produces a deferred transition to `done`. Terminal entry revokes the binding and releases the sandbox. The Factory UI performs the same operations against installed boards (see below); verify the persisted card's board, phase, and deferred decision status either way.
588
637
 
589
638
  Lifecycle, tool-result, and integration handlers may return `upsertLinkedWorkItem` targeting a different installed board. Linked cards enter that board's declared initial phase before moving to the requested phase. Existing cards cannot be reassigned to another board through either decision type. Targets are validated against their own installed board before acceptance and again before uncommitted deferred effects execute; a phase declared only on another board is not valid. Committed replay retains its recorded result and original `configVersion`.
590
639
 
@@ -608,6 +657,86 @@ Intake bindings are explicit. A Linear project, Jira project, or GitHub reposito
608
657
  - **Jira:** each connected-site project binding selects one installed board. One Jira project can feed several Factory projects: each binding takes either all issues or only issues carrying its labels (Settings › Intake › Jira routing, or `labels` on `PUT /web/intake/bindings`). Each label belongs to one binding per Jira project, and only one binding per project can take all issues. Label bindings win over the all-issues binding; an issue carrying labels of two label bindings goes to the binding created first. The split happens in the JQL each Factory sends, so every issue is filed in exactly one Factory. Labels only decide placement when an issue is first filed: relabelling an issue, or editing a binding's labels, does not move existing cards. Remove one Factory's binding with `DELETE /web/intake/bindings?integrationId=jira&sourceId=…&factoryProjectId=…`. The create-Factory flow can select a Jira project and initially binds it to Work. The browser checks routed projects for new issues every 30 seconds and on window focus; issues observed for a routed project materialize automatically as work items on the bound board (mirroring Linear), and closed issues transition their linked card to done or canceled. Both `JiraIntegration` and `PlatformJiraIntegration` reconcile imported cards every five minutes by default so status and metadata continue to refresh without an open browser, and both accept a `rules` option to replace or disable the `issueObserved` / `issueClosed` defaults. Agents on Jira-sourced runs get `jira_get_issue` and `jira_create_comment`. Set `MASTRACODE_JIRA_RECONCILE_ENABLED=false` to disable reconciliation or `MASTRACODE_JIRA_RECONCILE_INTERVAL_MS` to a positive millisecond interval to change its cadence.
609
658
  - **GitHub:** Settings › Intake › GitHub routing maps a label to a board per Factory project (`GET`/`PUT /web/intake/label-routes`). Labels match case-insensitively; unrouted issues go to Work. Saving a route relocates matching cards the same way, and `issues.labeled` / `issues.unlabeled` webhooks move a card between its routed board and Work while refreshing its label metadata. Routes apply to every repository linked to the project; label input is free text (no repository label autocomplete yet).
610
659
 
660
+ A project's [intake routes](#intake-routes) are checked before these bindings and label routes. The bindings and label routes apply only to cards no intake route places.
661
+
662
+ ### Intake routes
663
+
664
+ Each project has an ordered list of intake routes, managed through the API (there is no UI yet). A route decides where a new card lands: the first enabled route whose `when` matches the card names its board and phase. Routes place a card once, when it arrives. Nothing reads them again later.
665
+
666
+ **The default routes.** Every project starts with two routes. The first, `Outside authors wait in Intake`:
667
+
668
+ ```json
669
+ {
670
+ "when": {
671
+ "operator": "AND",
672
+ "conditions": [
673
+ { "field": "source.integration", "operator": "in", "value": ["github", "gitlab"] },
674
+ { "field": "author.trusted", "operator": "equals", "value": false }
675
+ ]
676
+ },
677
+ "target": { "boardKey": "work", "phaseKey": "intake" }
678
+ }
679
+ ```
680
+
681
+ It files GitHub and GitLab issues and pull requests from authors outside the write-access circle in Work › Intake, ahead of any label route or binding. Intake is a resting phase, so nothing starts there on its own. Any session, a person's or an agent's, can move the card on, and that move starts the next phase's run. Pushes to a pull request resting in Intake don't re-review it, and comments and edits on an issue never re-run Triage (see GitHub event rules). Trusted authors' cards, and Linear, Jira and incident.io cards (which carry no trust stamp), land where they did before. The second, `Pull requests go to PR review`, sends every other pull request and merge request (`source.kind equals pull_request`) to Work › PR review, where the reviewer runs once a person or the project's auto-run lets it start. Because it comes second, an outside author's pull request still waits in Intake. A pull request Factory opened for one of its own cards is filed by that card's rule, which no route re-places: it waits in Intake while the authoring card goes out for review.
682
+
683
+ The default routes are stored routes like any other: list them, edit them, disable them, reorder them or delete them through the API. Factory adds each one once, the first time the project's routes are read or written, appending it after the project's existing routes, and doesn't add it back after an admin deletes it. A project set up before the pull request route existed gets it this way too.
684
+
685
+ **Trust only decides where a card arrives.** Once a card is moved out of Intake, later input on it runs like on any card: a maintainer's push re-reviews an outside author's pull request. A phase that should only auto-start for trusted authors says so in its `autoStartWhen` (`author.trusted equals true`). Runs on untrusted cards still use their own isolated memory.
686
+
687
+ **Route shape.**
688
+
689
+ | Field | Meaning |
690
+ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
691
+ | `name` | Up to 120 characters. |
692
+ | `enabled` | Defaults to `true`. Disabled routes are skipped. |
693
+ | `when` | A rule over the card's facts (the same format as `autoStartWhen`). `null`, the default, matches every card. |
694
+ | `target` | Required. `{ boardKey, phaseKey? }` sets where matching cards land; without `phaseKey` they land in the board's first phase. The board must be installed in the project (code or stored), and the phase can't be terminal and must be reachable from the board's first phase. |
695
+
696
+ Routes are evaluated in `position` order (0 first). Rules can test these card facts: `item.labels`, `item.title`, `item.author`, `source.kind` (`issue`, `pull_request`, …), `source.integration` (`github`, `gitlab`, `linear`, `jira`, `incidentio`, …) and `author.trusted`. `author.trusted` is `true` when the card carries an `authorTrusted: true` or `factoryAuthored: true` stamp. GitHub and GitLab stamp `authorTrusted` from the author's repository permission, and a stamp that is missing counts as untrusted.
697
+
698
+ **Placement.** When an integration files a new card, or a card is created without naming a board (the `factory_create_work_item` tool, or `POST /web/factory/projects/:id/work-items` without `board`), the first enabled route that matches the card and whose board can take it decides where the card lands. On the built-in boards, a pull request lands on Work only in Intake or PR review, PR review takes only pull requests, and Review takes only pull requests; a route a card can't take is skipped and the next one is tried. If the route's phase no longer exists, or can no longer be reached from the first phase, the card lands in the first phase. A card routed to a later phase enters the first phase and then moves on through the transition service as a system move, recorded in the card's history. The route makes this move, not a person, so it gives no consent to start work; a run the phase asks for still needs a person or the project's auto-run. A board whose transition policy refuses system moves refuses the route, and the card is not filed. If no route places a card, the integration's binding, label route or default decides.
699
+
700
+ A card a route placed records the route's id in its `intakeRouteId` metadata and stays on that board afterwards: a GitHub label change, a reconcile that replays a known issue, a label route change, and rebinding the card's source all leave it there (its labels still update). An edited route moves no existing card. If filing a card stopped partway (it entered the board's first phase but the move to the route's phase failed), the retry keeps the card on that board: it moves to the phase the route names now, or stays in the first phase when the route was deleted, disabled or pointed at another board. Cards no route placed keep following label routes and bindings as before. An explicit placement wins over routes, for example:
701
+
702
+ - a maintainer's review request that files a pull request directly in PR review;
703
+ - a custom rule with `skipRules`;
704
+ - a child card a board's own rule files;
705
+ - a board named when the card is created. The board's **New card** button always names its board, so routes never place cards made there.
706
+
707
+ Not covered: a pull request routed to a board other than Work or Review no longer gets Factory review, because review requests and pushes only act on pull request cards on those boards.
708
+
709
+ **Routes.** Reading needs a signed-in user of the project's organization. Changes need an organization admin when auth is enabled. Deleting or reordering routes renumbers the routes after it and bumps their `revision`, so an update sent with an older `expectedRevision` is refused with 409 and must be retried with the current one. Changes are recorded in the audit log as `factory.intake_route.created`, `updated`, `deleted` and `reordered`.
710
+
711
+ | Method | Path | Body | Result |
712
+ | -------- | --------------------------------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
713
+ | `GET` | `/web/factory/projects/:id/intake-routes` | — | `intakeRoutes` in order. |
714
+ | `GET` | `/web/factory/projects/:id/intake-routes/:routeId` | — | The route. |
715
+ | `POST` | `/web/factory/projects/:id/intake-routes` | The route. | `201` and the route, added at the end. `422 unknown_board`, `unknown_phase`, `terminal_phase` or `unreachable_phase` for a target cards can't land on. `409 intake_route_limit` past 100 routes. |
716
+ | `PATCH` | `/web/factory/projects/:id/intake-routes/:routeId` | The fields to change, plus `expectedRevision`. | The route. |
717
+ | `DELETE` | `/web/factory/projects/:id/intake-routes/:routeId?expectedRevision=n` | — | `204`. |
718
+ | `POST` | `/web/factory/projects/:id/intake-routes/reorder` | `{ "ids": [...] }`: every route of the project, once each. | The routes in their new order. `409 intake_route_set_mismatch` if the list differs from the project's routes. |
719
+
720
+ A stale `expectedRevision` is refused with `409 revision_mismatch`. Each route reports `problems`, for example when its board has since been deleted. Such a route places no cards.
721
+
722
+ ```bash
723
+ # Send issues from trusted authors straight to Triage.
724
+ curl -X POST "$FACTORY_URL/web/factory/projects/$PROJECT/intake-routes" -H 'content-type: application/json' -d '{
725
+ "name": "Trusted issues to Triage",
726
+ "when": { "operator": "AND", "conditions": [
727
+ { "field": "author.trusted", "operator": "equals", "value": true },
728
+ { "field": "source.kind", "operator": "equals", "value": "issue" }
729
+ ] },
730
+ "target": { "boardKey": "work", "phaseKey": "triage" }
731
+ }'
732
+
733
+ # Let outside authors' issues go where label routes send them, instead of Intake.
734
+ curl -X PATCH "$FACTORY_URL/web/factory/projects/$PROJECT/intake-routes/$DEFAULT_ROUTE" -H 'content-type: application/json' -d '{
735
+ "enabled": false,
736
+ "expectedRevision": 1
737
+ }'
738
+ ```
739
+
611
740
  ### GitHub event rules
612
741
 
613
742
  Both `GithubIntegration` and `PlatformGithubIntegration` own their GitHub event handlers. Existing installations retain the defaults without additional configuration.
@@ -627,7 +756,7 @@ const github = new PlatformGithubIntegration({
627
756
  });
628
757
  ```
629
758
 
630
- Pass the integration in `MastraFactory`'s `integrations` array. The direct `GithubIntegration` accepts the same `rules` option alongside its GitHub App credentials. A function replaces one default handler without composing with it. `null` disables that event's handler, not authentication, webhook ingestion, or reconciliation bookkeeping. Omitted events and `undefined` retain their defaults. Each instance copies and freezes its resolved handler map; unknown event names and invalid handler values are rejected during construction.
759
+ Pass the integration in `MastraFactory`'s `integrations` array. The direct `GithubIntegration` accepts the same `rules` option alongside its GitHub App credentials. A function replaces one default handler without composing with it. `null` disables that event's handler, not authentication, webhook ingestion, or reconciliation bookkeeping. Omitted events and `undefined` retain their defaults. Triage runs once per card: the default `issueEdited`, `issueCommentCreated`, `issueCommentEdited` and `issueCommentDeleted` handlers are `null` (as are GitLab's `issueUpdated` and `issueCommented`), so a person moves the card into Triage or starts the run to triage again. Supply a function for one of those events to re-run Triage on it. Each instance copies and freezes its resolved handler map; unknown event names and invalid handler values are rejected during construction.
631
760
 
632
761
  When Platform credentials are present, `MastraFactory` installs a `PlatformGithubIntegration` itself, so a deploy can change its handlers without constructing one. Pass the same options under `platform.github` and they are forwarded to that integration's constructor:
633
762
 
@@ -675,7 +804,7 @@ const overrides = { github: { issueCommentCreated: { onEvent: null } } };
675
804
  const github = new PlatformGithubIntegration({ rules: { issueCommentCreated: null } });
676
805
  ```
677
806
 
678
- Board definitions own lifecycle, transition-policy, phase-semantics, and tool-result rules; nothing is configured globally. `MastraFactory({ configVersion })` supplies the deployment-owned label stamped on audit records and GitHub evaluations; it is not a hash of custom handler code, not ingress identity, and does not change delivery replay semantics. Update `configVersion` when changing handler behavior.
807
+ Board definitions own lifecycle, topology, phase-semantics, and tool-result rules; nothing is configured globally. `MastraFactory({ configVersion })` supplies the deployment-owned label stamped on audit records and GitHub evaluations; it is not a hash of custom handler code, not ingress identity, and does not change delivery replay semantics. Update `configVersion` when changing handler behavior.
679
808
 
680
809
  Handlers receive the existing typed GitHub context and return one decision or `undefined`. External titles, bodies, and comments remain untrusted data after webhook authentication. Custom handlers must preserve any required actor-permission checks explicitly.
681
810
 
@@ -713,7 +842,7 @@ A decision _without_ the flag that reaches a card which already exists keeps the
713
842
 
714
843
  Reconciliation re-applies label-derived placement. The issue sweep replays an open issue through the rules ingress whenever the issue's live labels differ from the card's stored ones — the `labeled`/`unlabeled` webhook may never have arrived (Factory was down, or the label was applied by something else). The deployment rule decides placement, exactly as at arrival, and the context carries the existing card on `item`, so one handler answers for both: a card still resting on the board's initial phase is landed the normal way, and a card that has already left it is re-placed with `skipRules` and no phase rule run. Cards parked by hand are untouched while an issue's labels are unchanged.
715
844
 
716
- A delivery that concerns two cards is evaluated once per card, each under its own ingress identity: every decision is committed against one card, at that card's revision. A merged pull request is the standard case — its Review card closes, and the built-in `pullRequestMerged` rule moves the Work item that wrote the code to Done. If that Work item has another pull request open, it stays where it is and its session is told which pull request is still out. An opening pull request is evaluated the same way. Its own Review card is filed by the arrival, the evaluation flagged `pullRequestIntake`, which is committed against the Work item that authored the pull request when provenance or a matching session branch names one; that binding is what links the new card to its item. The authoring item is then answered in a second evaluation of its own (`pullRequestIntake` unset), which is where a handler places the item that is now out for review. The built-in `pullRequestOpened` files the card only on the arrival and returns nothing for the authoring item.
845
+ A delivery that concerns two cards is evaluated once per card, each under its own ingress identity: every decision is committed against one card, at that card's revision. A merged pull request is the standard case — its own card closes, and the built-in `pullRequestMerged` rule moves the Work item that wrote the code to Done. If that Work item has another pull request open, it stays where it is and its session is told which pull request is still out. An opening pull request is evaluated the same way. Its own card is filed in Work Intake by the arrival, the evaluation flagged `pullRequestIntake`, which is committed against the Work item that authored the pull request when provenance or a matching session branch names one; that binding is what links the new card to its item. The authoring item is then answered in a second evaluation of its own (`pullRequestIntake` unset), which is where a handler places the item that is now out for review. The built-in `pullRequestOpened` files the pull request's card on the arrival. On the authoring item's evaluation it moves that Work item from Building to Review when the pull request is open and comes from a trusted author or from Factory; otherwise it returns nothing.
717
846
 
718
847
  ### GitHub CLI authentication in Factory sessions
719
848
 
@@ -824,7 +953,7 @@ A repository maintainer with write or admin access can start a Factory review fr
824
953
  @<factory-app> review
825
954
  ```
826
955
 
827
- `@<factory-app> re-review` is also accepted. Factory resolves `<factory-app>` from its observed or configured GitHub App login (without the `[bot]` suffix), so commands are ignored until that identity is known. The command creates and starts a first Review pass for a missing or Intake card, restarts a completed card with `factory-rereview`, and is a no-op while the card is already Reviewing. Other prose, quoted mentions, edited comments, and comments from untrusted users do not trigger a run.
956
+ `@<factory-app> re-review` is also accepted. Factory resolves `<factory-app>` from its observed or configured GitHub App login (without the `[bot]` suffix), so commands are ignored until that identity is known. The command creates and starts a first review pass for a missing or Intake card (new cards are filed on Work), restarts a completed card with `factory-rereview`, and is a no-op while a Reviewing card has no recorded verdict, because a pass is pending or running. Once a verdict is recorded, the card rests in Reviewing and the command re-enters it to start another pass with `factory-rereview`. Other prose, quoted mentions, edited comments, and comments from untrusted users do not trigger a run.
828
957
 
829
958
  ### Factory tools in user sessions
830
959
 
@@ -836,7 +965,7 @@ A person's own Factory session (a user session) gets tools to find, file and man
836
965
  | `factory_inspect_work_item` | `workItem` (id or `#number`) |
837
966
  | `factory_list_attention` | Optional `limit` (max 50) |
838
967
  | `factory_create_work_item` | `title`, `brief`, optional `repository` (`owner/name`, one this Factory links) |
839
- | `factory_update_work_item` | `workItem` plus any of `title`, `repository`, `parentWorkItem` (or `null` to detach), `plansPreapproved: true` |
968
+ | `factory_update_work_item` | `workItem` plus any of `title`, `repository`, `parentWorkItem` (or `null` to detach) |
840
969
  | `factory_subscribe_work_item` | `workItem` |
841
970
  | `factory_unsubscribe_work_item` | `workItem` |
842
971
  | `factory_transition_work_item` | `workItem`, `stage` |
@@ -853,7 +982,7 @@ Read tools and `factory_message_origin` are available on every turn. The other t
853
982
 
854
983
  `factory_switch_session_model` changes the model of a side, work item or review session you own in the same Factory, without recreating it. It refuses a model this server can't run. A running session switches right away; a stopped one uses the model on its next run.
855
984
 
856
- `factory_create_work_item` files the card as the caller in its board's first phase, exactly like **New card**, posts the brief as its first comment, and subscribes the session. Name the `repository` when the Factory links more than one: a run can't start on a card that doesn't say which. `factory_update_work_item` sets it afterwards, like choosing a repository on the card, and also edits the title, the parent item and plan pre-approval. Both refuse a repository the Factory doesn't link, and a card synced from an issue keeps the issue's repository. Stages, the board and role sessions aren't fields it edits; stages move with `factory_transition_work_item`. Subscriptions are stored per work item and session in the `factory_work_item_subscriptions` collection and are removed with the item, so any number of sessions can follow one item.
985
+ `factory_create_work_item` files the card as the caller where the project's [intake routes](#intake-routes) send it, or in the Work board's first phase when no route matches, posts the brief as its first comment, and subscribes the session. Name the `repository` when the Factory links more than one: a run can't start on a card that doesn't say which. `factory_update_work_item` sets it afterwards, like choosing a repository on the card, and also edits the title, the parent item and plan pre-approval. Both refuse a repository the Factory doesn't link, and a card synced from an issue keeps the issue's repository. Stages, the board and role sessions aren't fields it edits; stages move with `factory_transition_work_item`. Subscriptions are stored per work item and session in the `factory_work_item_subscriptions` collection and are removed with the item, so any number of sessions can follow one item.
857
986
 
858
987
  #### Messaging between sessions
859
988
 
@@ -1,5 +1,7 @@
1
1
  import type { RuleFacts } from '../rules/rule-group.js';
2
- import type { WorkItemRow } from '../storage/domains/work-items/base.js';
3
- /** What a phase condition (`autoStartWhen`, `exitTool.autoApproveWhen`) can test about a card. */
4
- export declare function cardRuleFacts(item: Pick<WorkItemRow, 'title' | 'metadata' | 'externalSource'>): RuleFacts;
2
+ import type { Card } from '../storage/domains/work-items/base.js';
3
+ /** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */
4
+ export declare function cardRuleFacts(item: Pick<Card, 'title' | 'metadata' | 'externalSource'> & {
5
+ workItem?: Pick<Card['workItem'], 'labels' | 'author'>;
6
+ }): RuleFacts;
5
7
  //# sourceMappingURL=card-facts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card-facts.d.ts","sourceRoot":"","sources":["../../src/boards/card-facts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEzE,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC,GAAG,SAAS,CAiBzG"}
1
+ {"version":3,"file":"card-facts.d.ts","sourceRoot":"","sources":["../../src/boards/card-facts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAGlE,sHAAsH;AACtH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC,GAAG;IAC1D,QAAQ,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC;CACxD,GACA,SAAS,CAsBX"}
@@ -1,13 +1,18 @@
1
+ import { authorTrusted } from "../rules/types.js";
2
+ import { workItemProviderAdapter } from "../work-items/providers/index.js";
1
3
  // src/boards/card-facts.ts
2
- /** What a phase condition (`autoStartWhen`, `exitTool.autoApproveWhen`) can test about a card. */
4
+ /** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */
3
5
  function cardRuleFacts(item) {
4
- const metadata = item.metadata ?? {};
5
- const labels = Array.isArray(metadata.labels) ? metadata.labels.filter((label) => typeof label === "string") : [];
6
6
  const source = item.externalSource;
7
+ const metadata = item.metadata ?? {};
8
+ const provider = source ? item.workItem ?? workItemProviderAdapter(source).toSource(source, metadata) : null;
9
+ const labels = source ? provider?.labels ?? [] : Array.isArray(metadata.labels) ? metadata.labels.filter((label) => typeof label === "string") : [];
10
+ const author = source ? provider?.author ?? null : typeof metadata.author === "string" ? metadata.author : null;
7
11
  return {
8
12
  "item.labels": labels,
9
13
  "item.title": item.title,
10
- ...typeof metadata.author === "string" ? { "item.author": metadata.author } : {},
14
+ ...author !== null ? { "item.author": author } : {},
15
+ "author.trusted": authorTrusted(item.metadata),
11
16
  ...source ? {
12
17
  "source.kind": source.type === "pull-request" ? "pull_request" : source.type,
13
18
  "source.integration": source.integrationId
@@ -1 +1 @@
1
- {"version":3,"file":"card-facts.js","names":[],"sources":["../../src/boards/card-facts.ts"],"sourcesContent":["import type { RuleFacts } from '../rules/rule-group.js';\nimport type { WorkItemRow } from '../storage/domains/work-items/base.js';\n\n/** What a phase condition (`autoStartWhen`, `exitTool.autoApproveWhen`) can test about a card. */\nexport function cardRuleFacts(item: Pick<WorkItemRow, 'title' | 'metadata' | 'externalSource'>): RuleFacts {\n const metadata = item.metadata ?? {};\n const labels = Array.isArray(metadata.labels)\n ? metadata.labels.filter((label): label is string => typeof label === 'string')\n : [];\n const source = item.externalSource;\n return {\n 'item.labels': labels,\n 'item.title': item.title,\n ...(typeof metadata.author === 'string' ? { 'item.author': metadata.author } : {}),\n ...(source\n ? {\n 'source.kind': source.type === 'pull-request' ? 'pull_request' : source.type,\n 'source.integration': source.integrationId,\n }\n : {}),\n };\n}\n"],"mappings":";;AAIA,SAAgB,cAAc,MAA6E;CACzG,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,MAAM,SAAS,MAAM,QAAQ,SAAS,MAAM,IACxC,SAAS,OAAO,QAAQ,UAA2B,OAAO,UAAU,QAAQ,IAC5E,CAAC;CACL,MAAM,SAAS,KAAK;CACpB,OAAO;EACL,eAAe;EACf,cAAc,KAAK;EACnB,GAAI,OAAO,SAAS,WAAW,WAAW,EAAE,eAAe,SAAS,OAAO,IAAI,CAAC;EAChF,GAAI,SACA;GACE,eAAe,OAAO,SAAS,iBAAiB,iBAAiB,OAAO;GACxE,sBAAsB,OAAO;EAC/B,IACA,CAAC;CACP;AACF"}
1
+ {"version":3,"file":"card-facts.js","names":[],"sources":["../../src/boards/card-facts.ts"],"sourcesContent":["import type { RuleFacts } from '../rules/rule-group.js';\nimport { authorTrusted } from '../rules/types.js';\nimport type { Card } from '../storage/domains/work-items/base.js';\nimport { workItemProviderAdapter } from '../work-items/providers/index.js';\n\n/** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */\nexport function cardRuleFacts(\n item: Pick<Card, 'title' | 'metadata' | 'externalSource'> & {\n workItem?: Pick<Card['workItem'], 'labels' | 'author'>;\n },\n): RuleFacts {\n const source = item.externalSource;\n const metadata = item.metadata ?? {};\n const provider = source ? (item.workItem ?? workItemProviderAdapter(source).toSource(source, metadata)) : null;\n const labels = source\n ? (provider?.labels ?? [])\n : Array.isArray(metadata.labels)\n ? metadata.labels.filter((label): label is string => typeof label === 'string')\n : [];\n const author = source ? (provider?.author ?? null) : typeof metadata.author === 'string' ? metadata.author : null;\n return {\n 'item.labels': labels,\n 'item.title': item.title,\n ...(author !== null ? { 'item.author': author } : {}),\n 'author.trusted': authorTrusted(item.metadata),\n ...(source\n ? {\n 'source.kind': source.type === 'pull-request' ? 'pull_request' : source.type,\n 'source.integration': source.integrationId,\n }\n : {}),\n };\n}\n"],"mappings":";;;;AAMA,SAAgB,cACd,MAGW;CACX,MAAM,SAAS,KAAK;CACpB,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,MAAM,WAAW,SAAU,KAAK,YAAY,wBAAwB,MAAM,CAAC,CAAC,SAAS,QAAQ,QAAQ,IAAK;CAC1G,MAAM,SAAS,SACV,UAAU,UAAU,CAAC,IACtB,MAAM,QAAQ,SAAS,MAAM,IAC3B,SAAS,OAAO,QAAQ,UAA2B,OAAO,UAAU,QAAQ,IAC5E,CAAC;CACP,MAAM,SAAS,SAAU,UAAU,UAAU,OAAQ,OAAO,SAAS,WAAW,WAAW,SAAS,SAAS;CAC7G,OAAO;EACL,eAAe;EACf,cAAc,KAAK;EACnB,GAAI,WAAW,OAAO,EAAE,eAAe,OAAO,IAAI,CAAC;EACnD,kBAAkB,cAAc,KAAK,QAAQ;EAC7C,GAAI,SACA;GACE,eAAe,OAAO,SAAS,iBAAiB,iBAAiB,OAAO;GACxE,sBAAsB,OAAO;EAC/B,IACA,CAAC;CACP;AACF"}
@@ -173,6 +173,7 @@ export interface BoardDefinition<BoardId extends string, PhaseId extends string>
173
173
  readonly tools: BoardToolRules;
174
174
  /** Integration event handlers for cards on this board; empty when the board declares none. */
175
175
  readonly events: BoardEventRules;
176
+ /** @deprecated Express the flow with each phase's `nextPhases` and `exitTool`; still enforced when set. */
176
177
  readonly transitionPolicy?: BoardTransitionPolicy;
177
178
  /** Where source-closed rules move a card; absent when the board opts out of auto-closing. */
178
179
  readonly sourceClosed?: BoardSourceClosed<PhaseId>;
@@ -201,6 +202,7 @@ type BoardConfig<BoardId extends string, Phases extends Record<string, BoardPhas
201
202
  phases: Phases;
202
203
  tools?: Record<string, BoardToolRule>;
203
204
  events?: BoardEventRules;
205
+ /** @deprecated Express the flow with each phase's `nextPhases` and `exitTool`; still enforced when set. */
204
206
  transitionPolicy?: BoardTransitionPolicy;
205
207
  sourceClosed?: {
206
208
  completed: keyof Phases & string;
@@ -1 +1 @@
1
- {"version":3,"file":"define-board.d.ts","sourceRoot":"","sources":["../../src/boards/define-board.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AASnE,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EAC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AC,CAEvF"}
@@ -176,6 +176,7 @@ const warnedBoards = /* @__PURE__ */ new Set();
176
176
  function deprecatedFields(config) {
177
177
  const found = [];
178
178
  if (config.title !== void 0 && config.name === void 0) found.push("title → name");
179
+ if (config.transitionPolicy !== void 0) found.push("transitionPolicy → phases.*.nextPhases and exitTool");
179
180
  for (const [phaseId, phase] of Object.entries(config.phases)) {
180
181
  if (phase.title !== void 0 && phase.name === void 0) found.push(`phases.${phaseId}.title → name`);
181
182
  if (phase.next !== void 0 && !phase.nextPhases?.includes(phase.next)) found.push(`phases.${phaseId}.next → nextPhases`);