Repository navigation
Conversation
…g CoreType switches
…rations table, drop isRef/gc/fillRefs methods
…gacy refs at every ingress
…torage-epoch fail-fast
…lifecycle and using-adoption at call sites
…robe, register characterization tests
…ect all runtime failures
This was referenced Oct 27, 2026
Closed
Collaborator
Author
|
Superseded by the reviewed, fully verified replacement stack: https://github.com/goatplatform/goatdb/stack/92
Each complete replacement tip passed full Deno + Node + browser suites on current Deno2.9.1 and actual floor2.3.3, with Node24.14.1 and Playwright1.64.1. Exact tip hashes, scope, dependencies, gates and breaking/data notices are in the new PR bodies. Final tip9e9a759f has 0 failures on all six full runs; the 49-source-commit content audit and independent review passed. Remote Actions status is separate from these measured local gates. Review bottom-up. This replaces the old split, not just its last diff. No PR was merged, no issue was edited, and original remote branches are retained. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: This PR was generated by an AI agent. If you'd like to talk with other humans, drop by our Discord!
CoreValue & JSON Serializer Refactor (issue #58)
Why this work matters
CoreType knowledge lived in three separate switch statements. Each new type needed three edits, and one missed edit failed silently. The JSON decoder pool leaked on error paths. Legacy
isRefand rich-text machinery stayed after its removal and misled readers. Dates had two wire forms, and the checksum could not tell a date from a number.This PR makes one table the single source of truth, closes the leaks, deletes the dead code, and unifies the Date form.
Changes at a glance
Added
+base/core-types/type-ops.ts— one frozenkTypeOpstable. A missing type is now a compile error.+base/core-types/encoding/encoded-ref.ts— dependency-free leaf for the ref guard.+cfds/richtext/legacy-ref.ts— rejects legacy ref shapes at every ingress.+db/storage-epoch.ts— refuses incompatible stores at open.+Characterization suites, benchmarks, and CI type-check plus runtime-floor probes.Removed
−Duplicate CoreType switches inclone.ts,equals.ts, andbase-encoder.ts.−Dead ref/GC plumbing:isRef,fillRefs,rewriteRefs,needGC,gc,getRefOperation, andcfds/base/types/utils.ts.−Five zero-import rich-text files (composer,shortcuts,doc-state,utils,markdownref case) and the commented blocks around them.Changed
~Decoder pool:Symbol.disposeplusOwnedDecoder. Acquire/finalize is idempotent and generation-tracked. Eight production leak sites anddecodedDataChangesare fixed.~Datewires only as{ "__t": "D", "__v": … }. The bare-number form is rejected.~The checksum tagsDatein all positions. The unknown-value path is unchanged.~Clone keeps shared aliases across array and set siblings.~Options and hash names are unified.coreValueHashbecomesencodableValueHash.Also on this branch (separate feature, #55)
~Idle repository and query auto-close, plus lazy query loading (db.ts,repo/,base/emitter.ts).Breaking changes
{ "__rId": <n> }outside__r/__dthrows.typeSafestring can still collide with a tagged Date. UsetypeSafefor untrusted input.kTypeOpsstays internal, not public API.Value
One place defines a type. Missing coverage fails the build. Leaks become testable. Incompatible data fails loud and clear, not as scattered corruption. Goldens pin the stored bytes.
Attached is an agent-optimized description of the changes in this PR: AGENT_REVIEW.md