Skip to content

Conversation

@flyingrobots
Copy link
Member

@flyingrobots flyingrobots commented Jan 30, 2026

Refactors the monolithic README into a VitePress documentation site, highlighting key 'stunts' and features.

Summary by CodeRabbit

  • Documentation

    • Full docs site launched with guides, API reference, internals, and advanced pattern articles (getting started, architecture, core concepts, troubleshooting, stunts, roadmap).
    • README condensed into a focused overview + Quick Start and a single Documentation link.
  • Chores

    • Added documentation build/dev/preview scripts and supporting doc tooling for local preview and site builds.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Adds a full VitePress documentation site (docs/...) with extensive new guides, API reference, internals, and stunts; condenses the top-level README to a short Features/Quick Start; and updates package.json with docs scripts and VitePress/Vue devDependencies.

Changes

Cohort / File(s) Summary
Docs site config & scripts
docs/.vitepress/config.js, package.json
Add VitePress site configuration and metadata; add npm scripts docs:dev, docs:build, docs:preview; add devDependencies vitepress, vue, and @git-stunts/docker-guard.
README & Homepage
README.md, docs/index.md
Condense README into a brief Features + Quick Start and add docs homepage with hero, technical overview, and features.
API reference
docs/api/index.md, docs/api/empty-graph.md, docs/api/traversal-service.md
Add API index and pages documenting EmptyGraph facade (createNode, readNode, rebuildIndex) and TraversalService (bfs, shortestPath, weightedShortestPath) with examples.
Guides / Core concepts
docs/guide/getting-started.md, docs/guide/core-concepts.md, docs/guide/architecture.md, docs/guide/what-is-this.md, docs/guide/comparison.md, docs/guide/interactive-demo.md, docs/guide/operations.md, docs/guide/roadmap.md, docs/guide/troubleshooting.md
Add comprehensive guides: Getting Started, core constructs (Node/Edge/Index), hexagonal architecture, conceptual overview, comparison, interactive demo, operations & safety, roadmap, and troubleshooting.
Internals / Indexing
docs/internals/bitmap-index.md
Document bitmap index internals: SHA→32-bit ID mapping, Roaring Bitmap adjacency, 256-shard layout, shard file naming, and lazy-loading behavior.
Stunts / Advanced patterns
docs/stunts/event-sourcing.md, docs/stunts/invisible-storage.md, docs/stunts/lagrangian-routing.md, docs/stunts/streaming.md
Add pattern articles: event sourcing using commits, invisible/empty-tree storage patterns, resource-aware weighted routing, and streaming large-graph traversal with async generators.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through docs and left a trail,
New pages sprouted, banners and detail,
Quick Start whispers, deep internals sing,
Stunts and guides — a flourishing spring,
A tiny README, a garden of things.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refactoring documentation from a monolithic README into a VitePress-based documentation site.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/remix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Fix all issues with AI agents
In `@docs/.vitepress/config.js`:
- Around line 7-52: The themeConfig.logo property is pointing at '/logo.png' but
that asset is missing; add a logo image named logo.png into the docs
static/public assets (so it resolves at '/logo.png') or update the
themeConfig.logo value to point to an existing image path; ensure the file is a
valid PNG and committed to the repo so the themeConfig.logo reference in
config.js resolves at runtime.

In `@docs/api/traversal-service.md`:
- Around line 7-14: Add documentation entries for the nine missing public
TraversalService methods: dfs, ancestors, descendants, findPath, isReachable,
commonAncestors, topologicalSort, aStarSearch, and bidirectionalAStar; for each
method add a signature matching the TypeScript definitions and a one-line
description of behavior (e.g., dfs({ start, maxDepth }), ancestors({ node }),
descendants({ node }), findPath({ from, to }), isReachable({ from, to }),
commonAncestors({ nodes }), topologicalSort({ nodes }), aStarSearch({ start,
goal, heuristic, weightProvider }), bidirectionalAStar({ from, to, heuristic,
weightProvider })); ensure the new entries follow the same format as existing
bfs/shortestPath/weightedShortestPath docs and include any required parameter
notes (heuristic and weightProvider where applicable) so the API page lists all
12 public methods consistently with the TypeScript defs.

