Repository navigation
fix/issue-63: Name the packages, specs and docs without a schema version - #88
Merged
Merged
Conversation
…al/schema, emit (#63) The output contract moves from internal/schema/v2 to internal/schema, the analyzer's internal fact model from internal/schema to internal/model, and the emitter from syntactic_analysis/v2emit to syntactic_analysis/emit. Comments, error strings and test names no longer say v1 or v2. The output is unchanged.
The seven v2- specs lose the prefix, and every link to them is updated. The living docs (CLAUDE.md, README.md, the undated specs, the Neo4j projection spec) no longer tell a v1 to v2 migration story. The migration records under docs/design/issues/ are deleted: they describe finished work. The other records only get their links and code references updated.
…/json does Go 1.26 escapes an invalid UTF-8 byte as \ufffd; Go 1.27 writes the character U+FFFD. writeJSONString always wrote the character, so on CI's Go 1.26 it differed from json.Marshal and TestWriteJSONString_EqualsMarshal failed on every run since #86. It now asks encoding/json once how it writes one.
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.
tl;dr The code and docs no longer call the schema "v2". The packages are
internal/schema(the output contract),internal/model(the analyzer's internal fact model) andemit. The output is byte-identical. It also fixes the CI failure that every run since #86 has had.Motivation and Context
Drop the "v2" name from packages, specs and docs #63: the analyzer has one output schema, but the code and docs called it "v2", so a reader expected a v1 to exist.
There was a second schema package. The old
internal/schema(GoApplication,GoCallable, …) is the analyzer's internal fact model: the parser, resolver and call-graph builder fill it, and the emitter converts it to the output. It is written out only as the debugging fileanalysis_cache.json, which nothing reads back. The code called it "v1". Because of it,internal/schema/v2could not simply becomeinternal/schema.Packages:
internal/schemainternal/modelinternal/schema/v2internal/schemaschema.Callable,schema.GlobalOrdinal)internal/syntactic_analysis/v2emitinternal/syntactic_analysis/emitComments, error strings (
v2emit: …→emit: …) and test names (buildMultipackageV2→buildMultipackage,TestGateL1_SupersetOfV1→TestGateL1_SupersetOfModel) no longer name a version. "v1" in comments now reads "the model".Docs:
v2-specs lose the prefix (v2-l1-emission.md→l1-emission.md, …), and every link to them is updated.CLAUDE.md,README.md, the undated specs and the Neo4j projection spec describe the schema as it is. Comparisons with v1 (for example "collapses v1'sis_interface") are dropped.docs/design/issues/(epic-v2-migration.md,parent-v2-migration.md, the two child issue drafts andpr-body-v2-l1-l2.md) are deleted: they describe finished work.v2.GlobalOrdinal,internal/schema/v2) are updated.CI fix:
TestWriteJSONString_EqualsMarshalhas failed on every CI run since fix/issues-79-80: Read and write artifact text without extra copies, and reuse the discovery copy buffer #86. Go changed howjson.Marshalwrites an invalid UTF-8 byte: Go 1.26 (CI, fromgo.mod) escapes it as\ufffd, Go 1.27 writes the character U+FFFD.writeJSONString, which streams artifact text intoanalysis.json(--artifact-textuses approximately 5 times the file size in memory #80), always wrote the character, so on Go 1.26 it differed fromjson.Marshal. It now asksencoding/jsononce how it writes one, and matches it on either version. Only artifact text with invalid UTF-8 was affected; the JSON was valid either way.How Has This Been Tested?
analysis.jsonat-a 1to-a 4andgraph.cypher, on all 16 fixtures intestdata/and on nats-server, plus theschema.neo4j.jsoncontract and every run's stdout and exit code. All 172 files are byte-identical.go test ./...passes on Go 1.26.0 (CI's) and Go 1.27.4.go vetpasses with theneo4j_itandmemtesttags, so the live and memory tests compile; they were not run.Breaking Changes
None. The output is unchanged, except that a cango built with Go 1.26 now writes an invalid UTF-8 byte in artifact text as
\ufffd, like every other string inanalysis.json. Code importing the internal packages needs the new paths.Types of changes
Checklist
Additional context
schema_version: "2.0.0"inanalysis.json, an output contract the SDK and the sibling analyzers may read.identity-v2-<hash>, where "v2" versions the identity hash, not the schema (renaming it would orphan existing caches);math/rand/v2; "cgroup v2"; module versions such asv1.2.0; and the Java analyzer's own "v1 parity" history inl3-l4-dataflow.md.