Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: state the read-state contract in the guard docs

This commit is contained in:
atlas 2026-11-15 20:17:45 +01:00 • committed by mara
commit 4a109fa038

View file

@ -1,16 +1,14 @@
//! Read-before-comment guard backed by forge's own notification
//! read-state — no local mirror (which drifts across restarts).
//!
//! When someone comments on an issue/PR the caller participates in,
//! forge raises an unread notification for that thread; once the agent
//! actually reads the thread (`comments` / `view`) we mark it read via
//! the notifications API. So "is there unread activity here?" is just
//! "does forge still have an unread notification for this thread?" —
//! forge is the single source of truth, nothing to lose on restart.
//!
//! (This pairs with the `forge_notify` harness change that stops
//! marking notifications read on wake *delivery* — issue tracker
//! `forge cli: agents keep commenting without reading prev comments`.)
//! `hive-forge-notify` marks a thread read on forge as soon as it delivers
//! the thread to the agent as a todo, so the todo carries the news and
//! forge's unread flag does not wait for the agent to open the thread.
//! "Unread activity here" is therefore "forge still has an unread
//! notification for this thread": activity newer than the last delivery
//! (the poll interval, about 30 s) and threads whose delivery failed.
//! Reading a thread (`comments` / `view`) also marks its notification
//! read, so the guard clears for a thread the agent opens itself.
use anyhow::Result;
use forge_client::NotificationThread;