Skip to content

Let Windows graphs live in the user folder - #58

Merged
JetSquirrel merged 1 commit into
mainfrom
fix/windows-home-graphs
Nov 4, 2026
Merged

JetSquirrel merged 1 commit into
mainfrom
fix/windows-home-graphs

Conversation

@JetSquirrel

Copy link
Copy Markdown
Owner

Problem

On Windows, creating or writing to a graph anywhere under C:\Users\... fails:

storage error: open namespace directory '\?\C:\Users': Access is denied. (os error 5)

HawDB flushes every parent folder up to the drive root when it opens a graph for writing, and an ordinary user can't open C:\Users for writing. A machine with only drive C had nowhere obvious to put a graph.

This isn't waiting on HawDB. nowledge-co/hawdb#1255 tracks it, and our pinned 0.24.0 already has the option for it, DatabaseConfig::namespace_durability_anchor. We never set it.

Change

  • On Windows, a graph inside the home folder now uses that folder as its anchor. HawDB still flushes everything from the graph up to and including the home folder.
  • Paths outside the home folder and other platforms keep the full walk. C:\graphs still fails, with a reworded hint.
  • The anchor depends only on the graph's path, so the CLI and the window always agree, which HawDB requires.
  • The README and the comment in .cargo/config.toml now say the same.

The decision to review

Setting an anchor means we promise the home folder is already durable; HawDB doesn't check. HawDB's namespace durability doc describes this pattern for the OS-provisioned LocalAppData folder and says not to do it for a folder the app just created. The home folder is also provisioned by Windows, but the doc doesn't name it, so this is our reading of it.

Not tested: power loss. HawDB's doc also lists Windows namespace power-loss qualification as still open, with or without an anchor.

Testing

On Windows 11 as a non-admin user:

Graph location Create Write, then read back
Inside the home folder Works Works, including read-only
Same, typed in lower case (c:/users/...) Works Works, including read-only
C:\ProgramData\... (outside home) Fails with the new hint, leaves nothing behind Not applicable
E:\... Works Works, including read-only
  • New test a_graph_in_the_home_folder_can_be_created_and_reopened fails with os error 5 when the anchor is turned off. It returns early if the temp folder isn't under the home folder, so it may not exercise this on every CI machine.
  • cargo test --workspace and cargo clippy --workspace --all-targets -- -D warnings pass locally.
  • Not run in the window; it opens graphs through the same open_inner.

After this and #57 both merge

This is based on main, so it can't touch text that only exists in #57. That text needs a small follow-up:

  • The probe_location comment in location.rs, which says HawDB needs write access to every parent folder.
  • The graph_dialog.new.no_suggestion string, which says graphs may not work on drive C.

suggest_location needs no change: its probe will now succeed for Documents.

🤖 Generated with Claude Code

A graph anywhere under C:\Users failed to open with os error 5, because HawDB
flushes every parent folder up to the drive root and ordinary users can't open
C:\Users for writing. HawDB 0.24 has an option for this that we never set:
namespace_durability_anchor stops the walk at a folder the host vouches for.

On Windows, a graph inside the home folder now anchors there. Paths elsewhere,
and every other platform, keep the full walk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JetSquirrel
JetSquirrel merged commit 86d7092 into main Nov 4, 2026
2 checks passed
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.

1 participant