Person/codekiln/GitHub/logseq-gardener/Analysis/Fable/26/09/12/0933 ET Call the impact command garden diff and run it where the link checker runs
Call the impact command garden diff and run it where the link checker runs
- Codex's Person/codekiln/GitHub/logseq-gardener/Analysis/Codex/26/09/12/0733 ET Build a command that shows what an edit affects is the best addition in the Codex set. A command that compares the graph at a git revision with the graph in the saved files is read-only, so it fits the Brief's read-only-first rule. It exercises block matching on real edits before the merge driver in Person/codekiln/GitHub/logseq-gardener/Analysis/Fable/26/09/12/0658 ET A Logseq-aware git merge driver before a CRDT trusts that matching. Agents in this repository can use it the week it exists. I would change its name, give it a git integration, and take its first fixtures from this repository's history.
Name it after what it does
git diff shows the lines an edit changed. This command shows the links, targets, parents, and block identities an edit changed, over the same --base <revision> argument, so garden diff says what it is to anyone who has used git, and garden diff --base HEAD reads as the graph counterpart of git diff HEAD. "Impact" names a consequence of the output, and "diff" names the output.- The name also fits the integration git offers.
.gitattributes can name an external diff driver for pages/*.md and journals/*.md (gitattributes, Defining an external diff driver), so git diff on a garden file can show the graph changes beside the text changes when a person asks for that view. Registering the merge driver later takes one more line in .gitattributes, described in gitattributes, Defining a custom merge driver on that same page. My/Principle/Simplify/Prefer Standards and Defaults applies.
Run it where the link checker runs today
- This repository runs
resolve-wikilinks.cljs from the link-hygiene skill when an agent drafts a page, and lefthook runs the identity scan on every commit. garden diff --base HEAD --json in those places reports new fileless pages, links whose target changed, blocks whose parent changed, and removed id:: lines that other blocks still reference. The report on new fileless pages does what resolve-wikilinks.cljs does today, so garden diff replaces it. The reports on changed link targets, changed block parents and removed id:: lines are checks this repository has never had.
The first fixtures are in git log
- This garden's history holds real alias removals. 588fb79e docs: point nvim/Distro/LazyVim at LazyVim page removed
alias:: [[nvim/Distro/LazyVim]] from the LazyVim page while other pages still link [[nvim/Distro/LazyVim]], so those links changed target in a commit that never touched their files. Check out that commit, run garden diff --base <its parent>, and the report must name those links and both targets. git log -S'alias::' --diff-filter=M -- pages lists more commits of the same kind.
Write the matcher once for two-way and three-way use
- Codex's rule stands: match blocks by explicit UUID when present, and report an ID-less match as uncertain when repeated text makes it so. The diff needs a two-way match between base and current, and the merge driver needs a three-way match among base, ours, and theirs. Write the matcher once with three inputs in mind, and the diff becomes its first user and its test bed.