-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
User request
Remove any Git usage from the graph-related flows. Changes must continue to be recorded on disk, but there should be no automated commits. During startup, do not select a Git branch for the graph data directory. Eliminate any other Git-dependent operations in these flows.
Summary of current state (from research)
- Graph persistence is Git-backed via
GitGraphRepository(packages/platform-server/src/graph/gitGraph.repository.ts). - Startup ensures/creates a Git repo and checks out a configured branch (
GRAPH_BRANCH), committing initial contents if needed. - Every graph upsert stages and commits changes with Git; rollback uses
git restore. - Reads may fall back to
HEADusinggit ls-treeandgit showwhen the working tree is inconsistent. - Controllers and docs refer to Git-specific errors like
COMMIT_FAILED.
Proposed changes (Git-free persistence)
- Configuration
- Introduce
GRAPH_DATA_PATH(default./data/graph). - Replace
GRAPH_BRANCHwithGRAPH_DATASET(defaultmain) and/or anactive-dataset.txtpointer inGRAPH_DATA_PATH. - Deprecate
GRAPH_BRANCH(map toGRAPH_DATASETif set, otherwise ignore).
- Filesystem layout
<GRAPH_DATA_PATH>/
active-dataset.txt
datasets/
<dataset>/
graph.meta.yaml
variables.yaml (optional)
nodes/*.yaml
edges/*.yaml
snapshots/
<version>/ ... snapshot content ...
- Repository implementation
- Add
FsGraphRepositoryto replaceGitGraphRepositorywith no Git invocations. - Atomic writes: temp files + rename + directory fsync; safe deletes.
- Snapshot/fallback: after each committed upsert, record a journal and optionally snapshot; readers fall back to the latest committed snapshot if working files are corrupted.
- Concurrency: keep a per-dataset lock file (e.g.,
.graph.lock). - Error semantics: replace
COMMIT_FAILEDwithPERSIST_FAILED; keepLOCK_TIMEOUT.
- DI & controllers
- Bind
GraphRepositorytoFsGraphRepositoryingraph-domain.module.ts. - Update controllers to remove Git-specific error mapping and to reflect new semantics.
- Migration
- Provide a
graph-migrate-to-fsutility or one-shot startup flag:- Read current working state and write it into the new dataset path using atomic writes.
- Optionally archive
.gitto.git.backup-<timestamp>and leave deletion to operators.
- Documentation
- Replace
docs/graph/git-store.mdwithdocs/graph/fs-store.mddescribing the new model. - Update
packages/platform-server/README.mdto remove Git semantics andCOMMIT_FAILEDreferences.
Acceptance criteria
- No graph flow executes any Git command or requires a
.gitdirectory. - Server startup requires no branch selection; active graph is resolved via
GRAPH_DATASETand/oractive-dataset.txt. - Graph changes persist to disk and survive restarts; versioning is maintained.
- Migration preserves existing graph data without loss.
Open questions
- Do we need multiple datasets (previously branches) or a single active dataset suffices initially?
- Is a snapshot history needed for user features (rollback/audit) or primarily for crash safety?
- May the migration tool read from Git one last time to ensure correctness, or must it avoid Git entirely as well?
- Expected scale/frequency of writes to calibrate snapshot cadence.
Implementation plan (single PR)
- Add new config keys and deprecate
GRAPH_BRANCH. - Implement
FsGraphRepositorywith atomic write + snapshot fallback. - Switch DI to use
FsGraphRepositoryand update controllers. - Add migration tool/flag and docs.
- Update references and remove Git-specific docs/errors.
- Add integration test that runs without a
.gitdir for graph data.
Linked research provides detailed file paths and methods for current Git interactions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels