Skip to content

Commit ae525ae

Browse files
committed
feat: publish viewer animation cadence
1 parent 45a88be commit ae525ae

8 files changed

Lines changed: 10 additions & 4 deletions

File tree

openspec/changes/published-viewer-animation/.openspec.yaml renamed to openspec/changes/archive/2026-07-20-published-viewer-animation/.openspec.yaml

File renamed without changes.

openspec/changes/published-viewer-animation/design.md renamed to openspec/changes/archive/2026-07-20-published-viewer-animation/design.md

File renamed without changes.

openspec/changes/published-viewer-animation/proposal.md renamed to openspec/changes/archive/2026-07-20-published-viewer-animation/proposal.md

File renamed without changes.

openspec/changes/published-viewer-animation/specs/build-viewer-artifacts/spec.md renamed to openspec/changes/archive/2026-07-20-published-viewer-animation/specs/build-viewer-artifacts/spec.md

File renamed without changes.

openspec/changes/published-viewer-animation/tasks.md renamed to openspec/changes/archive/2026-07-20-published-viewer-animation/tasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## 1. Published snapshot contract
22

3-
- [ ] 1.1 Add red-first builder coverage for the published animation cadence
3+
- [x] 1.1 Add red-first builder coverage for the published animation cadence
44
and its retention after a failed later build.
5-
- [ ] 1.2 Serialize the established `fps` and `frames` cadence into staging
5+
- [x] 1.2 Serialize the established `fps` and `frames` cadence into staging
66
`viewer.json` before atomic publication.
77

88
## 2. Verification
99

10-
- [ ] 2.1 Run the focused build, CLI, and snapshot-backed-viewer suites and
10+
- [x] 2.1 Run the focused build, CLI, and snapshot-backed-viewer suites and
1111
validate the originating Floor/V8 consumer against the completed build.

openspec/specs/build-viewer-artifacts/spec.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ Complete normal-build viewer state for private local framework consumers.
77
## Requirements
88

99
### Requirement: Complete builds publish a viewer snapshot
10-
The builder SHALL publish a versioned viewer snapshot in the normal build directory only after the current project model has assembled and every required STL artifact is current. The snapshot SHALL contain the recursive viewer state for the root model: node identity, type, colour, serialized operations, child relationships, and build-root-relative rigid-model paths.
10+
The builder SHALL publish a versioned viewer snapshot in the normal build directory only after the current project model has assembled and every required STL artifact is current. The snapshot SHALL contain the recursive viewer state for the root model: node identity, type, colour, serialized operations, child relationships, and build-root-relative rigid-model paths. It SHALL also contain an `animation` object with numeric `fps` and `frames` values representing the animation cadence used to evaluate raw `$t` operations. The snapshot and all referenced model files SHALL become visible together through the normal atomic build publication.
1111

1212
#### Scenario: A complete model is built once
1313
- **WHEN** `solid build <project>` completes successfully
1414
- **THEN** its `_build` directory contains a complete viewer snapshot whose rigid model paths resolve within that same published directory
1515

16+
#### Scenario: A completed animated model is published
17+
- **WHEN** `solid build <project>` completes a model with a `$t` operation
18+
- **THEN** its `viewer.json` contains numeric `animation.fps` and `animation.frames` values alongside the root tree
19+
1620
### Requirement: The framework viewer can read a published snapshot
1721
The framework SHALL provide its existing private viewer implementation a snapshot-backed mode that serves the same recursive node state and model files from a published build directory without importing the project model.
1822

solid_node/core/builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def _write_viewer_snapshot(self):
273273
os.makedirs(self.build_dir, exist_ok=True)
274274
with open(os.path.join(self.build_dir, 'viewer.json'), 'w') as snapshot:
275275
json.dump({'version': 1,
276+
'animation': {'fps': 30, 'frames': 360},
276277
'root': _viewer_state(self.node, self.build_dir)}, snapshot)
277278

278279
def _notify_callback(self):

tests/test_builder_lifecycle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def test_complete_build_writes_viewer_snapshot_before_publishing(self):
125125
data = json.load(snapshot)
126126
self.assertEqual(data['root']['name'], 'part')
127127
self.assertEqual(data['root']['model'], 'part.stl')
128+
self.assertEqual(data['animation'], {'fps': 30, 'frames': 360})
128129

129130
def test_failed_build_does_not_notify_callback(self):
130131
builder = Builder('model.py', build_dir='/tmp/candidate',

0 commit comments

Comments
 (0)