Repository navigation
fix/issues-70-72-81: Neo4j artifact layer matches the Python and TypeScript analyzers - #83
Merged
Merged
Conversation
…72) A dependency's locked_version came from a go.sum, but the JSON did not say which one. The Neo4j projector then used the root go.sum for every LOCKS edge. A dependency of a nested go.mod would get a LOCKS edge from a go.sum that did not lock it. The dependency now carries locked_in, the id of the go.sum artifact that gave locked_version, in the same way declared_in names its go.mod. It is additive and omitted when the dependency is not locked. v2.PackageID is now the one function that builds a package id (pkg:<ecosystem>/<name>), as the sibling analyzers use one purl helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s do (#81, #72) - :Artifact now carries kind, path, format, roles, size_bytes, sha256, source and extraction: the JSON artifact's fields. Before, it had only path and format, so a consumer of the shared node got the text and hash from a Python or TypeScript push and nothing from a Go push. Empty values are left out. (#81) - LOCKS comes from the dependency's locked_in artifact, not the root go.sum, and the package id comes from v2.PackageID. (#72) - The LOCKS property is now version, the name Python and TypeScript use, not locked_version. The SDK Go backend does not read it. The artifacts spec and CLAUDE.md record the decisions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… them wholesale (#70) The eager whole-app purge deleted every :GoCanNode under the app, and :Artifact carries :GoCanNode. :Artifact is shared with the Python and TypeScript analyzers, so an eager Go push deleted their artifact nodes too, with their edges (DECLARES_DEPENDENCY to pkg:pypi/..., config-key edges). The purge now skips :Artifact. An eager full push reconciles the app's artifacts before it upserts them, with the siblings' claim model (codeanalyzer-python PURGE_ARTIFACT_EDGES, RELEASE_VANISHED_ARTIFACTS): 1. delete the Go-owned edges on the app's artifacts: HAS_ARTIFACT from :GoApplication, incoming GO_ edges, and DECLARES_DEPENDENCY / LOCKS to pkg:golang/ packages. The push writes them again from this run; 2. for each artifact this run does not have, remove :GoCanNode and delete the node only when no analyzer still has a HAS_ARTIFACT edge to it. A lazy push and a -t push reconcile nothing (a lazy push never deletes), as in the sibling analyzers. Stale rows stay until the next --eager full push. The graph.cypher snapshot keeps its whole-app wipe, as Python's does. Tests: the query scope and the order (reconcile before the first artifact MERGE, only on eager full runs) on the fake DB; and three live tests (neo4j_it): an eager push removes a deleted file and a removed require, a lazy push keeps them, and a sibling's HAS_ARTIFACT and DECLARES_DEPENDENCY on a shared artifact survive an eager push. The last one fails on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it off --artifact-text was off by default, so a Go push wrote :Artifact without source unless the user asked for it. Python and TypeScript capture the text by default and offer --no-artifact-text. The Go flags now do the same: --artifact-text is on by default (still accepted), and --no-artifact-text keeps the artifact inventory and drops the text. Cost: each text artifact is read a second time and its text is in the output. That is small for normal files; very large text files are #80. Also drops the issue and date tags this branch added to CLAUDE.md (review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 of 9 tasks
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.
Fixes #70. Fixes #72. Fixes #81.
The Neo4j artifact layer now writes the same facts as the Python and TypeScript analyzers, and an
--eagerpush no longer deletes artifacts that those analyzers share.Motivation and Context
:Artifact,:Package,DECLARES_DEPENDENCYandLOCKSare shared with the sibling analyzers. When they run on the same repository, they write to the same nodes.Neo4j
:Artifactnode has no source and other key fields that the JSON has #81::Artifacthad onlypathandformat. It now haskind,path,format,roles,size_bytes,sha256,sourceandextraction, as the siblings write them. Empty values are left out.Neo4j projector builds package and lockfile ids instead of reading them from the JSON #72: the
LOCKSedge always came from the rootgo.sum. A dependency now recordslocked_in, thego.sumartifact that locked it, and the projector reads it.v2.PackageIDis now the one function that builds a package id.LOCKSproperty: renamed fromlocked_versiontoversion, the name the siblings use.Neo4j push never removes artifacts and dependencies that are gone #70: an
--eagerpush deleted every artifact node of the app, including the nodes and edges that Python and TypeScript wrote. The eager purge now skips:Artifact. An eager full push reconciles the artifacts, as the siblings do:HAS_ARTIFACTedge to it.A lazy push and a
-tpush reconcile nothing, because a lazy push never deletes.--artifact-text: on by default.--no-artifact-textturns it off. These are the siblings' flags and default.How Has This Been Tested?
locked_in,v2.PackageID, the:Artifactproperties,LOCKSfrom a nestedtools/go.sum, and the flags. Each one fails on the old code.neo4j_it):require;HAS_ARTIFACTandDECLARES_DEPENDENCYon a shared artifact survive an eager push. This test fails on the old code.go test ./...and golangci-lint pass.Breaking Changes
LOCKSproperty is nowversion, notlocked_version. The SDK Go backend does not read it.--artifact-textis on by default, soanalysis.jsonand the graph have each text file'ssource. Use--no-artifact-textfor the old output. Very large text files use much memory (--artifact-textuses approximately 5 times the file size in memory #80).dependencies[].locked_in.Types of changes
Checklist
Additional context
graph.cyphersnapshot still deletes and rebuilds the app's artifacts, as the Python snapshot does.docs/design/specs/v2-artifacts.md.