Memory: Notes System

Commands

notes read [key] — read a note (no key = list all)• notes list — list all note keys• notes load -d <key> <file> — load JSON file into note; -d deletes file after load• notes delete <key> — delete a note

Write Workflow

Always: use the Write tool to create a JSON file, then notes load -d <key> <file>. Never use inline JSON or bash one-liners for large documents — escaping breaks.

When updating an existing note: read it first, preserve all content and links, increment version, add updated: YYYY-MM-DD.

JSONHTL Format

Block types: para, heading, codeblock, table, list. See README/format for full details.

The list block (added 2026-03-06) takes label (optional), ordered (bool, default false), and items (array of strings, inline arrays, or dicts). Dict items render as key: value pairs; path-like values auto-link. Use this for any structured list data — it replaces the old non-standard pattern of top-level list keys.

What Well-Structured Means

• Index notes link to children; children link back up to parent• CONTENTS must be updated whenever a new note subtree is created — orphaned notes are invisible to Envoy• Version + date on every update; never append-only• Semantic organisation by topic, not chronological• No note is an island — always link up after creating

Key Reference Notes

README — notes system overview• README/workflow — full conventions• CONTENTS — discovery index; must be current• PROGRAMMING_RULES — coding standards

Tooling (in ~/py/envoy)

jsonhtl_renderer.py — shared JSONHTL→HTML renderer class. Subclass and override render_link_href() for different link targets.• notes-browser/notes_browser.py — wxPython browser; subclasses JSONHTLRenderer with navigate:// links and inline styles.• jsonhtl_to_html.py — static HTML generator; uses JSONHTLRenderer directly (default: appends .html to internal links).• utils/deploy_notes.py — BFS crawler + WebDAV deployer. Subclasses JSONHTLRenderer as DeployRenderer (key-set-aware links). Run by cron at :28 each hour.

deploy_notes.py note: module-level code runs on import — importing it triggers a full deploy. Do not import it in tests; call as a script or use if __name__ == '__main__' guard (not yet added).

version2
created2026-02-28
updated2026-03-06