docs(proposal): managed git vault lifecycle#18
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5578687e8c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks for putting this together — I’ve read through the proposal and I’m happy with the overall direction. Managing the repository lifecycle inside Hatchdoor makes sense to me. Pulls and checkouts affect the filesystem, SQLite index, watcher, write locking, revision events, and user-visible status, so keeping that coordination in the application is a good fit. I also like that the existing local-directory workflow remains fully supported and that conflicts preserve work rather than force-pushing or silently choosing a winner. There is one point I’d like corrected in the proposal: empty-repository bootstrap should not be allowed in pull-only mode. That would create a local commit which Hatchdoor is intentionally unable to push, and a later remote initialization could leave the checkout diverged. Please either restrict bootstrap to bidirectional mode or reject that configuration explicitly. On vault-subdirectory support: I don’t want to artificially limit the scope if you want to include it in the initial implementation. Please go ahead with it if that is the direction you want to take. The important part is to keep the repository root and vault root distinct internally, canonicalize and validate the configured subdirectory, and ensure all vault operations stay contained within it. With the pull-only bootstrap contradiction clarified, I’d be comfortable merging this as the agreed design direction. |
|
Thanks for the review and for confirming the overall direction. I addressed the requested clarification in commit
I also kept vault-subdirectory support in the proposed initial scope, clarified that repository root and vault root remain distinct, and made canonicalized containment the boundary for all vault operations. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8401145590
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8401145 to
dc83fac
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc83fac710
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| The filesystem watcher should also coordinate its refresh through the vault | ||
| lock. Repository-manager checkouts should explicitly refresh after a changed | ||
| HEAD; relying only on eventual filesystem events would create a period where the | ||
| working tree and cache disagree. Self-generated watcher events may be coalesced |
There was a problem hiding this comment.
Revalidate the vault root after every checkout
When a managed repository uses HATCHDOOR_VAULT_GIT_SUBDIR, a later remote commit can replace that directory with a symlink after the startup validation. The lifecycle calls for checkout followed directly by reindexing here, but does not require re-canonicalizing the configured vault root and verifying that it is still below repository_root; current write and asset guards canonicalize vault_root itself, so a symlinked root would make paths outside the checkout appear valid. Require this validation after every checkout/merge and before resuming reads or writes, otherwise a remote update can redirect vault access outside the managed repository.
Useful? React with 👍 / 👎.
Summary
This PR proposes making a Git repository URL a first-class Hatchdoor vault source.
Today, Hatchdoor expects an existing local vault directory and optionally synchronizes writes when that directory is already a configured Git checkout. The proposal
explores having Hatchdoor clone the repository into persistent managed storage and own its ongoing pull/push lifecycle.
This is a documentation-only proposal—no runtime behaviour is changed.
Motivation
The goal is to simplify Git-backed deployments by allowing operators to provide a repository URL instead of preparing and mounting a checkout themselves.
The design also considers repositories with multiple independent writers, such as Obsidian users, automation, and other services pushing from separate clones.
Proposed direction
Feedback requested
I would especially appreciate feedback on:
Validation
The proposal was based on the current startup, vault watcher, indexing, write-lock, and Git sync implementation.
AI assistance disclosure
This proposal and PR description were drafted with AI assistance.
No implementation code is included in this PR. The document should be treated as a design proposal for maintainer review, not as a claim that every architectural detail has already been validated in production.