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
Introduce the client-side VaultFs storage boundary required before rebasing the headless CLI work. This PR migrates DiskMirror off direct app.vault.* file operations and onto a small filesystem interface, with an Obsidian adapter for the plugin and an in-memory adapter for tests.
Opening as a draft intentionally: please confirm this scoped PR-A boundary before detailed review.
FakeVaultFs and targeted DiskMirror tests for create/update/delete/rename, suppression fingerprints, frontmatter-blocked writes, target-exists rename, and missing-source rename.
DiskMirror now uses VaultFs for disk reads/writes/deletes/renames.
Explicitly not included in this PR:
The remaining raw app.vault.* callsites in src/main.ts for reconcile scans, vault event handlers, direct reads, and disk-index stat calls.
CLI NodeVaultFs / NodeDiskMirror refactor. That is the PR-B rebase follow-up after this boundary lands.
Orchestration unification into a shared DiskMirrorCore.
Follow-up after this merges
Rebase PR #16 (feat/headless-cli-fresh) on top of main, drop its duplicate normalizer, add NodeVaultFs, and move the CLI filesystem hardening behind that adapter while preserving the PR #16 hardening checklist.
git log --oneline upstream/main..HEAD shows one refactor commit
Not run locally:
npm run test:e2e:obsidian failed before launching tests because wdio is not installed in this workspace (sh: wdio: command not found, exit 127). The two-peer manual Obsidian smoke was not run in this headless workspace for the same missing local harness reason.
Quick check before I rebase — upstream/main has moved ~120 commits since this branch was opened (runtime extraction into src/runtime/*, INV-SAFETY-02 in 48cfe67 + af61c03, the DiskMirror rewrite for RemoteDeleteDecision / PreservedUnresolvedRegistry / per-path write locks / setDiskWriteCallback, and the new canonical origin set in src/sync/origins.ts). Rebasing the existing DiskMirror migration on top of all that is doable but non-trivial, and the answer to two questions changes the shape:
1. Do you still want the client-side VaultFs seam as proposed? Text-only interface (normalize, readText, writeText, delete, rename, stat, listMarkdown) with ObsidianVaultFs / FakeVaultFs adapters, shared normalizeVaultPath (NFC + slash normalization), and exclude / frontmatter-guard behaviour staying where it currently lives. Yes / no / different shape?
2. If yes, do you want this PR shrunk to interface + adapters + tests only, with the DiskMirror migration as a focused follow-up? That makes the review trivial against current main and lets the recent DiskMirror rework settle. The alternative is to keep the current "boundary + DiskMirror migrated through it" shape, which is a more involved rebase against the new RemoteDeleteDecision / PreservedUnresolvedRegistry code paths.
Happy to push either shape on your call. I'll leave the draft as-is until I hear back so we don't churn on a direction you don't want.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Introduce the client-side
VaultFsstorage boundary required before rebasing the headless CLI work. This PR migratesDiskMirroroff directapp.vault.*file operations and onto a small filesystem interface, with an Obsidian adapter for the plugin and an in-memory adapter for tests.Opening as a draft intentionally: please confirm this scoped PR-A boundary before detailed review.
Scope
Included:
VaultFscontract, errors, stats/list/read/rename/write/delete operations.NFC, slash normalization, no leading/trailing slash).ObsidianVaultFspreserving Obsidian semantics (Vault.delete,FileManager.renameFile).FakeVaultFsand targetedDiskMirrortests for create/update/delete/rename, suppression fingerprints, frontmatter-blocked writes, target-exists rename, and missing-source rename.DiskMirrornow usesVaultFsfor disk reads/writes/deletes/renames.Explicitly not included in this PR:
app.vault.*callsites insrc/main.tsfor reconcile scans, vault event handlers, direct reads, and disk-index stat calls.NodeVaultFs/NodeDiskMirrorrefactor. That is the PR-B rebase follow-up after this boundary lands.DiskMirrorCore.Follow-up after this merges
Rebase PR #16 (
feat/headless-cli-fresh) on top ofmain, drop its duplicate normalizer, addNodeVaultFs, and move the CLI filesystem hardening behind that adapter while preserving the PR #16 hardening checklist.Verification
node --import jiti/register --test tests/sync/diskMirror-vaultFs.test.tsnpm run buildnpm run test:regressionsgit diff --checkgit log --oneline upstream/main..HEADshows one refactor commitNot run locally:
npm run test:e2e:obsidianfailed before launching tests becausewdiois not installed in this workspace (sh: wdio: command not found, exit 127). The two-peer manual Obsidian smoke was not run in this headless workspace for the same missing local harness reason.