721efceec582cc1d542ee410798ca4a55ce1346b
The watcher kept one cursor per repo in a `Mutex<HashMap>`, so every daemon restart began with no cursor — and `Watcher::poll` reads "no cursor" as "feed everything the forge returns". A restart therefore replayed the repository's whole history: every old thread a dispatch, and every dispatch a comment posted on a thread nobody had just touched. The dispatcher's dedup lane does not save this: it dedups against the pending inbox, and a drained event re-ingests clean. The cursor is a row now (`watch_cursors`, beside `watch_health`, same scope/forge/subject key), written after every successful poll and read before every poll, so a restart resumes where the last pass stopped. A watch with no cursor yet — newly added, or added to a repository full of history — starts at *now* rather than at the beginning: a watch reports news, and history is not news. The seed is written before the poll, so a forge that is down cannot walk the start line forward on every pass and lose the news arriving in between. Removing a watch forgets its cursor too, so a re-add seeds afresh instead of resuming into a backlog. `Watcher::poll_since` is the seam the daemon needs to pass a cursor it keeps itself; `Watcher::poll` keeps its in-memory behaviour unchanged. `Timestamp::from_epoch_millis` spells an instant the way the forges spell theirs, which is what a seed is. Tests: the first pass feeds nothing and asks from the seeded instant; a second pass resumes from it; the cursor moves only forward per watch and dies with the watch. `e2e`/`continuity`/`http` seed an established watch, since their subject is the dispatch, not the bootstrap.
ῥῆμα, "the spoken word": words that do things.
Rhema Claw
Rhema Claw is the resident tier of the Rhema agent framework: a claw-shaped daemon that watches forges (GitHub, Gitea, GitLab) and calendar feeds, dispatches work to its agents, and serves a chat surface over HTTP — native routes plus an OpenAI-compatible shim, with a web UI and an Android client talking to it.
The framework it embeds (the crates under crates/ it pulls from
crates.io: rhema-autonomous-agent, rhema-coding-agent,
rhema-rsd, and friends) lives in the
rhema repository.
Layout
crates/rhema-claw/— the daemon: forge watches, session dispatch, the chat surface, MCP wiring, and the vision helper. See its README.integrations/— the feed adapters that normalize forge and calendar activity intorhema-rsddispatch.tools/— what runs on the user's machine: therhema-claw-tools-contract(the scoped agent-token allowlist the auth middleware enforces), the shared thin-client code, andrhema-claw-tools-notify.web/claw/— the Nuxt web UI.android/— the Compose Android client.deploy/— the Docker images and the Helm chart.
Languages
Rust
76.8%
Kotlin
12%
Vue
7.2%
TypeScript
3%
Dockerfile
0.5%
Other
0.4%