v1.1.0-Roots-Hooks-Habit
v1.1.0 — Module Roots, Write Hooks & Habit Capture
Summary
Merging frontmatter → main and cutting v1.1.0. Three commits of feature work: a third write mode, per-module roots, a post-write shell hook. Plus two fixes that fell out of the same afternoon. One had been quietly eating dotfiles symlinks. The other was a version constant sitting on the wrong track since The Freeze.
Cargo.toml:1.0.0→1.1.0. Features, no breaking changes, so MINOR.CHANGELOG.md:[Unreleased]promoted to[1.1.0], plus the module-roots entry that was missing outright.config_versionstays at 0.4.0. The schema track and the crate version are independent, and they now disagree on purpose. See below.
What's landing
Module roots & write hooks (4c0522a)
Six optional config keys. Every one is absent-means-prior-behavior, so no existing config changes meaning.
base_pathon a module, plus[modules.<n>.platform]for per-OS overrides. A per-module root that supersedes[vault].base_path, so a module can capture outside the vault entirely. It always writes over the filesystem transport, because the Obsidian API can only reach the vault it serves.[modules.<n>.frontmatter], static frontmatter merged in after the captured fields.frontmatter_date_format, the per-module shape for the injecteddatekey.post_write_shell, pluspost_write_shell_on_serve(default false). A shell hook run after a successful write and awaited for 30s. Substitution uses an exhaustive token allowlist, and an unknown token is rejected at load rather than passed through.{{slug}}and{{slug_or_time}}path tokens.
All of this shipped with no CHANGELOG entry at all. A fast-forward merge would have buried a whole feature. Writing this record is what turned it up, which is most of the argument for writing one.
Habit capture v1 (1d5322e, 83374a4)
Spec: pour-habit-capture. Four general primitives and no habit-specific code. The habit module is a plain config block.
mode = "update", a third write mode that merges frontmatter keys into a note that already exists. It never creates one; the template owns the note's shape.toggleandcounterfield types.Transport::patch_frontmatter, one primitive over two backends. Pour's first PATCH request.- One-shot argv capture.
pour <module> <field> [value]writes without opening the TUI. - 76 new tests, densest around the part that cannot be undone: byte-for-byte preservation, a concurrent write landing between the baseline stat and the read, partial-application reporting.
Fixed: config writes destroyed stow symlinks
Every atomic write ended in std::fs::rename, which swaps a directory entry. Writing onto a ~/.pour/config.toml symlinked out of a dotfiles repo replaced the link with a regular file and left the tracked copy stale, so the edit stranded outside version control. Adding a bean origin through the TUI was enough to trigger it, and dots audit only caught it afterward.
transport/atomic.rs::resolve_write_target now follows a symlink before anything places the temp file. All six writers route through it. It returns regular files, not-yet-existing paths, and dangling links untouched, since a dangling link has no target worth preserving. Putting the temp file beside the resolved target also fixes a latent EXDEV failure when a link crosses a filesystem boundary.
tests/config_symlink.rs pins the fix by driving the real append_option_to_field_on_disk API over a stow layout. tests/util_atomic.rs keeps a test that documents the old behavior, so whoever reads the helper next can see why it exists.
Fixed: the config-schema version was on the crate's track
Config::CURRENT_CONFIG_VERSION moved in lockstep with the schema, 0.2.0 and then 0.3.0, until d245ad9 "v1.0.0 :: The Freeze" bumped it to 1.0.0 alongside Cargo.toml. No config has ever declared 1.0.0. resources/config_archive/ records the real line, and the shipped configs are at 0.4.0.
Reset to 0.4.0. A test now asserts it is not equal to CARGO_PKG_VERSION, so the two cannot be silently re-merged.
The schema stays on 0.x on purpose. Under semver, 0.x makes minor the breaking axis, and that matches what pour's schema changes actually are. A new WriteMode or FieldType variant is a hard parse error on any older binary, so nearly every addition breaks old readers. A 1.x track would promise minor-level backward compatibility the schema cannot keep.
Fixed: the config_version guard was inert
It compared majors only. With the schema on 0.x and the constant on 1.x it could not reject anything below major 2, which left it dead for every release after The Freeze. It now compares minor while major is 0, and falls back to major from 1.0.0 on.
That matters because pour ignores unknown keys silently. There is no deny_unknown_fields, so an older binary reading a newer config drops post_write_shell or goal without a word, and a hook that quietly never runs is worse than a parse error. Unknown enum values already failed loudly on their own.
Deliberate non-changes
- The schema is not bumped to 1.0.0. It would not fix the guard. The comparison is major-only above 0.x, so a
1.7.0config would sail through a1.0.0build exactly as it does now. The numbers would only look aligned. deny_unknown_fieldsstays off. Ignoring unknown keys is what lets an older binary tolerate a newer config at all. The version guard is the right place to catch that, not a parse error per key.
Known limitations carried into v1.1.0
- Multi-key
updatewrites are sequential and not atomic across keys. Pour raises every value-level error while planning, before the first write, and a transport failure mid-sequence returns an error naming the keys that already landed. The v1 cycle declined to batch the filesystem path because it would diverge the two transports. Candidate for v1.2. - The mtime guard on the filesystem patch path is a mitigation, not a lock. A sub-millisecond window survives by design.
- A note with no frontmatter block at all fails loudly on both transports rather than gaining one.
habitsetsmobile_visible = false. The PWA has no toggle or counter widget yet.- Pour still keeps all state in
~/.pour/. XDG migration ($XDG_CONFIG_HOME,$XDG_STATE_HOME,$XDG_CACHE_HOME) is next. Watchdirs::state_dir(), which returnsNoneon both Windows and macOS and needs an explicit fallback.
Test plan
cargo test. 1069 passing, 0 failed.cargo clippy --all-targets. Clean.cargo fmt -- --check. Clean.- Symlink fix checked against a revert. Removing
resolve_write_targetfailsappending_an_option_keeps_the_symlink_and_updates_the_tracked_fileandsuccessive_edits_keep_the_symlink. - Guard fix checked against a revert. Going back to a major-only comparison fails
config_version_newer_minor_is_rejected_while_major_is_zero. - Smoke:
pour,pour me,pour coffee. Capture loop unaffected. - Smoke:
pour habit water 16andpour habit cannabisagainst today's daily note. - Smoke: add a bean origin through the TUI, then confirm
~/.pour/config.tomlis still a symlink andgit -C ~/.dotfiles diffshows the edit.
Post-merge
- Tag
v1.1.0onmain. cargo install --path .. The installed binary dates to 2026-08-06 and predates both the habit module and the symlink fix.- Commit the dotfiles side separately:
pour/.pour/config.tomlreconciled to 0.4.0,pour/README.md, andMads-OS - docs/02 references/POUR.md. - The v0.3.0 record left "refresh the Path from Today snapshot" as a post-merge item that never got done, so it still read
Cargo.toml: 0.2.2and "Next planned tag: v0.3.0". Done in this pass.