Summary
The addon's product_sync.py parses responses from hc-http-gw with assumptions about the response JSON structure that have never been verified against a live conductor. The Python bridge repo's Pydantic models are the source of truth for these structures, but actual hc-http-gw JSON transcoding may differ.
Specific Concerns
-
Response key for spec hash: Code does spec_result.get("spec_hash", "").
The Pydantic model CreateResourceSpecificationOutput has a spec_hash field, but hc-http-gw's JSON transcoding of the Rust Record return type may wrap it differently.
-
Response key for resource hash: Same concern with resource_result.get("resource_hash", "").
-
Payload field names: The spec_input dict uses name, description, category, image_url, tags, governance_rules. These must match the Rust ResourceSpecificationInput struct fields exactly. The Python bridge's Pydantic models confirm these are correct, but live verification is needed.
-
Hash encoding: The Python bridge discovered that hc-http-gw v0.3.x uses msgpack-to-JSON transcoding, which requires ActionHash fields to be sent as byte arrays ([132, 41, 36, ...]), not base58 strings. See nondominium-erp-bridge commit c434ae1.
Tasks
Cross-References
- Sensorica/nondominium-erp-bridge
bridge/models.py — Pydantic definitions (source of truth)
- Sensorica/nondominium-erp-bridge
bridge/gateway_client.py — how the Python client parses responses
- Sensorica/nondominium-erp-bridge commit
c434ae1 — hash encoding fix for hc-http-gw v0.3.x
Acceptance Criteria
Summary
The addon's
product_sync.pyparses responses from hc-http-gw with assumptions about the response JSON structure that have never been verified against a live conductor. The Python bridge repo's Pydantic models are the source of truth for these structures, but actual hc-http-gw JSON transcoding may differ.Specific Concerns
Response key for spec hash: Code does
spec_result.get("spec_hash", "").The Pydantic model
CreateResourceSpecificationOutputhas aspec_hashfield, but hc-http-gw's JSON transcoding of the RustRecordreturn type may wrap it differently.Response key for resource hash: Same concern with
resource_result.get("resource_hash", "").Payload field names: The
spec_inputdict usesname,description,category,image_url,tags,governance_rules. These must match the RustResourceSpecificationInputstruct fields exactly. The Python bridge's Pydantic models confirm these are correct, but live verification is needed.Hash encoding: The Python bridge discovered that hc-http-gw v0.3.x uses msgpack-to-JSON transcoding, which requires ActionHash fields to be sent as byte arrays (
[132, 41, 36, ...]), not base58 strings. Seenondominium-erp-bridgecommitc434ae1.Tasks
bridge/models.pyPydantic definitionscreate_resource_specificationcall and inspect the raw JSON responsecreate_economic_resourcecall and inspect the raw JSON responsehash_to_bytes())Cross-References
bridge/models.py— Pydantic definitions (source of truth)bridge/gateway_client.py— how the Python client parses responsesc434ae1— hash encoding fix for hc-http-gw v0.3.xAcceptance Criteria