In `@docs/index.md`:
- Line 43: The bash example uses nested double quotes and will break; update the
command in docs/index.md to quote the JSON payload safely (e.g., use single
quotes around the JSON or escape inner quotes) so the example command works in a
shell—replace node create-node.js "{"hello": "world"}" with a properly quoted
variant like node create-node.js '{"hello":"world"}' (or an escaped-double-quote
form) to fix the quoting.
- Line 62: Remove the stray trailing code fence (the lone ``` sequence) left
open at the end of the document; delete that final ``` so there is no
unterminated code block in docs/index.md (search for the lone backtick fence
marker "```" at the end of the file and remove it).

In `@docs/stunts/lagrangian-routing.md`:
- Line 46: Replace the incorrect word "Topography" with "Topology" in the
heading sentence that currently reads "Dynamic Topography:" (the sentence
starting "The shape of your graph changes based on the *state* of the
nodes..."); update that heading to "Dynamic Topology:" so the terminology
correctly refers to graph/network structure rather than terrain.

In `@docs/stunts/streaming.md`:
- Line 36: The table header separator row currently uses the literal string
"|String|Result|" which breaks the Markdown table; replace that separator row
with a proper Markdown separator line (one separator cell per header, using
dashes) so the header columns align with the table body (locate the row
containing "|String|Result|" and update it accordingly).
🧹 Nitpick comments (4)
docs/stunts/invisible-storage.md (1)

16-18: Consider adding a language specifier to the code block.

The fenced code block containing the empty tree SHA would benefit from a language specifier for consistency and proper syntax highlighting.

✨ Suggested improvement
-```
+```text
 4b825dc642cb6eb9a060e54bf8d69288fbee4904
</details>

</blockquote></details>
<details>
<summary>README.md (1)</summary><blockquote>

`578-578`: **Remove trailing space in code span.**

The code span has an extra space before the closing backtick, which the static analysis correctly flagged.



<details>
<summary>✨ Proposed fix</summary>

```diff
-**Returns:** `Promise<{ found: boolean, path: string[] }> `
+**Returns:** `Promise<{ found: boolean, path: string[] }>`
docs/guide/core-concepts.md (1)

25-27: Tighten bullet phrasing to avoid repeated “We”.
This reads cleaner with parallel, imperative phrasing.

✏️ Suggested rewrite
- We assign every SHA an integer ID.
- We store adjacency lists in compressed bitmaps.
- We save this index *back into Git* as a set of sharded JSON files.
+ Assign every SHA an integer ID.
+ Store adjacency lists in compressed bitmaps.
+ Save the index *back into Git* as a set of sharded JSON files.
docs/stunts/lagrangian-routing.md (1)

23-25: Consider defining startSha and targetSha variables for clarity.

The code example uses startSha and targetSha without defining them. While experienced developers may infer their meaning, adding a brief comment or context would improve the example's completeness for readers new to the codebase.

📚 Suggested enhancement
+// Example: Find the cheapest path between two commits
+const startSha = 'abc123'; // "Download Data" node
+const targetSha = 'def456'; // "Save to S3" node
+
 const { path, totalCost } = await graph.traversal.weightedShortestPath({
   from: startSha,
   to: targetSha,

Comment on lines 7 to 53
['meta', { property: 'og:image', content: '/images/empty-graph-social.jpg' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:image', content: '/images/empty-graph-social.jpg' }],
],
themeConfig: {
logo: '/logo.png',
nav: [
{ text: 'Guide', link: '/guide/what-is-this' },
{ text: 'API', link: '/api/' },
{ text: 'Stunts', link: '/stunts/' },
{ text: 'GitHub', link: 'https://github.com/git-stunts/empty-graph' }
],
sidebar: [
{
text: 'The Guide',
items: [
{ text: 'What is this?', link: '/guide/what-is-this' },
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Core Concepts', link: '/guide/core-concepts' },
{ text: 'Architecture', link: '/guide/architecture' },
]
},
{
text: 'The Stunts',
items: [
{ text: 'Event Sourcing', link: '/stunts/event-sourcing' },
{ text: 'Resource-Aware Routing', link: '/stunts/lagrangian-routing' },
{ text: 'Infinite Memory Streaming', link: '/stunts/streaming' },
{ text: 'Invisible Metadata', link: '/stunts/invisible-storage' },
]
},
{
text: 'API Reference',
items: [
{ text: 'EmptyGraph Facade', link: '/api/empty-graph' },
{ text: 'GraphService', link: '/api/graph-service' },
{ text: 'TraversalService', link: '/api/traversal-service' },
{ text: 'BitmapIndex', link: '/api/bitmap-index' },
]
},
{
text: 'Internals',
items: [
{ text: 'The Bitmap Index', link: '/internals/bitmap-index' },
{ text: 'Binary Plumbing', link: '/internals/plumbing' },
]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for the referenced documentation pages and assets
echo "=== Searching for sidebar-referenced pages ==="
fd -a -t f 'graph-service\.md|bitmap-index\.md|plumbing\.md' docs

echo ""
echo "=== Searching for social/branding assets ==="
fd -a -t f 'empty-graph-social\.jpg|logo\.png' docs

Repository: git-stunts/empty-graph

Length of output: 444


Add missing /logo.png asset.
The config references /logo.png for the theme logo, but this file doesn't exist in the docs directory. The sidebar pages and social image are present, but the logo file needs to be added to resolve the missing asset.

🤖 Prompt for AI Agents
In `@docs/.vitepress/config.js` around lines 7 - 52, The themeConfig.logo property
is pointing at '/logo.png' but that asset is missing; add a logo image named
logo.png into the docs static/public assets (so it resolves at '/logo.png') or
update the themeConfig.logo value to point to an existing image path; ensure the
file is a valid PNG and committed to the repo so the themeConfig.logo reference
in config.js resolves at runtime.

Comment on lines +7 to +14
### `bfs({ start, maxDepth })`
Breadth-First Search generator.

### `shortestPath({ from, to })`
Finds shortest path using Bidirectional BFS.

### `weightedShortestPath({ from, to, weightProvider })`
Dijkstra's algorithm with custom weights (e.g., for Lagrangian routing).
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check TraversalService method surface
rg -nP '\bclass\s+TraversalService\b' -g '!**/docs/**' -C5

Repository: git-stunts/empty-graph

Length of output: 1435


🏁 Script executed:

#!/bin/bash
# Search for DFS and A* mentions in code (excluding docs)
rg -nP '\b(dfs|DFS|aStar|astar|A\*)\b' -g '!**/docs/**' -i | head -30

Repository: git-stunts/empty-graph

Length of output: 3499


🏁 Script executed:

#!/bin/bash
# Search for DFS and A* mentions in documentation
rg -nP '\b(dfs|DFS|aStar|astar|A\*)\b' -g '**/docs/**' -i | head -30

Repository: git-stunts/empty-graph

Length of output: 264


🏁 Script executed:

#!/bin/bash
# Check the traversal-service.md file content
cat docs/api/traversal-service.md

Repository: git-stunts/empty-graph

Length of output: 405


🏁 Script executed:

#!/bin/bash
# Extract all public async methods from TraversalService.js
sed -n '57,300p' src/domain/services/TraversalService.js | rg -P '^\s+async\s+\*?(\w+)\s*\(' | head -20

Repository: git-stunts/empty-graph

Length of output: 665


🏁 Script executed:

#!/bin/bash
# Check the TypeScript definition for all public methods
sed -n '602,700p' index.d.ts | grep -E '^\s+(async\s+)?\w+\(' | head -20

Repository: git-stunts/empty-graph

Length of output: 894


Document all 9 missing TraversalService methods in traversal-service.md.

The documentation only covers bfs, shortestPath, and weightedShortestPath, but the service provides 12 public methods. Missing documentation includes dfs, ancestors, descendants, findPath, isReachable, commonAncestors, topologicalSort, aStarSearch, and bidirectionalAStar. The TypeScript definitions and other docs (index.md, api/index.md) correctly advertise DFS and A* methods, but this API page lacks corresponding documentation. Add method signatures and brief descriptions for all public methods.

🤖 Prompt for AI Agents
In `@docs/api/traversal-service.md` around lines 7 - 14, Add documentation entries
for the nine missing public TraversalService methods: dfs, ancestors,
descendants, findPath, isReachable, commonAncestors, topologicalSort,
aStarSearch, and bidirectionalAStar; for each method add a signature matching
the TypeScript definitions and a one-line description of behavior (e.g., dfs({
start, maxDepth }), ancestors({ node }), descendants({ node }), findPath({ from,
to }), isReachable({ from, to }), commonAncestors({ nodes }), topologicalSort({
nodes }), aStarSearch({ start, goal, heuristic, weightProvider }),
bidirectionalAStar({ from, to, heuristic, weightProvider })); ensure the new
entries follow the same format as existing bfs/shortestPath/weightedShortestPath
docs and include any required parameter notes (heuristic and weightProvider
where applicable) so the API page lists all 12 public methods consistently with
the TypeScript defs.

docs/index.md Outdated
drwxr-xr-x 2 james staff 64 Jan 29 12:00 .

# Create a graph node (behind the scenes)
$ node create-node.js "{"hello": "world"}"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix JSON quoting in the bash example.
Line 43 uses nested double quotes, which will break in a shell.

✅ Safer command quoting
-$ node create-node.js "{"hello": "world"}"
+$ node create-node.js '{"hello": "world"}'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$ node create-node.js "{"hello": "world"}"
$ node create-node.js '{"hello": "world"}'
🤖 Prompt for AI Agents
In `@docs/index.md` at line 43, The bash example uses nested double quotes and
will break; update the command in docs/index.md to quote the JSON payload safely
(e.g., use single quotes around the JSON or escape inner quotes) so the example
command works in a shell—replace node create-node.js "{"hello": "world"}" with a
properly quoted variant like node create-node.js '{"hello":"world"}' (or an
escaped-double-quote form) to fix the quoting.


It's a stunt, yes. But it's also a legitimate tool for offline-first data, audit trails, and AI agent memory that needs to be distributed, versioned, and immutable.

``` No newline at end of file
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove stray code fence at EOF.
Line 62 opens a new code block and leaves it hanging.

🧹 Remove the trailing fence
-```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
🤖 Prompt for AI Agents
In `@docs/index.md` at line 62, Remove the stray trailing code fence (the lone ```
sequence) left open at the end of the document; delete that final ``` so there
is no unterminated code block in docs/index.md (search for the lone backtick
fence marker "```" at the end of the file and remove it).


## Why this is cool

1. **Dynamic Topography:** The shape of your graph changes based on the *state* of the nodes, not just their connections.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Terminology correction: "Topography" → "Topology"

"Topography" refers to physical terrain mapping, while "Topology" describes the structure and connectivity of a graph or network.

📝 Proposed fix
-1.  **Dynamic Topography:** The shape of your graph changes based on the *state* of the nodes, not just their connections.
+1.  **Dynamic Topology:** The shape of your graph changes based on the *state* of the nodes, not just their connections.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. **Dynamic Topography:** The shape of your graph changes based on the *state* of the nodes, not just their connections.
1. **Dynamic Topology:** The shape of your graph changes based on the *state* of the nodes, not just their connections.
🤖 Prompt for AI Agents
In `@docs/stunts/lagrangian-routing.md` at line 46, Replace the incorrect word
"Topography" with "Topology" in the heading sentence that currently reads
"Dynamic Topography:" (the sentence starting "The shape of your graph changes
based on the *state* of the nodes..."); update that heading to "Dynamic
Topology:" so the terminology correctly refers to graph/network structure rather
than terrain.

We ran this on a graph with **100,000 nodes** containing JSON payloads.

| Metric | Result |
|String|Result|
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the table header separator.

Line 36 contains |String|Result| which should be the table separator row. This creates an invalid table structure.

📋 Proposed fix for table formatting
 | Metric | Result |
-|String|Result|
 | --- | --- |
 | **Heap Used** | ~40 MB (Constant) |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 36-36: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


[warning] 36-36: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


[warning] 36-36: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)


[warning] 36-36: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


[warning] 36-36: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)

