Skip to content

gcf-go v1.0.0

Choose a tag to compare

@blackwell-systems blackwell-systems released this 10 Jun 08:25
· 44 commits to main since this release

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: OrderedMap type preserving JSON key insertion order
  • ParseJSONOrdered: ordered JSON parser for conformance-grade encoding
  • Property-based round-trip tests (configurable via GCF_ITERATIONS env 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

  • EncodeGeneric emits GCF profile=generic header
  • DecodeGeneric requires GCF 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
  • ##! summary trailer 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