Skip to content

fix/issue-63: Name the packages, specs and docs without a schema version - #88

Merged
rahlk merged 3 commits into
mainfrom
fix/issue-63-drop-v2-name
Dec 1, 2026
Merged

rahlk merged 3 commits into
mainfrom
fix/issue-63-drop-v2-name

Conversation

@rahlk

@rahlk rahlk commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

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) and emit. 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 file analysis_cache.json, which nothing reads back. The code called it "v1". Because of it, internal/schema/v2 could not simply become internal/schema.

  • Packages:

    Before After What it is
    internal/schema internal/model the analyzer's internal fact model
    internal/schema/v2 internal/schema the output contract (schema.Callable, schema.GlobalOrdinal)
    internal/syntactic_analysis/v2emit internal/syntactic_analysis/emit the emitter

    Comments, 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:

    • The seven 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's is_interface") are dropped.
    • The migration records under docs/design/issues/ (epic-v2-migration.md, parent-v2-migration.md, the two child issue drafts and pr-body-v2-l1-l2.md) are deleted: they describe finished work.
    • The other records (notes, roadmaps, the dated specs and the Neo4j projection issue drafts) keep their wording. Only their links and code references (v2.GlobalOrdinal, internal/schema/v2) are updated.
  • CI fix: TestWriteJSONString_EqualsMarshal has 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 how json.Marshal writes an invalid UTF-8 byte: Go 1.26 (CI, from go.mod) escapes it as \ufffd, Go 1.27 writes the character U+FFFD. writeJSONString, which streams artifact text into analysis.json (--artifact-text uses approximately 5 times the file size in memory #80), always wrote the character, so on Go 1.26 it differed from json.Marshal. It now asks encoding/json once 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?

  • Every output was written before and after the change and compared: analysis.json at -a 1 to -a 4 and graph.cypher, on all 16 fixtures in testdata/ and on nats-server, plus the schema.neo4j.json contract 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 vet passes with the neo4j_it and memtest tags, so the live and memory tests compile; they were not run.
  • golangci-lint passes on Go 1.26.0.

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 in analysis.json. Code importing the internal packages needs the new paths.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • Out of scope, as the issue says: schema_version: "2.0.0" in analysis.json, an output contract the SDK and the sibling analyzers may read.
  • Kept on purpose: the cache directory name 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 as v1.2.0; and the Java analyzer's own "v1 parity" history in l3-l4-dataflow.md.
  • Fixes Drop the "v2" name from packages, specs and docs #63.

…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.
@rahlk
rahlk merged commit d586f7d into main Dec 1, 2026
3 checks passed
@rahlk rahlk added the refactor ♻️ Code change that neither fixes a bug nor adds a feature label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor ♻️ Code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop the "v2" name from packages, specs and docs

1 participant