🤖 Prompt for AI Agents
In `@docs/stunts/streaming.md` at line 36, The table header separator row
currently uses the literal string "|String|Result|" which breaks the Markdown
table; replace that separator row with a proper Markdown separator line (one
separator cell per header, using dashes) so the header columns align with the
table body (locate the row containing "|String|Result|" and update it
accordingly).

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/stunts/invisible-storage.md`:
- Around line 16-18: The fenced code block containing the hash
"4b825dc642cb6eb9a060e54bf8d69288fbee4904" is missing a language tag which
triggers MD040; update that fence from ``` to include a language (for example
use ```text) so the block reads like ```text followed by the hash and closing
``` to satisfy the linter.
🧹 Nitpick comments (1)
docs/guide/core-concepts.md (1)

24-28: Consider varying bullet phrasing for readability.

The three consecutive bullets start with “We …”. Rewording one or two improves flow.

✏️ Example rewording
- - We assign every SHA an integer ID.
- - We store adjacency lists in compressed bitmaps.
- - We save this index *back into Git* as a set of sharded JSON files.
+ - Each SHA gets a stable integer ID.
+ - Adjacency lists are stored in compressed bitmaps.
+ - The index is saved *back into Git* as sharded JSON files.

Comment on lines +16 to +18
```
4b825dc642cb6eb9a060e54bf8d69288fbee4904
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a language for the fenced block.

The hash-only fence is missing a language tag, which triggers MD040.

🔧 Proposed fix
-```
+```text
 4b825dc642cb6eb9a060e54bf8d69288fbee4904
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.20.0)</summary>

