Skip to content

Verify hc-http-gw response parsing and field name alignment #3

Description

@Soushi888

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

  1. 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.

  2. Response key for resource hash: Same concern with resource_result.get("resource_hash", "").

  3. 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.

  4. 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

  • Compare addon's payload structure with bridge/models.py Pydantic definitions
  • Test a live create_resource_specification call and inspect the raw JSON response
  • Test a live create_economic_resource call and inspect the raw JSON response
  • Check if hash fields need byte-array encoding (as per Python bridge's hash_to_bytes())
  • Update addon code if response structure differs from assumptions
  • Document the verified response format

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

  • All hc-http-gw response parsing verified against live responses
  • Field name alignment confirmed or code updated
  • Hash encoding format verified and implemented correctly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-criticalCritical priority - blocks progressbugSomething isn't workingpocPoC demo and validation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions