@mastra/factory 0.28.0-alpha.3 → 0.28.0-alpha.4
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 +110 -56
- package/dist/boards/board-events.d.ts +1 -1
- package/dist/boards/board-events.d.ts.map +1 -1
- package/dist/boards/card-facts.d.ts +3 -1
- package/dist/boards/card-facts.d.ts.map +1 -1
- package/dist/boards/card-facts.js +26 -4
- package/dist/boards/card-facts.js.map +1 -1
- package/dist/boards/default-board.d.ts +2 -2
- package/dist/boards/default-board.js +2 -2
- package/dist/boards/default-board.js.map +1 -1
- package/dist/boards/define-board.d.ts +1 -1
- package/dist/boards/define-board.d.ts.map +1 -1
- package/dist/boards/define-board.js.map +1 -1
- package/dist/boards/intake-routing.d.ts +3 -5
- package/dist/boards/intake-routing.d.ts.map +1 -1
- package/dist/boards/intake-routing.js +3 -4
- package/dist/boards/intake-routing.js.map +1 -1
- package/dist/boards/project-boards.d.ts +18 -1
- package/dist/boards/project-boards.d.ts.map +1 -1
- package/dist/boards/project-boards.js +40 -3
- package/dist/boards/project-boards.js.map +1 -1
- package/dist/boards/semantics.d.ts +4 -4
- package/dist/boards/semantics.d.ts.map +1 -1
- package/dist/boards/semantics.js +8 -10
- package/dist/boards/semantics.js.map +1 -1
- package/dist/boards/work-migrations.d.ts +24 -1
- package/dist/boards/work-migrations.d.ts.map +1 -1
- package/dist/boards/work-migrations.js +97 -2
- package/dist/boards/work-migrations.js.map +1 -1
- package/dist/boards/work-routes.d.ts +6 -1
- package/dist/boards/work-routes.d.ts.map +1 -1
- package/dist/boards/work-routes.js +20 -6
- package/dist/boards/work-routes.js.map +1 -1
- package/dist/factory.d.ts +23 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +58 -43
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/integrations/github/default-rules.d.ts.map +1 -1
- package/dist/integrations/github/default-rules.js +3 -5
- package/dist/integrations/github/default-rules.js.map +1 -1
- package/dist/integrations/github/rules.d.ts +0 -6
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +23 -70
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/gitlab/routes.d.ts.map +1 -1
- package/dist/integrations/gitlab/routes.js +1 -3
- package/dist/integrations/gitlab/routes.js.map +1 -1
- package/dist/integrations/gitlab/rules.d.ts.map +1 -1
- package/dist/integrations/gitlab/rules.js +4 -9
- package/dist/integrations/gitlab/rules.js.map +1 -1
- package/dist/integrations/incidentio/agent-tools.js +5 -5
- package/dist/integrations/incidentio/agent-tools.js.map +1 -1
- package/dist/integrations/incidentio/default-rules.d.ts.map +1 -1
- package/dist/integrations/incidentio/default-rules.js.map +1 -1
- package/dist/integrations/incidentio/routes.d.ts +2 -2
- package/dist/integrations/incidentio/routes.d.ts.map +1 -1
- package/dist/integrations/incidentio/routes.js +10 -13
- package/dist/integrations/incidentio/routes.js.map +1 -1
- package/dist/integrations/incidentio/rules.d.ts +1 -3
- package/dist/integrations/incidentio/rules.d.ts.map +1 -1
- package/dist/integrations/incidentio/rules.js +1 -3
- package/dist/integrations/incidentio/rules.js.map +1 -1
- package/dist/integrations/jira/binding-scope.d.ts +5 -6
- package/dist/integrations/jira/binding-scope.d.ts.map +1 -1
- package/dist/integrations/jira/binding-scope.js +9 -11
- package/dist/integrations/jira/binding-scope.js.map +1 -1
- package/dist/integrations/jira/default-rules.d.ts.map +1 -1
- package/dist/integrations/jira/default-rules.js.map +1 -1
- package/dist/integrations/jira/routes.d.ts.map +1 -1
- package/dist/integrations/jira/routes.js +3 -5
- package/dist/integrations/jira/routes.js.map +1 -1
- package/dist/integrations/jira/rules.d.ts +1 -3
- package/dist/integrations/jira/rules.d.ts.map +1 -1
- package/dist/integrations/jira/rules.js +1 -3
- package/dist/integrations/jira/rules.js.map +1 -1
- package/dist/integrations/linear/default-rules.d.ts.map +1 -1
- package/dist/integrations/linear/default-rules.js.map +1 -1
- package/dist/integrations/linear/routes.d.ts.map +1 -1
- package/dist/integrations/linear/routes.js +11 -14
- package/dist/integrations/linear/routes.js.map +1 -1
- package/dist/integrations/linear/rules.d.ts +1 -3
- package/dist/integrations/linear/rules.d.ts.map +1 -1
- package/dist/integrations/linear/rules.js +1 -3
- package/dist/integrations/linear/rules.js.map +1 -1
- package/dist/integrations/platform/connect/session-tools.d.ts +5 -0
- package/dist/integrations/platform/connect/session-tools.d.ts.map +1 -1
- package/dist/integrations/platform/connect/session-tools.js +5 -0
- package/dist/integrations/platform/connect/session-tools.js.map +1 -1
- package/dist/integrations/platform/jira/routes.d.ts.map +1 -1
- package/dist/integrations/platform/jira/routes.js +3 -5
- package/dist/integrations/platform/jira/routes.js.map +1 -1
- package/dist/routes/automation-runs.d.ts +1 -1
- package/dist/routes/automation-runs.js.map +1 -1
- package/dist/routes/contracts.d.ts +3 -10
- package/dist/routes/contracts.d.ts.map +1 -1
- package/dist/routes/contracts.js +11 -9
- package/dist/routes/contracts.js.map +1 -1
- package/dist/routes/intake-routes.d.ts.map +1 -1
- package/dist/routes/intake-routes.js +6 -1
- package/dist/routes/intake-routes.js.map +1 -1
- package/dist/routes/intake.d.ts +0 -23
- package/dist/routes/intake.d.ts.map +1 -1
- package/dist/routes/intake.js +13 -310
- package/dist/routes/intake.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +1 -1
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +0 -2
- package/dist/routes/surface.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +0 -5
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +18 -22
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/rule-group.d.ts +1 -1
- package/dist/rules/rule-group.d.ts.map +1 -1
- package/dist/rules/rule-group.js +13 -5
- package/dist/rules/rule-group.js.map +1 -1
- package/dist/rules/transition-service.d.ts +2 -3
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +0 -1
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +7 -11
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js.map +1 -1
- package/dist/session/self-review-gate.d.ts +0 -2
- package/dist/session/self-review-gate.d.ts.map +1 -1
- package/dist/session/self-review-gate.js +1 -8
- package/dist/session/self-review-gate.js.map +1 -1
- package/dist/session/source-control-tools.d.ts +39 -13
- package/dist/session/source-control-tools.d.ts.map +1 -1
- package/dist/session/source-control-tools.js +54 -60
- package/dist/session/source-control-tools.js.map +1 -1
- package/dist/session/work-item-state-processor.d.ts +1 -4
- package/dist/session/work-item-state-processor.d.ts.map +1 -1
- package/dist/session/work-item-state-processor.js +5 -18
- package/dist/session/work-item-state-processor.js.map +1 -1
- package/dist/storage/domains/boards/base.d.ts +30 -8
- package/dist/storage/domains/boards/base.d.ts.map +1 -1
- package/dist/storage/domains/boards/base.js +43 -25
- package/dist/storage/domains/boards/base.js.map +1 -1
- package/dist/storage/domains/boards/schemas.js.map +1 -1
- package/dist/storage/domains/intake/base.d.ts +5 -45
- package/dist/storage/domains/intake/base.d.ts.map +1 -1
- package/dist/storage/domains/intake/base.js +11 -89
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/storage/domains/projects/base.d.ts +17 -9
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +15 -7
- package/dist/storage/domains/projects/base.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +7 -2
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +4 -0
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/work-items/providers/base.d.ts +4 -1
- package/dist/work-items/providers/base.d.ts.map +1 -1
- package/dist/work-items/providers/base.js +6 -1
- package/dist/work-items/providers/base.js.map +1 -1
- package/dist/work-items/providers/github.d.ts.map +1 -1
- package/dist/work-items/providers/github.js +2 -1
- package/dist/work-items/providers/github.js.map +1 -1
- package/dist/work-items/providers/gitlab.d.ts.map +1 -1
- package/dist/work-items/providers/gitlab.js +2 -1
- package/dist/work-items/providers/gitlab.js.map +1 -1
- package/dist/work-items/providers/jira.d.ts.map +1 -1
- package/dist/work-items/providers/jira.js +3 -2
- package/dist/work-items/providers/jira.js.map +1 -1
- package/dist/work-items/providers/linear.d.ts.map +1 -1
- package/dist/work-items/providers/linear.js +3 -2
- package/dist/work-items/providers/linear.js.map +1 -1
- package/dist/work-items/providers/types.d.ts +6 -0
- package/dist/work-items/providers/types.d.ts.map +1 -1
- package/factory-skills/configure-factory-rules/SKILL.md +2 -2
- package/factory-skills/factory-build/SKILL.md +5 -5
- package/factory-skills/factory-gitlab-rereview/SKILL.md +1 -1
- package/factory-skills/factory-gitlab-review/SKILL.md +1 -1
- package/factory-skills/factory-rereview/SKILL.md +2 -2
- package/factory-skills/factory-review/SKILL.md +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -176,7 +176,7 @@ const { inserted, updated, unchanged } = await factory.upsertBoard(bugs, { proje
|
|
|
176
176
|
|
|
177
177
|
**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.
|
|
178
178
|
|
|
179
|
-
**Integrations.** Integration event rules and reconcilers read only the code boards, which edits can't break: the initial phase and every phase with code behaviour are kept. Integration messages use the code names of phases.
|
|
179
|
+
**Integrations.** Integration event rules and reconcilers read only the code boards, which edits can't break: the initial phase and every phase with code behaviour are kept. Integration messages use the code names of phases. A project's [intake routes](#intake-routes) decide where new cards land, on its code or stored boards. Every card move goes through the transition service, which checks it against the project's boards.
|
|
180
180
|
|
|
181
181
|
**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`, `deleted` and `reset`.
|
|
182
182
|
|
|
@@ -222,7 +222,7 @@ curl -X POST "$FACTORY_URL/web/factory/projects/$PROJECT/boards/work/reset" -H '
|
|
|
222
222
|
-d "{\"expectedRevision\": $(curl -s "$FACTORY_URL/web/factory/projects/$PROJECT/boards/work" | jq .board.revision)}"
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
-
Admins can make the same edits in the Factory UI under **Settings →
|
|
225
|
+
Admins can make the same edits in the Factory UI under **Settings → Boards**, which also creates boards (from a Backlog → Doing → Done starter or a copy of an existing board), edits and deletes the ones the project created, and is reachable from **New board** in the sidebar and **Edit board** on a board.
|
|
226
226
|
|
|
227
227
|
### Migrating from `defineBoard()`
|
|
228
228
|
|
|
@@ -234,7 +234,7 @@ Admins can make the same edits in the Factory UI under **Settings → Work board
|
|
|
234
234
|
|
|
235
235
|
`includeDefaultBoards` decides whether projects get the built-in Work board.
|
|
236
236
|
|
|
237
|
-
Using only the built-in boards logs nothing. A board that cards reach only through the API, the Factory UI or Factory tools, and that needs no policies or rules, can move off code: write its definition under a new key into projects with `factory.upsertBoard()`, move its cards, then stop passing the code board. Keep passing a board while
|
|
237
|
+
Using only the built-in boards logs nothing. A board that cards reach only through the API, the Factory UI or Factory tools, and that needs no policies or rules, can move off code: write its definition under a new key into projects with `factory.upsertBoard()`, move its cards, then stop passing the code board. Keep passing a board while it needs code behaviors.
|
|
238
238
|
|
|
239
239
|
Removing `defineBoard()` still needs code behaviour that stored boards can reference by name, and integrations that read each project's boards. That work is tracked in [mastra-ai/mastra#28920](https://github.com/mastra-ai/mastra/issues/28920).
|
|
240
240
|
|
|
@@ -486,9 +486,11 @@ Work declares `intake` resting; `triage`, `planning`, `execute` and `pr-review`
|
|
|
486
486
|
| Building | `factory-build` in `work`, as a goal (up to 20 runs) | Builds the approved plan, runs its gates and pushes, then opens the change request and moves the card to Review. |
|
|
487
487
|
| Review | `factory-review` in `review` | Grants `factory_record_review_verdict` and `factory_review_source`. |
|
|
488
488
|
|
|
489
|
+
The review skills post their test results in a `## Factory test report` comment on the change request. Factory gives sessions no tool to publish a commit check; an app that wants one passes its own tool and builds it on `factory.reviewedChangeRequest()` (see [Mastra Connect and your own tools in sessions](#mastra-connect-and-your-own-tools-in-sessions)). Earlier releases had a per-project `reviewTestChecksEnabled` setting; `PATCH /web/factory/projects/:id` still accepts it for one release and ignores it.
|
|
490
|
+
|
|
489
491
|
#### Self-review is a board's choice
|
|
490
492
|
|
|
491
|
-
Work has no self-review phase: Building opens the change request itself. Self-review stays a capability any board can add. A working phase in the `review` context that grants only `factory_record_review_verdict` (not `factory_review_source`), and that the build phase can move into, is the board's self-review phase ([the pull request loop on any board](#the-pull-request-loop-on-any-board)). There `factory-self-review` tests the builder's pushed branch before any change request exists: requesting changes sends the card back to the build phase, approving opens the change request from the approved head and moves the card to the board's pull request review phase, and at its round limit it parks the card in the board's first phase. While the
|
|
493
|
+
Work has no self-review phase: Building opens the change request itself. Self-review stays a capability any board can add. A working phase in the `review` context that grants only `factory_record_review_verdict` (not `factory_review_source`), and that the build phase can move into, is the board's self-review phase ([the pull request loop on any board](#the-pull-request-loop-on-any-board)). There `factory-self-review` tests the builder's pushed branch before any change request exists: requesting changes sends the card back to the build phase, approving opens the change request from the approved head and moves the card to the board's pull request review phase, and at its round limit it parks the card in the board's first phase. While the card's board has a self-review phase, a change request opened from the build phase is refused until self-review approves; to skip self-review, remove the phase from the board.
|
|
492
494
|
|
|
493
495
|
```typescript
|
|
494
496
|
check: {
|
|
@@ -502,7 +504,7 @@ check: {
|
|
|
502
504
|
},
|
|
503
505
|
```
|
|
504
506
|
|
|
505
|
-
Projects stored before Work dropped its self-review phase
|
|
507
|
+
Projects stored before Work dropped its self-review phase still hold the `review` phase (named Review) in their Work row, which is their board. The one-time migration `self-review-switch-v1` follows the project's retired self-review setting. A project that had it on keeps the phase and runs it as before. A project that had it off loses the phase and every move into it, on every stored board, unless the board's code declares the phase, cards sit in it, the build phase can't reach pull request review without it, or it is another phase's only move; then Factory keeps it and logs a warning. While cards from before the work-item split are still being copied, the migration waits for a later load. To drop a kept phase, edit the board: remove the phase and the moves into it.
|
|
506
508
|
|
|
507
509
|
The agent that finishes a card's work cleans up the source issue's status labels (removes `status: needs triage`, `status: auto-triaged` and `status: needs approval`, adds `status: pending-close` and posts a done comment) before it moves the card to Done; a merged pull request that closes the issue moves the card there through the intake routes. Done itself starts nothing: earlier releases ran that cleanup on every entry into Done, so an issue card a merge or a person moves to Done now keeps its labels and gets no comment. The definition exposes the derived helpers `phaseKind`, `isWorking`, `isTerminal`, `roleForPhase`, and `phaseForRole`.
|
|
508
510
|
|
|
@@ -578,7 +580,24 @@ Boards and phases take `name` and an optional `description`. A phase lists the p
|
|
|
578
580
|
- `exitTool` — a tool name, or `{ id, autoApprove, autoApproveWhen }`, that ends the phase. The phase holds the card until that tool succeeds (for `submit_plan`, with an approved plan) in the session that works the card there: until then an agent or board rule asking to move the card on to another working phase is rejected with `approval_required`. Once it has succeeded during the card's current visit to the phase, the agent moves the card itself with `factory_transition_work_item` (the factory-phase signal tells it so and lists `nextPhases`), or a board tool rule for the exit tool (`tools`) moves it; the tool's success never moves the card by itself. A person can move the card at any time. The phase needs at least one next phase. `autoApprove` and `autoApproveWhen` only decide whether the tool approves itself, for every card or only cards matching the rule, or waits for a person; they are 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. Work's Planning declares `{ id: 'submit_plan', autoApprove: false }`: every plan waits for a person, who approves `submit_plan` in a signed-in chat (or moves the card), and then `factory-plan` moves the card to Building.
|
|
579
581
|
- `tools` — Factory tools the phase gives the session that works the card in it (the session whose context is the phase's `runner.context`): `factory_record_review_verdict` and `factory_review_source`. Tools follow the card: when it moves to a phase without them, the session loses them on its next turn, and a verdict tool call made after the card moved is refused. Every bound session keeps `factory_transition_work_item`. Work's Review grants both; a self-review phase, on a board that has one, grants only the verdict tool.
|
|
580
582
|
|
|
581
|
-
Rules test a card's facts
|
|
583
|
+
Rules test a card's facts, read from its work item as the provider reported it:
|
|
584
|
+
|
|
585
|
+
| Fact | What it is |
|
|
586
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
587
|
+
| `item.labels` | The item's labels. |
|
|
588
|
+
| `item.title` | The card's title. |
|
|
589
|
+
| `item.author` | Who opened the item. |
|
|
590
|
+
| `item.key` | The provider's key: `acme/app#42` (GitHub), `acme/app!7` (GitLab merge request), `ENG-12` (Linear), `OPS-3` (Jira), `INC-7` (incident.io). |
|
|
591
|
+
| `item.state` | The provider's state: `open`, `closed` or `merged` on GitHub and GitLab, the workflow state name (`In Progress`) on Linear and Jira. |
|
|
592
|
+
| `item.assignees` | Who the item is assigned to, as a list. |
|
|
593
|
+
| `item.pullRequest` | The number of the card's open pull or merge request, absent when it has none. |
|
|
594
|
+
| `author.trusted` | Whether the author is trusted (see below). |
|
|
595
|
+
| `source.kind` | `issue`, `pull_request`, … |
|
|
596
|
+
| `source.integration` | The integration that filed it: `github`, `gitlab`, `linear`, `jira`, `incidentio`, … |
|
|
597
|
+
| `source.provider` | The provider the work item comes from; the integration for every integration Factory ships. |
|
|
598
|
+
| `source.repository` | Where the item lives: the GitHub repository or GitLab project path (`acme/app`, `acme/platform/api`), the Linear team key (`ENG`) or the Jira project key (`OPS`). Absent for incident.io and manual cards. |
|
|
599
|
+
|
|
600
|
+
Strings compare case-insensitively, so `source.repository equals Acme/App` matches `acme/app`. A list fact (`item.labels`, `item.assignees`) is tested by its members: `item.assignees equals ada` matches when Ada is one of the assignees, and an empty list counts as missing, so `item.assignees exists` matches only assigned items. A fact the item doesn't have fails every operator except `not_exists`, `not_equals`, `not_contains` and `not_in`.
|
|
582
601
|
|
|
583
602
|
The example below is a custom board, not Work's behavior: it auto-starts and auto-approves planning only for cards labelled `effort:low`.
|
|
584
603
|
|
|
@@ -614,7 +633,7 @@ const releaseBoard = defineBoard({
|
|
|
614
633
|
|
|
615
634
|
### The `factory-work-item` signal
|
|
616
635
|
|
|
617
|
-
Every session bound to a card gets a `<factory-work-item>` state signal describing it, re-rendered only when the card, its sources
|
|
636
|
+
Every session bound to a card gets a `<factory-work-item>` state signal describing it, re-rendered only when the card, its sources or the binding change. It carries the card's key, title, URL, board and phase, next phases, labels, author and whether they're trusted, and the session's branch; its sources (issue and each pull or merge request, with state, head commit, a head branch that passes Factory's branch-name check, and the tool to fetch details); and Factory's state: whether the plan was approved, self-review rounds used, the last self-review and PR review verdicts with the commits they covered and findings, and the card's open change request. The session that reviews a pull request also gets the procedure to follow, the checkout steps and the pull request head to review. The source description is included, inside an `<untrusted-source-description>` block when an outside author wrote it. Comment threads are not included.
|
|
618
637
|
|
|
619
638
|
### Skills for custom boards
|
|
620
639
|
|
|
@@ -784,21 +803,21 @@ Custom phase signals and persisted tool-result ingestion use the item's installe
|
|
|
784
803
|
- Settings › Skills groups built-in skills under Work. For each custom board it shows the skill each phase runs (`runner.skill`) and the roles of phases that run no skill; those phases' kickoff instructions live in the board definition. Your app's other skills appear under App skills.
|
|
785
804
|
- Not yet board-aware: the Overview funnel and stage-hold metrics (Work-only), search scopes (Work sessions), and the automation toggles that are specific to Work triage and review. Custom-board cards still count toward in-flight totals and appear in activity and audit logs.
|
|
786
805
|
|
|
787
|
-
###
|
|
806
|
+
### Choose which sources feed a project
|
|
788
807
|
|
|
789
|
-
Intake bindings are explicit. A Linear project, Jira project, or GitHub repository is only offered as a candidate feed once it is bound to a
|
|
808
|
+
Intake bindings are explicit. A Linear project, Jira project, GitLab project, incident.io source or GitHub repository is only offered as a candidate feed once it is bound to a Factory project; nothing is materialized just by opening a board. A binding decides only which project a source feeds. Where its cards land is up to the project's [intake routes](#intake-routes): a new card is filed in the default board's first phase, and the first route that matches it places it. To send one repository, Linear team or Jira project to its own board, add a route with a `source.repository` condition. A route sees where an item lives, not which binding brought it in: two Linear projects in the same team share the team key, so a route can't send them to different boards.
|
|
790
809
|
|
|
791
|
-
- **Linear:** each project binding
|
|
792
|
-
- **Jira:**
|
|
793
|
-
- **GitHub:**
|
|
810
|
+
- **Linear:** each project binding feeds one Factory project.
|
|
811
|
+
- **Jira:** 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 binds it to the new Factory. 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 (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.
|
|
812
|
+
- **GitHub:** every repository linked to the project feeds it. To send one repository's issues and pull requests to another board, add an intake route with a `source.repository` condition; for labelled issues, an `item.labels` condition. A label change on an issue updates its card's labels and never moves the card.
|
|
794
813
|
|
|
795
|
-
|
|
814
|
+
Label routes (`GET`/`PUT /web/intake/label-routes`) and a binding's `board` were removed: use an intake route with any condition on the work item instead, such as `item.labels contains release` or `source.repository equals acme/app`. The label-route endpoints answer `410` with `label_routes_removed`, and a `board` an older client still sends on `PUT /web/intake/bindings` is ignored. Their stored rows stay, unread.
|
|
796
815
|
|
|
797
816
|
### Intake routes
|
|
798
817
|
|
|
799
|
-
Each project has an ordered list of intake routes
|
|
818
|
+
Each project has an ordered list of intake routes: the only thing that decides where a new card lands. Admins manage them in Settings › Work Intake › Intake routes or through the API, and anyone in the project can read them. A route names the board events it handles in `on`. A route on `work_item.created`, the default, decides where a new card lands: the first enabled route whose `when` matches the card names its board and phase. A route on `work_item.closed` or `work_item.reopened` decides where an existing card moves when its source closes or reopens (see [Status events](#status-events-move-existing-cards)).
|
|
800
819
|
|
|
801
|
-
**The default routes.** Every project starts with
|
|
820
|
+
**The default routes.** Every project starts with twelve routes: four for new cards, one of which files a pull request on its issue's card and the last of which takes everything else; three that move cards when their issue closes or reopens; and five that move cards when a pull request's status changes. The first, `Pull requests that close a waiting issue join its card`:
|
|
802
821
|
|
|
803
822
|
```json
|
|
804
823
|
{
|
|
@@ -831,7 +850,7 @@ It adds a trusted author's pull request to the card of the issue it closes while
|
|
|
831
850
|
}
|
|
832
851
|
```
|
|
833
852
|
|
|
834
|
-
It files GitHub and GitLab issues and pull requests from authors outside the write-access circle in Work › Intake, ahead of
|
|
853
|
+
It files GitHub and GitLab issues and pull requests from authors outside the write-access circle in Work › Intake, ahead of the routes after it. 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 third, `Pull requests go to Review`, sends every other pull request and merge request (`source.kind equals pull_request`) to Work › Review, where the reviewer runs once a person starts it, or on its own when the phase has `autoStart`. Because it comes after the outside-authors route, 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 is attached to the authoring card, which goes out for review. Pull requests opened before attaching existed keep their own card.
|
|
835
854
|
|
|
836
855
|
The other three move Work cards when their issue's status changes:
|
|
837
856
|
|
|
@@ -843,38 +862,38 @@ The other three move Work cards when their issue's status changes:
|
|
|
843
862
|
|
|
844
863
|
Five more move Work cards when a pull request's status changes. Each agrees with the move Work's default pull request rule already makes, so out of the box nothing changes; retarget one to send those cards elsewhere:
|
|
845
864
|
|
|
846
|
-
| Route | `on` | `when` | Target
|
|
847
|
-
| ------------------------------------------------------------- | ----------------------------------- | ------------------------------------- |
|
|
848
|
-
| `Merged pull requests go to Done` | `["pull_request.merged"]` | none | Work › Done
|
|
849
|
-
| `Pull requests closed unmerged go to Canceled` | `["pull_request.closed"]` | `source.kind equals pull_request` | Work › Canceled
|
|
850
|
-
| `Issues whose pull request closed unmerged go back to Intake` | `["pull_request.closed"]` | `source.kind not_equals pull_request` | Work › Intake
|
|
851
|
-
| `Pushes to a reviewed pull request re-review it` | `["pull_request.synchronized"]` | none | Work › Review
|
|
852
|
-
| `Requested reviews go to Review` | `["pull_request.review_requested"]` | none | Work › Review
|
|
865
|
+
| Route | `on` | `when` | Target |
|
|
866
|
+
| ------------------------------------------------------------- | ----------------------------------- | ------------------------------------- | --------------- |
|
|
867
|
+
| `Merged pull requests go to Done` | `["pull_request.merged"]` | none | Work › Done |
|
|
868
|
+
| `Pull requests closed unmerged go to Canceled` | `["pull_request.closed"]` | `source.kind equals pull_request` | Work › Canceled |
|
|
869
|
+
| `Issues whose pull request closed unmerged go back to Intake` | `["pull_request.closed"]` | `source.kind not_equals pull_request` | Work › Intake |
|
|
870
|
+
| `Pushes to a reviewed pull request re-review it` | `["pull_request.synchronized"]` | none | Work › Review |
|
|
871
|
+
| `Requested reviews go to Review` | `["pull_request.review_requested"]` | none | Work › Review |
|
|
853
872
|
|
|
854
873
|
They replace the close handlers each integration used to apply on its own, so a closed GitHub, GitLab, Linear, Jira or incident.io issue lands where it did before, but you can now edit or disable that move. To stop closes from moving Work cards, disable both close routes. Deleting them does not stop the move: with no route left that handles closes, Work's `sourceClosed` mapping moves closed cards to Done or Canceled again.
|
|
855
874
|
|
|
856
875
|
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. The closing-issue route is the exception: it goes first, since its condition only matches trusted authors' pull requests that close an issue. Deleting a default is permanent: recreate it by hand to get it back. A project set up before the pull request, closing-issue or close and reopen routes existed gets them this way too.
|
|
857
876
|
|
|
877
|
+
**Everything else.** The last default route, `Everything else goes to Work › Intake`, has no condition and sends every new card the routes before it don't take to Work › Intake. Point it at another board to send there every new card the routes above it don't take, or use **Send new cards to** in Settings, which also copies the close, reopen and pull request routes onto that board: a status event only moves a card through routes on the card's own board. Routes above it still apply, so with the defaults, outside authors' items still wait in Work › Intake and pull requests still go to Work › Review; disable or edit those routes to send them elsewhere too. A new route that places new cards goes just ahead of the first enabled route with no condition that takes every new card, whoever added it, so it can match. A route that only handles status events goes at the end. A project with no route left that places a card files it in the default board's first phase.
|
|
878
|
+
|
|
858
879
|
**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.
|
|
859
880
|
|
|
860
881
|
**Route shape.**
|
|
861
882
|
|
|
862
|
-
| Field
|
|
863
|
-
|
|
|
864
|
-
| `name`
|
|
865
|
-
| `enabled`
|
|
866
|
-
| `on`
|
|
867
|
-
| `when`
|
|
868
|
-
| `target`
|
|
869
|
-
| `allowWorkingPhase` | Defaults to `false`. A status move into a working phase (one that starts runs, such as Triage) is refused unless this is `true`, so a reopened card doesn't re-run Triage by accident. |
|
|
883
|
+
| Field | Meaning |
|
|
884
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
885
|
+
| `name` | Up to 120 characters. |
|
|
886
|
+
| `enabled` | Defaults to `true`. Disabled routes are skipped. |
|
|
887
|
+
| `on` | The board events the route handles: `work_item.created` (the default), `work_item.closed`, `work_item.reopened`, `pull_request.opened`, `pull_request.synchronized`, `pull_request.review_requested`, `pull_request.merged` and `pull_request.closed`. Each at most once. `work_item.commented` and `work_item.edited` are activity, which never moves a card, so a route can't name them. |
|
|
888
|
+
| `when` | A rule over the card's facts (the same format as `autoStartWhen`). `null`, the default, matches every card. A route that handles more than `work_item.created` can also test `event.type` and `event.reason`. |
|
|
889
|
+
| `target` | Required. `{ boardKey, phaseKey?, joinClosedIssue? }` 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). For a route on `work_item.created`, the phase can't be terminal and must be reachable from the board's first phase; a route that only moves existing cards can target any phase, terminal ones included. With `joinClosedIssue: true`, a pull request is added to the card of the issue it closes instead of getting its own card, and that card moves to `phaseKey` when the board allows the move (otherwise it stays put); the route is skipped when there is no such card on `boardKey`, and its `on` must be `["work_item.created"]` alone. An update that sets `target` replaces the whole target, so repeat `joinClosedIssue: true` to keep a route joining. |
|
|
870
890
|
|
|
871
|
-
Routes are evaluated in `position` order (0 first). Rules can test
|
|
891
|
+
Routes are evaluated in `position` order (0 first). Rules can test the [card facts](#phase-runners-automatic-starts-and-exit-tools) phase rules test, `source.repository` and `item.labels` among them. For pull requests, routes can also test `pullRequest.closesIssue` (`true` when the body closes an issue that has a usable card), `closedIssue.phase` and `closedIssue.hasPullRequest` (that card's phase and whether it already carries a pull request). These three are route-only: phase rules can't use them. A route that lets a pull request join a card already in its review phase doesn't start a second review: the review in progress keeps its pull request, and the new one is reviewed on its next push by a trusted author, or on a review request once the current pass has a verdict. That's why the default route requires `closedIssue.hasPullRequest` to be `false`. `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.
|
|
872
892
|
|
|
873
|
-
**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 Review and Review takes only cards with a pull request; 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
|
|
893
|
+
**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 Review and Review takes only cards with a pull request; 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 unless the phase starts on its own (`autoStart`). A board whose transition policy refuses system moves refuses the route, and the card is not filed. The board and phase an integration's rule names don't count: every integration files a new card in the default board's first phase, and the routes take it from there. If no route places it, it stays there.
|
|
874
894
|
|
|
875
|
-
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,
|
|
895
|
+
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, 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. An explicit placement wins over routes, for example:
|
|
876
896
|
|
|
877
|
-
- a maintainer's review request that files a pull request directly in Review;
|
|
878
897
|
- a custom rule with `skipRules`;
|
|
879
898
|
- a child card a board's own rule files;
|
|
880
899
|
- 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.
|
|
@@ -888,9 +907,9 @@ Every integration reports issue status changes with the same names: `work_item.c
|
|
|
888
907
|
When one of these arrives for a card that already exists, the first enabled route on the card's board whose `on` names the event and whose `when` matches the card and the event moves the card to the route's phase:
|
|
889
908
|
|
|
890
909
|
- The move is a system move made by the route, recorded in the card's history (`by: intake-route:<routeId>`) and in the audit log (`factory.work_item.stage_moved` with `cause: event_route`, made by actor `intake-route:<routeId>`).
|
|
891
|
-
- The move clears the card's armed autonomy. A provider event is not a person's go-ahead, so
|
|
910
|
+
- The move clears the card's armed autonomy. A provider event is not a person's go-ahead, so the move alone does not start a run: whether the phase's run starts is the phase's call (next bullet).
|
|
892
911
|
- It skips the board's `nextPhases`, so a reopened card can leave Done. It still checks that the phase exists and that the board's card lanes take the card (an issue card enters Review only once it has a pull request).
|
|
893
|
-
- It
|
|
912
|
+
- It can move the card into any phase, working ones such as Triage included. On a board with a pull request loop, a pull request card still enters only the review phase among working phases. The phase's run then starts when the phase has `autoStart` (and a matching `autoStartWhen`), or when it re-reviews a pull request Factory opened; otherwise it is proposed for a person to approve. Give Triage `autoStart` to have a reopen route into Triage re-run Triage straight away.
|
|
894
913
|
- A move into a working or resting phase waits for a run in flight on the card to end, then moves the card. While it waits it goes back to the queue, so it never holds a dispatch slot.
|
|
895
914
|
- The source's last status wins. When an issue is closed and reopened before Factory applies the close, the close is dropped and the card stays where it was.
|
|
896
915
|
- A move into a terminal phase doesn't wait: it runs terminal cleanup like any other, so a session still running on the card is aborted at once, as a close always has.
|
|
@@ -959,11 +978,10 @@ curl -X POST "$FACTORY_URL/web/factory/projects/$PROJECT/intake-routes" -H 'cont
|
|
|
959
978
|
"when": { "operator": "AND", "conditions": [
|
|
960
979
|
{ "field": "item.labels", "operator": "contains", "value": "bug" }
|
|
961
980
|
] },
|
|
962
|
-
"target": { "boardKey": "work", "phaseKey": "triage" }
|
|
963
|
-
"allowWorkingPhase": true
|
|
981
|
+
"target": { "boardKey": "work", "phaseKey": "triage" }
|
|
964
982
|
}'
|
|
965
983
|
|
|
966
|
-
# Let outside authors' issues go where
|
|
984
|
+
# Let outside authors' issues go where the other routes send them, instead of Intake.
|
|
967
985
|
curl -X PATCH "$FACTORY_URL/web/factory/projects/$PROJECT/intake-routes/$DEFAULT_ROUTE" -H 'content-type: application/json' -d '{
|
|
968
986
|
"enabled": false,
|
|
969
987
|
"expectedRevision": 1
|
|
@@ -996,27 +1014,25 @@ When Platform credentials are present, `MastraFactory` installs a `PlatformGithu
|
|
|
996
1014
|
```typescript
|
|
997
1015
|
import { MastraFactory } from '@mastra/factory';
|
|
998
1016
|
|
|
999
|
-
// Your own label → board mapping (Settings › Intake › GitHub label routes remain
|
|
1000
|
-
// the stored, per-project alternative when labels alone are enough).
|
|
1001
|
-
const boardForLabels = (labels: string[]) => (labels.includes('design') ? 'design' : 'work');
|
|
1002
|
-
|
|
1003
1017
|
new MastraFactory({
|
|
1004
1018
|
storage,
|
|
1005
1019
|
platform: {
|
|
1006
1020
|
github: {
|
|
1007
1021
|
rules: {
|
|
1008
|
-
//
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1022
|
+
// File only issues labelled `factory`; leave the rest on GitHub.
|
|
1023
|
+
issueOpened: context =>
|
|
1024
|
+
context.issue?.labels.includes('factory')
|
|
1025
|
+
? {
|
|
1026
|
+
type: 'upsertLinkedWorkItem',
|
|
1027
|
+
idempotencyKey: `${context.ingress.id}:issue-intake`,
|
|
1028
|
+
board: context.intake!.board,
|
|
1029
|
+
source: 'github-issue',
|
|
1030
|
+
sourceKey: `github-issue:${context.issue.number}`,
|
|
1031
|
+
title: context.issue.title,
|
|
1032
|
+
url: context.issue.url,
|
|
1033
|
+
stage: context.intake!.initialPhase,
|
|
1034
|
+
}
|
|
1035
|
+
: { type: 'reject', code: 'not_for_factory', reason: 'Only issues labelled factory are filed.' },
|
|
1020
1036
|
},
|
|
1021
1037
|
// Optional. Overrides the sibling `githubAppSlug` for recognizing Factory's own writes.
|
|
1022
1038
|
slug: 'factory-app',
|
|
@@ -1025,6 +1041,8 @@ new MastraFactory({
|
|
|
1025
1041
|
});
|
|
1026
1042
|
```
|
|
1027
1043
|
|
|
1044
|
+
A rule decides whether and what to file, not where: the project's [intake routes](#intake-routes) place every new card, whatever board and stage the decision names, so send labelled issues to another board with a route on `item.labels`. Only `skipRules: true` (see below) files a card exactly where the decision says.
|
|
1045
|
+
|
|
1028
1046
|
`platform.github` applies only to the integration the factory installs itself. An explicit `github` entry in `integrations` takes precedence and makes the key a no-op; the factory warns rather than ignoring it silently, and warns the same way when no Platform credentials and no explicit GitHub integration are present. `GithubRuleOverrides` (the `rules` option type) is exported from `@mastra/factory`.
|
|
1029
1047
|
|
|
1030
1048
|
**Migration:** Move each global `rules.github[event].onEvent` value to the integration constructor's `rules[event]` option:
|
|
@@ -1308,6 +1326,42 @@ const factory = new MastraFactory({
|
|
|
1308
1326
|
});
|
|
1309
1327
|
```
|
|
1310
1328
|
|
|
1329
|
+
To keep the Connect default next to your own tools, call `platformConnectTools(projectId)` from your `tools` function.
|
|
1330
|
+
|
|
1331
|
+
A tool can act on the change request a Review run reviews: `factory.reviewedChangeRequest(requestContext)` returns its provider, repository, number, current head and branch, or `undefined` outside a Review run bound to a change request. Its `publishCommitCheck()` publishes a commit check on the reviewed head through the project's source-control connection, and refuses, publishing nothing, when the head moved, the change request is no longer open, or the provider can't publish commit checks. A review skill you write can call a tool like this one to report its test run:
|
|
1332
|
+
|
|
1333
|
+
```typescript
|
|
1334
|
+
import { createTool } from '@mastra/core/tools';
|
|
1335
|
+
import { MastraFactory, platformConnectTools } from '@mastra/factory';
|
|
1336
|
+
import { z } from 'zod';
|
|
1337
|
+
|
|
1338
|
+
const publishTestCheck = createTool({
|
|
1339
|
+
id: 'publish_test_check',
|
|
1340
|
+
description: 'Publish the test results as a commit check on the reviewed head.',
|
|
1341
|
+
inputSchema: z.object({
|
|
1342
|
+
headSha: z.string().regex(/^[0-9a-f]{40}$/i),
|
|
1343
|
+
status: z.enum(['in-progress', 'success', 'failure', 'neutral', 'cancelled']),
|
|
1344
|
+
title: z.string(),
|
|
1345
|
+
summary: z.string(),
|
|
1346
|
+
}),
|
|
1347
|
+
execute: async (input, { requestContext }) => {
|
|
1348
|
+
const reviewed = await factory.reviewedChangeRequest(requestContext!);
|
|
1349
|
+
if (!reviewed) throw new Error('Only a Review run can publish a test check.');
|
|
1350
|
+
return reviewed.publishCommitCheck({ ...input, name: 'Review / tests' });
|
|
1351
|
+
},
|
|
1352
|
+
});
|
|
1353
|
+
|
|
1354
|
+
const factory: MastraFactory = new MastraFactory({
|
|
1355
|
+
// ...
|
|
1356
|
+
tools: async ({ requestContext }) => ({
|
|
1357
|
+
...(process.env.MASTRA_PROJECT_ID
|
|
1358
|
+
? await platformConnectTools(process.env.MASTRA_PROJECT_ID)({ requestContext })
|
|
1359
|
+
: {}),
|
|
1360
|
+
publish_test_check: publishTestCheck,
|
|
1361
|
+
}),
|
|
1362
|
+
});
|
|
1363
|
+
```
|
|
1364
|
+
|
|
1311
1365
|
### Voice input
|
|
1312
1366
|
|
|
1313
1367
|
The composer mic first asks `POST /web/voice/live-session`. When the chosen model has a realtime model (Mistral Voxtral), the server mints a short-lived Mistral `rt_` token with the selected key and the browser streams 16 kHz PCM to Mistral's realtime socket, so words appear in the draft while you speak. Every other provider answers `{ mode: 'batch' }`, and so does Mistral when it won't mint a token for a key that can still transcribe (for example one without the `create_client_session` permission): the browser records a clip and posts it to `POST /web/voice/transcribe`, where the server transcribes it with a provider from the Mastra Code speech-to-text registry (`@mastra/code-sdk/voice/stt-registry`). A rejected or out-of-credit Mistral key answers 502 before anything is recorded; other providers report a bad key only when the clip is transcribed. API keys never reach the browser. Each member can start 20 live sessions or transcriptions a minute on each server process (the counters are in memory); past that both routes answer 429 `voice_rate_limited` with `Retry-After`, before anything is recorded. Only a minted live session or a transcription counts, so when Mistral won't mint a token and the browser records a clip instead, that dictation counts once.
|
|
@@ -43,7 +43,7 @@ export declare const EVENT_RULE_FIELDS: readonly ['event.type', 'event.reason'];
|
|
|
43
43
|
*/
|
|
44
44
|
export declare const CLOSED_ISSUE_RULE_FIELDS: readonly ['pullRequest.closesIssue', 'closedIssue.phase', 'closedIssue.hasPullRequest'];
|
|
45
45
|
/** Every field an intake route's `when` may name. */
|
|
46
|
-
export declare const INTAKE_ROUTE_RULE_FIELDS: readonly ["item.labels", "item.title", "item.author", "author.trusted", "source.kind", "source.integration", "item.pullRequest", "event.type", "event.reason", "pullRequest.closesIssue", "closedIssue.phase", "closedIssue.hasPullRequest"];
|
|
46
|
+
export declare const INTAKE_ROUTE_RULE_FIELDS: readonly ["item.labels", "item.title", "item.author", "item.key", "item.state", "item.assignees", "author.trusted", "source.kind", "source.integration", "source.provider", "source.repository", "item.pullRequest", "event.type", "event.reason", "pullRequest.closesIssue", "closedIssue.phase", "closedIssue.hasPullRequest"];
|
|
47
47
|
/**
|
|
48
48
|
* Why a route's `on` and `when` can't be saved together, or null. `on` must name at least one
|
|
49
49
|
* status event, each once; `event.*` conditions need an event besides `work_item.created`, which
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-events.d.ts","sourceRoot":"","sources":["../../src/boards/board-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD;;;;GAIG;AACH,eAAO,MAAM,aAAa,YACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,CACb,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,gBAAgB,MAAM,EAAE,CAAC,CAAC;AAE9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,IAAI,gBAAgB,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EA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-1,7 +1,9 @@
|
|
|
1
1
|
import type { RuleFacts } from '../rules/rule-group.js';
|
|
2
2
|
import type { Card } from '../storage/domains/work-items/base.js';
|
|
3
|
+
type WorkItemFacts = Pick<Card['workItem'], 'labels' | 'author'> & Partial<Pick<Card['workItem'], 'sources' | 'provider' | 'key' | 'state' | 'metadata'>>;
|
|
3
4
|
/** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */
|
|
4
5
|
export declare function cardRuleFacts(item: Pick<Card, 'title' | 'metadata' | 'externalSource'> & {
|
|
5
|
-
workItem?:
|
|
6
|
+
workItem?: WorkItemFacts;
|
|
6
7
|
}): RuleFacts;
|
|
8
|
+
export {};
|
|
7
9
|
//# 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,IAAI,EAAE,MAAM,uCAAuC,CAAC;
|
|
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;AAKlE,KAAK,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,GAC9D,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC;AAUzF,sHAAsH;AACtH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,aAAa,CAAA;CAAE,GACvF,SAAS,CA4CX"}
|
|
@@ -1,25 +1,47 @@
|
|
|
1
1
|
import { authorTrusted } from "../rules/types.js";
|
|
2
2
|
import { workItemProviderAdapter } from "../work-items/providers/index.js";
|
|
3
|
+
import { stringList, stringValue } from "../work-items/providers/metadata-keys.js";
|
|
3
4
|
import { newestOpenPullRequestNumber } from "./semantics.js";
|
|
4
5
|
// src/boards/card-facts.ts
|
|
6
|
+
/** Who an item is assigned to, as the provider reports it: a list, or the one assignee. */
|
|
7
|
+
function assignees(metadata) {
|
|
8
|
+
const listed = stringList(metadata?.assignees);
|
|
9
|
+
if (listed.length > 0) return listed;
|
|
10
|
+
const one = stringValue(metadata?.assignee);
|
|
11
|
+
return one ? [one] : [];
|
|
12
|
+
}
|
|
5
13
|
/** What a condition (`autoStartWhen`, `exitTool.autoApproveWhen`, an intake route's `when`) can test about a card. */
|
|
6
14
|
function cardRuleFacts(item) {
|
|
7
15
|
const source = item.externalSource;
|
|
8
16
|
const metadata = item.metadata ?? {};
|
|
9
|
-
const
|
|
10
|
-
const
|
|
17
|
+
const adapter = source ? workItemProviderAdapter(source) : null;
|
|
18
|
+
const normalized = source ? adapter.toSource(source, metadata) : null;
|
|
19
|
+
const stored = item.workItem;
|
|
20
|
+
const labels = source ? (stored ?? normalized)?.labels ?? [] : Array.isArray(metadata.labels) ? metadata.labels.filter((label) => typeof label === "string") : [];
|
|
11
21
|
const pointer = metadata.openPullRequestNumber;
|
|
12
22
|
const pullRequest = typeof pointer === "number" ? pointer : newestOpenPullRequestNumber({ workItem: item.workItem ?? null });
|
|
13
|
-
const author = source ?
|
|
23
|
+
const author = source ? (stored ?? normalized)?.author ?? null : typeof metadata.author === "string" ? metadata.author : null;
|
|
24
|
+
const key = stored?.key ?? normalized?.key ?? null;
|
|
25
|
+
const state = stored?.state ?? normalized?.state ?? null;
|
|
26
|
+
const providerMetadata = stored?.metadata ?? normalized?.metadata ?? null;
|
|
27
|
+
const repository = adapter?.repository?.({
|
|
28
|
+
key,
|
|
29
|
+
metadata: providerMetadata
|
|
30
|
+
}) ?? null;
|
|
14
31
|
return {
|
|
15
32
|
"item.labels": labels,
|
|
16
33
|
"item.title": item.title,
|
|
17
34
|
...author !== null ? { "item.author": author } : {},
|
|
35
|
+
...key !== null ? { "item.key": key } : {},
|
|
36
|
+
...state !== null ? { "item.state": state } : {},
|
|
37
|
+
"item.assignees": assignees(source ? providerMetadata : metadata),
|
|
18
38
|
"author.trusted": authorTrusted(item.metadata),
|
|
19
39
|
...pullRequest !== null ? { "item.pullRequest": pullRequest } : {},
|
|
20
40
|
...source ? {
|
|
21
41
|
"source.kind": source.type === "pull-request" ? "pull_request" : source.type,
|
|
22
|
-
"source.integration": source.integrationId
|
|
42
|
+
"source.integration": source.integrationId,
|
|
43
|
+
"source.provider": stored?.provider ?? normalized?.provider ?? source.integrationId,
|
|
44
|
+
...repository !== null ? { "source.repository": repository } : {}
|
|
23
45
|
} : {}
|
|
24
46
|
};
|
|
25
47
|
}
|
|
@@ -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 { Card } from '../storage/domains/work-items/base.js';\nimport { workItemProviderAdapter } from '../work-items/providers/index.js';\nimport { newestOpenPullRequestNumber } from './semantics.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'> & {
|
|
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';\nimport { stringList, stringValue } from '../work-items/providers/metadata-keys.js';\nimport { newestOpenPullRequestNumber } from './semantics.js';\n\ntype WorkItemFacts = Pick<Card['workItem'], 'labels' | 'author'> &\n Partial<Pick<Card['workItem'], 'sources' | 'provider' | 'key' | 'state' | 'metadata'>>;\n\n/** Who an item is assigned to, as the provider reports it: a list, or the one assignee. */\nfunction assignees(metadata: Record<string, unknown> | null): string[] {\n const listed = stringList(metadata?.assignees);\n if (listed.length > 0) return listed;\n const one = stringValue(metadata?.assignee);\n return one ? [one] : [];\n}\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'> & { workItem?: WorkItemFacts },\n): RuleFacts {\n const source = item.externalSource;\n const metadata = item.metadata ?? {};\n const adapter = source ? workItemProviderAdapter(source) : null;\n // A card's work item holds what its provider reported; an arrival not filed yet is normalized\n // from its source and metadata the way its work item will be.\n const normalized = source ? adapter!.toSource(source, metadata) : null;\n const stored = item.workItem;\n const labels = source\n ? ((stored ?? normalized)?.labels ?? [])\n : Array.isArray(metadata.labels)\n ? metadata.labels.filter((label): label is string => typeof label === 'string')\n : [];\n const pointer = metadata.openPullRequestNumber;\n const pullRequest =\n typeof pointer === 'number' ? pointer : newestOpenPullRequestNumber({ workItem: item.workItem ?? null });\n const author = source\n ? ((stored ?? normalized)?.author ?? null)\n : typeof metadata.author === 'string'\n ? metadata.author\n : null;\n const key = stored?.key ?? normalized?.key ?? null;\n const state = stored?.state ?? normalized?.state ?? null;\n const providerMetadata = stored?.metadata ?? normalized?.metadata ?? null;\n const repository = adapter?.repository?.({ key, metadata: providerMetadata }) ?? null;\n return {\n 'item.labels': labels,\n 'item.title': item.title,\n ...(author !== null ? { 'item.author': author } : {}),\n ...(key !== null ? { 'item.key': key } : {}),\n ...(state !== null ? { 'item.state': state } : {}),\n 'item.assignees': assignees(source ? providerMetadata : metadata),\n 'author.trusted': authorTrusted(item.metadata),\n // The open change request: the one Factory opened for the card, else its own or an attached open one.\n ...(pullRequest !== null ? { 'item.pullRequest': pullRequest } : {}),\n ...(source\n ? {\n 'source.kind': source.type === 'pull-request' ? 'pull_request' : source.type,\n 'source.integration': source.integrationId,\n 'source.provider': stored?.provider ?? normalized?.provider ?? source.integrationId,\n ...(repository !== null ? { 'source.repository': repository } : {}),\n }\n : {}),\n };\n}\n"],"mappings":";;;;;;AAWA,SAAS,UAAU,UAAoD;CACrE,MAAM,SAAS,WAAW,UAAU,SAAS;CAC7C,IAAI,OAAO,SAAS,GAAG,OAAO;CAC9B,MAAM,MAAM,YAAY,UAAU,QAAQ;CAC1C,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC;AACxB;;AAGA,SAAgB,cACd,MACW;CACX,MAAM,SAAS,KAAK;CACpB,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,MAAM,UAAU,SAAS,wBAAwB,MAAM,IAAI;CAG3D,MAAM,aAAa,SAAS,QAAS,SAAS,QAAQ,QAAQ,IAAI;CAClE,MAAM,SAAS,KAAK;CACpB,MAAM,SAAS,UACT,UAAU,WAAA,EAAa,UAAU,CAAC,IACpC,MAAM,QAAQ,SAAS,MAAM,IAC3B,SAAS,OAAO,QAAQ,UAA2B,OAAO,UAAU,QAAQ,IAC5E,CAAC;CACP,MAAM,UAAU,SAAS;CACzB,MAAM,cACJ,OAAO,YAAY,WAAW,UAAU,4BAA4B,EAAE,UAAU,KAAK,YAAY,KAAK,CAAC;CACzG,MAAM,SAAS,UACT,UAAU,WAAA,EAAa,UAAU,OACnC,OAAO,SAAS,WAAW,WACzB,SAAS,SACT;CACN,MAAM,MAAM,QAAQ,OAAO,YAAY,OAAO;CAC9C,MAAM,QAAQ,QAAQ,SAAS,YAAY,SAAS;CACpD,MAAM,mBAAmB,QAAQ,YAAY,YAAY,YAAY;CACrE,MAAM,aAAa,SAAS,aAAa;EAAE;EAAK,UAAU;CAAiB,CAAC,KAAK;CACjF,OAAO;EACL,eAAe;EACf,cAAc,KAAK;EACnB,GAAI,WAAW,OAAO,EAAE,eAAe,OAAO,IAAI,CAAC;EACnD,GAAI,QAAQ,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;EAC1C,GAAI,UAAU,OAAO,EAAE,cAAc,MAAM,IAAI,CAAC;EAChD,kBAAkB,UAAU,SAAS,mBAAmB,QAAQ;EAChE,kBAAkB,cAAc,KAAK,QAAQ;EAE7C,GAAI,gBAAgB,OAAO,EAAE,oBAAoB,YAAY,IAAI,CAAC;EAClE,GAAI,SACA;GACE,eAAe,OAAO,SAAS,iBAAiB,iBAAiB,OAAO;GACxE,sBAAsB,OAAO;GAC7B,mBAAmB,QAAQ,YAAY,YAAY,YAAY,OAAO;GACtE,GAAI,eAAe,OAAO,EAAE,qBAAqB,WAAW,IAAI,CAAC;EACnE,IACA,CAAC;CACP;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Board a card belongs to when nothing names one: rows written before boards were persisted, and
|
|
3
|
-
* cards
|
|
4
|
-
* Work board); nothing else about it is special.
|
|
3
|
+
* new cards before the project's intake routes place them. Every project is seeded with it (the
|
|
4
|
+
* Work board) and its default routes name it; nothing else about it is special.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DEFAULT_BOARD_ID = "work";
|
|
7
7
|
//# sourceMappingURL=default-board.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/boards/default-board.ts
|
|
2
2
|
/**
|
|
3
3
|
* Board a card belongs to when nothing names one: rows written before boards were persisted, and
|
|
4
|
-
* cards
|
|
5
|
-
* Work board); nothing else about it is special.
|
|
4
|
+
* new cards before the project's intake routes place them. Every project is seeded with it (the
|
|
5
|
+
* Work board) and its default routes name it; nothing else about it is special.
|
|
6
6
|
*/
|
|
7
7
|
const DEFAULT_BOARD_ID = "work";
|
|
8
8
|
export { DEFAULT_BOARD_ID };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-board.js","names":[],"sources":["../../src/boards/default-board.ts"],"sourcesContent":["/**\n * Board a card belongs to when nothing names one: rows written before boards were persisted, and\n * cards
|
|
1
|
+
{"version":3,"file":"default-board.js","names":[],"sources":["../../src/boards/default-board.ts"],"sourcesContent":["/**\n * Board a card belongs to when nothing names one: rows written before boards were persisted, and\n * new cards before the project's intake routes place them. Every project is seeded with it (the\n * Work board) and its default routes name it; nothing else about it is special.\n */\nexport const DEFAULT_BOARD_ID = 'work';\n"],"mappings":";;;;;;AAKA,MAAa,mBAAmB"}
|
|
@@ -105,7 +105,7 @@ type WorkingPhaseFields = {
|
|
|
105
105
|
readonly runner?: BoardPhaseRunner;
|
|
106
106
|
/** @deprecated Use `runner.context`. */
|
|
107
107
|
readonly role?: string;
|
|
108
|
-
/** Runs start without anyone approving them,
|
|
108
|
+
/** Runs start without anyone approving them. The board, not a project setting, decides this. */
|
|
109
109
|
readonly autoStart?: boolean;
|
|
110
110
|
/** With `autoStart`, only cards this matches start on their own. */
|
|
111
111
|
readonly autoStartWhen?: RuleGroup;
|
|
@@ -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;AAQnE,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,4BAA4B,EAC7B,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,wEAAwE;AACxE,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;AAC1F,MAAM,MAAM,aAAa,GAAG;IAAE,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