@synap-core/workspace-templates 0.75.0 → 0.76.1

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.75.0",
3
+ "version": "0.76.1",
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,87 @@
1
+ {
2
+ "_about": "Recorded 3 Dec 2026 (lane R3, session 1286c739). merged = the dev.pr_merged fact the org flow 'GitHub pull requests and checks -> dev-loop facts' (43ae349d, node pr-merged) records for Synap-core/backend#1530, its mapping applied to GitHub's real payload (read 15:40 UTC), body cut to its first line; the pod recorded this fact at 11:21:20 UTC, 68 s after the merge (get_timeline). changes = six change entities on the pod read between 15:20 and 15:25 UTC: backend#1530 Checks running (merged 11:20:12, its run of 'A pull request moves its change' at 11:22:37 linked it and moved nothing), #1540 Ready to merge (merged 14:59:27, moved to Merged at 15:28:38), #1536 Checks running (merged 15:24:50, Merged at 15:53:13), synap-bridge#4 Checks running (merged 15:00:26, Merged at 15:30:44), #1538 Merged, #1532 Checks running (open then).",
3
+ "facts": {
4
+ "merged": {
5
+ "eventType": "dev.pr_merged",
6
+ "data": {
7
+ "repo": "Synap-core/backend",
8
+ "number": 1530,
9
+ "url": "https://github.com/Synap-core/backend/pull/1530",
10
+ "sha": "1afe5c6cb939730dfa47912b58e8f51ac92f11f5",
11
+ "branch": "feat/proposed-entity-layer",
12
+ "base": "main",
13
+ "intoDefault": true,
14
+ "title": "feat(pod-admin): a pending entity request draws the entity, its change marked on it",
15
+ "body": "Pod session: 4b724dc3-8d8f-403f-90e2-c256cf775d9c (wave 7 slice 2; design fe9803a4 §2.4, §6.3, §6.4; F1-F8 founder-validated 1 Dec 2026)",
16
+ "action": "closed",
17
+ "merged": true,
18
+ "headSha": "11db4c9a26c9faa3aa4d9b578d09efc51089daad",
19
+ "author": "Antoinesrvt",
20
+ "source": "github-webhook",
21
+ "subjectRef": "Synap-core/backend#1530"
22
+ }
23
+ }
24
+ },
25
+ "changes": [
26
+ {
27
+ "id": "a0fe8e2e-1033-41c8-90a4-a6fb8d8d5d4f",
28
+ "properties": {
29
+ "prRef": "Synap-core/backend#1530",
30
+ "repo": "Synap-core/backend",
31
+ "number": 1530,
32
+ "headSha": "11db4c9a26c9faa3aa4d9b578d09efc51089daad",
33
+ "changeStatus": "checks"
34
+ }
35
+ },
36
+ {
37
+ "id": "f778b630-6dec-4dba-84f0-254db4bb321c",
38
+ "properties": {
39
+ "prRef": "Synap-core/backend#1532",
40
+ "repo": "Synap-core/backend",
41
+ "number": 1532,
42
+ "headSha": "b92dfcc687f713d0d94d4e360038185faab00b75",
43
+ "changeStatus": "checks"
44
+ }
45
+ },
46
+ {
47
+ "id": "862bf8be-5d4a-4f74-8701-73125a287cf4",
48
+ "properties": {
49
+ "prRef": "Synap-core/backend#1536",
50
+ "repo": "Synap-core/backend",
51
+ "number": 1536,
52
+ "headSha": "5bc481c67775b1f0d3f23925db3a41b75b672e30",
53
+ "changeStatus": "checks"
54
+ }
55
+ },
56
+ {
57
+ "id": "eb92ff8e-f17b-4e54-8710-1bd3dc91e411",
58
+ "properties": {
59
+ "prRef": "Synap-core/backend#1538",
60
+ "repo": "Synap-core/backend",
61
+ "number": 1538,
62
+ "headSha": "83c920fd27845a5380ec2ceb08bb76e47e27b8a2",
63
+ "changeStatus": "merged"
64
+ }
65
+ },
66
+ {
67
+ "id": "bf55fb27-f8e6-47d3-82ba-964ff8798c91",
68
+ "properties": {
69
+ "prRef": "Synap-core/backend#1540",
70
+ "repo": "Synap-core/backend",
71
+ "number": 1540,
72
+ "headSha": "64440901fb81a3057850dcc4aa093e1f38dd2ded",
73
+ "changeStatus": "ready"
74
+ }
75
+ },
76
+ {
77
+ "id": "e5eee4d5-db18-4506-ac0c-2f0d0715248e",
78
+ "properties": {
79
+ "prRef": "Synap-core/synap-bridge#4",
80
+ "repo": "Synap-core/synap-bridge",
81
+ "number": 4,
82
+ "headSha": "af018bee8c6fa15931087e2adcedf5a46c1ae07c",
83
+ "changeStatus": "checks"
84
+ }
85
+ }
86
+ ]
87
+ }
@@ -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
@@ -4448,6 +4448,82 @@ automations:
4448
4448
  - { id: has-change--no-session-yet, source: has-change, target: no-session-yet, sourceHandle: "yes" }
4449
4449
  - { id: no-session-yet--name-session, source: no-session-yet, target: name-session, sourceHandle: "yes" }
4450
4450
 
4451
+ # A merged pull request settles its change, whatever happened to its run of
4452
+ # "A pull request moves its change" (lane R3, 3 Dec 2026, session 1286c739).
4453
+ # Measured that day: backend#1530 merged at 11:20 and its change stayed
4454
+ # Checks running (the run of its merge event linked the change and moved
4455
+ # nothing). So the merge reaches the change a second, independent way: the
4456
+ # `dev.pr_merged` fact the org-wide source "GitHub" (github-pr-events)
4457
+ # records, the fact the Ship page folds (`GET /work-release`). It only ever
4458
+ # writes Merged, on a change not already Merged; a pull request with no
4459
+ # change moves nothing. Every "nothing to do" ends on a condition, never a
4460
+ # guard (a guard stop posts a run summary). It listens to `dev.pr_merged`
4461
+ # only (a few dozen runs a day), never `dev.*`: each run of a flow that
4462
+ # writes an entity opens a session and waits on the pod's one automation
4463
+ # queue, which already ran up to ~30 min late that afternoon.
4464
+ - key: merged-pull-request-settles-change
4465
+ name: A merged pull request settles its change
4466
+ description: >-
4467
+ A dev.pr_merged fact into the default branch moves the pull request's
4468
+ change to Merged when GitHub's own event did not: a change already
4469
+ Merged, or a pull request with no change, moves nothing.
4470
+ triggerType: event
4471
+ triggerConfig:
4472
+ eventPattern: dev.pr_merged
4473
+ status: active
4474
+ flow:
4475
+ nodes:
4476
+ - id: t
4477
+ type: trigger
4478
+ position: { x: 0, y: 0 }
4479
+ data:
4480
+ label: A pull request merged
4481
+ triggerType: event
4482
+ config:
4483
+ eventPattern: dev.pr_merged
4484
+ - id: into-default
4485
+ type: condition
4486
+ position: { x: 0, y: 120 }
4487
+ data:
4488
+ label: It merged into the default branch
4489
+ expression: trigger.payload.data.intoDefault == "true"
4490
+ - id: find
4491
+ type: query
4492
+ position: { x: 0, y: 240 }
4493
+ data:
4494
+ label: Its change
4495
+ profileSlug: change
4496
+ limit: 1
4497
+ filter: '{"prRef": "{{trigger.payload.data.repo}}#{{trigger.payload.data.number}}"}'
4498
+ - id: has-change
4499
+ type: condition
4500
+ position: { x: 0, y: 360 }
4501
+ data:
4502
+ label: It has a change
4503
+ expression: steps.find.output.count >= 1
4504
+ - id: not-merged
4505
+ type: condition
4506
+ position: { x: 0, y: 480 }
4507
+ data:
4508
+ label: Its change is not Merged yet
4509
+ expression: steps.find.output.entities[0].properties.changeStatus != "merged"
4510
+ - id: settle
4511
+ type: output
4512
+ position: { x: 0, y: 600 }
4513
+ data:
4514
+ label: The change is Merged
4515
+ outputType: entity_update
4516
+ config:
4517
+ entityId: "{{steps.find.output.entities[0].id}}"
4518
+ properties:
4519
+ changeStatus: merged
4520
+ edges:
4521
+ - { id: t--into-default, source: t, target: into-default }
4522
+ - { id: into-default--find, source: into-default, target: find, sourceHandle: "yes" }
4523
+ - { id: find--has-change, source: find, target: has-change }
4524
+ - { id: has-change--not-merged, source: has-change, target: not-merged, sourceHandle: "yes" }
4525
+ - { id: not-merged--settle, source: not-merged, target: settle, sourceHandle: "yes" }
4526
+
4451
4527
  # The skills every AI working in Dev is told exist (installed by the
4452
4528
  # `require` dependencies above; this is the LINK, that is the INSTALL).
4453
4529
  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
  });