SGM is organized into four strictly-separated layers. Dependencies flow in one direction only:
┌─────────────────────────────────────────────────────────────┐
│ 1. SPECIFICATION authoritative; normative semantics │
├─────────────────────────────────────────────────────────────┤
│ 2. SCHEMAS machine-readable; normative shape │
├─────────────────────────────────────────────────────────────┤
│ 3. CONFORMANCE behavioral tests; normative proof │
├─────────────────────────────────────────────────────────────┤
│ 4. REFERENCE IMPL executable documentation only │
│ └── transports/ optional bindings (MCP/HTTP/CLI) │
└─────────────────────────────────────────────────────────────┘
The prose documents in spec/. These define what every term and operation
means. They are the source of truth. If code and spec disagree, the code is
wrong.
The JSON Schemas in ../schemas/. These define the structure
of every protocol object: required fields, types, enums, and relationships.
The schemas are normative for shape; the spec is normative for semantics. A
conforming implementation MUST satisfy both.
Schemas describe the logical object, never a physical storage table. An implementation MUST NOT leak its internal schema into the protocol objects.
The behavioral test suite in ../conformance/. These test
externally observable behavior — what a client can see — not internal
functions or database structure. Any independent implementation can run them to
answer: “Do I actually implement SGM correctly?”
The canonical invocation is conceptually:
sgm conformance # run all suites
sgm conformance retrieval # run one capability profile
The suite reports which capabilities an implementation satisfies.
A minimal, readable implementation in ../reference/. Its only
jobs are:
The reference implementation MUST NOT become a hidden dependency of the protocol. Two independent implementations MUST be able to interoperate without either reading the other’s source.
Before treating this repository as complete, it must pass:
Imagine the reference implementation does not exist. Does the SGM repository still make sense?
If no, the repo is too coupled. An independent developer must be able to, using only this public repository:
Transport bindings live in ../transports/, outside the
protocol core. A binding:
See overview.md.
Before promoting any implementation detail to a protocol requirement, ask:
Would two completely independent implementations need to agree on this to interoperate?
SGM defines the smallest strong standard capable of meaningful interoperability. The implementation may be far more sophisticated than the protocol. See capabilities.md.