@sprig-and-prose/sprig-scenes 0.1.1 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @sprig-and-prose/sprig-scenes
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a40227: - **scenes:** Emit array kinds in manifest as `array: { of: { type } }` to match prose; recognize field modifier `optional { }` when tokenized as identifier.
8
+ - **scene-engine:** Consume new array manifest shape (`kind.array.of`).
9
+ - **sprig-edge:** Attestation validation uses new array manifest shape (`kind.array.of`).
10
+ - Updated dependencies [2a40227]
11
+ - @sprig-and-prose/sprig-scene-engine@0.1.1
12
+
13
+ ## 0.2.0
14
+
15
+ ### Minor Changes
16
+
17
+ - **sprig-scenes (minor):** Export `PRIMITIVE_KINDS`, `ARTIFACT_TYPES`, and `ARTIFACT_TYPES_SET` from manifest as single source of truth. Add compile-time validation for primitive constraints (min/max/of) and array minItems/maxItems in `validateSceneManifest`. JSDoc: include `dataset` in artifactType.
18
+
19
+ **sprig-edge (minor):** Attestation now enforces optional fields, primitive constraints (min, max, of), and nested actor-shaped fields when manifest is available. Legend printed once at end for multiple scenes. Export `ValidationKind` and `ValidateRecordOptions`.
20
+
21
+ **sprig (patch):** Friendlier scene compile error prefix: "Scene compile failed" instead of "Scene compilation error".
22
+
23
+ **create-scene-tutorial (patch):** Generated scene file uses kebab-case filename: `demo-scene.scene.prose` instead of `DemoScene.scene.prose`.
24
+
3
25
  ## 0.1.1
4
26
 
5
27
  ### Patch Changes
@@ -134,13 +134,13 @@ for (const [actorName, statuses] of Object.entries(status.actors)) {
134
134
  const icon =
135
135
  s.status === 'attested' ? '🟢' : s.status === 'expected' ? '⚪' : 'šŸ”“';
136
136
  console.log(
137
- ` ${icon} ${s.status.toUpperCase().padEnd(10)} → ${s.location} / ${s.artifactType} / ${s.name}`,
137
+ ` ${icon} ${s.status.padEnd(10)} → ${s.location} / ${s.artifactType} / ${s.name}`,
138
138
  );
139
139
  }
140
140
  }
141
141
 
142
142
  console.log('\n✨ Legend:');
143
- console.log(' ⚪ EXPECTED - Projection declared but not yet attested');
144
- console.log(' 🟢 ATTESTED - Projection exists and is attested');
145
- console.log(' 🟠 DRIFTED - Shape has changed (not yet implemented)');
146
- console.log(' šŸ”“ FAILED - Attestation exists but status is not "present"');
143
+ console.log(' ⚪ expected - Projection declared but not yet attested');
144
+ console.log(' 🟢 attested - Projection exists and is attested');
145
+ console.log(' 🟠 drifted - Shape has changed (not yet implemented)');
146
+ console.log(' šŸ”“ failed - Attestation exists but status is not "present"');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprig-and-prose/sprig-scenes",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "Scene compiler and canonical outputs for sprig",
6
6
  "main": "src/index.js",
@@ -8,7 +8,7 @@ import { readFile, writeFile } from 'node:fs/promises';
8
8
  * Single attestation for an actor projection.
9
9
  * @typedef {Object} Attestation
10
10
  * @property {string} location - Location name
11
- * @property {'table' | 'schema'} artifactType - Type of artifact
11
+ * @property {'table' | 'schema' | 'dataset'} artifactType - Type of artifact
12
12
  * @property {string} name - Artifact name
13
13
  * @property {'present' | 'absent'} status - Attestation status
14
14
  * @property {string} observedAt - ISO 8601 timestamp
@@ -13,7 +13,7 @@
13
13
  * Status result for a single expectation.
14
14
  * @typedef {Object} ExpectationStatus
15
15
  * @property {string} location - Location name
16
- * @property {'table' | 'schema'} artifactType - Type of artifact
16
+ * @property {'table' | 'schema' | 'dataset'} artifactType - Type of artifact
17
17
  * @property {string} name - Artifact name
18
18
  * @property {'expected' | 'attested' | 'failed' | 'drifted'} status - Computed status
