Skip to content

[kit:csharp] migrate Bridge IR to layered tagged-union target shape (v1.6 catalog) #192

@TSavo

Description

@TSavo

Gap

Under the bridge-target-dimensionality spec (per protocol/specs/2026-05-03-bridge-target-dimensionality.md), bridges adopt the envelope/header/body shape with a tagged-union target field ({kind: "contract", cid} or {kind: "contractSet", cid}) replacing the v1.1 9-field flat shape with targetContractCid. This shape is valid under catalog v1.6.0 (the current catalog; a strict superset of v1.4.x).

The C# kit's Provekit.IR.Collector.BridgeDecl is (TargetContractName, IrArgSorts, IrReturnSort), a lift-adapter helper, not the spec Bridge shape. Self-contracts attestation IS signed (the bundle CID is pinned, and contractSetCid is emitted), but Phase 2 cross-kit bridges require a separate spec-shaped BridgeDeclaration record. Originally flagged against the v1.1.0 9-field shape; the migration target is the layered shape with a tagged-union target field.

(Version references updated from v1.4 to v1.6 mechanically -- no semantic change; the BridgeDeclaration shape defined in the spec is valid and unchanged across v1.4 through v1.6.)

Acceptance

  • Kit's IR types support the envelope/header/body layering (per 2026-05-03-substrate-layers-envelope-header-body.md) against catalog v1.6.0
  • A spec-shaped BridgeDeclaration record is added alongside the existing lift-adapter helper
  • Bridge mint emits the tagged-union target field
  • No placeholder strings in target.cid (pending-*:, deferred:* are forbidden per spec R2)
  • Round-trip parity: emit and re-parse a bridge memento with byte-identical output
  • Conformance fixture bridge_decl updated for the layered shape and passing
  • docs/reference/per-language-status.md "Bridge IR (tagged-union target)" column updated for this kit from ~ pending to +
  • docs/tutorials/csharp.md stub-gap note refreshed to reference the layered shape

Reference

Subsumes the v1.1 partial-shape gap originally tracked as the phantom reference #224 in docs/reference/per-language-status.md and docs/tutorials/csharp.md (entries replaced by this issue).

Related specs:

  • 2026-05-03-bridge-target-dimensionality.md
  • 2026-05-03-substrate-layers-envelope-header-body.md
  • 2026-05-03-bridge-linkage-protocol.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions