Skip to content

feat: prototype orgmode haustoria with WebDAV and SFTP transports#95

Open
friedenberg wants to merge 1 commit intomasterfrom
claude/orgmode-webdav-sftp-haustoria-jAkdp
Open

feat: prototype orgmode haustoria with WebDAV and SFTP transports#95
friedenberg wants to merge 1 commit intomasterfrom
claude/orgmode-webdav-sftp-haustoria-jAkdp

Conversation

@friedenberg
Copy link
Copy Markdown
Collaborator

Add a new haustoria implementation for syncing dodder zettels with
orgmode (.org) files served over WebDAV or SFTP. This follows the
same architecture as the existing CalDAV haustoria (FDR-0007).

New packages:

  • hotel/orgmode: minimal orgmode parser/serializer (headings, tags,
    property drawers, body text)
  • hotel/webdav: WebDAV HTTP client (PROPFIND, GET, PUT, DELETE, MKCOL)
  • mike/haustoria_orgmode: haustoria.Haustoria + store_workspace.StoreLike
    implementation with pluggable Transport interface

Transport abstraction supports two backends:

  • WebDAV (HTTP basic auth, ETag-based conditional updates)
  • SFTP (password, private key, or SSH agent authentication)

Workspace config extends HaustoriaConfig with Orgmode and Folders
sections. Tommy codegen updated to serialize/deserialize the new
TOML fields. init-workspace accepts -haustoria orgmode and reads
connection parameters from config or environment variables
(ORGMODE_WEBDAV_URL, ORGMODE_SFTP_HOST, etc.).

https://claude.ai/code/session_01SBeXGXMmWxw59XPA8HAx9V

Add a new haustoria implementation for syncing dodder zettels with
orgmode (.org) files served over WebDAV or SFTP. This follows the
same architecture as the existing CalDAV haustoria (FDR-0007).

New packages:
- hotel/orgmode: minimal orgmode parser/serializer (headings, tags,
  property drawers, body text)
- hotel/webdav: WebDAV HTTP client (PROPFIND, GET, PUT, DELETE, MKCOL)
- mike/haustoria_orgmode: haustoria.Haustoria + store_workspace.StoreLike
  implementation with pluggable Transport interface

Transport abstraction supports two backends:
- WebDAV (HTTP basic auth, ETag-based conditional updates)
- SFTP (password, private key, or SSH agent authentication)

Workspace config extends HaustoriaConfig with Orgmode and Folders
sections. Tommy codegen updated to serialize/deserialize the new
TOML fields. init-workspace accepts `-haustoria orgmode` and reads
connection parameters from config or environment variables
(ORGMODE_WEBDAV_URL, ORGMODE_SFTP_HOST, etc.).

https://claude.ai/code/session_01SBeXGXMmWxw59XPA8HAx9V
friedenberg added a commit that referenced this pull request Apr 5, 2026
- SSH host key verification: replace InsecureIgnoreHostKey() with
  proper known_hosts callback (falls back to ~/.ssh/known_hosts)
- Resource lifecycle: add Close() to Transport interface, close
  SFTP/SSH clients and agent socket in Flush()
- Fix swallowed SFTP connection error in env_workspace
- Add KnownHostsFile to OrgmodeSFTP config with TOML serialization
- Fix append slice aliasing in Compile (folder.Tags mutation)
- Make orgmode Properties ordered ([]Property instead of map) for
  deterministic serialization round-trips
- Fix unnecessary string(content) allocation in WebDAV Put
- Make WebDAV Put content-type a parameter (was hardcoded text/org)
- Normalize \r\n line endings in orgmode parser
- Fix dead code: emit blank line between headings in Serialize

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
friedenberg added a commit that referenced this pull request Apr 5, 2026
10 tests covering the orgmode haustoria SFTP transport:
- status/checkin/idempotency lifecycle
- blob preservation from heading body
- org heading tags -> dodder tags
- property drawer parsing
- plain text files (no headings) use preamble
- empty folder handling
- SSH known_hosts rejection with wrong key

Uses the existing test-sftp-server binary. Includes workaround for
tommy codegen variable shadowing bug (tommy#62): empty [haustoria.caldav]
and [haustoria.orgmode.webdav] sections prevent nil pointer in decoder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants