@synap-core/workspace-templates 0.62.0 → 0.64.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-KudS9Ja_.js';
1
+ import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-gpV3Inzh.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.62.0",
3
+ "version": "0.64.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",
@@ -100,7 +100,8 @@ playbooks:
100
100
  they want no new priorities.
101
101
  executor: is-agent
102
102
  status: active
103
- schedule: { cron: "0 16 * * 5", enabled: false, mode: appointment }
103
+ activators:
104
+ - { on: schedule, cron: "0 16 * * 5", mode: appointment, startsPaused: true }
104
105
  expectedOutputs:
105
106
  - { kind: task, label: Next week's priorities, relationToSubject: none }
106
107
  stages:
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Content OS campaigns (founder, 23 Nov 2026; J2 plan e51783ca, lane J2-cat).
3
+ *
4
+ * A campaign is the `campaign` kind, "an entity the post can be linked to
5
+ * (belongs to)", a container that gives workers, agents and the person their
6
+ * context. Membership is ONE single-valued property per kind (decision B1):
7
+ * `post-campaign` (already), `idea-campaign`, `composition-campaign`.
8
+ *
9
+ * Plan Next Content plans a campaign: its subject kind is `campaign` (the pod's
10
+ * copy is already bound to it), and it carries the founder's 9 Nov rules A
11
+ * (only posts are planned) and C (every date is a proposal), so applying a
12
+ * catalog update no longer reverts them. Rule B's numbers (the rhythm) live on
13
+ * the campaign, never in the catalog text.
14
+ */
15
+ import { describe, expect, it } from "vitest";
16
+ import { getWorkspaceTemplate } from "./templates.js";
17
+ import type { TemplatePlaybook } from "./types.js";
18
+
19
+ const template = (() => {
20
+ const resolved = getWorkspaceTemplate("content-os");
21
+ if (!resolved) throw new Error("content-os template is not registered");
22
+ return resolved;
23
+ })();
24
+
25
+ const profile = (slug: string) => template.profiles.find((p) => p.slug === slug);
26
+ const prop = (kind: string, slug: string) => profile(kind)?.properties.find((d) => d.slug === slug);
27
+ const playbook = (name: string) =>
28
+ (template.playbooks ?? []).find((p) => p.name === name) as TemplatePlaybook | undefined;
29
+
30
+ describe("Content OS: an idea and a piece belong to one campaign, like a post", () => {
31
+ const shape = (d: ReturnType<typeof prop>) =>
32
+ d && { valueType: d.valueType, targetProfileSlug: d.targetProfileSlug, inputType: d.inputType };
33
+
34
+ it("the post's own field is the model (non-vacuity)", () => {
35
+ expect(shape(prop("post", "post-campaign"))).toEqual({
36
+ valueType: "entity_id",
37
+ targetProfileSlug: "campaign",
38
+ inputType: "entity_select",
39
+ });
40
+ });
41
+
42
+ it("declares idea-campaign on idea and composition-campaign on content-composition, same shape", () => {
43
+ const model = shape(prop("post", "post-campaign"));
44
+ expect(shape(prop("idea", "idea-campaign"))).toEqual(model);
45
+ expect(shape(prop("content-composition", "composition-campaign"))).toEqual(model);
46
+ expect(prop("idea", "idea-campaign")?.label).toBe("Campaign");
47
+ expect(prop("content-composition", "composition-campaign")?.label).toBe("Campaign");
48
+ });
49
+
50
+ it("declares the graph edge to the campaign for both, as for a post", () => {
51
+ const links = (template.entityLinks ?? []).map(
52
+ (l) => `${l.sourceProfileSlug}-${l.type}->${l.targetProfileSlug}`,
53
+ );
54
+ expect(links).toEqual(
55
+ expect.arrayContaining([
56
+ "post-part_of_campaign->campaign",
57
+ "idea-part_of_campaign->campaign",
58
+ "content-composition-part_of_campaign->campaign",
59
+ ]),
60
+ );
61
+ });
62
+
63
+ it("Derive outputs gives the posts it makes the piece's campaign", () => {
64
+ const derive = playbook("Derive outputs");
65
+ expect(derive?.subjectProfile?.profileSlug).toBe("content-composition");
66
+ expect(derive?.goalTemplate).toMatch(/composition-campaign\), give each post that campaign\s+\(post-campaign\)/);
67
+ });
68
+ });
69
+
70
+ describe("Content OS: Plan Next Content plans a campaign, with the founder's rules", () => {
71
+ const plan = playbook("Plan Next Content");
72
+ const texts = () => [plan?.goalTemplate ?? "", ...(plan?.stages ?? []).map((s) => s.goal ?? "")];
73
+
74
+ it("is bound to the campaign kind, the pod's binding", () => {
75
+ expect(plan?.subjectProfile).toEqual({ profileSlug: "campaign" });
76
+ });
77
+
78
+ it("plans the run's campaign when it has one, else every active campaign", () => {
79
+ expect(plan?.goalTemplate).toMatch(/when this run has a subject, it is the\s+campaign to plan/);
80
+ expect(plan?.goalTemplate).toMatch(/With no subject,\s+plan every active campaign/);
81
+ // It reads the campaign's members from the one field per kind.
82
+ for (const field of ["idea-campaign", "composition-campaign", "post-campaign"]) {
83
+ expect(plan?.goalTemplate).toContain(field);
84
+ }
85
+ });
86
+
87
+ it("carries rule A: only posts are planned, never raw material", () => {
88
+ expect(plan?.goalTemplate).toContain("(A) Only POSTS are planned");
89
+ expect(plan?.goalTemplate).toMatch(/never give one a slot or a date/);
90
+ expect(plan?.goalTemplate).toMatch(/never treat a post that is only a take/);
91
+ });
92
+
93
+ it("carries rule C: every date is a proposal, and the final message reads back what is applied", () => {
94
+ expect(plan?.goalTemplate).toMatch(/\(C\) You change nothing yourself/);
95
+ expect(plan?.goalTemplate).toContain("never apply a date yourself");
96
+ expect(plan?.goalTemplate).toMatch(/exactly what is applied and what is proposed/);
97
+ expect((plan?.criteria ?? []).map((c) => c.key)).toContain("nothing-applied-directly");
98
+ });
99
+
100
+ it("reads rule B, the rhythm, from the campaign: no day or count of the rhythm in this text", () => {
101
+ expect(plan?.goalTemplate).toMatch(/\(B\) The rhythm is the campaign's/);
102
+ for (const text of texts()) {
103
+ expect(text).not.toMatch(/monday|tuesday|wednesday|thursday|friday|saturday|sunday/i);
104
+ expect(text).not.toMatch(/\b(two|three|four|five) publishing days\b/i);
105
+ }
106
+ });
107
+
108
+ it("keeps the pod's four stages, none of which moves the campaign's status", () => {
109
+ expect((plan?.stages ?? []).map((s) => s.key)).toEqual(["read", "audit", "place", "file"]);
110
+ for (const stage of plan?.stages ?? []) {
111
+ expect(stage.subjectStatus).toBeUndefined();
112
+ expect(stage.onApproved).toBeUndefined();
113
+ }
114
+ expect((plan?.criteria ?? []).map((c) => c.key)).toEqual([
115
+ "nothing-applied-directly",
116
+ "rhythm-kept",
117
+ "outputs-filed",
118
+ ]);
119
+ });
120
+
121
+ it("never runs at the same minute as Weekly content production", () => {
122
+ const planCron = plan?.activators?.find((a) => a.on === "schedule")?.cron;
123
+ const produce = template.automations?.find((a) => a.key === "content-os-weekly-produce");
124
+ expect(planCron).toBe("0 9 * * 1");
125
+ expect((produce?.triggerConfig as { expression?: string } | undefined)?.expression).not.toBe(planCron);
126
+ });
127
+ });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Content OS pin strategy — Produce Content is pinned; the weekly cron that
3
3
  * runs it ships paused; Plan Next Content's workers (weekly and by hand) run
4
- * once over every post and propose. Not a YAML snapshot.
4
+ * once per tick and propose. Not a YAML snapshot.
5
5
  */
6
6
  import { readFileSync } from "fs";
7
7
  import { dirname, join } from "path";
@@ -32,7 +32,7 @@ describe("Content OS pin strategy", () => {
32
32
  expect(rejected).toBeDefined();
33
33
  });
34
34
 
35
- it("pins Produce Content; Plan Next Content runs weekly and by hand, once over every post, proposing", () => {
35
+ it("pins Produce Content; Plan Next Content runs weekly and by hand, once per tick, proposing", () => {
36
36
  const produce = template.playbooks?.find((p) => p.name === "Produce Content");
37
37
  const plan = template.playbooks?.find((p) => p.name === "Plan Next Content");
38
38
 
@@ -47,12 +47,11 @@ describe("Content OS pin strategy", () => {
47
47
  expect(produce).not.toHaveProperty("schedule");
48
48
  expect(produce?.inputStrategy).not.toHaveProperty("pinnedEntityIds");
49
49
 
50
- // A subject-bound playbook's `schedule:` fans out one run per post: the
51
- // plan's clock is a per_moment activator instead, never that field.
50
+ // The plan's clock is a per_moment schedule activator: ONE run per tick,
51
+ // never one per campaign.
52
52
  expect(plan).not.toHaveProperty("schedule");
53
53
  expect(plan).not.toHaveProperty("inputStrategy");
54
- expect(plan?.subjectProfile).toEqual({ profileSlug: "post" });
55
- expect(plan?.stages ?? []).toEqual([]);
54
+ // Its subject kind and stages: content-os.campaigns.template.test.ts.
56
55
  expect(plan?.activators).toEqual([
57
56
  { on: "schedule", cron: "0 9 * * 1", mode: "propose" },
58
57
  { on: "manual", size: "per_moment", mode: "propose" },
@@ -70,7 +69,7 @@ describe("Content OS pin strategy", () => {
70
69
  key: "content-os-weekly-produce",
71
70
  triggerType: "cron",
72
71
  status: "paused",
73
- triggerConfig: { expression: "0 9 * * 1" },
72
+ triggerConfig: { expression: "0 9 * * 2" },
74
73
  });
75
74
 
76
75
  const nodes = (automation?.flow.nodes ?? []) as Array<{
@@ -558,6 +558,15 @@ profiles:
558
558
  valueType: entity_id
559
559
  targetProfileSlug: pillar
560
560
  inputType: entity_select
561
+ # The campaign this idea is kept for (founder, 23 Nov 2026, J2 plan
562
+ # e51783ca decision B1): ONE campaign per thing, the same single-valued
563
+ # shape as `post-campaign`, so Content Studio reads membership from the
564
+ # row and Plan Next Content reads a campaign's ideas from it.
565
+ - slug: idea-campaign
566
+ label: Campaign
567
+ valueType: entity_id
568
+ targetProfileSlug: campaign
569
+ inputType: entity_select
561
570
  - slug: idea-stage
562
571
  label: Journey Stage
563
572
  valueType: entity_id
@@ -1449,6 +1458,15 @@ profiles:
1449
1458
  valueType: string
1450
1459
  inputType: select
1451
1460
  enumValues: [text-site, text-linkedin, text-newsletter, carousel-linkedin, carousel-instagram, carousel-both, video-motion, video-capture, carousel]
1461
+ # The campaign this piece belongs to (founder, 23 Nov 2026, J2 plan
1462
+ # e51783ca decision B1): ONE campaign per piece, the same single-valued
1463
+ # shape as `post-campaign`. Derive outputs copies it onto the posts it
1464
+ # makes, so the campaign's Publications see them.
1465
+ - slug: composition-campaign
1466
+ label: Campaign
1467
+ valueType: entity_id
1468
+ targetProfileSlug: campaign
1469
+ inputType: entity_select
1452
1470
 
1453
1471
  - slug: content-asset
1454
1472
  displayName: Asset
@@ -1909,6 +1927,18 @@ entityLinks:
1909
1927
  targetProfileSlug: pillar
1910
1928
  type: belongs_to_pillar
1911
1929
  label: Pillar
1930
+ # An idea and a piece belong to a campaign the way a post does (J2 plan
1931
+ # e51783ca, decision B1): the single-valued property (`idea-campaign`,
1932
+ # `composition-campaign`) is what apps and playbooks read; the edge is
1933
+ # declared for the graph, as the pillar edges are.
1934
+ - sourceProfileSlug: idea
1935
+ targetProfileSlug: campaign
1936
+ type: part_of_campaign
1937
+ label: Campaign
1938
+ - sourceProfileSlug: content-composition
1939
+ targetProfileSlug: campaign
1940
+ type: part_of_campaign
1941
+ label: Campaign
1912
1942
  # The video pipeline edges (moved from content-studio.yaml). content-studio's
1913
1943
  # `made_with_recipe` edge is NOT carried: its recipe kind was folded into
1914
1944
  # Brand Library's `brand-template` (decision D2, 2026-10-12), which the
@@ -2517,53 +2547,128 @@ playbooks:
2517
2547
  statement: Nothing was published, and no Produce Content run started unless the person asked for it.
2518
2548
  check: { kind: judge }
2519
2549
 
2520
- # The proactive half: the plan. It reasons over the corpus as a whole, so it
2521
- # takes no params, and its WORKERS are per_moment: ONE run over every post,
2522
- # never one run per post (a subject-bound playbook's `schedule:` field fans
2523
- # out per entity; an activator's `schedule` and a per_moment `manual` do
2524
- # not: api `run-playbook.ts` runWorkerBatch). The `subjectProfile` names the
2525
- # kind those workers read; there are no stages, so it never moves a post's
2526
- # status.
2527
- # Run by hand ("Re-plan" on Content Studio's calendar, or the pod's button)
2528
- # and once a week (founder, report 22fec5ee §6, 3 Nov 2026). The weekly one
2529
- # compiles to a governed rule the owner can pause on the pod; both propose
2530
- # every write, so the dates arrive as ONE batch the person approves.
2531
- # The plan's numbers are never in this text: cadence, goal mix, pillar
2532
- # balance and the campaign are read from the pod, where the person edits them.
2550
+ # The proactive half: the plan. It reasons over a CAMPAIGN (founder, 23 Nov
2551
+ # 2026, J2 plan e51783ca decisions A1 and D-1: a campaign is the `campaign`
2552
+ # kind, the container that gives workers and the person their context). Run
2553
+ # on ONE campaign (Content Studio's "Plan this campaign" passes it as the
2554
+ # run's subject), it plans that campaign; run with no subject (the weekly
2555
+ # worker, the pod's button), it plans every active campaign. Its WORKERS are
2556
+ # per_moment: ONE run, one batch to approve, never one run per campaign (a
2557
+ # `schedule` activator is per_moment unless it declares `size: per_thing`:
2558
+ # api `run-playbook.ts` runWorkerBatch). Its stages carry no subjectStatus,
2559
+ # so it never moves a campaign's status.
2560
+ # The founder's three rules of 9 Nov 2026 (taken from the pod's copy,
2561
+ # version 8) are kept here, so applying a catalog update no longer reverts
2562
+ # them: (A) only posts are planned, (C) every date is a proposal. Rule (B)
2563
+ # is the RHYTHM, and its numbers (which days, which formats each day carries)
2564
+ # live on the campaign (its notes or its plan document), never in this text:
2565
+ # the plan's numbers are read from the pod, where the person edits them.
2533
2566
  - name: Plan Next Content
2534
2567
  description: Audit the whole corpus against the journey, find the gap, propose what to make next, and propose dates for the posts that have none or whose date has passed.
2535
2568
  goalTemplate: >-
2536
- Audit the content corpus. Map every post onto its pillar and its journey
2537
- stage, and list which pillar × stage cells are empty or thin. Check the
2538
- running series for the chapter that is missing. If the pod has offers,
2539
- note which ones no content teaches toward; if it has none, plan purely for
2540
- audience-building and do not invent commerce. Then propose the next one or
2541
- two pieces — each created as a post entity at the Idea status, placed on a
2542
- pillar, a stage and a platform, with the hook and the reason it is next.
2543
- Then re-plan the calendar. Read the plan's inputs from the pod, never from
2544
- a number in this text: the active campaign whose dates cover the coming
2545
- weeks (campaign-start-date, campaign-end-date, its notes), each publishing
2546
- account's cadence (platform-posting-freq on its platform), each pillar's
2547
- target (posting-frequency on the pillar) and the goal mix the person set
2548
- in this space's brief. Propose a publish-date for every post past Idea
2549
- that has none, and a new publish-date for every post whose date has
2550
- passed while it is not Published, the longest-waiting first: follow the
2551
- cadence, balance the pillars and the goals, keep a campaign's posts inside
2552
- its dates, and never put two posts of one account on the same day. Never
2553
- move a Published or Archived post, and never change a post's status. File
2554
- every date as a proposal, all of them in this one run so the person
2555
- approves them as one batch, each with a one-line reason (the cadence, the
2556
- gap or the campaign it serves); never apply a date yourself. When an input
2557
- is missing (no cadence, no goal mix), say which one in the run's summary
2558
- and plan without it.
2569
+ Plan the next content. THREE RULES FIRST (founder, 9 Nov 2026): (A) Only
2570
+ POSTS are planned. A recording, a free take, a composition or a board is
2571
+ raw material that posts are made FROM; never give one a slot or a date,
2572
+ and never treat a post that is only a take (tag source:take, no finished
2573
+ cut) as publishable. (B) The rhythm is the campaign's: which days it
2574
+ publishes and what each day carries (for example one produced video plus
2575
+ one companion carousel on the same idea) are written on the campaign (its
2576
+ notes or its plan document), never in this text. When the rhythm pairs
2577
+ formats, a companion never goes out alone: if a day has no finished lead
2578
+ piece, propose the piece to make (its idea, hook and format), not a lone
2579
+ companion. (C) You change nothing yourself: every new date, swap or move
2580
+ is filed as a proposal for the person (a capture or a proposed update),
2581
+ never applied directly, so never apply a date yourself; your final
2582
+ message must say exactly what is applied and what is proposed, read back
2583
+ from the records. WHICH CAMPAIGN: when this run has a subject, it is the
2584
+ campaign to plan, and you plan THAT campaign only: its dates
2585
+ (campaign-start-date, campaign-end-date), its goal, its audience, its
2586
+ notes and its plan document, its ideas (idea-campaign), its pieces
2587
+ (composition-campaign) and its posts (post-campaign). With no subject,
2588
+ plan every active campaign whose dates cover the coming weeks, each on
2589
+ its own rhythm; when none is active, plan without one and say so. Read
2590
+ the campaign's plan document first: its BACKBONE is the fixed series of
2591
+ slots and its BANK is every post at Idea or Briefed that has no slot yet,
2592
+ with the campaign's ideas and pieces (ideas from interviews, notes,
2593
+ news). Audit the corpus: map every post onto its pillar and its journey
2594
+ stage, list the pillar × stage cells that are empty or thin, and check
2595
+ the running series for the missing chapter. Then place the flow: for
2596
+ each bank idea, decide where it goes and say why: (1) TIMELY (news, a
2597
+ release, something people talk about this week): the next free day, or
2598
+ replace the backbone slot whose topic it covers better; (2) FITS THIS
2599
+ WEEK'S STAGE (the journey's stages in their order): swap it with the
2600
+ backbone slot of the same stage; (3) otherwise it waits in the bank. A
2601
+ displaced slot moves later, never silently dropped. Propose the coming
2602
+ week's days on the campaign's rhythm, with the reason for each (new
2603
+ pieces as post entities at Idea with their post-campaign set, existing
2604
+ ones as proposed date changes); the person decides every swap. When the
2605
+ campaign states no rhythm, follow each publishing account's cadence
2606
+ (platform-posting-freq on its platform) and each pillar's target
2607
+ (posting-frequency on the pillar). Keep a campaign's posts inside its
2608
+ dates, never put two posts of one account on the same day, never move a
2609
+ Published or Archived post, and never change a post's status. If the pod
2610
+ has offers, note which ones no content teaches toward; if it has none,
2611
+ plan purely for audience-building and do not invent commerce. When an
2612
+ input is missing (no rhythm, no cadence, no plan document), say which one
2613
+ in the run's summary and plan without it. Say "agent", never "AI".
2559
2614
  subjectProfile:
2560
- profileSlug: post
2615
+ profileSlug: campaign
2561
2616
  activators:
2562
2617
  - { on: schedule, cron: "0 9 * * 1", mode: propose }
2563
2618
  - { on: manual, size: per_moment, mode: propose }
2619
+ stages:
2620
+ - key: read
2621
+ name: Read the calendar and the corpus
2622
+ category: started
2623
+ tier: quick
2624
+ goal: >-
2625
+ Read the campaign (the run's subject, else every active campaign):
2626
+ its plan document (backbone and bank), its rhythm, its ideas and its
2627
+ pieces, and list the posts with their status, pillar, stage, campaign
2628
+ and date. Read by id; write a short summary in the room and do not
2629
+ re-read it later.
2630
+ - key: audit
2631
+ name: Audit pillar x stage
2632
+ category: started
2633
+ tier: deep
2634
+ goal: >-
2635
+ Map every post onto its pillar and journey stage, list empty or thin
2636
+ cells, name the missing chapter of the running series, and note
2637
+ offers no content teaches toward (or say there are none). Write the
2638
+ result in the room.
2639
+ - key: place
2640
+ name: Place the bank and the week
2641
+ category: started
2642
+ tier: deep
2643
+ goal: >-
2644
+ For each bank idea decide timely / fits this week's stage / waits,
2645
+ with the reason. Propose the coming week's days on the campaign's
2646
+ rhythm. Every date change or swap is filed as a proposal; never apply
2647
+ it.
2648
+ - key: file
2649
+ name: File the plan and the next post idea
2650
+ category: completed
2651
+ tier: quick
2652
+ goal: >-
2653
+ Create the plan document and the Next post idea (status Idea, no
2654
+ date), record both on the session, and post one message that says
2655
+ what is applied and what is proposed, read back from the records.
2656
+ criteria:
2657
+ - key: nothing-applied-directly
2658
+ statement: "No post date or status was changed directly: every date change is a pending proposal, and the final message says applied = none."
2659
+ required: true
2660
+ check: { kind: judge, hint: Compare the final message with the records' updatedAt. }
2661
+ - key: rhythm-kept
2662
+ statement: Each proposed publishing day follows the campaign's rhythm; when the rhythm pairs formats, no companion goes out alone, and no take, composition or board is given a date.
2663
+ required: true
2664
+ check: { kind: judge }
2665
+ - key: outputs-filed
2666
+ statement: The Next post idea and the plan document are recorded on the session before it ends, within one run's turns and without a 'Keep the run going' ask.
2667
+ required: true
2668
+ check: { kind: judge }
2564
2669
  # Typed output: each idea is a real `post` at Idea (the start of Produce
2565
- # Content's lifecycle), not prose in a message. The run works the whole
2566
- # set, so no edge to a subject.
2670
+ # Content's lifecycle), not prose in a message. No edge to the subject: the
2671
+ # post carries its campaign in `post-campaign`.
2567
2672
  expectedOutputs:
2568
2673
  - { kind: post, label: Next post idea, relationToSubject: none }
2569
2674
  executor: is-agent
@@ -2677,8 +2782,8 @@ playbooks:
2677
2782
  status: active
2678
2783
 
2679
2784
  # A newsletter issue from idea to sent, one stage per `newsletter-status`.
2680
- # No schedule: a subject-bound playbook on a cron fans out one run per
2681
- # existing newsletter, which is never what an issue cadence means.
2785
+ # No schedule: a per-thing schedule would run once per existing newsletter,
2786
+ # which is never what an issue cadence means.
2682
2787
  - name: Newsletter issue
2683
2788
  description: Take a newsletter issue from idea to sent — angle, draft, edit, schedule — with a person approving before it goes out.
2684
2789
  goalTemplate: >-
@@ -2899,9 +3004,12 @@ playbooks:
2899
3004
  post gets its own post-hook and its own text (in `content`), taken from
2900
3005
  the piece's own words, cut and shaped for the account's platform; never
2901
3006
  a claim the piece does not make, and no two posts with the same angle.
2902
- Set post-platform from the account's platform-type. Optionally, when
2903
- the piece reads as one, add ONE newsletter issue at Idea
2904
- (newsletter-status Idea) linked derived_from the piece. Create each
3007
+ Set post-platform from the account's platform-type. When the piece has
3008
+ a campaign (composition-campaign), give each post that campaign
3009
+ (post-campaign). Optionally, when the piece reads as one, add ONE
3010
+ newsletter issue at Idea (newsletter-status Idea, and its
3011
+ newsletter-campaign when the piece has one) linked derived_from the
3012
+ piece. Create each
2905
3013
  post and the issue (create_entity), then link each one derived_from
2906
3014
  the piece (create_relation); each write is a proposal the person
2907
3015
  approves. The piece's own status is not moved by this run. Nothing is
@@ -2923,17 +3031,20 @@ playbooks:
2923
3031
  - { kind: newsletter, label: Newsletter issue, relationToSubject: derived_from, optional: true }
2924
3032
 
2925
3033
  automations:
3034
+ # Tuesday, not Monday (J2 plan e51783ca, J2-cat item 4): Plan Next
3035
+ # Content proposes new ideas on Monday at 09:00, and this run picks the
3036
+ # oldest one, so the same minute would race the plan once switched on.
2926
3037
  - key: content-os-weekly-produce
2927
3038
  name: Weekly content production
2928
3039
  description: >
2929
- Monday 09:00. Runs Produce Content once, with no subject. The playbook
3040
+ Tuesday 09:00. Runs Produce Content once, with no subject. The playbook
2930
3041
  takes the first eligible pinned post, or the oldest post still in Idea
2931
3042
  when the pin list has nobody eligible. Shipped paused because Content OS
2932
3043
  is public: an active cron would spend a run for every installer. Turn
2933
3044
  it on to start the cycle. Produce Content's own schedule stays off.
2934
3045
  triggerType: cron
2935
3046
  triggerConfig:
2936
- expression: "0 9 * * 1"
3047
+ expression: "0 9 * * 2"
2937
3048
  status: paused
2938
3049
  flow:
2939
3050
  nodes:
@@ -2941,10 +3052,10 @@ automations:
2941
3052
  type: trigger
2942
3053
  position: { x: 0, y: 0 }
2943
3054
  data:
2944
- label: Monday at 09:00
3055
+ label: Tuesday at 09:00
2945
3056
  triggerType: cron
2946
3057
  config:
2947
- expression: "0 9 * * 1"
3058
+ expression: "0 9 * * 2"
2948
3059
  - id: produce
2949
3060
  type: playbook_run
2950
3061
  position: { x: 0, y: 160 }
package/src/crm.yaml CHANGED
@@ -1188,9 +1188,8 @@ playbooks:
1188
1188
  the risk and a recommended action for the human to decide.
1189
1189
 
1190
1190
  Skip anything already healthy. If nothing needs attention, do nothing.
1191
- schedule:
1192
- cron: "0 8 * * *"
1193
- enabled: true
1191
+ activators:
1192
+ - { on: schedule, cron: "0 8 * * *", mode: run }
1194
1193
  metadata:
1195
1194
  governance:
1196
1195
  forceProposeWrites: true
@@ -227,10 +227,11 @@ describe("decision 5 — billing", () => {
227
227
  const finance = tpl("finance");
228
228
  const pb = playbookOf(finance, "Bill a recurring fee")!;
229
229
  expect(pb.subjectProfile?.profileSlug).toBe("revenue-stream");
230
- expect(pb.schedule).toMatchObject({ cron: "0 8 1 * *", enabled: true });
230
+ // One run per stream, every month, running (not asking first).
231
+ expect(pb.activators).toEqual([{ on: "schedule", cron: "0 8 1 * *", size: "per_thing", mode: "run" }]);
232
+ expect(pb).not.toHaveProperty("schedule");
231
233
  expect(pb.metadata).toMatchObject({ governance: { forceProposeWrites: true } });
232
- // The pod's cron door keeps ONLY a string filter (readSubjectProfile), and
233
- // refuses an unfiltered AI fan-out, so an object here = no schedule at all.
234
+ // The pod's query filter grammar is a JSON string; it selects the streams the tick runs over.
234
235
  const filter = pb.subjectProfile?.filter;
235
236
  expect(typeof filter).toBe("string");
236
237
  const parsed = JSON.parse(filter as string) as Record<string, string>;
@@ -446,11 +446,12 @@ playbooks:
446
446
  defaultValue: "a head-to-head comparison summary and an updated competitor profile",
447
447
  }
448
448
  executor: is-agent
449
- # A radar MONITOR: bound to the competitor KIND + a schedule → the backing
450
- # cron automation fans out (query→loop→playbook_run) and runs this once per
451
- # competitor. Disabled by default so installing the workspace never silently
452
- # starts paid AI runs — the user turns it on when they want the watch.
453
- schedule: { cron: "0 9 * * 1", enabled: false }
449
+ # A radar MONITOR: a per-thing schedule on the competitor KIND runs this
450
+ # once per competitor every Monday. Installed paused so installing the
451
+ # workspace never silently starts paid AI runs — the user turns it on when
452
+ # they want the watch.
453
+ activators:
454
+ - { on: schedule, cron: "0 9 * * 1", size: per_thing, mode: run, startsPaused: true }
454
455
  tools: [update_entity, exa_search, apify_run_actor, entity.create]
455
456
  status: active
456
457
 
@@ -470,7 +471,8 @@ playbooks:
470
471
  the dedup key — never create a company whose website already matches one we
471
472
  track. Skip anything already known. Report what you added, the search
472
473
  angles you covered, and why each new one matters.
473
- schedule: { cron: "0 9 * * 1", enabled: false }
474
+ activators:
475
+ - { on: schedule, cron: "0 9 * * 1", mode: run, startsPaused: true }
474
476
  params:
475
477
  - {
476
478
  name: ourSpace,
package/src/finance.yaml CHANGED
@@ -653,11 +653,9 @@ playbooks:
653
653
  check: { kind: evidence, evidenceKey: payment-reference }
654
654
 
655
655
  # Recurring billing (founder decision 2026-10-12). Monthly, ONE run per
656
- # active monthly revenue stream: the schedule is bound to the kind, so the
657
- # pod's backing cron fans out query → loop → playbook_run over the streams
658
- # the filter selects. The filter is a JSON STRING because the pod's cron door
659
- # reads only a string (`readSubjectProfile`, cron-automation.ts) and refuses
660
- # an unfiltered AI fan-out. The run only drafts the invoice: "Bill a client"
656
+ # active monthly revenue stream: a per-thing schedule on the kind, over the
657
+ # streams the filter selects (a JSON string in the pod's query filter
658
+ # grammar). The run only drafts the invoice: "Bill a client"
661
659
  # takes it from there (its `created` activator). Writes are proposed, never
662
660
  # applied unattended. Retainer specifics (quarterly/annual cadences, usage
663
661
  # true-ups) are deliberately left for later.
@@ -681,7 +679,8 @@ playbooks:
681
679
  - { name: stream, type: entity, label: Revenue stream, required: true }
682
680
  executor: is-agent
683
681
  status: active
684
- schedule: { cron: "0 8 1 * *", enabled: true }
682
+ activators:
683
+ - { on: schedule, cron: "0 8 1 * *", size: per_thing, mode: run }
685
684
  metadata:
686
685
  governance:
687
686
  forceProposeWrites: true
@@ -753,7 +752,8 @@ playbooks:
753
752
  approval before closing.
754
753
  executor: is-agent
755
754
  status: active
756
- schedule: { cron: "0 9 1 * *", enabled: false, mode: appointment }
755
+ activators:
756
+ - { on: schedule, cron: "0 9 1 * *", mode: appointment, startsPaused: true }
757
757
  tools: [fetch_record, list_records]
758
758
  expectedOutputs:
759
759
  - { kind: financial-metric, label: Month-end metrics, relationToSubject: none }
@@ -119,7 +119,7 @@ describe("process contract — the clean fixture is clean", () => {
119
119
  describe("process contract — each rule fires on its own fixture", () => {
120
120
  // Negative control: each assertion goes red with the `playbook-field-retired`
121
121
  // loop removed from checkProcessContract.
122
- it("each retired field is refused (statusProperty, onEnd, humanOnlyStatuses)", () => {
122
+ it("each retired field is refused (statusProperty, onEnd, humanOnlyStatuses, schedule)", () => {
123
123
  expect(rulesOf(proc((pb) => (pb.subjectProfile.statusProperty = "widget-stage")))).toEqual([
124
124
  "playbook-field-retired",
125
125
  ]);
@@ -127,6 +127,7 @@ describe("process contract — each rule fires on its own fixture", () => {
127
127
  "playbook-field-retired",
128
128
  ]);
129
129
  expect(rulesOf(proc((pb) => (pb.humanOnlyStatuses = ["New"])))).toEqual(["playbook-field-retired"]);
130
+ expect(rulesOf(proc((pb) => (pb.schedule = { cron: "0 8 * * *", enabled: true })))).toEqual(["playbook-field-retired"]);
130
131
  });
131
132
 
132
133
  it("a stage subjectStatus outside the enum", () => {
@@ -217,6 +218,18 @@ describe("process contract — each rule fires on its own fixture", () => {
217
218
  expect(rules).toEqual(["activator-no-subject"]);
218
219
  });
219
220
 
221
+ it("a schedule on a playbook with no subject kind runs once per tick: no finding", () => {
222
+ const rules = rulesOf(
223
+ proc((pb) => {
224
+ delete pb.subjectProfile;
225
+ delete pb.stages;
226
+ delete pb.expectedOutputs;
227
+ pb.activators = [{ on: "schedule", cron: "0 8 * * *", mode: "run" }];
228
+ })
229
+ );
230
+ expect(rules).toEqual([]);
231
+ });
232
+
220
233
  it("a playbook-level relationToSubject the corpus does not define", () => {
221
234
  expect(rulesOf(proc((pb) => (pb.expectedOutputs[0].relationToSubject = "spawned_by")))).toEqual([
222
235
  "output-relation-unknown",