hyperhive/hive-c0re/src/dashboard
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas e8e6998ac5 refactor(#2756): replace the DAG terminal hook with real tail nodes
The queue carried a per-DAG `HookKind` that fired an inline side effect
from outside the graph when a container rolled up terminal. mara asked
three times why this could not be an ordinary node; the answer in the
code was a doc-comment claiming a node could not work, and it was wrong.

`DepWhen::AfterAny` already existed with two live users, and a weak edge
is satisfied by a `Cancelled` dep, so a tail node runs on success,
failure and cancel alike. What was genuinely missing was smaller than a
hook: a node had no way to learn how the work it followed ended.

So: `Claim` now carries `deps: Vec<DepOutcome>`, snapshotted at claim
time from the graph the scheduler already holds (no `hive-jobq` change).
`Claim::deps_state()` / `deps_error()` roll that up, and two new kinds
consume it — `ResolveApproval { approval_id }` and `EmitRebuilt { agent }`.
Templates append one as a group-root with `AfterAny` edges onto the DAG's
other group roots; a root's state is its subtree's roll-up, so that
covers every node without fanning out to each of them.

Deleted: `HookKind`, `DagSpec.hook`, `NodeKind::Dag.hook`, `DagMeta.hook`,
`TerminalDag`, `terminal_dag()`, `terminal_summary()`, `dag_agents()`,
`dag_rollup()`, `fire_terminal_hook()`, `run_terminal_hook()`,
`emit_rebuilt()`. `complete_node` returns `()`.

Load-bearing details:

- `JobQueue::cancel` spares tail nodes instead of cancelling the whole
  subtree, and returns `bool`. Without this a cancelled approval DAG
  would dangle its approval forever — the hazard `tests.rs` already
  named. The spared tail's deps are `Cancelled`, which satisfies its weak
  edge, so the scheduler claims it and it resolves the row as cancelled.
  `hive-jobq` anticipated exactly this: `cancel_node`'s doc already says
  to settle afterwards so "a weak-edge terminal node observing the
  cancellation" can advance.
- The existing `complete(container)` call after cancelling is kept and is
  deliberately a no-op when a tail was spared (a non-terminal child parks
  the container back in `Finishing`), so power ops still settle
  synchronously with no branch.
- `DeployTail` is NOT `is_tail()`: it does real compensating work, and a
  cancelled DAG has nothing to compensate.
- `exec::failure_reason` falls back to `first_error(dag_id)` because a
  group root that rolled up `Failed` from a child carries no error of its
  own — without it every tail-reported failure would lose its reason.
- `EmitRebuilt` is per agent, so a multi-agent DAG reports each agent's
  own outcome rather than painting all of them with the DAG roll-up.
- `ResolveApproval` is agentless: the approval row already names its
  agent, and that is also what lets one tail close a multi-agent DAG.

Transients-derived-from-running-nodes and the frontend's node-kind
strings stay out of this change; they touch iris's slice and review
better next to their own diff.
2026-07-27 15:06:27 +02:00
..
approvals.rs type Approval.agent as Ident 2026-07-22 21:10:17 +02:00
build_logs.rs feat(#2591): add GET /api/build-log/<node_id> {,/raw} query endpoints 2026-07-23 16:40:46 +02:00
extra_forges.rs feat(#2302): thread &Ident through agent path builders 2026-07-20 21:46:18 +02:00
infra_containers.rs refactor(#2431): extract hive-priv-sock crate from hive-sh4re 2026-07-14 20:02:20 +02:00
journal.rs feat(#2302): migrate dashboard to the single hive-host-sock Ident newtype 2026-07-20 21:46:18 +02:00
lifecycle_ops.rs fix(#2733): write the agent pause marker via hive-priv 2026-07-27 09:42:31 +02:00
matrix_accounts.rs feat(#2302): thread &Ident through agent path builders 2026-07-20 21:46:18 +02:00
meta_inputs.rs refactor(#2285): repoint all hive-c0re host-path consumers to paths.rs 2026-07-10 20:32:03 +02:00
misc_api.rs type Message.from as Ident 2026-07-22 21:10:17 +02:00
mod.rs dashboard: show and edit per-agent resource limits in core LOAD tab 2026-07-26 16:00:45 +02:00
permissions.rs refactor(#2302): type socket wire fields as ident, validated by serde on deserialize 2026-07-20 21:46:18 +02:00
questions.rs dashboard: return problem details directly from client-error handlers 2026-06-22 16:04:22 +02:00
schedules.rs refactor(#2756): replace the DAG terminal hook with real tail nodes 2026-07-27 15:06:27 +02:00
state_files.rs refactor(#2285): repoint all hive-c0re host-path consumers to paths.rs 2026-07-10 20:32:03 +02:00
state_snapshot.rs type Approval.agent as Ident 2026-07-22 21:10:17 +02:00
tombstones.rs feat(#2302): thread &Ident through agent path builders 2026-07-20 21:46:18 +02:00
topology.rs job_queue: finish reparent call-site swap, delete dead sync path 2026-07-26 19:47:36 +02:00
webhook.rs fix(#2417): accept forgejo's 'synchronized' pr-update webhook action 2026-07-15 18:38:47 +02:00