strip issue-tag comments from #2635 inc1 commits per hive-rules
This commit is contained in:
parent
e11e8294a3
commit
dcb2b79715
9 changed files with 26 additions and 26 deletions
|
|
@ -344,7 +344,7 @@ impl AgentServer {
|
||||||
if is_self_query && let Some(todos) = local_todos().await {
|
if is_self_query && let Some(todos) = local_todos().await {
|
||||||
loose_ends.extend(todos);
|
loose_ends.extend(todos);
|
||||||
}
|
}
|
||||||
// Merge local pending reminders (#2635 inc 1 — same self-query-only
|
// Merge local pending reminders — same self-query-only
|
||||||
// restriction: a manager asking for a child's loose-ends no longer
|
// restriction: a manager asking for a child's loose-ends no longer
|
||||||
// sees the child's reminders, matching the todos precedent above).
|
// sees the child's reminders, matching the todos precedent above).
|
||||||
if is_self_query && let Some(reminders) = local_reminders().await {
|
if is_self_query && let Some(reminders) = local_reminders().await {
|
||||||
|
|
@ -453,8 +453,8 @@ impl AgentServer {
|
||||||
Err(e) => return e,
|
Err(e) => return e,
|
||||||
};
|
};
|
||||||
let kind_label = loose_end_kind_label(kind);
|
let kind_label = loose_end_kind_label(kind);
|
||||||
// Reminders are harness-local (#2635 inc 1) — dial the in-agent
|
// Reminders are harness-local — dial the in-agent socket
|
||||||
// socket directly instead of the broker; every other kind
|
// directly instead of the broker; every other kind
|
||||||
// (question/approval) still lives in c0re.
|
// (question/approval) still lives in c0re.
|
||||||
if kind == hive_sh4re::CancelLooseEndKind::Reminder {
|
if kind == hive_sh4re::CancelLooseEndKind::Reminder {
|
||||||
return match dial_agent_socket(&hive_agent_sock::Request::CancelReminder { id })
|
return match dial_agent_socket(&hive_agent_sock::Request::CancelReminder { id })
|
||||||
|
|
@ -543,8 +543,8 @@ impl AgentServer {
|
||||||
(Some(s), None) => hive_sh4re::ReminderTiming::InSeconds { seconds: s },
|
(Some(s), None) => hive_sh4re::ReminderTiming::InSeconds { seconds: s },
|
||||||
(None, Some(t)) => hive_sh4re::ReminderTiming::At { unix_timestamp: t },
|
(None, Some(t)) => hive_sh4re::ReminderTiming::At { unix_timestamp: t },
|
||||||
};
|
};
|
||||||
// Reminders are harness-local (#2635 inc 1) — dial the in-agent
|
// Reminders are harness-local — dial the in-agent socket
|
||||||
// socket directly instead of the broker.
|
// directly instead of the broker.
|
||||||
match dial_agent_socket(&hive_agent_sock::Request::StoreReminder {
|
match dial_agent_socket(&hive_agent_sock::Request::StoreReminder {
|
||||||
message: args.message,
|
message: args.message,
|
||||||
timing,
|
timing,
|
||||||
|
|
|
||||||
|
|
@ -338,8 +338,8 @@ pub(super) async fn local_todos() -> Option<Vec<hive_sh4re::LooseEnd>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Query the harness's in-agent socket for this agent's local pending
|
/// Query the harness's in-agent socket for this agent's local pending
|
||||||
/// reminders (#2635 inc 1 — was a broker query before reminders moved
|
/// reminders — was a broker query before reminders moved in-container.
|
||||||
/// in-container). Same best-effort contract as [`local_todos`].
|
/// Same best-effort contract as [`local_todos`].
|
||||||
pub(super) async fn local_reminders() -> Option<Vec<hive_sh4re::LooseEnd>> {
|
pub(super) async fn local_reminders() -> Option<Vec<hive_sh4re::LooseEnd>> {
|
||||||
match dial_agent_socket(&hive_agent_sock::Request::ListReminders).await? {
|
match dial_agent_socket(&hive_agent_sock::Request::ListReminders).await? {
|
||||||
hive_agent_sock::Response::LooseEnds { loose_ends } => Some(loose_ends),
|
hive_agent_sock::Response::LooseEnds { loose_ends } => Some(loose_ends),
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
//! Wire types for the *in-agent* socket, served by the hive-agent harness
|
//! Wire types for the *in-agent* socket, served by the hive-agent harness
|
||||||
//! to the in-container producers (matrix / bash MCP daemons) and
|
//! to the in-container producers (matrix / bash MCP daemons) and
|
||||||
//! `forge_notify`. Carries the loose-ends-v2 *todo* op family plus the
|
//! `forge_notify`. Carries the loose-ends-v2 *todo* op family plus the
|
||||||
//! harness-local *reminder* op family (#2635 increment 1); more in-agent
|
//! harness-local *reminder* op family; more in-agent request families may
|
||||||
//! request families may be added over time (the socket is deliberately
|
//! be added over time (the socket is deliberately named for the agent,
|
||||||
//! named for the agent, not the todos).
|
//! not the todos).
|
||||||
//!
|
//!
|
||||||
//! Distinct from `hive-core-agent-sock`, the *host*-served core↔agent
|
//! Distinct from `hive-core-agent-sock`, the *host*-served core↔agent
|
||||||
//! protocol on `/run/hive/mcp.sock`: this socket never leaves the
|
//! protocol on `/run/hive/mcp.sock`: this socket never leaves the
|
||||||
|
|
|
||||||
|
|
@ -332,8 +332,8 @@ impl Surface for AgentSurface {
|
||||||
Ok(Response::LooseEnds { loose_ends }) => u64::try_from(loose_ends.len()).ok(),
|
Ok(Response::LooseEnds { loose_ends }) => u64::try_from(loose_ends.len()).ok(),
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
// Reminders are harness-local (#2635 inc 1) — dial the in-agent
|
// Reminders are harness-local — dial the in-agent socket directly
|
||||||
// socket directly instead of the broker.
|
// instead of the broker.
|
||||||
let reminders =
|
let reminders =
|
||||||
match todo_server::dial(&hive_agent_sock::Request::CountPendingReminders).await {
|
match todo_server::dial(&hive_agent_sock::Request::CountPendingReminders).await {
|
||||||
Some(hive_agent_sock::Response::PendingRemindersCount { count }) => Some(count),
|
Some(hive_agent_sock::Response::PendingRemindersCount { count }) => Some(count),
|
||||||
|
|
@ -458,7 +458,7 @@ async fn serve_main<S: Surface>(socket: &Path, poll_ms: u64) -> Result<()> {
|
||||||
tracing::error!(error = %e, "web_ui::serve exited with error");
|
tracing::error!(error = %e, "web_ui::serve exited with error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Harness-local reminders (#2635 increment 1): a due reminder fires
|
// Harness-local reminders: a due reminder fires
|
||||||
// straight into an mpsc channel the serve loop races against the
|
// straight into an mpsc channel the serve loop races against the
|
||||||
// broker long-poll (unlike todos, a fire carries real per-row data,
|
// broker long-poll (unlike todos, a fire carries real per-row data,
|
||||||
// so a bare `Notify` doesn't fit — see `reminder_timer` docs).
|
// so a bare `Notify` doesn't fit — see `reminder_timer` docs).
|
||||||
|
|
@ -476,8 +476,8 @@ async fn serve_main<S: Surface>(socket: &Path, poll_ms: u64) -> Result<()> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
tokio::spawn(reminder_timer::run(reminder_store.clone(), reminder_tx));
|
tokio::spawn(reminder_timer::run(reminder_store.clone(), reminder_tx));
|
||||||
// In-agent todo socket (loose-ends v2 + #2635 reminders): the harness
|
// In-agent todo socket (loose-ends v2 + harness-local reminders): the
|
||||||
// owns the todo + reminder stores locally and serves the
|
// harness owns the todo + reminder stores locally and serves the
|
||||||
// in-container producers on `HIVE_AGENT_SOCKET`. A new/changed todo
|
// in-container producers on `HIVE_AGENT_SOCKET`. A new/changed todo
|
||||||
// upsert fires `todo_wake` so the serve loop drives a turn directly —
|
// upsert fires `todo_wake` so the serve loop drives a turn directly —
|
||||||
// no broker round-trip, no marker files. Best-effort: if the todos
|
// no broker round-trip, no marker files. Best-effort: if the todos
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,9 @@ pub fn todos_db() -> PathBuf {
|
||||||
harness_dir().join("hyperhive-todos.sqlite")
|
harness_dir().join("hyperhive-todos.sqlite")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Harness-local reminder store (#2635 increment 1). Same rationale as
|
/// Harness-local reminder store. Same rationale as [`todos_db`] — mutable
|
||||||
/// [`todos_db`] — mutable per-agent state the harness owns, kept out of
|
/// per-agent state the harness owns, kept out of the append-only events
|
||||||
/// the append-only events sink.
|
/// sink.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn reminders_db() -> PathBuf {
|
pub fn reminders_db() -> PathBuf {
|
||||||
harness_dir().join("hyperhive-reminders.sqlite")
|
harness_dir().join("hyperhive-reminders.sqlite")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
//! Delivery half of the harness-local reminders store (#2635 increment 1).
|
//! Delivery half of the harness-local reminders store. Polls [`Reminders`]
|
||||||
//! Polls [`Reminders`] for due rows and pushes each as a
|
//! for due rows and pushes each as a
|
||||||
//! [`hive_sh4re::DeliveredMessage`] down an mpsc channel the serve loop
|
//! [`hive_sh4re::DeliveredMessage`] down an mpsc channel the serve loop
|
||||||
//! races against the broker long-poll — mirrors `todo_server`'s `Notify`
|
//! races against the broker long-poll — mirrors `todo_server`'s `Notify`
|
||||||
//! wake, but a reminder fire carries real per-row data (message/id), so a
|
//! wake, but a reminder fire carries real per-row data (message/id), so a
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//! Harness-local reminder store — the persistent, DB-backed half of the
|
//! Harness-local reminder store — the persistent, DB-backed half of the
|
||||||
//! in-container reminders migration (#2635 increment 1). Mirrors
|
//! in-container reminders migration. Mirrors `todos.rs`'s shape: one
|
||||||
//! `todos.rs`'s shape: one sqlite db under the harness dir, single-agent
|
//! sqlite db under the harness dir, single-agent
|
||||||
//! scope (no `agent` column — every row belongs to this agent, unlike the
|
//! scope (no `agent` column — every row belongs to this agent, unlike the
|
||||||
//! old c0re-side store which served every agent in the hive).
|
//! old c0re-side store which served every agent in the hive).
|
||||||
//!
|
//!
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
//! In-agent socket server (loose-ends v2 + #2635 reminders). Binds the
|
//! In-agent socket server (loose-ends v2 + harness-local reminders). Binds
|
||||||
//! harness-owned `HIVE_AGENT_SOCKET` and serves the `hive-agent-sock`
|
//! the harness-owned `HIVE_AGENT_SOCKET` and serves the `hive-agent-sock`
|
||||||
//! protocol to the in-container producers (matrix / bash daemons,
|
//! protocol to the in-container producers (matrix / bash daemons,
|
||||||
//! forge-notify) and to `hive-agent-mcp`'s `remind`/`get_loose_ends`/
|
//! forge-notify) and to `hive-agent-mcp`'s `remind`/`get_loose_ends`/
|
||||||
//! `cancel_loose_end` tool impls. Todo ops hit the harness-local [`Todos`]
|
//! `cancel_loose_end` tool impls. Todo ops hit the harness-local [`Todos`]
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ pub(super) async fn api_stats(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetch reminder activity stats from the harness-local reminder store over
|
/// Fetch reminder activity stats from the harness-local reminder store over
|
||||||
/// `HIVE_AGENT_SOCKET` (#2635 inc 1 — was a broker RPC before reminders
|
/// `HIVE_AGENT_SOCKET` — was a broker RPC before reminders moved
|
||||||
/// moved in-container). Returns `None` on any transport / decode failure or
|
/// in-container. Returns `None` on any transport / decode failure or
|
||||||
/// when the socket is unset — the stats are decorative, not authoritative.
|
/// when the socket is unset — the stats are decorative, not authoritative.
|
||||||
async fn fetch_reminder_stats(window_secs: u64) -> Option<hive_sh4re::ReminderStats> {
|
async fn fetch_reminder_stats(window_secs: u64) -> Option<hive_sh4re::ReminderStats> {
|
||||||
match crate::todo_server::dial(&hive_agent_sock::Request::ReminderRollup {
|
match crate::todo_server::dial(&hive_agent_sock::Request::ReminderRollup {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue