hyperhive/hive-c0re/src/stores
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 77cc7bea6b refactor(#2949): the build-log row carries its node id
`QueueInner` was `{ sched, node_rt }`, where `node_rt` held exactly one
datum per node: the `build_logs` row id. It existed because a `hive_jobq`
node payload is immutable after insert while the log row is created when
the build starts — so the link could not ride the node.

Invert it: the log row names its node (`build_logs.node_id`, one migration
in the existing `schema_versions` framework). Same single-home property,
in the direction the type system allows.

`QueueInner` is now just the scheduler. That is the point: the queue holds
no per-node side map, so nothing has to be locked alongside the graph.

Deleted as a consequence, each surfaced by dead-code analysis after the
edit above rather than predicted:

- `NodeRuntime`, `node_rt`, `set_build_log_id`, and `build_log_id_of`
  (which linear-scanned the map to match a wire `u64` against opaque
  `NodeId`s). The lookup is an indexed query now.
- `struct Ctx`, entirely. It carried `coord` + `dag_id` + `node_id` into
  the executors so the build-log callback could reach the queue; without
  the callback, `coord`/`dag_id` were never read and `node_id` was already
  on the `Claim` both executors receive.
- `QueueInner::node_running`, which existed only for `set_build_log_id`'s
  "only while running" guard.
- The `Fn(i64)` callbacks on `prebuild_toplevel` / `swap_update` /
  `priv_run_inner`, replaced by a `node_id: Option<u64>` passed down. The
  id travels one way now instead of being registered back.

`meta.rs`'s `nix_logged` passes `None` deliberately: its callers reach it
from outside the queue as well as inside, and nothing reads the link for
them yet.

`id_for_node` takes `MAX(id)` rather than assuming uniqueness — a retried
node opens a second row and the panel wants the current attempt. The test
moved to where the behaviour lives and covers that, plus survival across
completion and non-collision with node-less rows.
2026-08-02 22:00:34 +02:00
..
approvals.rs hive-c0re: finish chrono-clock migration 2026-08-02 02:12:19 +02:00
audit_log.rs hive-c0re: finish chrono-clock migration 2026-08-02 02:12:19 +02:00
broker.rs hive-c0re: finish chrono-clock migration 2026-08-02 02:12:19 +02:00
build_logs.rs refactor(#2949): the build-log row carries its node id 2026-08-02 22:00:34 +02:00
db.rs fix(#2279): idempotent column-guard migrations, drop invalid ADD COLUMN IF NOT EXISTS 2026-07-10 22:05:08 +02:00
mod.rs refactor(#2569): remove the c0re todo store + handlers (todos now owned in-container) 2026-07-20 23:29:26 +02:00
operator_questions.rs hive-c0re: finish chrono-clock migration 2026-08-02 02:12:19 +02:00
power.rs hive-c0re: finish chrono-clock migration 2026-08-02 02:12:19 +02:00
scheduled_prompts.rs hive-c0re: finish chrono-clock migration 2026-08-02 02:12:19 +02:00