@synap-core/workspace-templates 0.56.0 → 0.57.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/dist/wire.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-Dto5_E47.js';
1
+ import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-KudS9Ja_.js';
2
2
  import '@synap-core/types/presentation';
3
3
  import '@synap-core/types/space-brief';
4
4
  import '@synap-core/types/capability-intents';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/workspace-templates",
3
- "version": "0.56.0",
3
+ "version": "0.57.0",
4
4
  "type": "module",
5
5
  "description": "Canonical workspace definitions — YAML source + typed exports for browser, backend, CLI, and marketplace",
6
6
  "repository": {
@@ -508,6 +508,7 @@ profiles:
508
508
  inputType: textarea
509
509
  - slug: token-json
510
510
  label: Tokens JSON
511
+ 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.
511
512
  valueType: string
512
513
  inputType: textarea
513
514
  - slug: token-css
package/src/builder.yaml CHANGED
@@ -48,10 +48,13 @@ meta:
48
48
  label: Product
49
49
  # The ONE primary output (One model decision 3): the feature is what the dev loop ships (Build a change works one).
50
50
  primary: devplane_feature
51
+ # A story and a UI design are worked here to serve the feature, not outputs of their own.
51
52
  produces:
52
53
  - profile: devplane_feature
53
54
  - profile: devplane_story
55
+ as: helper
54
56
  - profile: ui-design
57
+ as: helper
55
58
 
56
59
  workspace:
57
60
  name: Dev
@@ -2117,11 +2120,15 @@ playbooks:
2117
2120
  worktree, commit in verified slices, and run the smallest gate that
2118
2121
  answers for each finished slice, with its negative control; quote the
2119
2122
  output. PR OPENED: open a draft pull request whose body carries the line
2120
- "Pod session: <this session id>", and record it on this session as the
2121
- outcome pr-<repo>-<number> (kind pull_request, ref url); one outcome per
2122
- pull request, and for each a session criterion keyed the same,
2123
+ "Pod session: <this session id>", and complete THIS stage's output
2124
+ pull-request with its url (completeOutput pull-request, ref.url): this
2125
+ step's criterion pr-opened names it, so Checks waits for that one, and
2126
+ the Merged step's criterion merged names it too, so the merge grades it
2127
+ there. A second pull request, in another repo, is its own outcome
2128
+ pr-<repo>-<number> (kind pull_request, ref url), with a session
2129
+ criterion that names it with outputKey pr-<repo>-<number>,
2123
2130
  "<repo>#<number> is merged", checked by the capability
2124
- github_check_pr_merged, so the pod grades the merge itself. CHECKS: read the checks on the pull request's head with
2131
+ github_check_pr_merged, so the pod grades that merge itself. CHECKS: read the checks on the pull request's head with
2125
2132
  github_pr_checks (the github-read capability, on the person's own token)
2126
2133
  or wait for the ci.finished event; a red check sends the work back to
2127
2134
  Build. MERGE: a person merges; never merge and never push to main. The
@@ -2173,14 +2180,16 @@ playbooks:
2173
2180
  category: started
2174
2181
  tier: standard
2175
2182
  subjectStatus: in_review
2176
- 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.'
2183
+ 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>.'
2177
2184
  expectedOutputs:
2178
- - kind: pull_request
2179
- label: Pull request (outcome pr-<repo>-<number>, ref = its url)
2185
+ - key: pull-request
2186
+ kind: pull_request
2187
+ label: 'Pull request: complete this output with its url (completeOutput pull-request, ref.url)'
2180
2188
  relationToSubject: none
2181
2189
  criteria:
2182
2190
  - key: pr-opened
2183
- statement: A pull request for this change is open and recorded on the session as a pr-<repo>-<number> outcome with its url.
2191
+ statement: A pull request for this change is open and recorded as this stage's pull-request output with its url.
2192
+ outputKey: pull-request
2184
2193
  check: { kind: evidence, evidenceKey: pr-opened }
2185
2194
  - key: pr-names-session
2186
2195
  statement: The pull request body carries the line naming this Pod session.
@@ -2202,10 +2211,11 @@ playbooks:
2202
2211
  name: Merged
2203
2212
  category: started
2204
2213
  tier: standard
2205
- 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.
2214
+ 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.
2206
2215
  criteria:
2207
2216
  - key: merged
2208
2217
  statement: The pull request is merged.
2218
+ outputKey: pull-request
2209
2219
  check:
2210
2220
  kind: evidence
2211
2221
  evidenceKey: merged
@@ -2363,17 +2373,18 @@ playbooks:
2363
2373
  - key: change-recorded
2364
2374
  check:
2365
2375
  kind: judge
2366
- 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.'
2376
+ 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.'
2367
2377
  - key: pr-names-session
2368
2378
  check:
2369
2379
  kind: judge
2370
2380
  statement: A pull request body, when there is one, carries the line naming this Pod session.
2371
- 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.'
2381
+ 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.'
2372
2382
  tier: standard
2373
2383
  subjectStatus: in_review
2374
2384
  expectedOutputs:
2375
- - kind: pull_request
2376
- label: Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only
2385
+ - key: pull-request
2386
+ kind: pull_request
2387
+ label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
2377
2388
  optional: true
2378
2389
  - key: checks
2379
2390
  gate:
@@ -2547,16 +2558,17 @@ playbooks:
2547
2558
  - key: change-recorded
2548
2559
  check:
2549
2560
  kind: judge
2550
- 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.'
2561
+ 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.'
2551
2562
  - key: pr-names-session
2552
2563
  check:
2553
2564
  kind: judge
2554
2565
  statement: A pull request body, when there is one, carries the line naming this Pod session.
2555
- 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.'
2566
+ 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.'
2556
2567
  tier: standard
2557
2568
  expectedOutputs:
2558
- - kind: pull_request
2559
- label: Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only
2569
+ - key: pull-request
2570
+ kind: pull_request
2571
+ label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
2560
2572
  optional: true
2561
2573
  - key: checks
2562
2574
  gate:
@@ -2791,16 +2803,17 @@ playbooks:
2791
2803
  - key: change-recorded
2792
2804
  check:
2793
2805
  kind: judge
2794
- 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.'
2806
+ 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.'
2795
2807
  - key: pr-names-session
2796
2808
  check:
2797
2809
  kind: judge
2798
2810
  statement: A pull request body, when there is one, carries the line naming this Pod session.
2799
- 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.'
2811
+ 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.'
2800
2812
  tier: standard
2801
2813
  expectedOutputs:
2802
- - kind: pull_request
2803
- label: Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only
2814
+ - key: pull-request
2815
+ kind: pull_request
2816
+ label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
2804
2817
  optional: true
2805
2818
  - key: checks
2806
2819
  gate:
@@ -2952,16 +2965,17 @@ playbooks:
2952
2965
  - key: change-recorded
2953
2966
  check:
2954
2967
  kind: judge
2955
- 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.'
2968
+ 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.'
2956
2969
  - key: pr-names-session
2957
2970
  check:
2958
2971
  kind: judge
2959
2972
  statement: A pull request body, when there is one, carries the line naming this Pod session.
2960
- 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.'
2973
+ 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.'
2961
2974
  tier: standard
2962
2975
  expectedOutputs:
2963
- - kind: pull_request
2964
- label: Draft pull request (outcome pr-<repo>-<number>, ref = its url); public repo only
2976
+ - key: pull-request
2977
+ kind: pull_request
2978
+ label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
2965
2979
  optional: true
2966
2980
  - key: checks
2967
2981
  gate:
package/src/crm.yaml CHANGED
@@ -2409,9 +2409,11 @@ playbooks:
2409
2409
  table (entities.list, entities.get, views.list, profiles.list,
2410
2410
  lifecycle.board, flow.of, lifecycle.throughput, attention.needsYou,
2411
2411
  attention.count, sessions.list, lifecycle.home, lifecycle.moving,
2412
- documents.get, lens.page) and only that op's params; the host stamps
2413
- the space, so never put a workspaceId, a token, a pod URL or a fetch in
2414
- the page. What the bridge reads stays live: query it in the page, never
2412
+ documents.get, lens.page, sessions.get, playbook.process,
2413
+ playbook.scorecard, project.pillars) and only that op's params; the
2414
+ host stamps the space, so never put a workspaceId, a token, a pod URL
2415
+ or a fetch in the page. What the bridge reads stays live: query it in
2416
+ the page, never
2415
2417
  paste its rows. What it cannot read yet (messages, replies, sends: the
2416
2418
  bridge has no message op) you read now with your own tools
2417
2419
  (synap_get_channel, synap_get_entities) and write into the page as a
@@ -9,6 +9,8 @@
9
9
  * lifecycle may be declared there (a role foundation owns);
10
10
  * - one `primary` output per producing space, one of `produces`; a library
11
11
  * names none (`intent-primary-*`, One model decision 3);
12
+ * - a produced kind's `as` (output or helper): the primary is never a
13
+ * helper, and both doors carry it;
12
14
  * - (the catalog header half lives in `schema/intent-header.test.ts`);
13
15
  * - BOTH install doors carry it (top-level `intent` on both), driven through
14
16
  * the real converters.
@@ -121,6 +123,25 @@ describe("meta.intent — validator rules", () => {
121
123
  expect(errs.map((e) => e.rule)).toEqual(["intent-primary-library"]);
122
124
  });
123
125
 
126
+ // Negative control: goes red with the `as` checks removed from checkIntent.
127
+ it("a helper kind: the primary is never a helper; an unknown `as` is a shape error", () => {
128
+ const profiles = [lifecycled("feature"), lifecycled("story")];
129
+ const ok = make("t", profiles, {
130
+ label: "P",
131
+ primary: "feature",
132
+ produces: [{ profile: "feature", as: "output" }, { profile: "story", as: "helper" }],
133
+ });
134
+ expect(intentErrors(ok)).toEqual([]);
135
+ const helperPrimary = make("t", profiles, { label: "P", primary: "feature", produces: [{ profile: "feature", as: "helper" }, { profile: "story" }] });
136
+ expect(intentErrors(helperPrimary).map((e) => e.rule)).toEqual(["intent-primary-helper"]);
137
+ const unknownAs = make("t", profiles, {
138
+ label: "P",
139
+ primary: "feature",
140
+ produces: [{ profile: "feature" }, { profile: "story", as: "sidekick" }],
141
+ } as unknown as TemplateIntent);
142
+ expect(intentErrors(unknownAs).map((e) => e.rule)).toEqual(["intent-shape"]);
143
+ });
144
+
124
145
  it("an unresolvable dependency does not fabricate an unknown-profile error", () => {
125
146
  const t = make("t", [lifecycled("thing")], { label: "P", produces: [{ profile: "elsewhere" }] }, ["not-in-corpus"]);
126
147
  expect(intentErrors(t)).toEqual([]);
@@ -141,6 +162,17 @@ describe("meta.intent — both install doors carry it", () => {
141
162
  expect(toWorkspaceDefinition(t).definition.intent).toEqual(intent);
142
163
  });
143
164
 
165
+ it("a helper kind reaches both doors as declared", () => {
166
+ const helper = {
167
+ label: "Product",
168
+ primary: "thing",
169
+ produces: [{ profile: "thing" }, { profile: "step", as: "helper" as const }],
170
+ };
171
+ const h = make("t", [lifecycled("thing"), lifecycled("step")], helper);
172
+ expect(toPackageDefinition(h).intent).toEqual(helper);
173
+ expect(toWorkspaceDefinition(h).definition.intent).toEqual(helper);
174
+ });
175
+
144
176
  it("no intent → no field on either door", () => {
145
177
  const none = make("t", [lifecycled("thing")]);
146
178
  expect("intent" in toPackageDefinition(none)).toBe(false);
@@ -176,6 +208,15 @@ describe("meta.intent — the catalog", () => {
176
208
  expect(table["research-base"]).toEqual(["Research", "hypothesis", "research-finding"]);
177
209
  });
178
210
 
211
+ it("Builder: stories and UI designs are helpers of the feature", () => {
212
+ const builder = corpus.find((t) => t.meta.slug === "builder-workspace")!;
213
+ expect(builder.meta.intent!.produces).toEqual([
214
+ { profile: "devplane_feature" },
215
+ { profile: "devplane_story", as: "helper" },
216
+ { profile: "ui-design", as: "helper" },
217
+ ]);
218
+ });
219
+
179
220
  it("every producing space names its primary (One model decision 3)", () => {
180
221
  const primaries = Object.fromEntries(corpus.filter((t) => t.meta.intent?.produces?.length).map((t) => [t.meta.slug, t.meta.intent!.primary]));
181
222
  expect(primaries).toEqual({
@@ -204,3 +204,86 @@ describe("Ship a change - binds with no feature (structural guard P4 d)", () =>
204
204
  expect(pb.goalTemplate).not.toContain("({feature})");
205
205
  });
206
206
  });
207
+
208
+ describe("the merge criterion names the PR outcome (work-model W4)", () => {
209
+ // The pod pairs a criterion with an outcome by `outputKey` only; a shared key
210
+ // pairs nothing, so a text that teaches "keyed the same" leaves the merge
211
+ // check without its PR (the evaluator hands over no outcome).
212
+ const cap = JSON.parse(
213
+ readFileSync(join(HERE, "../capabilities/github-read.capability.json"), "utf8")
214
+ ).spec as { skills: { name: string; description: string; code?: string }[] };
215
+ const merged = cap.skills.find((v) => v.name === "github_check_pr_merged");
216
+
217
+ it("Ship a change teaches outputKey pr-<repo>-<number>, never a criterion keyed the same", () => {
218
+ expect(pb.goalTemplate).toContain("outputKey pr-<repo>-<number>");
219
+ const merge = pb.stages.find((s) => s.key === "merge") as unknown as { goal: string };
220
+ expect(merge.goal).toContain("by outputKey");
221
+ for (const text of [pb.goalTemplate, merge.goal]) {
222
+ expect(text).not.toMatch(/keyed the same|of the same key/);
223
+ }
224
+ });
225
+
226
+ it("github_check_pr_merged tells the caller to name the outcome by outputKey", () => {
227
+ expect(merged).toBeDefined();
228
+ for (const text of [merged!.description, merged!.code ?? ""]) {
229
+ expect(text).toContain("outputKey");
230
+ expect(text).not.toMatch(/key the criterion like/i);
231
+ }
232
+ });
233
+ });
234
+
235
+ describe("a declared PR slot is completed, never shadowed by a new outcome (W6)", () => {
236
+ // The session check gate reads the outputs the stage left declares
237
+ // (backend#1179): a PR recorded only as a NEW outcome pr-<repo>-<n> leaves the
238
+ // declared slot owed and holds the run. Every catalog stage that declares a
239
+ // pull request tells the agent to complete THAT output.
240
+ type Stage = {
241
+ key: string;
242
+ goal?: string;
243
+ description?: string;
244
+ expectedOutputs?: { key?: string; kind?: string; label?: string }[];
245
+ };
246
+ const declaring = (getWorkspaceTemplate("builder-workspace")!.playbooks ?? []).flatMap((p) => {
247
+ const q = p as unknown as { name: string; goalTemplate?: string; stages?: Stage[] };
248
+ return (q.stages ?? []).flatMap((stage) =>
249
+ (stage.expectedOutputs ?? [])
250
+ .filter((o) => o.kind === "pull_request")
251
+ .map((out) => ({ playbook: q.name, goalTemplate: q.goalTemplate ?? "", stage, out }))
252
+ );
253
+ });
254
+
255
+ it("Ship a change: the PR step's and the merge step's criteria name the declared slot (W6: a step counts only its own and earlier criteria)", () => {
256
+ const named = pb.stages.flatMap((st) =>
257
+ ((st as unknown as { criteria?: { key: string; outputKey?: string }[] }).criteria ?? [])
258
+ .filter((c) => c.outputKey === "pull-request")
259
+ .map((c) => `${st.key}/${c.key}`)
260
+ );
261
+ expect(named).toEqual(["pr-opened/pr-opened", "merge/merged"]);
262
+ });
263
+
264
+ it("finds the stages it checks (an empty scan is a blind guard)", () => {
265
+ expect(declaring.map((d) => d.playbook)).toEqual(
266
+ expect.arrayContaining(["Ship a change", "Build a change", "Fix a bug", "Maintain", "Fix main red"])
267
+ );
268
+ });
269
+
270
+ it("each names its slot and says to complete that output with the PR's url", () => {
271
+ for (const { playbook, goalTemplate, stage, out } of declaring) {
272
+ const where = `${playbook} / ${stage.key}`;
273
+ const text = `${stage.goal ?? ""} ${stage.description ?? ""}`;
274
+ expect(out.label, where).not.toMatch(/outcome pr-<repo>-<number>/);
275
+ if (out.key) {
276
+ expect(out.key, where).toBe("pull-request");
277
+ expect(out.label, where).toContain(
278
+ "complete this output with its url (completeOutput pull-request, ref.url)"
279
+ );
280
+ expect(text, where).toMatch(
281
+ /complete (THIS output, pull-request,|the pull-request output of THIS stage) with its url/
282
+ );
283
+ } else {
284
+ // A slot named by its label (Merged fix, Fix PR): the text names THAT output.
285
+ expect(`${text} ${goalTemplate}`, where).toContain(out.label!);
286
+ }
287
+ }
288
+ });
289
+ });
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;