19
19
  * @property {ProjectionExpectation} expectation - The original expectation
@@ -2,12 +2,15 @@
2
2
  "sceneName": "LeftPanel",
3
3
  "actors": {
4
4
  "Player": {
5
- "kind": {
6
- "object": {
7
- "id": {
5
+ "type": "shape",
6
+ "fields": {
7
+ "id": {
8
+ "type": {
8
9
  "primitive": "integer"
9
- },
10
- "name": {
10
+ }
11
+ },
12
+ "name": {
13
+ "type": {
11
14
  "primitive": "string"
12
15
  }
13
16
  }
@@ -17,4 +20,4 @@
17
20
  },
18
21
  "portals": {},
19
22
  "derived": {}
20
- }
23
+ }
@@ -1,6 +1,6 @@
1
1
  scene LeftPanel {
2
2
  actor Player {
3
- kind {
3
+ shape {
4
4
  id { integer }
5
5
  name { string }
6
6
  }
@@ -2,12 +2,15 @@
2
2
  "sceneName": "LeftPanel",
3
3
  "actors": {
4
4
  "Location": {
5
- "kind": {
6
- "object": {
7
- "id": {
5
+ "type": "shape",
6
+ "fields": {
7
+ "id": {
8
+ "type": {
8
9
  "primitive": "integer"
9
- },
10
- "name": {
10
+ }
11
+ },
12
+ "name": {
13
+ "type": {
11
14
  "primitive": "string"
12
15
  }
13
16
  }
@@ -17,15 +20,20 @@
17
20
  ]
18
21
  },
19
22
  "Player": {
20
- "kind": {
21
- "object": {
22
- "id": {
23
+ "type": "shape",
24
+ "fields": {
25
+ "id": {
26
+ "type": {
23
27
  "primitive": "integer"
24
- },
25
- "name": {
28
+ }
29
+ },
30
+ "name": {
31
+ "type": {
26
32
  "primitive": "string"
27
- },
28
- "location": {
33
+ }
34
+ },
35
+ "location": {
36
+ "type": {
29
37
  "actor": "Location"
30
38
  }
31
39
  }
@@ -35,12 +43,15 @@
35
43
  ]
36
44
  },
37
45
  "Skill": {
38
- "kind": {
39
- "object": {
40
- "id": {
46
+ "type": "shape",
47
+ "fields": {
48
+ "id": {
49
+ "type": {
41
50
  "primitive": "integer"
42
- },
43
- "name": {
51
+ }
52
+ },
53
+ "name": {
54
+ "type": {
44
55
  "primitive": "string"
45
56
  }
46
57
  }
@@ -50,15 +61,20 @@
50
61
  ]
51
62
  },
52
63
  "PlayerSkill": {
53
- "kind": {
54
- "object": {
55
- "player": {
64
+ "type": "shape",
65
+ "fields": {
66
+ "player": {
67
+ "type": {
56
68
  "actor": "Player"
57
- },
58
- "skill": {
69
+ }
70
+ },
71
+ "skill": {
72
+ "type": {
59
73
  "actor": "Skill"
60
- },
61
- "experience": {
74
+ }
75
+ },
76
+ "experience": {
77
+ "type": {
62
78
  "primitive": "integer"
63
79
  }
64
80
  }
@@ -71,4 +87,4 @@
71
87
  },
72
88
  "portals": {},
73
89
  "derived": {}
74
- }
90
+ }
@@ -1,6 +1,6 @@
1
1
  scene LeftPanel {
2
2
  actor Location {
3
- kind {
3
+ shape {
4
4
  id { integer }
5
5
  name { string }
6
6
  }
@@ -9,7 +9,7 @@ scene LeftPanel {
9
9
  }
10
10
 
11
11
  actor Player {
12
- kind {
12
+ shape {
13
13
  id { integer }
14
14
  name { string }
15
15
  location { Location }
@@ -19,7 +19,7 @@ scene LeftPanel {
19
19
  }
20
20
 
21
21
  actor Skill {
22
- kind {
22
+ shape {
23
23
  id { integer }
24
24
  name { string }
25
25
  }
@@ -28,7 +28,7 @@ scene LeftPanel {
28
28
  }
29
29
 
30
30
  actor PlayerSkill {
31
- kind {
31
+ shape {
32
32
  player { Player }
33
33
  skill { Skill }
34
34
  experience { integer }
@@ -2,12 +2,15 @@
2
2
  "sceneName": "ToolScene",
3
3
  "actors": {
4
4
  "Tool": {
5
- "kind": {
6
- "object": {
7
- "id": {
5
+ "type": "shape",
6
+ "fields": {
7
+ "id": {
8
+ "type": {
8
9
  "primitive": "integer"
9
- },
10
- "name": {
10
+ }
11
+ },
12
+ "name": {
13
+ "type": {
11
14
  "primitive": "string"
12
15
  }
13
16
  }
@@ -17,14 +20,19 @@
17
20
  ]
18
21
  },
19
22
  "Item": {
20
- "kind": {
21
- "object": {
22
- "id": {
23
+ "type": "shape",
24
+ "fields": {
25
+ "id": {
26
+ "type": {
23
27
  "primitive": "integer"
24
- },
25
- "tools": {
28
+ }
29
+ },
30
+ "tools": {
31
+ "type": {
26
32
  "array": {
27
- "actor": "Tool"
33
+ "of": {
34
+ "actor": "Tool"
35
+ }
28
36
  }
29
37
  }
30
38
  }
@@ -34,12 +42,15 @@
34
42
  ]
35
43
  },
36
44
  "ContainerRow": {
37
- "kind": {
38
- "object": {
39
- "item": {
45
+ "type": "shape",
46
+ "fields": {
47
+ "item": {
48
+ "type": {
40
49
  "actor": "Item"
41
- },
42
- "count": {
50
+ }
51
+ },
52
+ "count": {
53
+ "type": {
43
54
  "primitive": "integer"
44
55
  }
45
56
  }
@@ -49,11 +60,14 @@
49
60
  ]
50
61
  },
51
62
  "Something": {
52
- "kind": {
53
- "object": {
54
- "tools": {
63
+ "type": "shape",
64
+ "fields": {
65
+ "tools": {
66
+ "type": {
55
67
  "array": {
56
- "actor": "Tool"
68
+ "of": {
69
+ "actor": "Tool"
70
+ }
57
71
  }
58
72
  }
59
73
  }
@@ -65,14 +79,18 @@
65
79
  "ContainerRows": {
66
80
  "kind": {
67
81
  "array": {
68
- "actor": "ContainerRow"
82
+ "of": {
83
+ "actor": "ContainerRow"
84
+ }
69
85
  }
70
86
  }
71
87
  },
72
88
  "AnotherToolPortal": {
73
89
  "kind": {
74
90
  "array": {
75
- "actor": "Something"
91
+ "of": {
92
+ "actor": "Something"
93
+ }
76
94
  }
77
95
  }
78
96
  }
@@ -195,4 +213,4 @@
195
213
  ]
196
214
  }
197
215
  }
198
- }
216
+ }
@@ -1,7 +1,7 @@
1
1
  scene ToolScene {
2
2
  actors {
3
3
  Tool {
4
- kind {
4
+ shape {
5
5
  id { integer }
6
6
  name { string }
7
7
  }
@@ -10,16 +10,18 @@ scene ToolScene {
10
10
  }
11
11
 
12
12
  Item {
13
- kind {
13
+ shape {
14
14
  id { integer }
15
- tools { [ Tool ] }
15
+ tools {
16
+ array { of { Tool } }
17
+ }
16
18
  }
17
19
 
18
20
  identity { id }
19
21
  }
20
22
 
21
23
  ContainerRow {
22
- kind {
24
+ shape {
23
25
  item { Item }
24
26
  count { integer }
25
27
  }
@@ -28,19 +30,21 @@ scene ToolScene {
28
30
  }
29
31
 
30
32
  Something {
31
- kind {
32
- tools { [ Tool ] }
33
+ shape {
34
+ tools {
35
+ array { of { Tool } }
36
+ }
33
37
  }
34
38
  }
35
39
  }
36
40
 
37
41
  portals {
38
42
  ContainerRows {
39
- kind { [ ContainerRow ] }
43
+ array { of { ContainerRow } }
40
44
  }
41
45
 
42
46
  AnotherToolPortal {
43
- kind { [ Something ] }
47
+ array { of { Something } }
44
48
  }
45
49
  }
46
50