Skip to content

Gate initial graph seeding behind --seed#9

Merged
PabloZaiden merged 2 commits into
mainfrom
gate-initial-seeding-behind-seed-and-def-b360812
May 3, 2026
Merged

Gate initial graph seeding behind --seed#9
PabloZaiden merged 2 commits into
mainfrom
gate-initial-seeding-behind-seed-and-def-b360812

Conversation

@PabloZaiden

Copy link
Copy Markdown
Owner

Summary

  • Added CLI parsing for a --seed flag and wired startup seeding through it.
  • Prevented initial graph bootstrap unless storage is empty and --seed is explicitly provided.
  • Deferred JSON storage directory creation until data is actually saved.
  • Updated README and tests to cover seeding behavior, CLI handling, HTTP/app startup, and storage directory creation.

Tests

  • Added coverage in src/server/app.test.ts, src/server/cli.test.ts, and src/storage/json.test.ts.

Copilot AI review requested due to automatic review settings May 3, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --seed CLI parsing and threaded the flag through app startup.
  • Changed JsonGraphRepository so 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.

Comment thread src/server/app.ts
Comment thread README.md Outdated
Comment thread src/server/app.ts Outdated
@PabloZaiden
PabloZaiden merged commit 0c9ca25 into main May 3, 2026
1 check passed
@PabloZaiden
PabloZaiden deleted the gate-initial-seeding-behind-seed-and-def-b360812 branch May 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants