Skip to content

feat(bundle)!: adopt the spec-generated records - #531

Merged
JR-Morgan merged 2 commits into
mainfrom
jrm/bundle-spec-1.2.0
Sep 24, 2026
Merged

JR-Morgan merged 2 commits into
mainfrom
jrm/bundle-spec-1.2.0

Conversation

@JR-Morgan

Copy link
Copy Markdown
Member

Aligns specklepy with the bundle spec's generated records, following the C# SDK and connectors.

specklepy was two spec generations behind — pinned at 1.0.0 while C# sits on 1.1.0 heading to 1.2.0. Re-vendors to 1.2.0 (ten nullability flags, Rel.CENTERLINE, and the new bundle_nodes / bundle_rows modules), then adopts those records in the writer API and the read facade.

Depends on:

Breaking: writer methods take spec records instead of loose scalars, and the Model* read classes expose .fields instead of flattened scalar properties.

Two behaviour fixes worth calling out:

  • Material interning compares whole records. Reusing a key with a different opacity or roughness previously returned the first material and silently dropped the new values — the same defect just fixed in C#.
  • node_fields raises, naming the node and column, when a spec-mandatory column is NULL on read, instead of surfacing it as None.

Structural results stay unimplemented — no Python consumer needs them.

Verified with 191 bundle tests passing, the spec conformance validator actually running rather than skipping, and verify-pin reporting 5 files matching @speckle/bundle-spec@1.2.0.

⚠️ BUNDLE_SPEC_PIN.json points at a commit on the spec PR branch. Repin to the merge commit of speckle-bundle-spec#32 before merging this.

🤖 Generated with Claude Code

specklepy was two spec generations behind — pinned at 1.0.0 while the C#
SDK sits on 1.1.0 heading to 1.2.0. Re-vendors to 1.2.0, which flips ten
nullability flags, adds Rel.CENTERLINE, and brings in the two new
generated modules (bundle_nodes, bundle_rows).

Writers take those records instead of loose scalars: add_material,
add_level, add_collection, add_container, add_property_set_definition and
the get_or_add_* wrappers. add_container gains gh_topology, which the C#
equivalent already carried. The hand-written CameraView is replaced by the
generated one; meta.produced_by is hand-set non-nullable, since meta is
not emitted into BY_TABLE in either SDK.

Material interning now compares whole records rather than name and argb.
Reusing a key with a different opacity or roughness previously returned
the first material and silently dropped the new values — the same defect
just fixed in C#. normalize_material is public so callers can normalise
before comparing, or an unnormalised repeat compares unequal to a row it
would write identically.

Read side: node_fields projects a row onto its per-kind record and raises
naming the node and column when a mandatory column is NULL, and the
flattened properties on ModelMaterial/ModelColor/ModelLevel/
ModelContainer/ModelDefinition become a single .fields record.

BREAKING CHANGE: writer methods take spec records, and the Model* read
classes expose .fields instead of flattened scalar properties.

Structural results stay unimplemented — no Python consumer needs them and
the spec constants were already vendored unused.

Verified: 191 bundle tests pass with the spec conformance validator
actually running (not skipped), and verify-pin reports 5 files matching
@speckle/bundle-spec@1.2.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for specklepy ready!

Name Link
🔨 Latest commit 9fde181
🔍 Latest deploy log https://app.netlify.com/projects/specklepy/deploys/6aaaa41f11ba490008edc32d
😎 Deploy Preview https://deploy-preview-531--specklepy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

speckle-bundle-spec#32 squash-merged as 82ae2e9, so the previous pin
pointed at a branch commit that is not an ancestor of main.

Also corrects specHash. The old value was computed on Windows before that
repo gained a .gitattributes, so it hashed the spec SQL with CRLF line
endings; the real LF hash is 45c91980. verify-pin never reads specHash, so
nothing would have caught it — it is provenance metadata that would simply
have been wrong.

Vendored files are unchanged: all five are byte-identical to merged main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JR-Morgan
JR-Morgan merged commit 2c72716 into main Sep 24, 2026
6 of 11 checks passed
@JR-Morgan
JR-Morgan deleted the jrm/bundle-spec-1.2.0 branch September 24, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants