diff --git a/docs/tools/forge.md b/docs/tools/forge.md index 6beb0840..64fd0f79 100644 --- a/docs/tools/forge.md +++ b/docs/tools/forge.md @@ -55,9 +55,6 @@ hive-forge pr-reviews 42 # list reviews; inline comments incl hive-forge pr-reviews 42 --approve # submit APPROVED review hive-forge pr-reviews 42 --request-changes -m "msg" # submit REQUEST_CHANGES review hive-forge pr-reviews 42 --comment -m "msg" # submit COMMENT review -hive-forge pr assign-reviewer 42 argus # set argus as a requested reviewer on the PR -hive-forge pr assign-reviewer 42 argus --remove # withdraw the request -hive-forge pr assign-committer 42 damocles # add damocles to the PR's assignee list hive-forge diff 42 # unified diff (lockfile hunks collapsed by default) hive-forge diff 42 --full # include unfiltered lockfile hunks hive-forge list # open issues/PRs diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index 61fe767a..0d8636d8 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -145,7 +145,7 @@ nodes are skipped. A `select all / select none` control sits above the tree. Checking inputs + submitting bumps the lock in `/meta/` and rebuilds the selected agents in sequence; each outcome reaches the root agent as a `rebuilt` -system event. `POST /api/meta-update`. While a lock-bump ripple runs, +system event. `POST /meta-update`. While a lock-bump ripple runs, the panel shows a pulsing "⏳ meta-update running" banner and the update button is disabled (snapshot field `meta_update_running`, live event `meta_update_running`). @@ -430,9 +430,9 @@ Refreshed on tab activation and after each submit/cancel. Backed by **QU3U3D R3M1ND3RS** — reminders agents have scheduled for themselves (via the `remind` tool) but not yet delivered. Each row shows the owner, due time, and message; a `CANC3L` -button hard-deletes (`POST /api/cancel-reminder/{id}`) and a +button hard-deletes (`POST /cancel-reminder/{id}`) and a `R3TRY` button re-arms one whose delivery failed -(`POST /api/retry-reminder/{id}`). Backed by `GET /api/reminders`. +(`POST /retry-reminder/{id}`). Backed by `GET /api/reminders`. Lives in the SCH3DUL3S tab alongside operator schedules so the operator has one place for everything time-fired. The due-time label (`.reminder-due`) carries a `data-due-at` Unix timestamp @@ -1124,8 +1124,8 @@ that's a browser-level decision, not ours. a background `du -sxb` of the agent's state dir + container writable rootfs every ~5 min, `-x` excluding the shared read-only nix store. `null` until the first sample lands. -- `POST /api/cancel-reminder/{id}` — hard-delete a pending reminder. -- `POST /api/retry-reminder/{id}` — re-arm a reminder whose delivery +- `POST /cancel-reminder/{id}` — hard-delete a pending reminder. +- `POST /retry-reminder/{id}` — re-arm a reminder whose delivery failed (clears the failure state so the scheduler retries). - `GET /api/tool-groups` — returns `{ groups: Vec, assignments: BTreeMap>, @@ -1197,7 +1197,7 @@ that's a browser-level decision, not ours. Per-target `last_result` is annotated as a manual fire so the audit trail distinguishes scheduled fires from operator- triggered ones. -- `POST /api/meta-update` — `nix flake update` the selected +- `POST /meta-update` — `nix flake update` the selected `meta/flake.lock` inputs, then rebuild the affected agents. - `GET /dashboard/stream` — unified live event channel: broker `sent` / `delivered`, plus the mutation events listed diff --git a/hive-forge/src/main.rs b/hive-forge/src/main.rs index d03afb8d..eb617eac 100644 --- a/hive-forge/src/main.rs +++ b/hive-forge/src/main.rs @@ -63,7 +63,7 @@ enum Verb { /// Edit an issue's title, body, state, or milestone. #[command(hide = true)] IssueEdit(verbs::issue_edit::Args), - /// PR-scoped commands: `pr …`. + /// PR-scoped commands: `pr …`. Pr(verbs::pr_cmd::Args), /// List a PR's commits as JSON (sha, message, author date, author). /// Survives rebase-rewritten shas — message + author date let a @@ -135,9 +135,6 @@ enum Verb { /// `--request-changes` / `--comment` (with `-m` for the body). #[command(hide = true)] PrReviews(verbs::pr_reviews::Args), - /// Request (or withdraw with `--remove`) a review from a user on a PR. - #[command(hide = true)] - PrAssignReviewer(verbs::pr_assign_reviewer::Args), /// List branches, optionally filtered. Branches(verbs::branches::Args), /// Print the tree SHA at a branch or commit. @@ -203,7 +200,6 @@ fn main() -> Result<()> { Verb::Milestone(a) => verbs::milestone::run(&client, a), Verb::PrMerge(a) => verbs::pr_merge::run(&client, a), Verb::PrReviews(a) => verbs::pr_reviews::run(&client, a), - Verb::PrAssignReviewer(a) => verbs::pr_assign_reviewer::run(&client, a), Verb::Branches(a) => verbs::branches::run(&client, a), Verb::TreeSha(a) => verbs::tree_sha::run(&client, a), Verb::Diff(a) => verbs::diff::run(&client, a), diff --git a/hive-forge/src/verbs/mod.rs b/hive-forge/src/verbs/mod.rs index ffe8c420..60b4bb99 100644 --- a/hive-forge/src/verbs/mod.rs +++ b/hive-forge/src/verbs/mod.rs @@ -26,7 +26,6 @@ pub mod lint; pub mod list; pub mod milestone; pub mod pr; -pub mod pr_assign_reviewer; pub mod pr_cmd; pub mod pr_commits; pub mod pr_create; diff --git a/hive-forge/src/verbs/pr_assign_reviewer.rs b/hive-forge/src/verbs/pr_assign_reviewer.rs deleted file mode 100644 index 5f4718e0..00000000 --- a/hive-forge/src/verbs/pr_assign_reviewer.rs +++ /dev/null @@ -1,41 +0,0 @@ -//! `pr assign-reviewer [--remove]` — add or remove a -//! requested reviewer on a PR. Unlike `pr assign-committer` (assignees, -//! mutate + PATCH the issue) Forgejo has a dedicated endpoint pair for review -//! requests: `POST /repos/{repo}/pulls/{index}/requested_reviewers` -//! adds, `DELETE` (same path + body) removes. Requesting a review from -//! a user who is already requested is a Forgejo-side no-op, so the verb -//! is idempotent in both directions. - -use anyhow::Result; -use clap::Args as ClapArgs; -use serde_json::json; - -use crate::client::Client; - -#[derive(ClapArgs)] -pub struct Args { - /// PR number. - number: u64, - /// User login to request a review from (or withdraw with `--remove`). - user: String, - /// Withdraw the review request instead of adding it. - #[arg(long)] - remove: bool, -} - -pub fn run(client: &Client, args: Args) -> Result<()> { - let repo = client.repo(); - let path = format!("/repos/{repo}/pulls/{}/requested_reviewers", args.number); - let body = json!({ "reviewers": [args.user] }); - if args.remove { - client.delete(&path, Some(&body))?; - println!( - "review request withdrawn: {} on #{}", - args.user, args.number - ); - } else { - client.post_json(&path, &body)?; - println!("review requested: {} on #{}", args.user, args.number); - } - Ok(()) -} diff --git a/hive-forge/src/verbs/pr_cmd.rs b/hive-forge/src/verbs/pr_cmd.rs index ce627bff..533100f3 100644 --- a/hive-forge/src/verbs/pr_cmd.rs +++ b/hive-forge/src/verbs/pr_cmd.rs @@ -1,7 +1,7 @@ //! `pr ` — PR-scoped sub-commands. Wraps the per-verb modules under a //! `pr` parent so `hive-forge pr close 42`, `pr status --pr 42`, etc. read as //! kind-namespaced commands. The generic verbs that also work on issues -//! (view/comment/comments/close/reopen/labels/assign-committer/timeline) kind-check the number +//! (view/comment/comments/close/reopen/labels/assign/timeline) kind-check the number //! is a PR first (`assert_kind`); the PR-only verbs hit `/pulls/…` and are //! kind-correct by construction. The flat `pr-*` + bare generic verbs stay as //! hidden back-compat aliases (see `main.rs`). @@ -32,8 +32,6 @@ enum Cmd { Merge(verbs::pr_merge::Args), /// List a PR's reviews, or submit one. Reviews(verbs::pr_reviews::Args), - /// Request (or withdraw with `--remove`) a review from a user. - AssignReviewer(verbs::pr_assign_reviewer::Args), /// Print the PR's unified diff. Diff(verbs::diff::Args), /// Show title + body + comments. @@ -48,9 +46,8 @@ enum Cmd { Reopen(verbs::reopen::Args), /// List / add / remove labels. Labels(verbs::labels::Args), - /// Assign or unassign a user (the PR's assignee list). - #[command(alias = "assign")] - AssignCommitter(verbs::assign::Args), + /// Assign or unassign a user. + Assign(verbs::assign::Args), /// List timeline events. Timeline(verbs::timeline::Args), } @@ -64,7 +61,6 @@ pub fn run(client: &Client, args: Args) -> Result<()> { Cmd::Status(a) => verbs::pr_status::run(client, a), Cmd::Merge(a) => verbs::pr_merge::run(client, a), Cmd::Reviews(a) => verbs::pr_reviews::run(client, a), - Cmd::AssignReviewer(a) => verbs::pr_assign_reviewer::run(client, a), Cmd::Diff(a) => verbs::diff::run(client, a), // Generics shared with `issue` — verify the number is a PR first. Cmd::View(a) => { @@ -91,7 +87,7 @@ pub fn run(client: &Client, args: Args) -> Result<()> { assert_kind(client, a.number, Kind::Pr)?; verbs::labels::run(client, a) } - Cmd::AssignCommitter(a) => { + Cmd::Assign(a) => { assert_kind(client, a.number, Kind::Pr)?; verbs::assign::run(client, a) }