Commit Graph
8 Commits
Author SHA1 Message Date
marc 43215d6e0a add 'diwan remote <machine>' to open the diwan workspace on a saved herdr machine
Threads an optional machine= kwarg through herdr_json/
herdr_diwan_workspace_id (default None, fully backward compatible),
reusing the exact focus-then-attach pattern cmd_bare already uses
locally, just against --machine <label> for the scripted focus call
and --remote <machine> for the actual interactive attach.

Verified: argparse wiring, the no-herdr-on-PATH dry-run path, and that
a bogus --machine label fails fast and cleanly (not a hang) rather than
attempting a real network connection -- confirms the warning-then-exec
fallback in cmd_remote is safe. Did not test an actual real remote
attach (no SSH path to any herdr server from this sandbox).
2026-11-09 18:43:08 +01:00
marc c7859400a1 Reports: only write entries with real information; tick: actually retire closed sessions
Reports no longer get an entry for routine mechanical steps (a plain
dispatch, a session closure Marc already asked for, a nudge, a pass
with nothing to triage) -- only for actual findings/decisions/problems.
Zero new entries in a tick run is now the normal case; PROTOCOL.md's
worked example replaced with entries that carry real information
instead of 'dispatched X'/'triaged N items' noise.

TICK.md step 3: a session whose Close diwan session is checked off now
gets genuinely torn down by the tick agent -- herdr tab close on its
DIWAN_ID's tab, :session: tag stripped from the heading, DIWAN_ID
property kept as a historical record. Resolves the 'retired-session
teardown' known gap from DESIGN.md (previously only reported, never
actually closed). Not yet verified against a real live tick run.
2026-11-09 18:34:07 +01:00
marc c09f2a1a11 fix: STATE_DIR.mkdir leftover calls still said DIWAN_DIR
Three mkdir(exist_ok=True) calls (locked(), save_state(), cmd_tick())
were never updated during the DIWAN_DIR/DIWAN_NOTES_DIR rename -- they
called .mkdir() on DIWAN_DIR (the tool's own install dir, which already
exists, so this silently no-op'd) instead of STATE_DIR (the content
repo's .diwan/ bookkeeping dir, which needs creating on a repo's first
run). Masked in all my own testing because diwan-dev-notes already had
a .diwan/ directory from manual setup predating the rename; surfaced on
thingvellir against a genuinely fresh content repo with no pre-existing
.diwan/, where it crashed with FileNotFoundError on .diwan/.lock.

Reproduced the crash against a fresh git-init'd repo with no .diwan/
directory, confirmed the fix via 'nix build' + running the packaged
binary against it.
2026-11-09 16:20:34 +01:00
marc de1576af0a add flake.nix: package diwan as a proper nix derivation
Bundles PROTOCOL.md/TICK.md/DO.md alongside the diwan script under
share/diwan/, wraps python3 with DIWAN_DIR set explicitly to that
directory and git on PATH. Verified live: built with 'nix build', ran
'result/bin/diwan tick' against diwan-dev-notes, dispatched a real pi
tick agent successfully end to end.
2026-11-09 11:12:32 +01:00
marc b9d1f96563 Reports: make the entry title itself the link, drop :LINK: property
A report subheading's title is now the link to the heading it's about
(org [[target][description]] syntax, description = the short title),
instead of a separate :LINK: property in a properties drawer. Plain text
title when there's no single heading to link. Further links, if needed,
go inline in the signed body.
2026-11-09 10:56:03 +01:00
marc 18c8284349 make pi the only harness, drop Claude Code support entirely
Removed AGENT_KIND/DIWAN_HARNESS and CLAUDE_PERMISSION_MODE/
DIWAN_PERMISSION_MODE; herdr_agent_start_args now hardcodes --kind pi and
always appends PI_APPROVE_FLAG. Motivated by a real live failure: Claude
Code blocks on an interactive first-run trust dialog in any content repo
it hasn't seen before, which herdr's real-pane dispatch can't answer
(agent_not_ready after a 30s timeout). pi has no such dialog and no
per-tool-call approval gate, so it was already the better fit for
diwan's unattended model -- confirmed live against a brand-new content
repo with zero blocking.

Updated PROTOCOL.md/DESIGN.md accordingly, replacing the harness-
agnosticism framing with an explicit pi-only statement, while leaving
TICK.md/DO.md untouched since neither ever mentioned a specific harness.
2026-11-09 10:49:12 +01:00
marc d52f733f14 rename TOOL_ROOT/CONTENT_ROOT to DIWAN_DIR/DIWAN_NOTES_DIR
DIWAN_DIR: where diwan itself is installed (was TOOL_ROOT /
DIWAN_TOOL_ROOT). DIWAN_NOTES_DIR: the content repo diwan is invoked
against (was CONTENT_ROOT); now also has its own env var override, not
just git rev-parse --show-toplevel discovery, for cron/systemd use where
cwd may not be the content repo.

The content repo's own runtime-bookkeeping directory (state.json, .lock)
is renamed STATE_DIR internally to avoid colliding with the new DIWAN_DIR
name; its on-disk path is unchanged (still a .diwan/ subdirectory of the
content repo).
2026-11-09 10:40:19 +01:00
marc fc0e556b42 diwan: the tool, split out from personal notes content
Contains only the generic diwan CLI and procedure docs (diwan, PROTOCOL.md,
TICK.md, DO.md, DESIGN.md). No personal notes, no content-repo-specific
AGENTS.md -- those now live in a separate content repo (e.g. diwan-dev-notes
for testing, ~/nc/org-agenda for the real thing), discovered at runtime via
git rev-parse --show-toplevel from wherever diwan is invoked.

History reset: this repo previously doubled as both diwan's own dev copy and
a throwaway test-content repo, with 48 commits of the two tangled together.
Starting fresh now that the split is done -- still v0/prototyping.
2026-11-09 10:13:24 +01:00