Repository navigation
Conversation
Spec and CLAUDE.md schema decisions from the design loop: application.artifacts (all non-.go files, metadata-first, --artifact-text opt-in), can://<app>/artifact ids, version-less pkg:golang package ids, go.mod requires as dependencies with go.sum locks, L1 at every level. Config keys deferred. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Adds application.artifacts (every non-.go project file: format, roles, size, sha256; source only with --artifact-text) and application.dependencies (go.mod requires with direct, locked_version from go.sum, provides_imports by longest prefix). The Neo4j projector writes :Artifact (app-scoped), :Package (pkg:golang/<module>), HAS_ARTIFACT, DECLARES_DEPENDENCY and LOCKS. Config keys are deferred. Refs #45 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
upsertNodes and upsertEdges sent each node or edge group as one UNWIND statement in one write transaction. On a large app at L4 one group holds millions of rows. On nats-server the push exceeded the Neo4j limit dbms.memory.transaction.total.max and failed with MemoryPoolOutOfMemoryError. Split each group into chunks of boltBatchSize (5000) rows. Each chunk runs in its own write transaction. Build the driver parameters for each chunk only. The snapshot writer already chunks its UNWIND batches. On nats-server the push now completes with 1858128 nodes and 10419341 relationships, exit 0. Client peak memory stays at about 25 GB. That is the second part of #59 and needs separate work.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pen (#59) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…59) Each app runs as --app-name <sanitised base name>, passed through MEMTEST_APP_NAME, so every push owns its own can://<name> keyspace in the fresh Neo4j container; duplicate names fail before any container starts. The pure helpers and the exit/OOMKilled/peak decision move to an untagged file with table tests, so plain go test covers them without Docker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WithWaitStrategy wraps the strategy in wait.ForAll with a 60 s deadline, which capped every cango run at about 60 s whatever ForExit's exit timeout. Use WithWaitStrategyAndDeadline with the same 5 h run bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gitea passes at 16 GB with the streaming push alone (peak 15.8 GiB, the same under a 24 GB limit), so #59 closes on the push. §8 records the split and the results; §7.5 drops the expectation that gitea needs the analysis-memory work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node groups flush in group-key order and in 5000-row chunks, so a :GoModule row could land with its content_hash before the rest of its module's nodes. A push that died in between left a matching hash; the next lazy push skipped the module and MATCH dropped the edges into its missing nodes. The Bolt writer now upserts :GoModule rows with content_hash = null and keeps only the (id, hash) pairs; late stamps them in boltBatchSize UNWIND batches after the final node flush. The final graph is unchanged and graph.cypher is untouched. Also: align the package doc's stage numbers with the stager (0-5), mark upsertNodes/upsertEdges/partitionNodes as test seams, run pushPaths' replay in its own subtest, and cover the lazy push in StreamPushOrder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- spec 7.3: the harness mounts the app at /src-app and copies it to /app; - WriteCypher: a killed process leaves its hidden temp file behind; - cypher.go header: WriteCypher is deterministic by module key order plus each builder's sort; add a byte-for-byte determinism test; - streamGraph doc: the late and tail builders are app-wide; - v2emit.Stream is not safe for concurrent use; - the streamed-script test compares row lines as a multiset keyed by statement, and checks its ReadFile error; - the parity tests name the failing fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the renderer writes through a scriptWriter interface instead of *strings.Builder, golangci-lint's errcheck flags every unchecked WriteString/WriteByte. Route the writes through put, which drops the error on purpose: a strings.Builder never fails, and a bufio.Writer keeps its first error and WriteCypher checks it at Flush. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #59.
--emit neo4jprojects one module at a time, in two passes, so the push no longer holds the full output tree or the fullGraphRows.Motivation and Context
On large apps,
--emit neo4jran out of memory. It kept the full output tree and the fullGraphRowsin memory at the same time. For nats-server, this was approximately 25 GB.How Has This Been Tested?
Projectrows, on the existing fixtures and through the emitter stream.WriteCypherwrites the same bytes on each run (determinism test).internal/memtest, build tagmemtest) runs cango and Neo4j in containers with no swap. At 16 GB, nats-server peaks at 7.8 GiB and gitea at 15.8 GiB. Both pass.Breaking Changes
None. The rows in
graph.cypherare now in module order. The graph that the file makes does not change.Types of changes
Checklist
Additional context
graph.cypherwriter use the same two passes.graph.cyphergoes to a temporary file, and then the writer renames it.content_hashonly after all node rows are in the database. If a push stops before this, the next lazy push writes the module again.docs/design/specs/2026-11-24-neo4j-streaming-push.md.