Gate initial graph seeding behind --seed#9
Merged
PabloZaiden merged 2 commits intoMay 3, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes Link’s startup behavior so the JSON graph is no longer bootstrapped automatically on first run. Instead, seeding default node/edge types is now an explicit CLI-driven action, while the storage layer stays read-only until data is actually written.
Changes:
- Added
--seedCLI parsing and threaded the flag through app startup. - Changed
JsonGraphRepositoryso bootstrap seeding only happens when explicitly requested on an empty graph, and directory creation is deferred until writes. - Updated tests and README to reflect explicit seeding, read-only startup, and lazy storage directory creation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/storage/json.ts |
Reworked repository initialization to make seeding explicit and defer directory creation until writes. |
src/storage/json.test.ts |
Added repository tests for read-only startup, explicit seeding, lazy directory creation, and empty-graph behavior. |
src/server/cli.ts |
Added CLI option parsing for --validate and --seed. |
src/server/cli.test.ts |
Added unit coverage for CLI flag parsing combinations. |
src/server/app.ts |
Threaded seed options into app/repository startup and added a startApp options object. |
src/server/app.test.ts |
Added tests covering normal startup vs explicit seeded startup. |
src/index.ts |
Switched entrypoint startup/validation flow to use parsed CLI options. |
src/api/http.test.ts |
Updated integration tests to seed repositories explicitly before CRUD/API assertions. |
README.md |
Documented explicit seeding, lazy directory creation, and updated usage examples. |
Dockerfile |
Removed eager /data directory creation from the runtime image. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
--seedflag and wired startup seeding through it.--seedis explicitly provided.Tests
src/server/app.test.ts,src/server/cli.test.ts, andsrc/storage/json.test.ts.