@synap-core/workspace-templates 0.74.1 → 0.76.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-gpV3Inzh.js';
1
+ import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-BkLLS_UL.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.74.1",
3
+ "version": "0.76.0",
4
4
  "type": "module",
5
5
  "description": "Canonical workspace definitions — YAML source + typed exports for browser, backend, CLI, and marketplace",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -0,0 +1,72 @@
1
+ {
2
+ "_about": "Two dev.pr_opened facts as the pod records them: the org flow 'GitHub pull requests and checks -> dev-loop facts' (43ae349d, node pr-opened) mapping applied to GitHub's real payloads of Synap-core/backend#1504 and #1501 (read 2 Dec 2026), body cut to its first line and its Pod session line, and data.sessionId as the pod stamps it (record-observation withResolvedSession: #1504's body names session 7bf6eed9, which exists; #1501, a Dependabot PR, names none, so no stamp). changes = the two change entities on the pod for those PRs at 15:20 UTC, session empty on both.",
3
+ "facts": {
4
+ "namesSession": {
5
+ "eventType": "dev.pr_opened",
6
+ "data": {
7
+ "sha": "623d70d5732b908198d75760387fa07c7cdcd3e3",
8
+ "url": "https://github.com/Synap-core/backend/pull/1504",
9
+ "base": "main",
10
+ "body": "## What\n\nPod session: 7bf6eed9-cc49-4e85-bc10-fd9ee19481f6",
11
+ "repo": "Synap-core/backend",
12
+ "title": "fix(ci): the merge queue runs the full suite on the combined tree",
13
+ "action": "opened",
14
+ "author": "Antoinesrvt",
15
+ "branch": "ci/queue-runs-full-suite",
16
+ "merged": false,
17
+ "number": 1504,
18
+ "source": "github-webhook",
19
+ "headSha": "623d70d5732b908198d75760387fa07c7cdcd3e3",
20
+ "intoDefault": true,
21
+ "subjectRef": "Synap-core/backend#1504",
22
+ "sessionId": "7bf6eed9-cc49-4e85-bc10-fd9ee19481f6"
23
+ }
24
+ },
25
+ "namesNone": {
26
+ "eventType": "dev.pr_opened",
27
+ "data": {
28
+ "sha": "1cfadb1e68b53b4e49b7eb8809055beda3773172",
29
+ "url": "https://github.com/Synap-core/backend/pull/1501",
30
+ "base": "main",
31
+ "body": "Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 4.1.3 to 4.1.4.",
32
+ "repo": "Synap-core/backend",
33
+ "title": "chore(deps): Bump sigstore/cosign-installer from 4.1.3 to 4.1.4",
34
+ "action": "opened",
35
+ "author": "dependabot[bot]",
36
+ "branch": "dependabot/github_actions/sigstore/cosign-installer-4.1.4",
37
+ "merged": false,
38
+ "number": 1501,
39
+ "source": "github-webhook",
40
+ "headSha": "1cfadb1e68b53b4e49b7eb8809055beda3773172",
41
+ "intoDefault": true,
42
+ "subjectRef": "Synap-core/backend#1501"
43
+ }
44
+ }
45
+ },
46
+ "changes": [
47
+ {
48
+ "id": "d8c05238-56fc-4b10-a516-accce8e4cf4c",
49
+ "properties": {
50
+ "prRef": "Synap-core/backend#1504",
51
+ "repo": "Synap-core/backend",
52
+ "number": 1504,
53
+ "branch": "ci/queue-runs-full-suite",
54
+ "url": "https://github.com/Synap-core/backend/pull/1504",
55
+ "headSha": "623d70d5732b908198d75760387fa07c7cdcd3e3",
56
+ "changeStatus": "ready"
57
+ }
58
+ },
59
+ {
60
+ "id": "9214549c-ca0c-4bf3-8a43-08f316931774",
61
+ "properties": {
62
+ "prRef": "Synap-core/backend#1501",
63
+ "repo": "Synap-core/backend",
64
+ "number": 1501,
65
+ "branch": "dependabot/github_actions/sigstore/cosign-installer-4.1.4",
66
+ "url": "https://github.com/Synap-core/backend/pull/1501",
67
+ "headSha": "1cfadb1e68b53b4e49b7eb8809055beda3773172",
68
+ "changeStatus": "ready"
69
+ }
70
+ }
71
+ ]
72
+ }
@@ -793,7 +793,10 @@ profiles:
793
793
  property: guideline-status