[warning] 16-16: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In @docs/stunts/invisible-storage.md around lines 16 - 18, The fenced code block
containing the hash "4b825dc642cb6eb9a060e54bf8d69288fbee4904" is missing a
language tag which triggers MD040; update that fence from to include a language (for example usetext) so the block reads like text followed by the hash and closing to satisfy the linter.


</details>

<!-- fingerprinting:phantom:triton:eagle -->

<!-- This is an auto-generated comment by CodeRabbit -->

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

29-47: ⚠️ Potential issue | 🟡 Minor

Top-level await in the Quick Start can break in common setups.

Many readers will paste this into a non‑ESM context or older Node versions. Wrap in an async IIFE (or explicitly note ESM/top‑level await requirement).

✅ Suggested snippet adjustment
-import GitPlumbing from '@git-stunts/plumbing';
-import EmptyGraph, { GitGraphAdapter } from '@git-stunts/empty-graph';
+import GitPlumbing from '@git-stunts/plumbing';
+import EmptyGraph, { GitGraphAdapter } from '@git-stunts/empty-graph';

-// Initialize on the current directory
-const plumbing = new GitPlumbing({ cwd: '.' });
-const persistence = new GitGraphAdapter({ plumbing });
-const graph = new EmptyGraph({ persistence });
-
-// Create a node (writes to .git/objects)
-const sha = await graph.createNode({
-  message: JSON.stringify({ type: 'UserCreated', name: 'Alice' })
-});
-
-console.log(`Node created: ${sha}`);
-
-// Read it back
-const data = await graph.readNode(sha);
-console.log(data);
+// Initialize on the current directory
+(async () => {
+  const plumbing = new GitPlumbing({ cwd: '.' });
+  const persistence = new GitGraphAdapter({ plumbing });
+  const graph = new EmptyGraph({ persistence });
+
+  // Create a node (writes to .git/objects)
+  const sha = await graph.createNode({
+    message: JSON.stringify({ type: 'UserCreated', name: 'Alice' })
+  });
+
+  console.log(`Node created: ${sha}`);
+
+  // Read it back
+  const data = await graph.readNode(sha);
+  console.log(data);
+})();
🤖 Fix all issues with AI agents
In `@docs/guide/interactive-demo.md`:
- Around line 3-16: Add a short "Prerequisites" section above the "Quick Start"
heading in interactive-demo.md that explicitly lists Docker (engine/compose) and
Node.js/npm as required with minimum recommended versions and a note to ensure
Docker is running; reference the existing "Quick Start" section and the npm demo
scripts (npm run demo:setup, npm run demo:explore, npm run demo:inspect) so
readers know these commands depend on those prerequisites.

