English | 简体中文 | 繁體中文 | 日本語 | Español | Français | Deutsch
Official website and documentation
The MissionWeaveProtocol Go SDK provides schema-first Go bindings for
MissionWeaveProtocol 0.1. The Go
module is github.com/missionweaveprotocol/go-sdk, and its root package is
missionweaveprotocol.
This release demonstrates schema-and-vector conformance. It does not claim behavioral conformance for an authoritative Core, Agent runtime, Worker Scheduler, Group gateway, persistence, or the complete Mission/WorkItem state machine.
| Go SDK | MissionWeaveProtocol |
|---|---|
0.1.x |
0.1 |
SDK and protocol versions are independent. PROTOCOL_PIN.json records the
exact protocol commit plus SHA-256 digests for the vendored schemas and conformance vectors.
Go 1.24 or newer is required.
go get github.com/missionweaveprotocol/go-sdk@latest- byte-exact embedded protocol pin, 21 Draft 2020-12 schemas, and 56 conformance vectors;
- verification of schema, conformance, and combined bundle digests;
- strict UTF-8 JSON parsing with recursive duplicate-member rejection;
- offline
$idschema resolution with format assertions and ECMAScript-compatible patterns; - an embedded or caller-supplied
fs.FSSchemaCatalog; - a 56-vector conformance runner and
missionweaveprotocol-conformancecommand; - RFC 8785 JSON canonicalization and
sha256:content identifiers; - Ed25519 signing and verification with unpadded base64url values;
- signing payloads that exclude only the top-level
signaturemember; SignedDocumentCodeccoverage for all 22 cryptography cases and 62 evaluations;- a generic, schema-validating, canonical
FrameCodecfor WebSocket frames.
if err := missionweaveprotocol.VerifyProtocolBundle(); err != nil {
log.Fatal(err)
}
pin, err := missionweaveprotocol.CurrentProtocolPin()
if err != nil {
log.Fatal(err)
}
fmt.Println(pin.ProtocolVersion, pin.Commit)catalog, err := missionweaveprotocol.NewEmbeddedSchemaCatalog()
if err != nil {
log.Fatal(err)
}
if err := catalog.Validate("command.schema.json", commandJSON); err != nil {
log.Fatal(err)
}NewSchemaCatalog(source fs.FS) provides the same Interface for an unpacked protocol checkout or
release bundle. Every schema is registered by $id before compilation; unresolved references never
fall back to the network.
codec, err := missionweaveprotocol.NewFrameCodec()
if err != nil {
log.Fatal(err)
}
frame, err := codec.DecodeFrame(frameJSON)
if err != nil {
log.Fatal(err)
}
canonicalFrame, err := codec.EncodeFrame(frame)
if err != nil {
log.Fatal(err)
}DecodeFrame rejects malformed UTF-8, duplicate JSON members, unknown frame variants, extra fields,
and schema-invalid content. EncodeFrame validates before returning canonical RFC 8785 JSON.
canonical, err := missionweaveprotocol.CanonicalizeJSON(document)
hash, err := missionweaveprotocol.CanonicalHash(document)
signature, err := missionweaveprotocol.SignDocument(privateKey, document)
verified, err := missionweaveprotocol.VerifyDocument(publicKey, document, signature)CanonicalizeJSON, CanonicalHash, and the document-signing Interface accept JSON bytes and do
not apply custom conversions for Go values such as time.Time. MarshalCanonicalJSON is an
explicit convenience that applies standard encoding/json marshaling before JCS. SignDocument
and VerifyDocument remove the top-level signature member before canonicalization; nested
members with that name remain signed.
SignedDocumentCodec implements the ordered cryptographic profile for exactly nine explicit
document kinds:
codec, err := missionweaveprotocol.NewSignedDocumentCodec()
signed, err := codec.Sign(missionweaveprotocol.SignedDocumentCommand, unsigned, signingKey)
verified, err := codec.Verify(missionweaveprotocol.SignedDocumentCommand, raw, keyResolver)
fmt.Println(signed["signature"], verified.SigningHash(), verified.ResolvedKey().Principal())SigningKey is the only signing adapter. KeyResolver receives a KeyResolutionRequest and must
return a KeyRegistrySnapshot whose completeness is explicitly
KeyRegistryOrganizationWide; partial or unspecified Agent Registry snapshots fail closed. Verification
errors expose only a stable WireCode() to peers, while ProtectedDiagnostic() retains the first
failing stage and reason for local operators. See the runnable test-fixture example in
examples/sign.
Run against the embedded protocol bundle:
go run github.com/missionweaveprotocol/go-sdk/cmd/missionweaveprotocol-conformance@latestOr run against a protocol checkout or release bundle:
go run ./cmd/missionweaveprotocol-conformance --root ../missionweaveprotocolSuccess reports 56/56 conformance vectors passed. The command exits non-zero for a validity
mismatch, malformed vector, missing resource, or schema compilation error.
go run ./examples/validate
go run ./examples/sign
go run ./internal/cmd/repository-policy
go test -race ./...
go vet ./...
go build ./...The CI gate also verifies formatting, canonical naming, both embedded and checkout conformance, and a compiled-binary resource smoke test.
The normative protocol repository remains the source of truth. This SDK intentionally does not copy the Python reference implementation's server, database adapters, scheduling algorithm, local runtime, or internal projection models. Future runtime features require their own behavioral conformance work and will be documented separately.
Licensed under Apache-2.0.