794
794
  options:
795
795
  - { key: draft, category: open }
796
- - { key: approved, category: done }
796
+ # humanOnly (space contract, 3 Dec 2026): a playbook's `guidance`
797
+ # renders the approved guidelines into the AI's instructions, so only
798
+ # a person makes one approved.
799
+ - { key: approved, category: done, humanOnly: true }
797
800
  - { key: deprecated, category: lost, humanOnly: true }
798
801
  # How it renders (entity rendering, decision 8): @synap-core/types/presentation.
799
802
  presentation:
package/src/builder.yaml CHANGED
@@ -4365,6 +4365,89 @@ automations:
4365
4365
  - { id: verdict--timed-out, source: verdict, target: mark-red, sourceHandle: timed_out }
4366
4366
  - { id: verdict--startup, source: verdict, target: mark-red, sourceHandle: startup_failure }
4367
4367
 
4368
+ # A change names the session that works it (founder, 2 Dec 2026, plan
4369
+ # 963343b8). The session is the one the pod stamps on its own dev facts
4370
+ # (`data.sessionId`: a session that recorded the pull request as an outcome,
4371
+ # else the session its body's "Pod session: <uuid>" line names, when that
4372
+ # session exists; none when nothing or several match). So the ONE rule that
4373
+ # reads the line stays the pod's, and this flow never parses a body.
4374
+ # It reads the dev facts recorded by the org-wide source "GitHub"
4375
+ # (github-pr-events): with no such source, no fact arrives and it never runs.
4376
+ # The wait: a pull request's fact can be recorded before "A pull request moves
4377
+ # its change" has created the change (85 s on backend#1504, 2 Dec 2026).
4378
+ # It never overwrites a session already set, and every "nothing to do" ends on
4379
+ # a condition, never a guard (a guard stop posts a run summary).
4380
+ - key: pull-request-names-change-session
4381
+ name: A pull request names its change's session
4382
+ description: >-
4383
+ A dev fact about a pull request (opened, reopened, queued, merged or
4384
+ closed) that names one session fills its change's Session, once: a change
4385
+ that already names a session keeps it, and a pull request that names no
4386
+ session, or several, leaves it empty.
4387
+ triggerType: event
4388
+ triggerConfig:
4389
+ eventPattern: dev.*
4390
+ status: active
4391
+ flow:
4392
+ nodes:
4393
+ - id: t
4394
+ type: trigger
4395
+ position: { x: 0, y: 0 }
4396
+ data:
4397
+ label: A dev fact is recorded
4398
+ triggerType: event
4399
+ config:
4400
+ eventPattern: dev.*
4401
+ - id: names-session
4402
+ type: condition
4403
+ position: { x: 0, y: 120 }
4404
+ data:
4405
+ label: It names one session
4406
+ expression: trigger.payload.data.sessionId != ""
4407
+ - id: wait
4408
+ type: delay
4409
+ position: { x: 0, y: 240 }
4410
+ data:
4411
+ label: Wait for its change to exist
4412
+ duration: 5m
4413
+ - id: find
4414
+ type: query
4415
+ position: { x: 0, y: 360 }
4416
+ data:
4417
+ label: Its change
4418
+ profileSlug: change
4419
+ limit: 1
4420
+ filter: '{"prRef": "{{trigger.payload.data.repo}}#{{trigger.payload.data.number}}"}'
4421
+ - id: has-change
4422
+ type: condition
4423
+ position: { x: 0, y: 480 }
4424
+ data:
4425
+ label: It has a change
4426
+ expression: steps.find.output.count >= 1
4427
+ - id: no-session-yet
4428
+ type: condition
4429
+ position: { x: 0, y: 600 }
4430
+ data:
4431
+ label: Its change names no session yet
4432
+ expression: steps.find.output.entities[0].properties.session == ""
4433
+ - id: name-session
4434
+ type: output
4435
+ position: { x: 0, y: 720 }
4436
+ data:
4437
+ label: The change names its session
4438
+ outputType: entity_update
4439
+ config:
4440
+ entityId: "{{steps.find.output.entities[0].id}}"
4441
+ properties:
4442
+ session: "{{trigger.payload.data.sessionId}}"
4443
+ edges:
4444
+ - { id: t--names-session, source: t, target: names-session }
4445
+ - { id: names-session--wait, source: names-session, target: wait, sourceHandle: "yes" }
4446
+ - { id: wait--find, source: wait, target: find }
4447
+ - { id: find--has-change, source: find, target: has-change }
4448
+ - { id: has-change--no-session-yet, source: has-change, target: no-session-yet, sourceHandle: "yes" }
4449
+ - { id: no-session-yet--name-session, source: no-session-yet, target: name-session, sourceHandle: "yes" }
4450
+
4368
4451
  # The skills every AI working in Dev is told exist (installed by the
