Two messaging fixes: Header.parse and the project envelope - #25
Open
gonzalocasas wants to merge 2 commits into
Open
gonzalocasas wants to merge 2 commits into
gonzalocasas wants to merge 2 commits into
Conversation
Header.parse passed four values positionally into a constructor whose first parameter is increment_response_ID, so every field shifted by one: sequence_id landed in increment_response_ID, response_id in sequence_id, device_id in response_id, time_stamp in device_id, and time_stamp was regenerated. Verified over a live broker round-trip. This has been wrong since 26577b9 (2024-05-01), which added increment_response_ID as a new first parameter without updating the call site. The version before it read each field by name. Pass the fields as keyword arguments and restore the validation that commit dropped. Two related fixes: - The constructor used `sequence_id or default`, discarding a legitimate counter value of 0. Use `is None` instead. - parse() now accepts either the decoded wire dict or a Header instance. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
create_project_data_from_compas emitted beams/joints instead of elements for a TimberModel. Consumers read "model" and "elements" — the C# runtime does exactly that — so a timber project silently produced a model with no elements at all. Define the envelope in terms of a plain compas_model Model and always emit elements. Beams and joints stay available for timber-aware consumers, but as additive extras rather than a different contract. Also relaxes the compas_pb test pin from 1.1 to 1.x, matching requirements.txt (>=1.1,<2) and the 1.2 the C# runtime targets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jckenny59
approved these changes
Sep 9, 2026
jckenny59
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 👍 Thanks for fixing my “creative interpretation” of Header.parse 😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent bug fixes on top of the Model migration. Neither involves a design decision.
Header.parse scrambles every field
messages.pyis identical onmainandrestructure, so this fix applies to both. It lives here, at the base of the messaging stack, rather than in a separate PR againstmain: the protobuf wire work in #26 stacks on top of it and touches the same file, and #23 is queued to merge, somainpicks the fix up along with it.Header.parsepassed four values positionally into a constructor whose first parameter isincrement_response_ID, shifting every field. Broken since 2024-05-01. Fixed with keyword arguments, the dropped validation restored, plus a zero-valued-counter bug (sequence_id or defaultdiscards a legitimate0).The project envelope drops elements for timber models
create_project_data_from_compasemittedbeams/jointsinstead ofelementsfor aTimberModel:Consumers read
modelandelements— the C# runtime does exactly that — so a timber project silently produced a model with no elements at all.The envelope is now defined in terms of a plain
compas_modelModel and always emitselements. Beams and joints stay available for timber-aware consumers, but as additive extras rather than a different contract. This follows the intent that COMPAS XR work with plainModelby default and treatcompas_timberas a specialisation.Fully removing the
compas_timberdependency is a larger job and not attempted here —BuildingPlan,StepandSimpleSequenceGeneratorrun through the project API.Also
Relaxes the
compas_pbtest pin from1.1to1.x, matchingrequirements.txt(>=1.1,<2) and the 1.2 the C# runtime targets. The test asserted1.1.specifically and would have failed on a legitimate, wire-compatible upgrade.15/15 tests pass.
🤖 Generated with Claude Code