You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[How To Read The Codebase Next](#how-to-read-the-codebase-next)
15
+
-[A Look Inside a `git-warp` Repository](#a-look-inside-a-git-warp-repository)
16
+
-[Summary](#summary)
30
17
31
18
## `git-warp` Overview
32
19
@@ -112,7 +99,9 @@ This approach has several key advantages. First, it allows for **multi-writer, c
112
99
In `git-warp`, the source of truth is not a single database file, but rather the collection of objects and refs in the underlying Git repository. This is a fundamental concept that underpins the entire system.
113
100
114
101
### In Git Objects
115
-
The immutable history of the graph is stored in Git's object database.
102
+
103
+
The immutable history of the graph is stored in Git's object database.
104
+
116
105
-**Patch Commits**: Each change to the graph is stored as a Git commit. The commit message contains metadata, and the patch payload itself is often stored in a separate blob.
117
106
-**Content Blobs**: Binary content attached to nodes or edges is stored in Git blobs, referenced by the graph data.
118
107
@@ -208,45 +197,56 @@ The `WarpGraph` object returned by `openWarpGraph` is a frozen capability bag. I
208
197
classDiagram
209
198
class WarpGraph {
210
199
<<interface>>
211
-
+info: GraphInfo
212
-
+patches: CommitmentSurface
200
+
+graphName: string
201
+
+writerId: string
202
+
+commitment: CommitmentSurface
213
203
+folding: FoldingSurface
214
-
+query: RevelationSurface
204
+
+revelation: RevelationSurface
215
205
+governance: GovernanceSurface
206
+
+query: QueryCapability
207
+
+patches: PatchCapability
208
+
+sync: SyncCapability
209
+
+strands: StrandCapability
210
+
+checkpoint: CheckpointCapability
211
+
+provenance: ProvenanceCapability
212
+
+comparison: ComparisonCapability
213
+
+subscriptions: SubscriptionCapability
216
214
}
217
215
218
216
class CommitmentSurface {
219
217
<<interface>>
220
-
+createPatch() PatchBuilder
221
-
+patch() Promise~string~
218
+
+patches: PatchCapability
219
+
+strands: StrandCapability
220
+
+comparison: ComparisonCapability
222
221
}
223
222
224
223
class FoldingSurface {
225
224
<<interface>>
226
-
+join() WarpState
227
-
+reduce() WarpState
225
+
+checkpoint: CheckpointCapability
228
226
}
229
227
230
228
class RevelationSurface {
231
229
<<interface>>
232
-
+hasNode() Promise~bool~
233
-
+getNodeProps() Promise~object~
234
-
+worldline() Worldline
235
-
+observer() Observer
230
+
+query: QueryCapability
231
+
+subscriptions: SubscriptionCapability
232
+
+provenance: ProvenanceCapability
236
233
}
237
234
238
235
class GovernanceSurface {
239
236
<<interface>>
240
-
+syncWith() Promise~SyncWithResult~
241
-
+createCheckpoint() Promise~string~
237
+
+sync: SyncCapability
242
238
}
243
239
244
-
WarpGraph o-- CommitmentSurface
245
-
WarpGraph o-- FoldingSurface
246
-
WarpGraph o-- RevelationSurface
247
-
WarpGraph o-- GovernanceSurface
240
+
WarpGraph o-- CommitmentSurface : commitment
241
+
WarpGraph o-- FoldingSurface : folding
242
+
WarpGraph o-- RevelationSurface : revelation
243
+
WarpGraph o-- GovernanceSurface : governance
248
244
```
249
245
246
+
The architectural surfaces are the primary shape. The flat aliases
247
+
(`graph.query`, `graph.patches`, `graph.sync`, and related capabilities) exist
248
+
for ergonomic access to the same underlying capability namespaces.
249
+
250
250
## Core Workflows: The Golden Paths
251
251
252
252
This section details the primary workflows, or "golden paths", that a user or developer will follow when interacting with `git-warp`.
@@ -285,7 +285,7 @@ Your goal is to use `git-warp` to build an application. You should focus on the
285
285
### For the Data Analyst / Auditor
286
286
Your goal is to understand the history of the data and verify its integrity.
287
287
1.**Understand the Commit Structure**: Look at the "A Look Inside a `git-warp` Repository" section to see how patches are stored in Git.
288
-
2.**Learn about Provenance**: Read "Golden Path 9" to understand how `git-warp` enables you to trace datalineage.
288
+
2.**Learn about Provenance**: Read the provenance entry in the Domain Dictionary and inspect the patch trailers in the repository example to see how `git-warp` enables data-lineage tracing.
289
289
3.**Explore the `JoinReducer`**: The tests in `test/unit/domain/services/JoinReducer.test.ts` will show you how the final state is derived from the history.
290
290
291
291
### For the Core Contributor
@@ -296,46 +296,44 @@ Your goal is to understand the internals of `git-warp` to fix bugs or add new fe
296
296
297
297
## A Look Inside a `git-warp` Repository
298
298
299
-
The concepts of writer refs and patch commits can feel abstract. To make them more concrete, we can examine the `git-warp` repository itself, which uses its own technology to store internal data.
299
+
The concepts of writer refs and patch commits can feel abstract. A fixture-style example makes the storage shape concrete without depending on one developer workstation's local refs.
300
300
301
-
By running `git for-each-ref refs/warp/`, we can see the `git-warp` graphs stored within the repository:
301
+
Running `git for-each-ref refs/warp/` in a repository that stores graph data might produce output shaped like this:
This reveals several internal graphs, but the most interesting is `graft-ast`. This graph is used to store the Abstract Syntax Tree (AST) of a project. Let's look at the history of the `graft` writer in this graph:
309
+
This reveals the per-writer heads and optional checkpoint head for a graph. Looking at the history of one writer head shows that each patch is represented by a structured commit:
This log output shows a single patch commit. The commit message is highly structured, using trailers to store metadata:
331
-
-`eg-graph`: The name of the graph (`graft-ast`).
332
-
-`eg-writer`: The ID of the writer (`graft`).
329
+
-`eg-graph`: The name of the graph (`example-graph`).
330
+
-`eg-writer`: The ID of the writer (`alice`).
333
331
-`eg-lamport`: The Lamport timestamp of the patch.
334
332
-`eg-patch-oid`: The SHA of a Git blob that contains the actual patch payload.
335
333
336
-
The commit itself is just a metadata container. The actual operations are in the blob with SHA `9ef88aaeca1bb42aa8414ce55ade63210f5b5bc3`. If we inspect the type of this object:
334
+
The commit itself is just a metadata container. The actual operations are in the blob with SHA `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`. If we inspect the type of this object:
0 commit comments