parity

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package parity contains the cross-binary diff harness. Phase 1 dumps the SQLite cache to a normalized JSON form; phase 2 extends to the Kuzu graph produced by `codeiq enrich`. DumpKuzu lives here so the harness can compare post-enrich graphs node-for-node and edge-for-edge against the Java side's Neo4j dump.

Package parity contains the cross-binary diff harness. Phase 1 dumps the SQLite cache to a normalized JSON form; phase 2 extends to the Kuzu graph.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpKuzu

func DumpKuzu(dir string) ([]byte, error)

DumpKuzu returns a deterministic JSON dump of all nodes and edges in the Kuzu store at `dir`. The shape mirrors what java-normalize.jq produces from the Java side's `codeiq graph -f json` output, so the parity harness can diff the two byte-for-byte modulo the entries listed in expected-divergence.json.

Kuzu-specific notes:

  • The store at `dir` must have been written by `codeiq enrich` (schema + bulk-loaded nodes + per-EdgeKind rel tables + indexes).
  • The rel-type accessor is `label(r)` in Kuzu 0.7.1 — the Cypher standard `type(r)` is not bound. The "edges" entries carry the rel-table name as the `kind` field so the JSON looks like the Java/Neo4j side.
  • LIMIT cannot be parameter-bound in Kuzu 0.7.1; we don't need LIMIT here because the diff requires the full set.
  • Cypher ORDER BY drops the rel-pattern scope after RETURN, so we sort defensively in Go on top of any server-side ordering.

func Normalize

func Normalize(c *cache.Cache) (string, error)

Normalize reads every entry from c and returns a sorted, parsed_at-stripped JSON dump suitable for byte-level diffing.

Types

type NormalizedEntry

type NormalizedEntry struct {
	Path     string            `json:"path"`
	Language string            `json:"language"`
	Nodes    []*model.CodeNode `json:"nodes"`
	Edges    []*model.CodeEdge `json:"edges"`
}

NormalizedEntry is the diff-friendly shape of a cache entry. Volatile fields (parsed_at timestamp) are dropped — they're never equal across runs of two different binaries.

Directories

Path Synopsis
cmd
parity-normalize command
Binary parity-normalize reads a codeiq SQLite cache and writes a normalized JSON dump to stdout.
Binary parity-normalize reads a codeiq SQLite cache and writes a normalized JSON dump to stdout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL