Read /new to get a template with date and identifier pre-filled; write
back (frontmatter + optional body) to create the note on disk. Mirrors
the 9beads new-file pattern. Empty fields (title, signature) render as
bare YAML nulls, not quoted strings.
Adds gopkg.in/yaml.v3 for struct-based template marshaling.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When reading body of a newly created note that hasn't been saved,
generate YAML frontmatter from the note's metadata instead of
returning empty string.
Populate the Path field when creating notes via /new by constructing
the expected filename and joining it with the denote directory.
Default extension is .md. Also fix mutex lock/unlock to prevent crash.
- Md (yaml+toml): tags now marshal as ["tag1", "tag2"] (quoted)
- Txt: tags now marshal as double-space-separated (tag1 tag2)
- Add parseTags() to Unmarshal: accepts any delimiter format and
normalizes each tag to [a-z0-9]+, enabling lenient frontmatter
input on body writes
- Fix results tests to use UnmarshalStrict where errors were expected
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The pubsub event endpoint was only used for physical file sync, which is
no longer needed now that reads/writes go directly through 9P. Removed
the /event file, pubsub message bus, and all Publish calls.
Added renameNote helper that renames the physical file and updates
note.Path whenever title, keywords, signature, or body frontmatter
changes, keeping the denote filename in sync with in-memory metadata.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
readDir was slicing the serialized dir entry bytes at the raw byte
boundary, splitting entries mid-stream. The plan9 client's dirUnpack
stops on a truncated entry, so 9pfuse received nothing usable.
Fix readDir to return only complete entries per read, as required by
the 9P spec. Also warn-and-skip on ExtractMetadata errors in LoadAll
instead of aborting the entire directory walk.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add /event file for pub/sub event notifications
- Events: n (new), u (update), r (rename), d (delete)
- Format: '<type> <identifier>' per line
- Blocking read with 30s timeout