Skip to main content

agentmux_srv_core/backend/
kanban_delegate.rs

1// Copyright 2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3//
4//! An agent accepting or sending back a Kanban task in Review. Any agent may;
5//! the history records the agent that did it, never the operator
6//! (`server/work_delegate.rs`).
7
8/// How long the operator can Reopen a task an agent accepted.
9pub const REOPEN_WINDOW_MS: i64 = 7 * 24 * 60 * 60 * 1000;
10
11/// Why a decision was refused. `code` is stable (the audit and the logs carry
12/// it); `words` is for the agent, who can act on it.
13#[derive(Debug, Clone, PartialEq, Eq)]
14pub struct Refusal {
15    pub code: &'static str,
16    pub words: String,
17}
18
19fn refuse(code: &'static str, words: impl Into<String>) -> Refusal {
20    Refusal { code, words: words.into() }
21}
22
23pub fn not_in_review(name: &str, state: &str) -> Refusal {
24    refuse("not_in_review", format!("{name} is {}, not in Review.", state.replace('_', " ")))
25}
26
27pub fn sensitive_quote() -> Refusal {
28    refuse("sensitive_text", "The text looks like it holds a credential; it isn't stored.")
29}
30
31/// What the Kanban's Start message says when the task's text is another
32/// agent's, quoted (`app_api/kanban.rs` `start_text`).
33pub const RELAYED_START_MARK: &str = "wrote it down; here it is as they wrote it:";
34
35/// What a send-back message says when the reason is an agent's, quoted
36/// (`app_api/kanban.rs` `send_back_task`).
37pub const RELAYED_REASON_MARK: &str = "here is their reason as they wrote it:";