4369
4452
  # `require` dependencies above; this is the LINK, that is the INSTALL).
4370
4453
  skills:
@@ -393,23 +393,29 @@ describe("a piece's format: content-format (design I)", () => {
393
393
  });
394
394
  });
395
395
 
396
- describe("Thinking session: a timeboxed process on one piece, the AI never writes it", () => {
396
+ describe("Unfold a thought, route session: a timeboxed process on one piece, the AI never writes it", () => {
397
397
  const pb = (contentOs.playbooks ?? []).find(
398
- (p) => p.name === "Thinking session"
398
+ (p) => p.name === "Unfold a thought"
399
399
  );
400
+ const session = (pb?.stages ?? []).filter((s) => s.key.startsWith("session-"));
400
401
 
401
- it("works one piece, with a timebox param of 60 minutes by default", () => {
402
- expect(pb?.subjectProfile?.profileSlug).toBe("content-composition");
402
+ it("Thinking session is no sibling playbook any more: it is a source of Unfold a thought", () => {
403
+ expect(
404
+ (contentOs.playbooks ?? []).find((p) => p.name === "Thinking session")
405
+ ).toBeUndefined();
406
+ expect(pb?.params?.find((p) => p.name === "source")).toMatchObject({
407
+ type: "choice",
408
+ options: ["thought", "interview", "session"],
409
+ });
410
+ });
411
+
412
+ it("takes a piece and a timebox param of 60 minutes by default", () => {
403
413
  const params = (pb?.params ?? []) as Array<{
404
414
  name: string;
405
415
  type: string;
406
416
  default?: unknown;
407
- required?: boolean;
408
417
  }>;
409
- expect(params.find((p) => p.name === "piece")).toMatchObject({
410
- type: "entity",
411
- required: true,
412
- });
418
+ expect(params.find((p) => p.name === "piece")).toMatchObject({ type: "entity" });
413
419
  expect(params.find((p) => p.name === "minutes")).toMatchObject({
414
420
  type: "number",
415
421
  default: 60,
@@ -417,27 +423,27 @@ describe("Thinking session: a timeboxed process on one piece, the AI never write
417
423
  expect(pb?.goalTemplate).toContain("{minutes}");
418
424
  });
419
425
 
420
- it("gather → questions → thesis → draft; only the person-approved draft moves the piece, to Drafting", () => {
421
- const stages = pb?.stages ?? [];
422
- expect(stages.map((s) => s.key)).toEqual([
423
- "gather",
424
- "questions",
425
- "thesis",
426
- "draft",
427
- ]);
428
- const moving = stages.filter((s) => s.subjectStatus);
429
- expect(moving.map((s) => [s.key, s.subjectStatus])).toEqual([
430
- ["draft", "drafting"],
426
+ it("gather → questions → thesis → draft; the person-approved draft is gated and sends the run back to the questions", () => {
427
+ expect(session.map((s) => s.key)).toEqual([
428
+ "session-gather",
429
+ "session-questions",
430
+ "session-thesis",
431
+ "session-draft",
431
432
  ]);
432
- expect(keys).toContain("drafting");
433
- const draft = stages.find((s) => s.key === "draft");
433
+ const draft = session.find((s) => s.key === "session-draft");
434
434
  expect(draft?.gate).toEqual({ kind: "human" });
435
- expect(draft?.onFail).toEqual({ toStage: "questions" });
435
+ expect(draft?.onFail).toEqual({ toStage: "session-questions" });
436
+ // The piece moves to Drafting through the status door, named in the goal.
437
+ expect(keys).toContain("drafting");
438
+ expect(draft?.goal).toMatch(/move the piece to Drafting/);
436
439
  });
437
440
 
438
441
  it("says the AI never writes the piece, and stitches the person's answers in their order", () => {
439
442
  expect(pb?.goalTemplate).toMatch(/never write the piece/i);
440
- expect(pb?.goalTemplate).toMatch(/order they/i);
443
+ expect(draftGoal()).toMatch(/order of their answers/i);
444
+ function draftGoal() {
445
+ return (session.find((s) => s.key === "session-draft")?.goal ?? "").replace(/\s+/g, " ");
446
+ }
441
447
  });
442
448
  });
443
449
 
@@ -452,19 +458,26 @@ describe("Derive outputs: posts (any number per account) and a newsletter issue,
452
458
  it("works a piece, as an agent, with the params the studio sends", () => {
453
459
  expect(pb?.subjectProfile?.profileSlug).toBe("content-composition");
454
460
  expect(pb?.executor).toBe("is-agent");
455
- expect(pb?.tools).toEqual(["create_entity", "create_relation"]);
461
+ expect(pb?.tools).toEqual([
462
+ "create_entity",
463
+ "create_relation",
464
+ "propose_entity_graph",
465
+ "update_entity",
466
+ ]);
456
467
  const params = (pb?.params ?? []) as Array<{
457
468
  name: string;
458
469
  type: string;
459
470
  required?: boolean;
460
471
  }>;
461
472
  expect(params.map((p) => [p.name, p.type])).toEqual([
473
+ ["source", "choice"],
462
474
  ["piece", "entity"],
463
475
  ["accounts", "text"],
464
476
  ["posts", "number"],
465
477
  ["from", "text"],
466
478
  ]);
467
- expect(params.find((p) => p.name === "piece")?.required).toBe(true);
479
+ // Optional: the idea-bank source has no piece.
480
+ expect(params.find((p) => p.name === "piece")?.required).toBeUndefined();
468
481
  for (const p of params) expect(goal, p.name).toContain(`{${p.name}}`);
469
482
  });
470
483
 
@@ -498,6 +511,8 @@ describe("Derive outputs: posts (any number per account) and a newsletter issue,
498
511
  pb?.expectedOutputs?.map((o) => [o.kind, o.relationToSubject])
499
512
  ).toEqual([
500
513
  ["post", "derived_from"],
514
+ // The idea-bank source (was "Package ideas"): packaged posts, no subject.
515
+ ["post", "none"],
501
516
  ["newsletter", "derived_from"],
502
517
  ]);
503
518
  const links = contentOs.entityLinks ?? [];
@@ -513,10 +528,16 @@ describe("Derive outputs: posts (any number per account) and a newsletter issue,
513
528
  ).toBe(true);
514
529
  });
515
530
 
516
- it("writes only through its own tools, and leaves the piece's status alone (no update tool)", () => {
517
- expect(goal).toContain("(create_entity)");
518
- expect(goal).toContain("(create_relation)");
519
- expect(goal).not.toMatch(/synap_capture|synap_update_entity|update_entity/);
520
- expect(goal).toMatch(/piece's own status is not moved/);
531
+ it("the piece source writes only through create tools and leaves the piece's status alone; only the idea-bank source moves ideas", () => {
532
+ // Two sources, one goal: the piece route is the text after "PIECE:".
533
+ const piece = goal.slice(goal.indexOf("PIECE:"));
534
+ expect(piece).toContain("(create_entity)");
535
+ expect(piece).toContain("(create_relation)");
536
+ expect(piece).not.toMatch(/synap_capture|synap_update_entity|update_entity/);
537
+ expect(piece).toMatch(/piece's own status is not moved/);
538
+ // The idea bank files ONE capture graph and moves the ideas it used (never a piece).
539
+ const bank = goal.slice(0, goal.indexOf("PIECE:"));
540
+ expect(bank).toMatch(/synap_capture graph/);
541
+ expect(bank).toMatch(/move\s+each idea that feeds a post to Used/);
521
542
  });
522
543
  });
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Content OS declares its space contract at the marketplace template (founder,
3
+ * 3 Dec 2026; plan 97135f3c; spec 3c7c61cf §3 and §6), so every pod that
4
+ * installs it, and our pod through the template update, gets it.
5
+ *
6
+ * - the post lifecycle: who moves each status (humanOnly on Idea, Scheduled,
7
+ * Archived), Measured after Published, no gate on In Draft;
8
+ * - the steps of the path are recipes with variants as PARAMETERS: the merged
9
+ * playbooks are gone from the template, their sources are routes of the one
10
+ * recipe that absorbed them;
11
+ * - the rules a step reads are declared as `guidance` (a reader per rule),
12
+ * the Produce Content ones equal to what the pod already declares;
13
+ * - the space takes requests in plain words (`onboarding.intents`).
14
+ *
15
+ * Read from the YAML SOURCE. Does NOT cover what the pod does with a stage at
16
+ * run time (a stage jumped to by `currentStage`, a gate on a skipped stage):
17
+ * that is dogfood.
18
+ */
19
+
20
+ import { describe, expect, it } from "vitest";
21
+ import { readFileSync } from "node:fs";
22
+ import { dirname, join } from "node:path";
23
+ import { fileURLToPath } from "node:url";
24
+ import { load } from "js-yaml";
25
+ import type { TemplatePlaybook, WorkspaceYaml } from "./types.js";
26
+
27
+ const source = load(
28
+ readFileSync(join(dirname(fileURLToPath(import.meta.url)), "content-os.yaml"), "utf8")
29
+ ) as WorkspaceYaml;
30
+ const playbooks = (source.playbooks ?? []) as TemplatePlaybook[];
31
+ const pb = (name: string) => playbooks.find((p) => p.name === name);
32
+ const post = source.profiles.find((p) => p.slug === "post")!;
33
+
34
+ describe("the post lifecycle: an owner and a gate per status", () => {
35
+ const opt = (key: string) => post.lifecycle?.options.find((o) => o.key === key);
36
+
37
+ it("Idea, Scheduled and Archived are the person's; Measured is done, after Published", () => {
38
+ expect(
39
+ post.lifecycle?.options.filter((o) => o.humanOnly).map((o) => o.key)
40
+ ).toEqual(["Idea", "Scheduled", "Archived"]);
41
+ const keys = post.lifecycle?.options.map((o) => o.key) ?? [];
42
+ expect(keys.indexOf("Measured")).toBe(keys.indexOf("Published") + 1);
43
+ expect(opt("Measured")?.category).toBe("done");
44
+ expect(opt("Measured")?.humanOnly).toBeUndefined();
45
+ });
46
+
47
+ it("Published is not person-only: a fact the person records is recorded directly", () => {
48
+ expect(opt("Published")?.humanOnly).toBeUndefined();
49
+ });
50
+
51
+ it("only Review and Publish keep a person's gate in Produce Content", () => {
52
+ const gated = (pb("Produce Content")?.stages ?? []).filter((s) => s.gate).map((s) => s.key);
53
+ expect(gated).toEqual(["review", "publish"]);
54
+ });
55
+
56
+ it("Repurpose measures: its measure stage reaches Measured and names the move", () => {
57
+ const measure = pb("Repurpose")?.stages?.find((s) => s.key === "measure");
58
+ expect(measure?.onApproved).toBe("Measured");
59
+ expect(measure?.goal).toMatch(/Measured/);
60
+ });
61
+ });
62
+
63
+ describe("one recipe per step, variants as parameters", () => {
64
+ it("the merged playbooks are no sibling of the recipe that absorbed them", () => {
65
+ const names = playbooks.map((p) => p.name);
66
+ for (const gone of ["Package ideas", "Thinking session"]) expect(names, gone).not.toContain(gone);
67
+ });
68
+
69
+ it("the recipes name their route in a choice param, and every stage key is unique", () => {
70
+ const choice = (name: string, param: string) =>
71
+ (pb(name)?.params as Array<{ name: string; type: string; options?: string[] }> | undefined)?.find(
72
+ (p) => p.name === param
73
+ );
74
+ expect(choice("Unfold a thought", "source")?.options).toEqual(["thought", "interview", "session"]);
75
+ expect(choice("Make the stills (from a board)", "step")?.options).toEqual(["shape", "stills", "next", "post"]);
76
+ expect(choice("Make a film (from the board)", "kind")?.options).toEqual(["animated", "presenter", "recorded"]);
77
+ expect(choice("Derive outputs", "source")?.options).toEqual(["piece", "idea-bank"]);
78
+ expect(choice("Repurpose", "mode")?.options).toEqual(["measure", "repurpose", "both"]);
79
+ for (const p of playbooks) {
80
+ const keys = (p.stages ?? []).map((s) => s.key);
81
+ expect(new Set(keys).size, p.name).toBe(keys.length);
82
+ }
83
+ });
84
+
85
+ it("the Monday interview is re-declared on Unfold a thought", () => {
86
+ expect(pb("Unfold a thought")?.activators).toContainEqual(
87
+ expect.objectContaining({ on: "schedule", cron: "0 8 * * 1", mode: "propose" })
88
+ );
89
+ });
90
+
91
+ it("the apps' lookups still find their recipe by the param it declares", () => {
92
+ const declares = (name: string, param: string) =>
93
+ (pb(name)?.params as Array<{ name: string }> | undefined)?.some((p) => p.name === param);
94
+ expect(declares("Make the stills (from a board)", "formats")).toBe(true);
95
+ expect(declares("Make the stills (from a board)", "intent")).toBe(true);
96
+ expect(declares("Make a film (from the board)", "stills")).toBe(true);
97
+ });
98
+
99
+ it("stays small: 8 recipes, the newsletter, and the two kept for a stated reason", () => {
100
+ const recipes = [
101
+ "Unfold a thought",
102
+ "Derive outputs",
103
+ "Produce Content",
104
+ "Make the stills (from a board)",
105
+ "Make a film (from the board)",
106
+ "Repurpose",
107
+ "Plan Next Content",
108
+ "Improve a recipe (from its runs)",
109
+ ];
110
+ const kept = [
111
+ "Newsletter issue",
112
+ // One-shot (executor generate): a stage cannot be one, and Content Studio finds it by name.
113
+ "Write the caption",
114
+ // Its subject is the take (a content-asset), not a composition, and the studio's take doors find it by name.
115
+ "Work a take",
116
+ ];
117
+ expect(playbooks.map((p) => p.name).sort()).toEqual([...recipes, ...kept].sort());
118
+ });
119
+ });
120
+
121
+ describe("a rule has a declared reader", () => {
122
+ // The pod's Produce Content also filters a third ref on `post-platform`
123
+ // (LinkedIn). The catalog refuses a `where` on a property the guideline kind
124
+ // does not have (catalog-lib guidance-ref), and content-guideline has no
125
+ // platform property, so the template carries the first two verbatim and the
126
+ // pod keeps its own third (an owner-edited field is kept by the update).
127
+ it("Produce Content declares the first two refs the pod already holds, verbatim", () => {
128
+ expect(pb("Produce Content")?.guidance).toEqual([
129
+ { ref: "kind:brand-voice-guide", label: "Voice of the account's brand" },
130
+ {
131
+ ref: "kind:content-guideline",
132
+ label: "Base and per-format guidelines (open the topic before the product, hooks and closes)",
133
+ },
134
+ ]);
135
+ });
136
+
137
+ it("every step that writes or plans posts reads the guidelines", () => {
138
+ for (const name of ["Produce Content", "Derive outputs", "Plan Next Content", "Repurpose"]) {
139
+ expect(
140
+ (pb(name)?.guidance ?? []).some((g) => g.ref === "kind:content-guideline"),
141
+ name
142
+ ).toBe(true);
143
+ }
144
+ });
145
+ });
146
+
147
+ describe("the space takes requests in plain words", () => {
148
+ const intents = (source.onboarding as { intents?: Array<{ phrase: string; locale?: string }> }).intents ?? [];
149
+
150
+ it("declares the four requests, each in English and in French (the cap is 8)", () => {
151
+ expect(intents).toHaveLength(8);
152
+ expect(intents.filter((i) => i.locale === "en")).toHaveLength(4);
153
+ expect(intents.filter((i) => i.locale === "fr")).toHaveLength(4);
154
+ expect(intents.map((i) => i.phrase)).toEqual(
155
+ expect.arrayContaining(["write a LinkedIn post", "rédiger un post LinkedIn", "write our brand story"])
156
+ );
157
+ });
158
+ });
@@ -314,6 +314,7 @@ describe("Content OS scripts a post before generating it", () => {
314
314
  "Review",
315
315
  "Scheduled",
316
316
  "Published",
317
+ "Measured",
317
318
  "Archived",
318
319
  ];
319
320
  expect(prop("post-status")?.enumValues).toEqual(order);
@@ -354,9 +355,14 @@ describe("Content OS scripts a post before generating it", () => {
354
355
  ]);
355
356
  });
356
357
 
357
- it("holds the draft behind a person's approval of the script, reworking the script on reject", () => {
358
- expect(stage("draft")?.gate).toEqual({ kind: "human" });
359
- expect(stage("draft")?.onFail).toEqual({ toStage: "script" });
358
+ // Space contract (founder, 3 Dec 2026): a draft is private and reversible, so
359
+ // entering In Draft asks nobody; the gate that stays is Review's.
360
+ it("lets the draft start without a gate, and keeps the person's gate on Review and Publish", () => {
361
+ expect(stage("draft")?.gate).toBeUndefined();
362
+ expect(stage("draft")?.onFail).toBeUndefined();
363
+ expect(stage("draft")?.subjectStatus).toBe("In Draft");
364
+ expect(stage("review")?.gate).toEqual({ kind: "human" });
365
+ expect(stage("publish")?.gate).toEqual({ kind: "human" });
360
366
  });
361
367
  });
362
368
 
@@ -400,11 +406,18 @@ describe("Content OS ideas: their own kind, feeding posts", () => {
400
406
  });
401
407
 
402
408
  it("packages ideas through a bank-wide playbook that proposes posts, never writes them", () => {
403
- const pkg = template.playbooks?.find((p) => p.name === "Package ideas");
404
- expect(pkg?.subjectProfile).toBeUndefined();
405
- expect(pkg?.expectedOutputs).toEqual([
406
- expect.objectContaining({ kind: "post", relationToSubject: "none" }),
407
- ]);
409
+ // "Package ideas" is the idea-bank SOURCE of Derive outputs (space contract:
410
+ // a variant is a parameter, not a sibling playbook); it has no subject, so
411
+ // it is run by name.
412
+ expect(template.playbooks?.find((p) => p.name === "Package ideas")).toBeUndefined();
413
+ const pkg = template.playbooks?.find((p) => p.name === "Derive outputs");
414
+ expect(pkg?.params?.find((p) => p.name === "source")).toMatchObject({
415
+ type: "choice",
416
+ options: ["piece", "idea-bank"],
417
+ });
418
+ expect(pkg?.expectedOutputs).toContainEqual(
419
+ expect.objectContaining({ kind: "post", relationToSubject: "none", optional: true })
420
+ );
408
421
  expect(pkg?.goalTemplate).toMatch(/idea feeds post/);
409
422
  expect(pkg?.goalTemplate).toMatch(/ONE synap_capture graph/);
410
423
  expect(pkg?.goalTemplate).toMatch(/Never a script/);
@@ -341,8 +341,8 @@ describe("Produce Content moves the post's status with its stages", () => {
341
341
  expect(goalOf("brief")).toContain("A stage moves the post when its work is APPROVED, not when it is entered");
342
342
  });
343
343
 
344
- it("makes a take's cut plan the script, and says the Draft gate's approval writes In Draft", () => {
344
+ it("makes a take's cut plan the script, and says entering Draft moves the post to In Draft with no approval", () => {
345
345
  expect(goalOf("script")).toContain("With takes (the RE-EDIT route), the script is the cut plan");
346
- expect(goalOf("draft").startsWith("Entering Draft waits on the person: this stage's gate asks them to approve the script, and that approval moves the post to In Draft. Build nothing before it passes.")).toBe(true);
346
+ expect(goalOf("draft").startsWith("Entering Draft moves the post to In Draft and asks nobody: a draft is private and reversible, and the person decides at Review.")).toBe(true);
347
347
  });
348
348
  });