@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 +22 -0
- package/examples/expectations-demo.js +5 -5
- package/package.json +1 -1
- package/src/attestations/attestations.js +1 -1
- package/src/attestations/compute_status.js +1 -1
- package/src/canonical/actor.scene.json +9 -6
- package/src/canonical/actor.scene.prose +1 -1
- package/src/canonical/actors.scene.json +41 -25
- package/src/canonical/actors.scene.prose +4 -4
- package/src/canonical/tools.scene.json +41 -23
- package/src/canonical/tools.scene.prose +12 -8
- package/src/compiler/compile_scene.js +743 -76
- package/src/manifest/scene_manifest.d.ts +2 -2
- package/src/manifest/scene_manifest.js +88 -5
- package/test/api.test.js +2 -2
- package/test/compile_scene.test.js +15 -15
- package/test/expectations.test.js +64 -20
- package/test/fixtures/expectations-basic.scene.prose +5 -5
- package/test/fixtures/players.scene.prose +2 -2
- package/test/fixtures/skills-many-some.scene.prose +4 -4
- package/test/fixtures/skills-many.scene.prose +4 -4
- package/test/fixtures/skills.scene.prose +7 -7
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.
|
|
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(' āŖ
|
|
144
|
-
console.log(' š¢
|
|
145
|
-
console.log(' š
|
|
146
|
-
console.log(' š“
|
|
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
|
@@ -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
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"type": "shape",
|
|
6
|
+
"fields": {
|
|
7
|
+
"id": {
|
|
8
|
+
"type": {
|
|
8
9
|
"primitive": "integer"
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
+
}
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
"sceneName": "LeftPanel",
|
|
3
3
|
"actors": {
|
|
4
4
|
"Location": {
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"type": "shape",
|
|
6
|
+
"fields": {
|
|
7
|
+
"id": {
|
|
8
|
+
"type": {
|
|
8
9
|
"primitive": "integer"
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
"type": "shape",
|
|
24
|
+
"fields": {
|
|
25
|
+
"id": {
|
|
26
|
+
"type": {
|
|
23
27
|
"primitive": "integer"
|
|
24
|
-
}
|
|
25
|
-
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"name": {
|
|
31
|
+
"type": {
|
|
26
32
|
"primitive": "string"
|
|
27
|
-
}
|
|
28
|
-
|
|
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
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
"type": "shape",
|
|
47
|
+
"fields": {
|
|
48
|
+
"id": {
|
|
49
|
+
"type": {
|
|
41
50
|
"primitive": "integer"
|
|
42
|
-
}
|
|
43
|
-
|
|
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
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
"type": "shape",
|
|
65
|
+
"fields": {
|
|
66
|
+
"player": {
|
|
67
|
+
"type": {
|
|
56
68
|
"actor": "Player"
|
|
57
|
-
}
|
|
58
|
-
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"skill": {
|
|
72
|
+
"type": {
|
|
59
73
|
"actor": "Skill"
|
|
60
|
-
}
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"type": "shape",
|
|
6
|
+
"fields": {
|
|
7
|
+
"id": {
|
|
8
|
+
"type": {
|
|
8
9
|
"primitive": "integer"
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
"type": "shape",
|
|
24
|
+
"fields": {
|
|
25
|
+
"id": {
|
|
26
|
+
"type": {
|
|
23
27
|
"primitive": "integer"
|
|
24
|
-
}
|
|
25
|
-
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"tools": {
|
|
31
|
+
"type": {
|
|
26
32
|
"array": {
|
|
27
|
-
"
|
|
33
|
+
"of": {
|
|
34
|
+
"actor": "Tool"
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
}
|
|
30
38
|
}
|
|
@@ -34,12 +42,15 @@
|
|
|
34
42
|
]
|
|
35
43
|
},
|
|
36
44
|
"ContainerRow": {
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
"type": "shape",
|
|
46
|
+
"fields": {
|
|
47
|
+
"item": {
|
|
48
|
+
"type": {
|
|
40
49
|
"actor": "Item"
|
|
41
|
-
}
|
|
42
|
-
|
|
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
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
"type": "shape",
|
|
64
|
+
"fields": {
|
|
65
|
+
"tools": {
|
|
66
|
+
"type": {
|
|
55
67
|
"array": {
|
|
56
|
-
"
|
|
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
|
-
"
|
|
82
|
+
"of": {
|
|
83
|
+
"actor": "ContainerRow"
|
|
84
|
+
}
|
|
69
85
|
}
|
|
70
86
|
}
|
|
71
87
|
},
|
|
72
88
|
"AnotherToolPortal": {
|
|
73
89
|
"kind": {
|
|
74
90
|
"array": {
|
|
75
|
-
"
|
|
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
|
-
|
|
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
|
-
|
|
13
|
+
shape {
|
|
14
14
|
id { integer }
|
|
15
|
-
tools {
|
|
15
|
+
tools {
|
|
16
|
+
array { of { Tool } }
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
identity { id }
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
ContainerRow {
|
|
22
|
-
|
|
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
|
-
|
|
32
|
-
tools {
|
|
33
|
+
shape {
|
|
34
|
+
tools {
|
|
35
|
+
array { of { Tool } }
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
portals {
|
|
38
42
|
ContainerRows {
|
|
39
|
-
|
|
43
|
+
array { of { ContainerRow } }
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
AnotherToolPortal {
|
|
43
|
-
|
|
47
|
+
array { of { Something } }
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
|