In `@README.md`:
- Around line 33-35: The README snippet using GitPlumbing({ cwd: '.' }) and
GitGraphAdapter assumes the current directory is a Git repository; update the
README text around the code example to explicitly state that the snippet must be
run inside a Git repo and add a short hint to run git init (or clone a repo) if
not already initialized, and mention that GitPlumbing's cwd option points to the
repository root so callers should set cwd accordingly.
- Around line 16-18: Update the README line that reads "O(1) bidirectional
lookups via sharded bitmap indexing" to qualify the claim: change it to
something like "Index-assisted, amortized O(1) bidirectional lookups (when an
index is present and shard/cache assumptions hold) via sharded bitmap indexing"
so the statement for "O(1) bidirectional lookups via sharded bitmap indexing" is
clearly qualified to reflect index presence, cache warm state, and
amortized/average-case behavior.
🧹 Nitpick comments (4)
docs/guide/interactive-demo.md (1)

43-43: Prefer a repo-relative link for site portability.
Using a relative link (e.g., /examples/WALKTHROUGH.md or ../.. as appropriate) keeps the doc working in the VitePress site and in forks without redirecting to GitHub.

docs/guide/operations.md (3)

37-38: Add more specific guidance for stale lock detection.

The advice to remove stale locks "older than X minutes" could be risky without additional safeguards. Consider adding guidance on:

  • Checking for process existence before removing locks
  • Logging lock removals for audit purposes
  • Setting conservative timeframes (e.g., minutes not seconds)
  • Considering whether the operation should fail-fast instead of auto-removing locks
