use serde_json::Value;
use super::Verb;
pub const PROPOSALS: Verb = Verb {
word: "proposals",
params: &["workspace"],
flags: &[],
summary: "what a reviewer has staged for this workspace's config, and how big it is",
detail: "A reviewer agent that learned something writes it as a real \
config patch and parks it on a branch of its own, waiting for \
you. This lists them: which reviewer staged each one, which \
lineage it would move, how many lines it changes, and what the \
reviewer called it. `fresh` means the lineage still stands where \
the reviewer read it, so the patch can be taken as it is; `stale` \
means somebody advanced that lineage since, and the answer is to \
reject it and let the next checkpoint re-derive from where things \
now stand. Nothing staged is an empty answer, not a refusal. The \
wire also takes an `id`, which answers that proposal whole — \
message and diff — beside the listing.",
};
pub const PROPOSAL: Verb = Verb {
word: "proposal",
params: &["workspace", "id", "verdict"],
flags: &[],
summary: "take a reviewer's staged config patch, or throw it away",
detail: "The decision the learning loop is built around: read what an \
agent concluded, then say yes or no. `accept` fast-forwards the \
patch's lineage onto it and deletes the staging branch, and every \
conversation on that lineage picks the change up at its next step \
with no act per conversation. `reject` deletes the staging branch \
and nothing else — the reviewer's own conversation survives as \
the record of why it thought so. Both words are required, and \
neither has a default. An accept whose lineage moved under it \
refuses and names where that lineage now stands, rather than \
merging somebody's memory forward.",
};
pub const VERDICTS: [&str; 2] = ["accept", "reject"];
pub fn proposals(workspace: String, id: Option<String>) -> Value {
PROPOSALS.stating(vec![workspace], "id", id)
}
pub fn proposal(workspace: String, id: String, verdict: String) -> Value {
PROPOSAL.built(vec![workspace, id, verdict], &[])
}
#[cfg(test)]
mod tests;