@synap-core/workspace-templates 0.76.1 → 0.77.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/workspace-templates",
3
- "version": "0.76.1",
3
+ "version": "0.77.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",
package/src/builder.yaml CHANGED
@@ -1619,6 +1619,7 @@ profiles:
1619
1619
  label: App
1620
1620
  valueType: entity_id
1621
1621
  targetProfileSlug: devplane_app
1622
+ relation: belongs_to
1622
1623
  inputType: entity_select
1623
1624
  description: The app this design is for (one devplane_app, filed into the design's project). The Design app lists an app's designs by it; target-surface stays the screen's name.
1624
1625
  - slug: design-scope
@@ -1663,6 +1664,7 @@ profiles:
1663
1664
  label: Screenshot
1664
1665
  valueType: entity_id
1665
1666
  targetProfileSlug: file
1667
+ relation: references
1666
1668
  inputType: entity_select
1667
1669
  description: A render of the design, for review at a glance.
1668
1670
  - slug: motion
@@ -1764,6 +1766,7 @@ profiles:
1764
1766
  label: Screenshot
1765
1767
  valueType: entity_id
1766
1768
  targetProfileSlug: file
1769
+ relation: references
1767
1770
  inputType: entity_select
1768
1771
  description: A render of its main story, for review at a glance.
1769
1772
  - slug: props-summary
@@ -1785,6 +1788,7 @@ profiles:
1785
1788
  label: App
1786
1789
  valueType: entity_id
1787
1790
  targetProfileSlug: devplane_app
1791
+ relation: belongs_to
1788
1792
  inputType: entity_select
1789
1793
  description: The app (devplane_app) whose Storybook it comes from.
1790
1794
  - slug: source-hash
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Every entity-id property of Content OS declares the relation it creates (REL1,
3
+ * 4 Dec 2026; backend#1498: a template property's `relation` makes writing it a
4
+ * link, and the space health read flags `relation-as-property` for one that does
5
+ * not). Read from the YAML SOURCE.
6
+ *
7
+ * The six left without a relation are NAMED here, each because no existing
8
+ * relation type fits (extend, never twin: a new type is the founder's call) or
9
+ * because two properties of one kind would need the same type (one property per
10
+ * relation per kind). Adding a relation to one removes it from this list: the
11
+ * test fails until it does, so the list can only shrink.
12
+ */
13
+ import { describe, expect, it } from "vitest";
14
+ import { readFileSync } from "node:fs";
15
+ import { dirname, join } from "node:path";
16
+ import { fileURLToPath } from "node:url";
17
+ import { load } from "js-yaml";
18
+ import type { WorkspaceYaml } from "./types.js";
19
+
20
+ const dir = dirname(fileURLToPath(import.meta.url));
21
+ const read = (f: string) => load(readFileSync(join(dir, f), "utf8")) as WorkspaceYaml;
22
+ const contentOs = read("content-os.yaml");
23
+ const builder = read("builder.yaml");
24
+
25
+ const entityIdProps = (t: WorkspaceYaml) =>
26
+ t.profiles.flatMap((p) =>
27
+ p.properties
28
+ .filter((pr) => pr.valueType === "entity_id")
29
+ .map((pr) => ({ at: `${p.slug}.${pr.slug}`, relation: (pr as { relation?: string }).relation }))
30
+ );
31
+
32
+ const QUESTIONS = [
33
+ "post.post-account", // post -> platform: no `published_on` type
34
+ "post.post-copy-of", // post -> post: `derived_from` is taken by post.derived-from (one per kind)
35
+ "pillar.pillar-pain-ref", // pillar -> pain-point: no `addresses` type
36
+ "offer.offer-positioning", // offer -> positioning: no type
37
+ "content-composition.project-zip", // composition -> file twice (zip, mp4): needs two types
38
+ "content-composition.render-mp4",
39
+ ];
40
+
41
+ describe("Content OS: a property that holds an entity id creates a link", () => {
42
+ const props = entityIdProps(contentOs);
43
+
44
+ it("finds the properties it guards (non-vacuity)", () => {
45
+ expect(props.length).toBeGreaterThanOrEqual(28);
46
+ expect(props.filter((p) => p.relation).length).toBeGreaterThanOrEqual(22);
47
+ });
48
+
49
+ it("leaves only the named questions without a relation", () => {
50
+ expect(props.filter((p) => !p.relation).map((p) => p.at).sort()).toEqual([...QUESTIONS].sort());
51
+ });
52
+
53
+ it("each relation names an edge the template declares or a dependency's type", () => {
54
+ const own = new Set((contentOs.entityLinks ?? []).map((l) => l.type));
55
+ for (const p of props.filter((x) => x.relation))
56
+ expect(
57
+ own.has(p.relation!) || ["targets", "affects", "uses", "derived_from", "references"].includes(p.relation!),
58
+ p.at
59
+ ).toBe(true);
60
+ });
61
+
62
+ it("the edge each property creates is declared as a link between its kinds", () => {
63
+ const links = new Set((contentOs.entityLinks ?? []).map((l) => `${l.sourceProfileSlug}>${l.targetProfileSlug}:${l.type}`));
64
+ for (const at of [
65
+ "newsletter>campaign:part_of_campaign",
66
+ "newsletter>pillar:belongs_to_pillar",
67
+ "newsletter>sponsor:sponsored_by",
68
+ "series>pillar:belongs_to_pillar",
69
+ "idea>journey-stage:at_journey_stage",
70
+ ])
71
+ expect(links.has(at), at).toBe(true);
72
+ });
73
+ });
74
+
75
+ describe("Builder: the design's app and screenshot create links", () => {
76
+ it("ui-design and ui-component declare belongs_to (app) and references (screenshot)", () => {
77
+ const by = Object.fromEntries(entityIdProps(builder).map((p) => [p.at, p.relation]));
78
+ expect(by["ui-design.design-app"]).toBe("belongs_to");
79
+ expect(by["ui-design.screenshot"]).toBe("references");
80
+ expect(by["ui-component.design-app"]).toBe("belongs_to");
81
+ expect(by["ui-component.screenshot"]).toBe("references");
82
+ });
83
+ });
@@ -343,6 +343,7 @@ profiles:
343
343
  label: Sponsor
344
344
  valueType: entity_id
345
345
  targetProfileSlug: sponsor
346
+ relation: sponsored_by
346
347
  inputType: entity_select
347
348
  # ── The journey layer — BOTH axes optional, and independent ────────────
348
349
  # `post-stage` is the AUDIENCE axis (unordered: where is the reader), and
@@ -355,6 +356,7 @@ profiles:
355
356
  label: Journey Stage
356
357
  valueType: entity_id
357
358
  targetProfileSlug: journey-stage
359
+ relation: at_journey_stage
358
360
  inputType: entity_select
359
361
  - slug: post-series
360
362
  label: Series
@@ -382,6 +384,7 @@ profiles:
382
384
  label: Offer
383
385
  valueType: entity_id
384
386
  targetProfileSlug: offer
387
+ relation: teaches_toward
385
388
  inputType: entity_select
386
389
  - slug: publish-date
387
390
  label: Publish Date
@@ -423,6 +426,7 @@ profiles:
423
426
  label: Repurposed From
424
427
  valueType: entity_id
425
428
  targetProfileSlug: post
429
+ relation: derived_from
426
430
  inputType: entity_select
427
431
  # The person's own words, verbatim (B7). Stored by capture before it was
428
432
  # declared; declared so it can be queried and validated.
@@ -607,6 +611,7 @@ profiles:
607
611
  label: Journey Stage
608
612
  valueType: entity_id
609
613
  targetProfileSlug: journey-stage
614
+ relation: at_journey_stage
610
615
  inputType: entity_select
611
616
  # Where it came from (`source:dump`, `source:interview`, …), as on `post-tags`.
612
617
  - slug: idea-tags
@@ -667,6 +672,7 @@ profiles:
667
672
  label: Audience
668
673
  valueType: entity_id
669
674
  targetProfileSlug: audience
675
+ relation: targets
670
676
  inputType: entity_select
671
677
  - slug: pillar-pain-ref
672
678
  label: Pain Addressed
@@ -755,6 +761,7 @@ profiles:
755
761
  label: Audience
756
762
  valueType: entity_id
757
763
  targetProfileSlug: audience
764
+ relation: targets
758
765
  inputType: entity_select
759
766
  - slug: belief-installed
760
767
  label: Now Believes
@@ -821,6 +828,7 @@ profiles:
821
828
  label: Pillar
822
829
  valueType: entity_id
823
830
  targetProfileSlug: pillar
831
+ relation: belongs_to_pillar
824
832
  inputType: entity_select
825
833
 
826
834
  # `platform` is the ONE pod-wide publishing-account *vocabulary*. `scope: shared`
@@ -1023,16 +1031,19 @@ profiles:
1023
1031
  label: Sponsor
1024
1032
  valueType: entity_id
1025
1033
  targetProfileSlug: sponsor
1034
+ relation: sponsored_by
1026
1035
  inputType: entity_select
1027
1036
  - slug: newsletter-campaign
1028
1037
  label: Campaign
1029
1038
  valueType: entity_id
1030
1039
  targetProfileSlug: campaign
1040
+ relation: part_of_campaign
1031
1041
  inputType: entity_select
1032
1042
  - slug: newsletter-pillar
1033
1043
  label: Primary Pillar
1034
1044
  valueType: entity_id
1035
1045
  targetProfileSlug: pillar
1046
+ relation: belongs_to_pillar
1036
1047
  inputType: entity_select
1037
1048
  - slug: newsletter-tags
1038
1049
  label: Tags
@@ -1225,6 +1236,7 @@ profiles:
1225
1236
  label: Audience
1226
1237
  valueType: entity_id
1227
1238
  targetProfileSlug: audience
1239
+ relation: affects
1228
1240
  inputType: entity_select
1229
1241
  - slug: evidence
1230
1242
  label: Evidence
@@ -1318,6 +1330,7 @@ profiles:
1318
1330
  label: Audience
1319
1331
  valueType: entity_id
1320
1332
  targetProfileSlug: audience
1333
+ relation: targets
1321
1334
  inputType: entity_select
1322
1335
  - slug: offer-positioning
1323
1336
  label: Positioning
@@ -1503,6 +1516,7 @@ profiles:
1503
1516
  label: Template
1504
1517
  valueType: entity_id
1505
1518
  targetProfileSlug: brand-template
1519
+ relation: uses
1506
1520
  inputType: entity_select
1507
1521
  description: The reusable brand-template shell this started from.
1508
1522
  - slug: recipe-ref
@@ -1659,6 +1673,7 @@ profiles:
1659
1673
  label: Cut from take
1660
1674
  valueType: entity_id
1661
1675
  targetProfileSlug: content-asset
1676
+ relation: derived_from
1662
1677
  inputType: entity_select
1663
1678
  - slug: source-start
1664
1679
  label: Starts at (s)
@@ -1718,6 +1733,7 @@ profiles:
1718
1733
  label: Output
1719
1734
  valueType: entity_id
1720
1735
  targetProfileSlug: file
1736
+ relation: references
1721
1737
  inputType: entity_select
1722
1738
  - slug: output-url
1723
1739
  label: Output URL
@@ -2035,6 +2051,56 @@ profileEntityBentoTemplates:
2035
2051
 
2036
2052
  # Editorial graph: connect posts to campaign / pillar / sponsor
2037
2053
  entityLinks:
2054
+ # REL1 (4 Dec 2026): the edges the properties above create (each property
2055
+ # declares its relation; the pair is declared here so the graph knows it).
2056
+ - sourceProfileSlug: idea
2057
+ targetProfileSlug: journey-stage
2058
+ type: at_journey_stage
2059
+ label: Journey Stage
2060
+ - sourceProfileSlug: pillar
2061
+ targetProfileSlug: audience
2062
+ type: targets
2063
+ label: Audience
2064
+ - sourceProfileSlug: journey-stage
2065
+ targetProfileSlug: audience
2066
+ type: targets
2067
+ label: Audience
2068
+ - sourceProfileSlug: series
2069
+ targetProfileSlug: pillar
2070
+ type: belongs_to_pillar
2071
+ label: Pillar
2072
+ - sourceProfileSlug: newsletter
2073
+ targetProfileSlug: sponsor
2074
+ type: sponsored_by
2075
+ label: Sponsor
2076
+ - sourceProfileSlug: newsletter
2077
+ targetProfileSlug: campaign
2078
+ type: part_of_campaign
2079
+ label: Campaign
2080
+ - sourceProfileSlug: newsletter
2081
+ targetProfileSlug: pillar
2082
+ type: belongs_to_pillar
2083
+ label: Pillar
2084
+ - sourceProfileSlug: offer
2085
+ targetProfileSlug: audience
2086
+ type: targets
2087
+ label: Audience
2088
+ - sourceProfileSlug: content-composition
2089
+ targetProfileSlug: brand-template
2090
+ type: uses
2091
+ label: Template
2092
+ - sourceProfileSlug: content-asset
2093
+ targetProfileSlug: content-asset
2094
+ type: derived_from
2095
+ label: Taken from
2096
+ - sourceProfileSlug: pain-point
2097
+ targetProfileSlug: audience
2098
+ type: affects
2099
+ label: Audience
2100
+ - sourceProfileSlug: render-job
2101
+ targetProfileSlug: file
2102
+ type: references
2103
+ label: Output file
2038
2104
  - sourceProfileSlug: post
2039
2105
  targetProfileSlug: campaign
2040
2106
  type: part_of_campaign
package/src/templates.ts CHANGED
@@ -6081,6 +6081,7 @@ const DATA = {
6081
6081
  "label": "App",
6082
6082
  "valueType": "entity_id",
6083
6083
  "targetProfileSlug": "devplane_app",
6084
+ "relation": "belongs_to",
6084
6085
  "inputType": "entity_select",
6085
6086
  "description": "The app this design is for (one devplane_app, filed into the design's project). The Design app lists an app's designs by it; target-surface stays the screen's name."
6086
6087
  },
@@ -6148,6 +6149,7 @@ const DATA = {
6148
6149
  "label": "Screenshot",
6149
6150
  "valueType": "entity_id",
6150
6151
  "targetProfileSlug": "file",
6152
+ "relation": "references",
6151
6153
  "inputType": "entity_select",
6152
6154
  "description": "A render of the design, for review at a glance."
6153
6155
  },
@@ -6297,6 +6299,7 @@ const DATA = {
6297
6299
  "label": "Screenshot",
6298
6300
  "valueType": "entity_id",
6299
6301
  "targetProfileSlug": "file",
6302
+ "relation": "references",
6300
6303
  "inputType": "entity_select",
6301
6304
  "description": "A render of its main story, for review at a glance."
6302
6305
  },
@@ -6326,6 +6329,7 @@ const DATA = {
6326
6329
  "label": "App",
6327
6330
  "valueType": "entity_id",
6328
6331
  "targetProfileSlug": "devplane_app",
6332
+ "relation": "belongs_to",
6329
6333
  "inputType": "entity_select",
6330
6334
  "description": "The app (devplane_app) whose Storybook it comes from."
6331
6335
  },
@@ -12565,6 +12569,7 @@ const DATA = {
12565
12569
  "label": "Sponsor",
12566
12570
  "valueType": "entity_id",
12567
12571
  "targetProfileSlug": "sponsor",
12572
+ "relation": "sponsored_by",
12568
12573
  "inputType": "entity_select"
12569
12574
  },
12570
12575
  {
@@ -12572,6 +12577,7 @@ const DATA = {
12572
12577
  "label": "Journey Stage",
12573
12578
  "valueType": "entity_id",
12574
12579
  "targetProfileSlug": "journey-stage",
12580
+ "relation": "at_journey_stage",
12575
12581
  "inputType": "entity_select"
12576
12582
  },
12577
12583
  {
@@ -12594,6 +12600,7 @@ const DATA = {
12594
12600
  "label": "Offer",
12595
12601
  "valueType": "entity_id",
12596
12602
  "targetProfileSlug": "offer",
12603
+ "relation": "teaches_toward",
12597
12604
  "inputType": "entity_select"
12598
12605
  },
12599
12606
  {
@@ -12644,6 +12651,7 @@ const DATA = {
12644
12651
  "label": "Repurposed From",
12645
12652
  "valueType": "entity_id",
12646
12653
  "targetProfileSlug": "post",
12654
+ "relation": "derived_from",
12647
12655
  "inputType": "entity_select"
12648
12656
  },
12649
12657
  {
@@ -12860,6 +12868,7 @@ const DATA = {
12860
12868
  "label": "Journey Stage",
12861
12869
  "valueType": "entity_id",
12862
12870
  "targetProfileSlug": "journey-stage",
12871
+ "relation": "at_journey_stage",
12863
12872
  "inputType": "entity_select"
12864
12873
  },
12865
12874
  {
@@ -12936,6 +12945,7 @@ const DATA = {
12936
12945
  "label": "Audience",
12937
12946
  "valueType": "entity_id",
12938
12947
  "targetProfileSlug": "audience",
12948
+ "relation": "targets",
12939
12949
  "inputType": "entity_select"
12940
12950
  },
12941
12951
  {
@@ -13029,6 +13039,7 @@ const DATA = {
13029
13039
  "label": "Audience",
13030
13040
  "valueType": "entity_id",
13031
13041
  "targetProfileSlug": "audience",
13042
+ "relation": "targets",
13032
13043
  "inputType": "entity_select"
13033
13044
  },
13034
13045
  {
@@ -13107,6 +13118,7 @@ const DATA = {
13107
13118
  "label": "Pillar",
13108
13119
  "valueType": "entity_id",
13109
13120
  "targetProfileSlug": "pillar",
13121
+ "relation": "belongs_to_pillar",
13110
13122
  "inputType": "entity_select"
13111
13123
  }
13112
13124
  ]
@@ -13367,6 +13379,7 @@ const DATA = {
13367
13379
  "label": "Sponsor",
13368
13380
  "valueType": "entity_id",
13369
13381
  "targetProfileSlug": "sponsor",
13382
+ "relation": "sponsored_by",
13370
13383
  "inputType": "entity_select"
13371
13384
  },
13372
13385
  {
@@ -13374,6 +13387,7 @@ const DATA = {
13374
13387
  "label": "Campaign",
13375
13388
  "valueType": "entity_id",
13376
13389
  "targetProfileSlug": "campaign",
13390
+ "relation": "part_of_campaign",
13377
13391
  "inputType": "entity_select"
13378
13392
  },
13379
13393
  {
@@ -13381,6 +13395,7 @@ const DATA = {
13381
13395
  "label": "Primary Pillar",
13382
13396
  "valueType": "entity_id",
13383
13397
  "targetProfileSlug": "pillar",
13398
+ "relation": "belongs_to_pillar",
13384
13399
  "inputType": "entity_select"
13385
13400
  },
13386
13401
  {
@@ -13650,6 +13665,7 @@ const DATA = {
13650
13665
  "label": "Audience",
13651
13666
  "valueType": "entity_id",
13652
13667
  "targetProfileSlug": "audience",
13668
+ "relation": "affects",
13653
13669
  "inputType": "entity_select"
13654
13670
  },
13655
13671
  {
@@ -13771,6 +13787,7 @@ const DATA = {
13771
13787
  "label": "Audience",
13772
13788
  "valueType": "entity_id",
13773
13789
  "targetProfileSlug": "audience",
13790
+ "relation": "targets",
13774
13791
  "inputType": "entity_select"
13775
13792
  },
13776
13793
  {
@@ -13973,6 +13990,7 @@ const DATA = {
13973
13990
  "label": "Template",
13974
13991
  "valueType": "entity_id",
13975
13992
  "targetProfileSlug": "brand-template",
13993
+ "relation": "uses",
13976
13994
  "inputType": "entity_select",
13977
13995
  "description": "The reusable brand-template shell this started from."
13978
13996
  },
@@ -14153,6 +14171,7 @@ const DATA = {
14153
14171
  "label": "Cut from take",
14154
14172
  "valueType": "entity_id",
14155
14173
  "targetProfileSlug": "content-asset",
14174
+ "relation": "derived_from",
14156
14175
  "inputType": "entity_select"
14157
14176
  },
14158
14177
  {
@@ -14253,6 +14272,7 @@ const DATA = {
14253
14272
  "label": "Output",
14254
14273
  "valueType": "entity_id",
14255
14274
  "targetProfileSlug": "file",
14275
+ "relation": "references",
14256
14276
  "inputType": "entity_select"
14257
14277
  },
14258
14278
  {
@@ -14632,6 +14652,78 @@ const DATA = {
14632
14652
  }
14633
14653
  },
14634
14654
  "entityLinks": [
14655
+ {
14656
+ "sourceProfileSlug": "idea",
14657
+ "targetProfileSlug": "journey-stage",
14658
+ "type": "at_journey_stage",
14659
+ "label": "Journey Stage"
14660
+ },
14661
+ {
14662
+ "sourceProfileSlug": "pillar",
14663
+ "targetProfileSlug": "audience",
14664
+ "type": "targets",
14665
+ "label": "Audience"
14666
+ },
14667
+ {
14668
+ "sourceProfileSlug": "journey-stage",
14669
+ "targetProfileSlug": "audience",
14670
+ "type": "targets",
14671
+ "label": "Audience"
14672
+ },
14673
+ {
14674
+ "sourceProfileSlug": "series",
14675
+ "targetProfileSlug": "pillar",
14676
+ "type": "belongs_to_pillar",
14677
+ "label": "Pillar"
14678
+ },
14679
+ {
14680
+ "sourceProfileSlug": "newsletter",
14681
+ "targetProfileSlug": "sponsor",
14682
+ "type": "sponsored_by",
14683
+ "label": "Sponsor"
14684
+ },
14685
+ {
14686
+ "sourceProfileSlug": "newsletter",
14687
+ "targetProfileSlug": "campaign",
14688
+ "type": "part_of_campaign",
14689
+ "label": "Campaign"
14690
+ },
14691
+ {
14692
+ "sourceProfileSlug": "newsletter",
14693
+ "targetProfileSlug": "pillar",
14694
+ "type": "belongs_to_pillar",
14695
+ "label": "Pillar"
14696
+ },
14697
+ {
14698
+ "sourceProfileSlug": "offer",
14699
+ "targetProfileSlug": "audience",
14700
+ "type": "targets",
14701
+ "label": "Audience"
14702
+ },
14703
+ {
14704
+ "sourceProfileSlug": "content-composition",
14705
+ "targetProfileSlug": "brand-template",
14706
+ "type": "uses",
14707
+ "label": "Template"
14708
+ },
14709
+ {
14710
+ "sourceProfileSlug": "content-asset",
14711
+ "targetProfileSlug": "content-asset",
14712
+ "type": "derived_from",
14713
+ "label": "Taken from"
14714
+ },
14715
+ {
14716
+ "sourceProfileSlug": "pain-point",
14717
+ "targetProfileSlug": "audience",
14718
+ "type": "affects",
14719
+ "label": "Audience"
14720
+ },
14721
+ {
14722
+ "sourceProfileSlug": "render-job",
14723
+ "targetProfileSlug": "file",
14724
+ "type": "references",
14725
+ "label": "Output file"
14726
+ },
14635
14727
  {
14636
14728
  "sourceProfileSlug": "post",
14637
14729
  "targetProfileSlug": "campaign",