📝 Suggested enhancement
-2.  **Stale Locks:** If a process crashes hard *during* a write, the `.lock` file might be left behind, freezing the repo.
-    *   **Solution:** On application startup, check for stale lock files (older than X minutes) and remove them. Use caution!
+2.  **Stale Locks:** If a process crashes hard *during* a write, the `.lock` file might be left behind, freezing the repo.
+    *   **Solution:** On application startup, check for stale lock files (older than a conservative threshold, e.g., 5+ minutes) and remove them only after verifying the owning process no longer exists. Log all lock removals for audit purposes. In high-reliability scenarios, consider failing fast and alerting operators rather than auto-removing locks.

32-32: Optional: Consider simplifying "exact same" to "same".

Static analysis suggests that "exact same millisecond" could be simplified to "same millisecond" for conciseness.


42-42: Optional: Consider "different from" instead of "different than".

Static analysis suggests using "different from" rather than "different than" for more formal style: "look different from in text files."

Comment on lines +3 to +16
EmptyGraph includes a comprehensive interactive demo that runs in Docker. It demonstrates a real-world e-commerce event store.

## Quick Start

```bash
# 1. Setup the demo environment
npm run demo:setup

# 2. Run the interactive explorer
npm run demo:explore

# 3. Inspect the bitmap index distribution
npm run demo:inspect
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add explicit prerequisites (Docker + Node/npm) before Quick Start.
Right now the commands assume Docker and npm are installed and configured; calling this out avoids first-run confusion.

🤖 Prompt for AI Agents
In `@docs/guide/interactive-demo.md` around lines 3 - 16, Add a short
"Prerequisites" section above the "Quick Start" heading in interactive-demo.md
that explicitly lists Docker (engine/compose) and Node.js/npm as required with
minimum recommended versions and a note to ensure Docker is running; reference
the existing "Quick Start" section and the npm demo scripts (npm run demo:setup,
npm run demo:explore, npm run demo:inspect) so readers know these commands
depend on those prerequisites.

Comment on lines +16 to +18
- **Invisible Storage:** Uses the "Empty Tree" pattern to store data in `.git/objects`.
- **High Performance:** O(1) bidirectional lookups via sharded bitmap indexing.
- **Streaming:** Process millions of nodes with constant memory using async generators.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify the O(1) traversal claim to avoid overpromising.

“O(1) bidirectional lookups” is likely only true under specific assumptions (index present, cache warm, shard sizes bounded). Consider qualifying as “index-assisted” or “amortized/average-case” to set accurate expectations.

💡 Possible wording tweak
-- **High Performance:** O(1) bidirectional lookups via sharded bitmap indexing.
+- **High Performance:** Index-assisted (amortized) bidirectional lookups via sharded bitmap indexing.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Invisible Storage:** Uses the "Empty Tree" pattern to store data in `.git/objects`.
- **High Performance:** O(1) bidirectional lookups via sharded bitmap indexing.
- **Streaming:** Process millions of nodes with constant memory using async generators.
- **Invisible Storage:** Uses the "Empty Tree" pattern to store data in `.git/objects`.
- **High Performance:** Index-assisted (amortized) bidirectional lookups via sharded bitmap indexing.
- **Streaming:** Process millions of nodes with constant memory using async generators.
🤖 Prompt for AI Agents
In `@README.md` around lines 16 - 18, Update the README line that reads "O(1)
bidirectional lookups via sharded bitmap indexing" to qualify the claim: change
it to something like "Index-assisted, amortized O(1) bidirectional lookups (when
an index is present and shard/cache assumptions hold) via sharded bitmap
indexing" so the statement for "O(1) bidirectional lookups via sharded bitmap
indexing" is clearly qualified to reflect index presence, cache warm state, and
amortized/average-case behavior.

Comment on lines +33 to 35
// Initialize on the current directory
const plumbing = new GitPlumbing({ cwd: '.' });
const persistence = new GitGraphAdapter({ plumbing });
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Note that the snippet must run inside a Git repository.

GitPlumbing({ cwd: '.' }) will likely fail if the current directory isn’t a Git repo. A short note or git init hint would reduce friction.

🤖 Prompt for AI Agents
In `@README.md` around lines 33 - 35, The README snippet using GitPlumbing({ cwd:
'.' }) and GitGraphAdapter assumes the current directory is a Git repository;
update the README text around the code example to explicitly state that the
snippet must be run inside a Git repo and add a short hint to run git init (or
clone a repo) if not already initialized, and mention that GitPlumbing's cwd
option points to the repository root so callers should set cwd accordingly.

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