gcf-go v1.0.0
Reference implementation for GCF SPEC v2.0 Stable
133 conformance fixtures passing. 80M property-based round-trips with zero failures. 7.9M fuzz executions, 3 bugs found and fixed. Cross-language conformance matrix verified.
New
scalar.go: common scalar grammar (quoting, escaping, parsing, number formatting)orderedmap.go:OrderedMaptype preserving JSON key insertion orderParseJSONOrdered: ordered JSON parser for conformance-grade encoding- Property-based round-trip tests (configurable via
GCF_ITERATIONSenv var) - Fuzz targets for encoder and decoder with saved crash regression cases
- Conformance test runner for 133 fixtures
- Cross-language encode/decode matrix verification
Breaking changes from v0.6.0
EncodeGenericemitsGCF profile=genericheaderDecodeGenericrequiresGCF profile=header- Strings colliding with typed literals are quoted (
"true","123","-") - Full JSON string escaping (
\b,\f,\n,\r,\t,\uXXXX, surrogate pairs) - Full JSON number grammar with exponent notation
-for null,~for absent fields,^for nested attachments##! summarytrailer replaces## _summary- Graph encoder emits
profile=graph, sorts symbols by score descending - Graph encoder assigns IDs after sorting (sequential in output order)
- Session encoder uses session-stable IDs across calls
Lossless round-trip invariant
decodeGeneric(encodeGeneric(value)) == value for every JSON value. Proven by:
- 80M random and adversarial round-trips
- 7.9M fuzz executions (3 bugs found and fixed: negative zero, large integer precision, quoted brace in field declarations)
- Structural proof by construction (scalar injectivity + container injectivity)
Install
go get github.com/blackwell-systems/gcf-go@v1.0.0