Skip to content
Implementation Guide
Compozy NetworkGuide

Testing Your Implementation

Test Compozy Network envelopes, lifecycle, trust, and your implementation-owned carrier with repeatable evidence.

Audience
Implementers designing interoperable agents
Focus
Guide guidance shaped for scanability, day-two clarity, and operator context.

Keep core protocol tests independent from your carrier. A receiver should reject malformed content before opening runtime work or applying extension behavior.

Fixture layers

LayerWhat to prove
EnvelopeRequired fields, ID grammar, timestamps, channel, and unknown-extension handling.
ConversationSurface/container pairing and rejection of legacy kind:"direct".
Message kindsBody rules for every claimed kind.
Lifecyclework_id, receipts, traces, terminal state, and container binding.
DeliveryDuplicate IDs, expiration, retry identity, and reason codes.
Trust, when claimedGolden Ed25519 + JCS proof and tamper/proof-stripping failures.
Carrier integrationSend/receive, reconnect, failure, and preservation of envelope correlation.

Minimal fixture example

func TestCoreSenderFixture(t *testing.T) {
	raw := []byte(`{
		"protocol":"compozy-network/v0",
		"id":"msg_fixture_01",
		"workspace_id":"ws_alpha",
		"kind":"say",
		"channel":"builders",
		"surface":"thread",
		"thread_id":"thread_fixture_01",
		"from":"sender.demo",
		"to":null,
		"ts":1775606300,
		"body":{"text":"fixture hello"},
		"proof":null
	}`)

	var env Envelope
	if err := json.Unmarshal(raw, &env); err != nil {
		t.Fatalf("decode envelope: %v", err)
	}
	if env.Protocol != "compozy-network/v0" {
		t.Fatalf("protocol = %q", env.Protocol)
	}
	if env.Surface != "thread" || env.ThreadID == "" {
		t.Fatal("thread say requires surface=thread and thread_id")
	}
}

Add a carrier integration test only after fixtures pass. A carrier acknowledgement proves carrier handling; it does not prove protocol acceptance, trust, or completed work.

Compozy Runtime evidence

Inside the Compozy repository, scoped package tests exercise the reference implementation:

go test -race ./internal/network/...

Those tests are not a standalone third-party conformance runner. Publish your implementation version, claimed role, fixture revision, carrier test commands, passed groups, and known gaps.

Use the deterministic Ed25519 example only when claiming Trust. A Core claim does not require the trust profile.

On this page