Summary
encoding/gob is used throughout the codebase for serializing store configs,
object metadata, indexes, and collection types. It forces fields that should be
private to be exported (e.g. objects.metadata), requires a global registry of
types via gob.Register in init() functions, and couples unrelated packages
through shared serialization concerns. The codebase has been migrating toward
hyphence (typed blob) serialization and binary codecs, but gob remains as
legacy scaffolding.
TODO comments
internal/oscar/store_config/main.go:25 — "remove gob entirely and cleanly
separate store functionality (mutation, changes, loading and unloading) from
config functionality (reading properties)"
internal/oscar/store_config/persist.go:4 — "remove once V13 support dropped"
internal/golf/env_repo/genesis.go:162 — "remove gob"
internal/bravo/ids/registry.go:13 — "remove this once gob is removed
entirely"
lib/charlie/quiter/keyer_stringer.go:13 — "remove when removing gob"
Affected files
Direct gob usage (encode/decode calls)
| File |
Usage |
internal/oscar/store_config/persist.go |
gob encode/decode for store config persistence (V13 compat) |
internal/oscar/store_config/main.go |
gob.Register in init() for collection types |
internal/golf/env_repo/genesis.go |
gob encode during genesis |
internal/hotel/store_abbr/main.go |
gob encode/decode for abbreviation store |
internal/hotel/log_remote_inventory_lists/v0.go |
gob encode/decode for remote inventory |
internal/sierra/store_browser/cache.go |
gob encode/decode for browser cache |
internal/foxtrot/zettel_id_index/v1/main.go |
gob encode/decode for zettel ID index |
internal/foxtrot/zettel_id_index/v0/main.go |
gob encode/decode for zettel ID index (v0) |
internal/charlie/hyphence/coder_gob.go |
dedicated gob coder for hyphence (bridge code) |
internal/mike/store_fs/main.go |
gob.Register(sku.Transacted{}) |
gob.Register init() scaffolding (no encode/decode, just registration)
| File |
What it registers |
internal/bravo/ids/registry.go |
generic ID types + collection sets |
internal/golf/sku/collections.go |
TransactedSetEmpty, MakeTransactedMutableSet |
internal/golf/sku/keyers.go |
transactedKeyerObjectId |
internal/golf/sku/main.go |
Transacted{} |
lib/charlie/quiter/keyer_stringer.go |
StringerKeyer variants |
lib/delta/collections_value/gob.go |
generic Set/MutableSet |
lib/delta/collections_value/construction.go |
5x gob.Register for constructed sets |
lib/delta/collections_ptr/gob.go |
generic Set/MutableSet (ptr variant) |
lib/delta/tridex/main.go |
&Tridex{} |
lib/echo/thyme/time.go |
Time{} |
Structural debt forced by gob
| File |
Issue |
internal/delta/objects/main.go:20-21 |
"all the fields need to be public for gob's stupid illusions, but should be private once moving away from the gob entirely" |
internal/delta/objects/index.go:41 |
ImplicitTags is "public for gob, but should be private" |
Test-only gob usage
| File |
Notes |
internal/bravo/ids/zettel_id_test.go |
gob round-trip test for ZettelId |
internal/bravo/ids/gob_test.go |
dedicated gob serialization test |
lib/delta/collections/bitset_test.go |
gob encode/decode test for bitset |
lib/delta/trie/main.go |
gob encode/decode in trie (may be test-adjacent) |
Approach considerations
- Store config persistence (
oscar/store_config/persist.go) gates on V13
support — dropping gob there requires deciding the minimum supported store
version
objects.metadata fields can be made private once gob is gone, which is a
significant encapsulation win
- The
hyphence/coder_gob.go bridge can be deleted once no persisted data uses
gob format
gob.Register calls in init() across ~15 files can be removed wholesale
once no code path calls gob.NewEncoder/gob.NewDecoder
collections_value/gob.go and collections_ptr/gob.go are dedicated gob
files that can be deleted entirely
Summary
encoding/gobis used throughout the codebase for serializing store configs,object metadata, indexes, and collection types. It forces fields that should be
private to be exported (e.g.
objects.metadata), requires a global registry oftypes via
gob.Registerininit()functions, and couples unrelated packagesthrough shared serialization concerns. The codebase has been migrating toward
hyphence (typed blob) serialization and binary codecs, but gob remains as
legacy scaffolding.
TODO comments
internal/oscar/store_config/main.go:25— "remove gob entirely and cleanlyseparate store functionality (mutation, changes, loading and unloading) from
config functionality (reading properties)"
internal/oscar/store_config/persist.go:4— "remove once V13 support dropped"internal/golf/env_repo/genesis.go:162— "remove gob"internal/bravo/ids/registry.go:13— "remove this once gob is removedentirely"
lib/charlie/quiter/keyer_stringer.go:13— "remove when removing gob"Affected files
Direct gob usage (encode/decode calls)
internal/oscar/store_config/persist.gointernal/oscar/store_config/main.gogob.Registerininit()for collection typesinternal/golf/env_repo/genesis.gointernal/hotel/store_abbr/main.gointernal/hotel/log_remote_inventory_lists/v0.gointernal/sierra/store_browser/cache.gointernal/foxtrot/zettel_id_index/v1/main.gointernal/foxtrot/zettel_id_index/v0/main.gointernal/charlie/hyphence/coder_gob.gointernal/mike/store_fs/main.gogob.Register(sku.Transacted{})gob.Registerinit() scaffolding (no encode/decode, just registration)internal/bravo/ids/registry.gointernal/golf/sku/collections.goTransactedSetEmpty,MakeTransactedMutableSetinternal/golf/sku/keyers.gotransactedKeyerObjectIdinternal/golf/sku/main.goTransacted{}lib/charlie/quiter/keyer_stringer.goStringerKeyervariantslib/delta/collections_value/gob.goSet/MutableSetlib/delta/collections_value/construction.gogob.Registerfor constructed setslib/delta/collections_ptr/gob.goSet/MutableSet(ptr variant)lib/delta/tridex/main.go&Tridex{}lib/echo/thyme/time.goTime{}Structural debt forced by gob
internal/delta/objects/main.go:20-21internal/delta/objects/index.go:41ImplicitTagsis "public for gob, but should be private"Test-only gob usage
internal/bravo/ids/zettel_id_test.gointernal/bravo/ids/gob_test.golib/delta/collections/bitset_test.golib/delta/trie/main.goApproach considerations
oscar/store_config/persist.go) gates on V13support — dropping gob there requires deciding the minimum supported store
version
objects.metadatafields can be made private once gob is gone, which is asignificant encapsulation win
hyphence/coder_gob.gobridge can be deleted once no persisted data usesgob format
gob.Registercalls ininit()across ~15 files can be removed wholesaleonce no code path calls
gob.NewEncoder/gob.NewDecodercollections_value/gob.goandcollections_ptr/gob.goare dedicated gobfiles that can be deleted entirely