@synap-core/workspace-templates 0.56.0 → 0.58.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/src/templates.ts CHANGED
@@ -2353,6 +2353,7 @@ const DATA = {
2353
2353
  {
2354
2354
  "slug": "token-json",
2355
2355
  "label": "Tokens JSON",
2356
+ "description": "A W3C DTCG 2025.10 token file (Synap's own paths, e.g. space.space-200, radius.radius-container, grid.grid-columns-expanded) whose values are this brand's. The Design app draws a project's frames in it; a file that is not DTCG is kept, but frames keep Synap's values.",
2356
2357
  "valueType": "string",
2357
2358
  "inputType": "textarea"
2358
2359
  },
@@ -3592,10 +3593,12 @@ const DATA = {
3592
3593
  "profile": "devplane_feature"
3593
3594
  },
3594
3595
  {
3595
- "profile": "devplane_story"
3596
+ "profile": "devplane_story",
3597
+ "as": "helper"
3596
3598
  },
3597
3599
  {
3598
- "profile": "ui-design"
3600
+ "profile": "ui-design",
3601
+ "as": "helper"
3599
3602
  }
3600
3603
  ]
3601
3604
  }
@@ -6811,7 +6814,7 @@ const DATA = {
6811
6814
  {
6812
6815
  "name": "Ship a change",
6813
6816
  "description": "Take a shaped change from branch to pull request, green checks, merge, lab and a dogfood walk, until its criteria are verified. The facts (PR opened, CI finished, merged, deployed) move the step; the person approves only the lab deploy.",
6814
- "goalTemplate": "Ship this change through one session, one branch and its pull requests, then the merge, the lab and a dogfood walk, until its criteria are verified. Feature, when one is bound: {feature}. The step follows the work; with a feature, move its status only through its lifecycle (update_entity with expectedStatus), never invent one; with none, the session alone carries the stages. SHAPE: write the end state and 2-5 binary criteria on this session, set the feature's change type (feature, refactor or chore) when there is a feature, and name the repos it touches. BUILD: branch <type>/<slug> from origin/main in your own worktree, commit in verified slices, and run the smallest gate that answers for each finished slice, with its negative control; quote the output. PR OPENED: open a draft pull request whose body carries the line \"Pod session: <this session id>\", and record it on this session as the outcome pr-<repo>-<number> (kind pull_request, ref url); one outcome per pull request, and for each a session criterion keyed the same, \"<repo>#<number> is merged\", checked by the capability github_check_pr_merged, so the pod grades the merge itself. CHECKS: read the checks on the pull request's head with github_pr_checks (the github-read capability, on the person's own token) or wait for the ci.finished event; a red check sends the work back to Build. MERGE: a person merges; never merge and never push to main. The merge marks the outcome met. DEPLOY: ask the person for the lab deploy (synap_request_deploy_approval); the deploy is their call. DOGFOOD: walk the change in the running lab as a person would and report WORKS, BROKEN or CANNOT-TELL with what was seen. VERIFY: grade every criterion with its evidence, and separate VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD.",
6817
+ "goalTemplate": "Ship this change through one session, one branch and its pull requests, then the merge, the lab and a dogfood walk, until its criteria are verified. Feature, when one is bound: {feature}. The step follows the work; with a feature, move its status only through its lifecycle (update_entity with expectedStatus), never invent one; with none, the session alone carries the stages. SHAPE: write the end state and 2-5 binary criteria on this session, set the feature's change type (feature, refactor or chore) when there is a feature, and name the repos it touches. BUILD: branch <type>/<slug> from origin/main in your own worktree, commit in verified slices, and run the smallest gate that answers for each finished slice, with its negative control; quote the output. PR OPENED: open a draft pull request whose body carries the line \"Pod session: <this session id>\", and complete THIS stage's output pull-request with its url (completeOutput pull-request, ref.url): this step's criterion pr-opened names it, so Checks waits for that one, and the Merged step's criterion merged names it too, so the merge grades it there. A second pull request, in another repo, is its own outcome pr-<repo>-<number> (kind pull_request, ref url), with a session criterion that names it with outputKey pr-<repo>-<number>, \"<repo>#<number> is merged\", checked by the capability github_check_pr_merged, so the pod grades that merge itself. CHECKS: read the checks on the pull request's head with github_pr_checks (the github-read capability, on the person's own token) or wait for the ci.finished event; a red check sends the work back to Build. MERGE: a person merges; never merge and never push to main. The merge marks the outcome met. DEPLOY: ask the person for the lab deploy (synap_request_deploy_approval); the deploy is their call. DOGFOOD: walk the change in the running lab as a person would and report WORKS, BROKEN or CANNOT-TELL with what was seen. VERIFY: grade every criterion with its evidence, and separate VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD.",
6815
6818
  "subjectProfile": {
6816
6819
  "profileSlug": "devplane_feature"
6817
6820
  },
@@ -6893,18 +6896,20 @@ const DATA = {
6893
6896
  "category": "started",
6894
6897
  "tier": "standard",
6895
6898
  "subjectStatus": "in_review",
6896
- "goal": "Open a draft pull request whose body carries the line \"Pod session: <this session id>\" and record it as the outcome pr-<repo>-<number> with its url.",
6899
+ "goal": "Open a draft pull request whose body carries the line \"Pod session: <this session id>\" and complete THIS output, pull-request, with its url (completeOutput pull-request, ref.url). A second pull request in another repo is its own outcome pr-<repo>-<number>.",
6897
6900
  "expectedOutputs": [
6898
6901
  {
6902
+ "key": "pull-request",
6899
6903
  "kind": "pull_request",
6900
- "label": "Pull request (outcome pr-<repo>-<number>, ref = its url)",
6904
+ "label": "Pull request: complete this output with its url (completeOutput pull-request, ref.url)",
6901
6905
  "relationToSubject": "none"
6902
6906
  }
6903
6907
  ],
6904
6908
  "criteria": [
6905
6909
  {
6906
6910
  "key": "pr-opened",
6907
- "statement": "A pull request for this change is open and recorded on the session as a pr-<repo>-<number> outcome with its url.",
6911
+ "statement": "A pull request for this change is open and recorded as this stage's pull-request output with its url.",
6912
+ "outputKey": "pull-request",
6908
6913
  "check": {
6909
6914
  "kind": "evidence",
6910
6915
  "evidenceKey": "pr-opened"
@@ -6947,11 +6952,12 @@ const DATA = {
6947
6952
  "name": "Merged",
6948
6953
  "category": "started",
6949
6954
  "tier": "standard",
6950
- "goal": "A person merges the pull request; the merge marks the pr-<repo>-<number> outcome met and its criterion of the same key (github_check_pr_merged) grades it on GitHub's own answer. Never merge and never push to main.",
6955
+ "goal": "A person merges the pull request; the merge meets its output, graded by the criterion that names it by outputKey (merged for pull-request; for a second pull request its own, github_check_pr_merged on GitHub's own answer). Never merge and never push to main.",
6951
6956
  "criteria": [
6952
6957
  {
6953
6958
  "key": "merged",
6954
6959
  "statement": "The pull request is merged.",
6960
+ "outputKey": "pull-request",
6955
6961
  "check": {
6956
6962
  "kind": "evidence",
6957
6963
  "evidenceKey": "merged",
@@ -7181,7 +7187,7 @@ const DATA = {
7181
7187
  "check": {
7182
7188
  "kind": "judge"
7183
7189
  },
7184
- "statement": "The change is recorded on the session as an outcome with its url: pr-<repo>-<number> for a public repo, commit-<repo>-<sha8> for a private repo."
7190
+ "statement": "The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo."
7185
7191
  },
7186
7192
  {
7187
7193
  "key": "pr-names-session",
@@ -7191,13 +7197,14 @@ const DATA = {
7191
7197
  "statement": "A pull request body, when there is one, carries the line naming this Pod session."
7192
7198
  }
7193
7199
  ],
7194
- "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then record the outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
7200
+ "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
7195
7201
  "tier": "standard",
7196
7202
  "subjectStatus": "in_review",
7197
7203
  "expectedOutputs": [
7198
7204
  {
7205
+ "key": "pull-request",
7199
7206
  "kind": "pull_request",
7200
- "label": "Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only",
7207
+ "label": "Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only",
7201
7208
  "optional": true
7202
7209
  }
7203
7210
  ]
@@ -7456,7 +7463,7 @@ const DATA = {
7456
7463
  "check": {
7457
7464
  "kind": "judge"
7458
7465
  },
7459
- "statement": "The change is recorded on the session as an outcome with its url: pr-<repo>-<number> for a public repo, commit-<repo>-<sha8> for a private repo."
7466
+ "statement": "The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo."
7460
7467
  },
7461
7468
  {
7462
7469
  "key": "pr-names-session",
@@ -7466,12 +7473,13 @@ const DATA = {
7466
7473
  "statement": "A pull request body, when there is one, carries the line naming this Pod session."
7467
7474
  }
7468
7475
  ],
7469
- "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then record the outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
7476
+ "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
7470
7477
  "tier": "standard",
7471
7478
  "expectedOutputs": [
7472
7479
  {
7480
+ "key": "pull-request",
7473
7481
  "kind": "pull_request",
7474
- "label": "Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only",
7482
+ "label": "Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only",
7475
7483
  "optional": true
7476
7484
  }
7477
7485
  ]
@@ -7822,7 +7830,7 @@ const DATA = {
7822
7830
  "check": {
7823
7831
  "kind": "judge"
7824
7832
  },
7825
- "statement": "The change is recorded on the session as an outcome with its url: pr-<repo>-<number> for a public repo, commit-<repo>-<sha8> for a private repo."
7833
+ "statement": "The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo."
7826
7834
  },
7827
7835
  {
7828
7836
  "key": "pr-names-session",
@@ -7832,12 +7840,13 @@ const DATA = {
7832
7840
  "statement": "A pull request body, when there is one, carries the line naming this Pod session."
7833
7841
  }
7834
7842
  ],
7835
- "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then record the outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
7843
+ "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
7836
7844
  "tier": "standard",
7837
7845
  "expectedOutputs": [
7838
7846
  {
7847
+ "key": "pull-request",
7839
7848
  "kind": "pull_request",
7840
- "label": "Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only",
7849
+ "label": "Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only",
7841
7850
  "optional": true
7842
7851
  }
7843
7852
  ]
@@ -8064,7 +8073,7 @@ const DATA = {
8064
8073
  "check": {
8065
8074
  "kind": "judge"
8066
8075
  },
8067
- "statement": "The change is recorded on the session as an outcome with its url: pr-<repo>-<number> for a public repo, commit-<repo>-<sha8> for a private repo."
8076
+ "statement": "The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo."
8068
8077
  },
8069
8078
  {
8070
8079
  "key": "pr-names-session",
@@ -8074,12 +8083,13 @@ const DATA = {
8074
8083
  "statement": "A pull request body, when there is one, carries the line naming this Pod session."
8075
8084
  }
8076
8085
  ],
8077
- "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then record the outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
8086
+ "description": "Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line \"Pod session: <session id>\", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.",
8078
8087
  "tier": "standard",
8079
8088
  "expectedOutputs": [
8080
8089
  {
8090
+ "key": "pull-request",
8081
8091
  "kind": "pull_request",
8082
- "label": "Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only",
8092
+ "label": "Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only",
8083
8093
  "optional": true
8084
8094
  }
8085
8095
  ]
@@ -16572,7 +16582,7 @@ const DATA = {
16572
16582
  {
16573
16583
  "name": "Propose a Health cell",
16574
16584
  "description": "Answer one question about your sales with a tile on the Health dashboard; the AI writes the tile and you approve it before it shows. Run by one of your agents for now (Synap AI cannot place a tile yet).",
16575
- "goalTemplate": "Propose one Health tile that answers: {question}. FIND THE VIEW: in the CRM space, the bento view named Health (synap_list_views with the space's workspaceId, type bento). When the space has none, stop and say so: never create another dashboard. READ FIRST: what already sits on Health (its config.blocks: each widget tile names a cell by widgetType) and the space's cells (synap_list_widgets); when a tile already answers the question, say which one and stop. DATA: decide where each number comes from. A cell reads the pod ONLY through the cell bridge, at render time: window.synap.query(op, params), with an op of the bridge table (entities.list, entities.get, views.list, profiles.list, lifecycle.board, flow.of, lifecycle.throughput, attention.needsYou, attention.count, sessions.list, lifecycle.home, lifecycle.moving, documents.get, lens.page) and only that op's params; the host stamps the space, so never put a workspaceId, a token, a pod URL or a fetch in the page. What the bridge reads stays live: query it in the page, never paste its rows. What it cannot read yet (messages, replies, sends: the bridge has no message op) you read now with your own tools (synap_get_channel, synap_get_entities) and write into the page as a snapshot, with the date it was taken shown on the tile (for example \"au 8 novembre\") and how it was counted. Never invent a number: a figure you cannot source is left out and the tile says what is missing. THE PAGE: one self-contained HTML page, inline script and style only (no CDN, no remote font or image: the frame's CSP refuses them), that answers the question in one glance (a number, a short table or a small chart), in the person's language (French by default), readable in light and dark, and that shows an error, never an empty tile, when a query fails. FILE IT: synap_create_cell with name = a short title of the question, rendererSource = the page, workspaceId = the CRM space (never pod-wide: the CRM app reads only its space's cells), contentKind widget, placeOn = {viewId: the Health view's id}, and reasoning = the question in the person's words. It comes back proposed: that is success, never retry it; the person approves it in the CRM or the pod, which defines the cell and puts its tile on Health in one act. One cell per run.",
16585
+ "goalTemplate": "Propose one Health tile that answers: {question}. FIND THE VIEW: in the CRM space, the bento view named Health (synap_list_views with the space's workspaceId, type bento). When the space has none, stop and say so: never create another dashboard. READ FIRST: what already sits on Health (its config.blocks: each widget tile names a cell by widgetType) and the space's cells (synap_list_widgets); when a tile already answers the question, say which one and stop. DATA: decide where each number comes from. A cell reads the pod ONLY through the cell bridge, at render time: window.synap.query(op, params), with an op of the bridge table (entities.list, entities.get, views.list, profiles.list, lifecycle.board, flow.of, lifecycle.throughput, attention.needsYou, attention.count, sessions.list, lifecycle.home, lifecycle.moving, documents.get, lens.page, sessions.get, playbook.process, playbook.scorecard, project.pillars) and only that op's params; the host stamps the space, so never put a workspaceId, a token, a pod URL or a fetch in the page. What the bridge reads stays live: query it in the page, never paste its rows. What it cannot read yet (messages, replies, sends: the bridge has no message op) you read now with your own tools (synap_get_channel, synap_get_entities) and write into the page as a snapshot, with the date it was taken shown on the tile (for example \"au 8 novembre\") and how it was counted. Never invent a number: a figure you cannot source is left out and the tile says what is missing. THE PAGE: one self-contained HTML page, inline script and style only (no CDN, no remote font or image: the frame's CSP refuses them), that answers the question in one glance (a number, a short table or a small chart), in the person's language (French by default), readable in light and dark, and that shows an error, never an empty tile, when a query fails. FILE IT: synap_create_cell with name = a short title of the question, rendererSource = the page, workspaceId = the CRM space (never pod-wide: the CRM app reads only its space's cells), contentKind widget, placeOn = {viewId: the Health view's id}, and reasoning = the question in the person's words. It comes back proposed: that is success, never retry it; the person approves it in the CRM or the pod, which defines the cell and puts its tile on Health in one act. One cell per run.",
16576
16586
  "params": [
16577
16587
  {
16578
16588
  "name": "question",
package/src/types.ts CHANGED
@@ -759,6 +759,8 @@ export interface TemplateCriterion {
759
759
  hint?: string;
760
760
  };
761
761
  stageKey?: string;
762
+ /** The key of the output this criterion checks (the pod's `outputKey`, W1). */
763
+ outputKey?: string;
762
764
  }
763
765
 
764
766
  /** A declared process activator (compiled to a governed rule at install). */
@@ -1123,9 +1125,18 @@ export interface TemplateIntent {
1123
1125
  * its operational kinds). A library (no `produces`) names none.
1124
1126
  */
1125
1127
  primary?: string;
1126
- produces?: Array<{ profile: string }>;
1128
+ /**
1129
+ * Each kind the space works, in order. `as` (default `output`): `helper` =
1130
+ * worked here to serve an output without being one (a story for a
1131
+ * feature: not a pillar's output). The primary is never a helper.
1132
+ */
1133
+ produces?: Array<{ profile: string; as?: TemplateKindAs }>;
1127
1134
  }
1128
1135
 
1136
+ /** `meta.intent.produces[].as` — the pod's `SPACE_KIND_AS` (`@synap-core/types/workspaces/settings`). */
1137
+ export const TEMPLATE_KIND_AS = ["output", "helper"] as const;
1138
+ export type TemplateKindAs = (typeof TEMPLATE_KIND_AS)[number];
1139
+
1129
1140
  export interface WorkspaceYaml {
1130
1141
  /** Template metadata — not sent to backend, used for listing/UI */
1131
1142
  meta: TemplateMeta;
package/src/validate.ts CHANGED
@@ -57,7 +57,7 @@ import type {
57
57
  // eslint-disable-next-line import/extensions -- .ts extension is intentional; see header.
58
58
  import { validateFlowDefinition } from "./validate-flow.ts";
59
59
  // eslint-disable-next-line import/extensions -- .ts extension is intentional; see header.
60
- import { INTENT_LABEL_MAX, START_EXAMPLE_RANGE, START_STARTERS_RANGE, START_VIEWS_MAX, startProfileOf } from "./types.ts";
60
+ import { INTENT_LABEL_MAX, START_EXAMPLE_RANGE, START_STARTERS_RANGE, START_VIEWS_MAX, TEMPLATE_KIND_AS, startProfileOf } from "./types.ts";
61
61
 
62
62
  import {
63
63
  CAPABILITY_INTENTS,
@@ -635,7 +635,7 @@ export const MAX_SESSION_CRITERIA = 12;
635
635
  * (rootDir is `src`). `schema/mirror.tripwire.test.ts` pins the two equal,
636
636
  * and both to the pod's `playbookActivatorSchema`.
637
637
  */
638
- export const TEMPLATE_ACTIVATOR_ON = ["created", "enters_status", "count", "schedule", "manual"] as const;
638
+ export const TEMPLATE_ACTIVATOR_ON = ["created", "enters_status", "count", "schedule", "manual", "run_ended"] as const;
639
639
 
640
640
  /**
641
641
  * Does a stage's goal NAME the move into `value` — the status value or its
@@ -1289,6 +1289,8 @@ function checkKanbanGrouping(
1289
1289
  * - each produced profile DECLARES a lifecycle (in one of those
1290
1290
  * declarations) — a home counts things by lifecycle category, and a kind
1291
1291
  * without one cannot be counted;
1292
+ * - an entry's `as` is `output` (default) or `helper`, and the primary is
1293
+ * never a helper (`intent-primary-helper`);
1292
1294
  * - only a template that OWNS a space declares it (never an overlay or a
1293
1295
  * pack — `ownsNoWorkspace`).
1294
1296
  * The dependency half needs the closure: a profile neither own nor reachable
@@ -1368,6 +1370,15 @@ function checkIntent(
1368
1370
  }
1369
1371
  if (seen.has(slug)) add("intent-duplicate", `${at}.profile`, `"${slug}" is produced twice`);
1370
1372
  seen.add(slug);
1373
+ const as = (entry as { as?: unknown }).as;
1374
+ if (as !== undefined && !(TEMPLATE_KIND_AS as readonly unknown[]).includes(as))
1375
+ add("intent-shape", `${at}.as`, `${at}.as must be one of ${TEMPLATE_KIND_AS.join(", ")} (got ${JSON.stringify(as)})`);
1376
+ if (as === "helper" && slug === primary)
1377
+ add(
1378
+ "intent-primary-helper",
1379
+ `${at}.as`,
1380
+ `"${slug}" is the space's primary output and cannot be a helper — a helper is worked to serve an output, it is not one`
1381
+ );
1371
1382
  const decls = sources.flatMap((t) => (t.profiles ?? []).filter((p) => p.slug === slug));
1372
1383
  if (decls.length === 0) {
1373
1384
  if (!unresolved)