dashboard: surface the hive's hyperhive rev on the H0M3 start page

Adds hyperhive_rev to the dashboard's /api/state StateSnapshot,
resolved via the same current_flake_rev helper get_agent_meta's
per-agent hyperhive_rev already uses. home.js renders it next to the
existing hive-identity line, truncated to the last 12 chars with the
full value in title=, hidden when the flake ref isn't a local path pin.

Requested by annika (infra.run) via dmatrix, hyperhive#2854.
This commit is contained in:
iris 2026-07-31 19:32:20 +02:00
commit 761f4b8351
3 changed files with 22 additions and 0 deletions

View file

@ -48,6 +48,19 @@ async function init() {
ident.textContent = parts.join(' / ');
ident.hidden = false;
}
// Rev line: absent when the flake ref isn't a local path pin (a bare
// `github:` url has no on-disk rev to canonicalize) — hidden rather
// than showing a placeholder in that case.
const rev = $('hive-rev');
if (rev && state.hyperhive_rev) {
const short = state.hyperhive_rev.length > 16
? `${state.hyperhive_rev.slice(-12)}`
: state.hyperhive_rev;
rev.textContent = `rev ${short}`;
rev.title = state.hyperhive_rev;
rev.hidden = false;
}
}
init();

View file

@ -30,6 +30,7 @@
<header class="home-header">
<p class="banner-thin" id="hive-identity" hidden></p>
<pre class="banner">░▒▓█▓▒░ ░▒▓█▓▒░ H Y P E R H I V E · H0M3 ░▒▓█▓▒░ ░▒▓█▓▒░</pre>
<p class="banner-thin" id="hive-rev" hidden></p>
</header>
<main class="home-main">