@mastra/factory 0.27.0-alpha.2 → 0.27.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.
- package/README.md +94 -47
- package/dist/boards/card-facts.d.ts +4 -2
- package/dist/boards/card-facts.d.ts.map +1 -1
- package/dist/boards/card-facts.js +7 -4
- package/dist/boards/card-facts.js.map +1 -1
- package/dist/boards/define-board.d.ts +2 -0
- package/dist/boards/define-board.d.ts.map +1 -1
- package/dist/boards/define-board.js +1 -0
- package/dist/boards/define-board.js.map +1 -1
- package/dist/boards/intake-routing.d.ts +2 -2
- package/dist/boards/intake-routing.d.ts.map +1 -1
- package/dist/boards/intake-routing.js.map +1 -1
- package/dist/boards/phase-automation.d.ts +4 -4
- package/dist/boards/phase-automation.d.ts.map +1 -1
- package/dist/boards/phase-automation.js.map +1 -1
- package/dist/boards/pull-request-review.d.ts +0 -7
- package/dist/boards/pull-request-review.d.ts.map +1 -1
- package/dist/boards/pull-request-review.js +15 -14
- package/dist/boards/pull-request-review.js.map +1 -1
- package/dist/boards/relocate.d.ts +4 -4
- package/dist/boards/relocate.d.ts.map +1 -1
- package/dist/boards/relocate.js +1 -1
- package/dist/boards/relocate.js.map +1 -1
- package/dist/boards/review.d.ts.map +1 -1
- package/dist/boards/review.js +1 -2
- package/dist/boards/review.js.map +1 -1
- package/dist/boards/semantics.d.ts +8 -8
- package/dist/boards/semantics.d.ts.map +1 -1
- package/dist/boards/semantics.js.map +1 -1
- package/dist/boards/transition-policy.d.ts +7 -0
- package/dist/boards/transition-policy.d.ts.map +1 -1
- package/dist/boards/transition-policy.js.map +1 -1
- package/dist/boards/work.d.ts +6 -0
- package/dist/boards/work.d.ts.map +1 -1
- package/dist/boards/work.js +71 -25
- package/dist/boards/work.js.map +1 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +6 -15
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/integrations/github/acceptance-labels.d.ts +2 -2
- package/dist/integrations/github/acceptance-labels.d.ts.map +1 -1
- package/dist/integrations/github/acceptance-labels.js +2 -2
- package/dist/integrations/github/acceptance-labels.js.map +1 -1
- package/dist/integrations/github/default-rules.d.ts +5 -11
- package/dist/integrations/github/default-rules.d.ts.map +1 -1
- package/dist/integrations/github/default-rules.js +6 -22
- package/dist/integrations/github/default-rules.js.map +1 -1
- package/dist/integrations/github/issue-reconciler.js +6 -4
- package/dist/integrations/github/issue-reconciler.js.map +1 -1
- package/dist/integrations/github/provenance.d.ts +2 -2
- package/dist/integrations/github/provenance.d.ts.map +1 -1
- package/dist/integrations/github/provenance.js.map +1 -1
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +46 -1
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/rules.d.ts +3 -3
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +43 -39
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/gitlab/default-rules.d.ts +2 -9
- package/dist/integrations/gitlab/default-rules.d.ts.map +1 -1
- package/dist/integrations/gitlab/default-rules.js +2 -19
- package/dist/integrations/gitlab/default-rules.js.map +1 -1
- package/dist/integrations/gitlab/issue-reconciler.js +2 -2
- package/dist/integrations/gitlab/issue-reconciler.js.map +1 -1
- package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -1
- package/dist/integrations/gitlab/merge-request-reconciler.js +11 -11
- package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -1
- package/dist/integrations/gitlab/rules.d.ts.map +1 -1
- package/dist/integrations/gitlab/rules.js +2 -1
- package/dist/integrations/gitlab/rules.js.map +1 -1
- package/dist/integrations/incidentio/rules.d.ts.map +1 -1
- package/dist/integrations/incidentio/rules.js +1 -0
- package/dist/integrations/incidentio/rules.js.map +1 -1
- package/dist/integrations/issue-reconciler.d.ts +7 -7
- package/dist/integrations/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/issue-reconciler.js +11 -14
- package/dist/integrations/issue-reconciler.js.map +1 -1
- package/dist/integrations/jira/rules.d.ts.map +1 -1
- package/dist/integrations/jira/rules.js +1 -0
- package/dist/integrations/jira/rules.js.map +1 -1
- package/dist/integrations/linear/issue-reconciler.js +2 -2
- package/dist/integrations/linear/issue-reconciler.js.map +1 -1
- package/dist/integrations/linear/routes.d.ts.map +1 -1
- package/dist/integrations/linear/routes.js +1 -1
- package/dist/integrations/linear/routes.js.map +1 -1
- package/dist/integrations/linear/rules.d.ts.map +1 -1
- package/dist/integrations/linear/rules.js +2 -1
- package/dist/integrations/linear/rules.js.map +1 -1
- package/dist/integrations/slack/feed-publisher.d.ts +2 -2
- package/dist/integrations/slack/feed-publisher.d.ts.map +1 -1
- package/dist/integrations/slack/feed-publisher.js.map +1 -1
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js.map +1 -1
- package/dist/packages/_internals/workspace/dist/index.js +1 -1
- package/dist/routes/attention-activity.js +1 -1
- package/dist/routes/attention-activity.js.map +1 -1
- package/dist/routes/attention-parked.js.map +1 -1
- package/dist/routes/attention-providers.d.ts +4 -4
- package/dist/routes/attention-providers.d.ts.map +1 -1
- package/dist/routes/attention-providers.js +2 -2
- package/dist/routes/attention-providers.js.map +1 -1
- package/dist/routes/contracts.d.ts +33 -5
- package/dist/routes/contracts.d.ts.map +1 -1
- package/dist/routes/contracts.js +13 -4
- package/dist/routes/contracts.js.map +1 -1
- package/dist/routes/intake.d.ts.map +1 -1
- package/dist/routes/intake.js +1 -1
- package/dist/routes/intake.js.map +1 -1
- package/dist/routes/projects.js +3 -2
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/surface.js +4 -4
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +9 -3
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/binding-context.js +1 -1
- package/dist/rules/binding-context.js.map +1 -1
- package/dist/rules/decision-applicability.d.ts +2 -2
- package/dist/rules/decision-applicability.d.ts.map +1 -1
- package/dist/rules/decision-applicability.js +1 -1
- package/dist/rules/decision-applicability.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +2 -7
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +13 -17
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/processor.d.ts +2 -2
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +4 -2
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/review-source-tool.d.ts.map +1 -1
- package/dist/rules/review-source-tool.js +2 -4
- package/dist/rules/review-source-tool.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +5 -2
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/tools.d.ts.map +1 -1
- package/dist/rules/tools.js +7 -10
- package/dist/rules/tools.js.map +1 -1
- package/dist/rules/transition-service.d.ts +8 -16
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +19 -21
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +9 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +2 -2
- package/dist/rules/types.js.map +1 -1
- package/dist/session/resource-migration.d.ts +3 -3
- package/dist/session/resource-migration.d.ts.map +1 -1
- package/dist/session/resource-migration.js.map +1 -1
- package/dist/session/work-item-repository.d.ts +4 -2
- package/dist/session/work-item-repository.d.ts.map +1 -1
- package/dist/session/work-item-repository.js +2 -2
- package/dist/session/work-item-repository.js.map +1 -1
- package/dist/skills/catalog.js +1 -1
- package/dist/storage/domains/comments/base.d.ts.map +1 -1
- package/dist/storage/domains/comments/base.js +15 -8
- package/dist/storage/domains/comments/base.js.map +1 -1
- package/dist/storage/domains/comments/domain.d.ts +2 -2
- package/dist/storage/domains/comments/domain.d.ts.map +1 -1
- package/dist/storage/domains/comments/domain.js +1 -1
- package/dist/storage/domains/comments/domain.js.map +1 -1
- package/dist/storage/domains/comments/feed-sync.d.ts +2 -2
- package/dist/storage/domains/comments/feed-sync.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.d.ts +0 -3
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +0 -3
- package/dist/storage/domains/projects/base.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +99 -35
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +318 -170
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/storage/domains/work-items/board-version.d.ts +2 -2
- package/dist/storage/domains/work-items/board-version.d.ts.map +1 -1
- package/dist/storage/domains/work-items/board-version.js +16 -5
- package/dist/storage/domains/work-items/board-version.js.map +1 -1
- package/dist/storage/domains/work-items/cards.d.ts +57 -0
- package/dist/storage/domains/work-items/cards.d.ts.map +1 -0
- package/dist/storage/domains/work-items/cards.js +290 -0
- package/dist/storage/domains/work-items/cards.js.map +1 -0
- package/dist/storage/domains/work-items/metrics.d.ts +2 -2
- package/dist/storage/domains/work-items/metrics.d.ts.map +1 -1
- package/dist/storage/domains/work-items/metrics.js.map +1 -1
- package/dist/storage/domains/work-items/work-item-schema.d.ts +117 -0
- package/dist/storage/domains/work-items/work-item-schema.d.ts.map +1 -0
- package/dist/storage/domains/work-items/work-item-schema.js +300 -0
- package/dist/storage/domains/work-items/work-item-schema.js.map +1 -0
- package/dist/tools/read-tools.d.ts +4 -4
- package/dist/tools/read-tools.d.ts.map +1 -1
- package/dist/tools/read-tools.js +19 -9
- package/dist/tools/read-tools.js.map +1 -1
- package/dist/tools/session-tools.d.ts.map +1 -1
- package/dist/tools/session-tools.js.map +1 -1
- package/dist/tools/side-sessions.d.ts +2 -2
- package/dist/tools/side-sessions.d.ts.map +1 -1
- package/dist/tools/side-sessions.js.map +1 -1
- package/dist/tools/work-item-tools.d.ts.map +1 -1
- package/dist/tools/work-item-tools.js +12 -17
- package/dist/tools/work-item-tools.js.map +1 -1
- package/dist/work-items/create-work-item.d.ts +4 -4
- package/dist/work-items/create-work-item.d.ts.map +1 -1
- package/dist/work-items/create-work-item.js +65 -27
- package/dist/work-items/create-work-item.js.map +1 -1
- package/dist/work-items/providers/base.d.ts +22 -0
- package/dist/work-items/providers/base.d.ts.map +1 -0
- package/dist/work-items/providers/base.js +44 -0
- package/dist/work-items/providers/base.js.map +1 -0
- package/dist/work-items/providers/factory.d.ts +4 -0
- package/dist/work-items/providers/factory.d.ts.map +1 -0
- package/dist/work-items/providers/factory.js +13 -0
- package/dist/work-items/providers/factory.js.map +1 -0
- package/dist/work-items/providers/github.d.ts +3 -0
- package/dist/work-items/providers/github.d.ts.map +1 -0
- package/dist/work-items/providers/github.js +30 -0
- package/dist/work-items/providers/github.js.map +1 -0
- package/dist/work-items/providers/gitlab.d.ts +3 -0
- package/dist/work-items/providers/gitlab.d.ts.map +1 -0
- package/dist/work-items/providers/gitlab.js +35 -0
- package/dist/work-items/providers/gitlab.js.map +1 -0
- package/dist/work-items/providers/incidentio.d.ts +3 -0
- package/dist/work-items/providers/incidentio.d.ts.map +1 -0
- package/dist/work-items/providers/incidentio.js +23 -0
- package/dist/work-items/providers/incidentio.js.map +1 -0
- package/dist/work-items/providers/index.d.ts +8 -0
- package/dist/work-items/providers/index.d.ts.map +1 -0
- package/dist/work-items/providers/index.js +34 -0
- package/dist/work-items/providers/index.js.map +1 -0
- package/dist/work-items/providers/jira.d.ts +3 -0
- package/dist/work-items/providers/jira.d.ts.map +1 -0
- package/dist/work-items/providers/jira.js +16 -0
- package/dist/work-items/providers/jira.js.map +1 -0
- package/dist/work-items/providers/linear.d.ts +3 -0
- package/dist/work-items/providers/linear.d.ts.map +1 -0
- package/dist/work-items/providers/linear.js +24 -0
- package/dist/work-items/providers/linear.js.map +1 -0
- package/dist/work-items/providers/metadata-keys.d.ts +24 -0
- package/dist/work-items/providers/metadata-keys.d.ts.map +1 -0
- package/dist/work-items/providers/metadata-keys.js +84 -0
- package/dist/work-items/providers/metadata-keys.js.map +1 -0
- package/dist/work-items/providers/slack.d.ts +6 -0
- package/dist/work-items/providers/slack.d.ts.map +1 -0
- package/dist/work-items/providers/slack.js +15 -0
- package/dist/work-items/providers/slack.js.map +1 -0
- package/dist/work-items/providers/types.d.ts +23 -0
- package/dist/work-items/providers/types.d.ts.map +1 -0
- package/dist/work-items/providers/types.js +1 -0
- package/dist/work-items/split-migration.d.ts +51 -0
- package/dist/work-items/split-migration.d.ts.map +1 -0
- package/dist/work-items/split-migration.js +293 -0
- package/dist/work-items/split-migration.js.map +1 -0
- package/factory-skills/configure-factory-rules/SKILL.md +12 -16
- package/factory-skills/factory-self-review/SKILL.md +1 -1
- package/factory-skills/factory-triage/SKILL.md +3 -3
- package/package.json +15 -15
- package/dist/boards/work-transition-policy.d.ts +0 -3
- package/dist/boards/work-transition-policy.d.ts.map +0 -1
- package/dist/boards/work-transition-policy.js +0 -78
- 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
|
|
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
|
|
|
@@ -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,
|
|
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
|
|
|
@@ -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
|
-
###
|
|
361
|
+
### Where cards can move
|
|
309
362
|
|
|
310
|
-
Boards own
|
|
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
|
-
|
|
365
|
+
The built-in Work board lists these moves:
|
|
313
366
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,7 +419,7 @@ 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
|
|
|
368
|
-
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
|
|
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.
|
|
369
423
|
|
|
370
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.
|
|
371
425
|
|
|
@@ -393,10 +447,12 @@ Boards and phases take `name` and an optional `description`. A phase lists the p
|
|
|
393
447
|
|
|
394
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.
|
|
395
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.
|
|
396
|
-
- `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
|
|
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.
|
|
397
451
|
|
|
398
452
|
Rules test a card's facts: `item.labels`, `item.title`, `item.author`, `author.trusted`, `source.kind` and `source.integration`.
|
|
399
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`.
|
|
455
|
+
|
|
400
456
|
```typescript
|
|
401
457
|
const LOW_EFFORT = {
|
|
402
458
|
operator: 'AND',
|
|
@@ -415,7 +471,7 @@ const releaseBoard = defineBoard({
|
|
|
415
471
|
runner: { context: 'build', skill: 'factory-plan' },
|
|
416
472
|
autoStart: true,
|
|
417
473
|
autoStartWhen: LOW_EFFORT,
|
|
418
|
-
exitTool: { id: 'submit_plan', autoApprove: true },
|
|
474
|
+
exitTool: { id: 'submit_plan', autoApprove: true, autoApproveWhen: LOW_EFFORT },
|
|
419
475
|
nextPhases: ['build', 'canceled'],
|
|
420
476
|
},
|
|
421
477
|
build: { name: 'Build', kind: 'working', runner: { context: 'build' }, nextPhases: ['done'] },
|
|
@@ -514,15 +570,6 @@ const releaseBoard = defineBoard<'release', Record<ReleasePhase, BoardPhaseDefin
|
|
|
514
570
|
id: 'release',
|
|
515
571
|
name: 'Release',
|
|
516
572
|
initialPhase: 'backlog',
|
|
517
|
-
transitionPolicy: context => {
|
|
518
|
-
if (context.fromStage === 'backlog' && context.toStage === 'preparing' && !context.isHumanTransition) {
|
|
519
|
-
return {
|
|
520
|
-
type: 'reject',
|
|
521
|
-
code: 'approval_required',
|
|
522
|
-
reason: 'A person must start the release rehearsal.',
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
573
|
phases: {
|
|
527
574
|
backlog: { name: 'Backlog', kind: 'resting', nextPhases: ['preparing'] },
|
|
528
575
|
preparing: {
|
|
@@ -586,7 +633,7 @@ export function createFactory(config: Omit<MastraFactoryConfig, 'boards' | 'incl
|
|
|
586
633
|
|
|
587
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.
|
|
588
635
|
|
|
589
|
-
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
|
|
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.
|
|
590
637
|
|
|
591
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`.
|
|
592
639
|
|
|
@@ -631,11 +678,11 @@ Each project has an ordered list of intake routes, managed through the API (ther
|
|
|
631
678
|
}
|
|
632
679
|
```
|
|
633
680
|
|
|
634
|
-
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.
|
|
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.
|
|
635
682
|
|
|
636
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.
|
|
637
684
|
|
|
638
|
-
**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
|
|
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.
|
|
639
686
|
|
|
640
687
|
**Route shape.**
|
|
641
688
|
|
|
@@ -709,7 +756,7 @@ const github = new PlatformGithubIntegration({
|
|
|
709
756
|
});
|
|
710
757
|
```
|
|
711
758
|
|
|
712
|
-
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.
|
|
713
760
|
|
|
714
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:
|
|
715
762
|
|
|
@@ -757,7 +804,7 @@ const overrides = { github: { issueCommentCreated: { onEvent: null } } };
|
|
|
757
804
|
const github = new PlatformGithubIntegration({ rules: { issueCommentCreated: null } });
|
|
758
805
|
```
|
|
759
806
|
|
|
760
|
-
Board definitions own lifecycle,
|
|
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.
|
|
761
808
|
|
|
762
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.
|
|
763
810
|
|
|
@@ -918,7 +965,7 @@ A person's own Factory session (a user session) gets tools to find, file and man
|
|
|
918
965
|
| `factory_inspect_work_item` | `workItem` (id or `#number`) |
|
|
919
966
|
| `factory_list_attention` | Optional `limit` (max 50) |
|
|
920
967
|
| `factory_create_work_item` | `title`, `brief`, optional `repository` (`owner/name`, one this Factory links) |
|
|
921
|
-
| `factory_update_work_item` | `workItem` plus any of `title`, `repository`, `parentWorkItem` (or `null` to detach)
|
|
968
|
+
| `factory_update_work_item` | `workItem` plus any of `title`, `repository`, `parentWorkItem` (or `null` to detach) |
|
|
922
969
|
| `factory_subscribe_work_item` | `workItem` |
|
|
923
970
|
| `factory_unsubscribe_work_item` | `workItem` |
|
|
924
971
|
| `factory_transition_work_item` | `workItem`, `stage` |
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { RuleFacts } from '../rules/rule-group.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Card } from '../storage/domains/work-items/base.js';
|
|
3
3
|
/** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */
|
|
4
|
-
export declare function cardRuleFacts(item: Pick<
|
|
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;AAExD,OAAO,KAAK,EAAE,
|
|
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,15 +1,18 @@
|
|
|
1
1
|
import { authorTrusted } from "../rules/types.js";
|
|
2
|
+
import { workItemProviderAdapter } from "../work-items/providers/index.js";
|
|
2
3
|
// src/boards/card-facts.ts
|
|
3
4
|
/** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */
|
|
4
5
|
function cardRuleFacts(item) {
|
|
5
|
-
const metadata = item.metadata ?? {};
|
|
6
|
-
const labels = Array.isArray(metadata.labels) ? metadata.labels.filter((label) => typeof label === "string") : [];
|
|
7
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;
|
|
8
11
|
return {
|
|
9
12
|
"item.labels": labels,
|
|
10
13
|
"item.title": item.title,
|
|
11
|
-
...
|
|
12
|
-
"author.trusted": authorTrusted(metadata),
|
|
14
|
+
...author !== null ? { "item.author": author } : {},
|
|
15
|
+
"author.trusted": authorTrusted(item.metadata),
|
|
13
16
|
...source ? {
|
|
14
17
|
"source.kind": source.type === "pull-request" ? "pull_request" : source.type,
|
|
15
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 { authorTrusted } from '../rules/types.js';\nimport type {
|
|
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,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,mBAAmB,CAAC;AAU3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,KAAK,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAC1G,KAAK,0BAA0B,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAE/D,wEAAwE;AACxE,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;AAC1F,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;AAErE;;;GAGG;AACH,KAAK,oBAAoB,CAAC,SAAS,SAAS,MAAM,EAAE,OAAO,IAAI,QAAQ,CACrE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,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MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,2GAA2G;IAC3G,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,YAAY,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtF,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,KAAK;IACpC,IAAI,SAA0B;CACxC;AAyQD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,CAAC,OAAO,SAAS,MAAM,EAC5B,KAAK,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,EAChF,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,eAAe,CAAC,OAAO,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,CAEvF;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,0FAA0F;AAC1F,wBAAgB,sBAAsB,CACpC,KAAK,CAAC,OAAO,SAAS,MAAM,EAC5B,KAAK,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,EAChF,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,eAAe,CAAC,OAAO,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,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`);
|