Watch
0
0
Fork
You've already forked hyperhive
0

setup assistant creates ruth with logs and metrics; docs for the harness gate, ordering and pass

This commit is contained in:
atlas 2026-11-01 18:27:55 +01:00
commit 8a60f52afa
3 changed files with 44 additions and 22 deletions

View file

@ -1,8 +1,8 @@
// <SetupAssistant> - the start page's first-time helper: a paperclip with a
// speech bubble offering to set up an agent. It renders only while the swarm
// has no `ruth` (see `ruthIsMissing`), and a click opens the create-agent
// form with her name filled in and `manage_root_agent` checked on top of the
// default permissions (`RUTH_EXTRA_PERMISSIONS`); the form already selects
// form with her name filled in and `manage_root_agent`, `logs` and
// `metrics` checked on top of the default permissions (`RUTH_EXTRA_PERMISSIONS`); the form already selects
// the only hive. No dismiss: once ruth exists it goes away.
import { useEffect, useState } from "preact/hooks";
import { Dialog } from "../ui/dialog/Dialog.js";

View file

@ -27,5 +27,9 @@ export async function ruthIsMissing(fetchImpl: Fetch): Promise<boolean> {
}
/** What the setup assistant's create form checks on top of the default set:
* ruth recovers the other agents, which takes `manage_root_agent`. */
export const RUTH_EXTRA_PERMISSIONS = ["manage_root_agent"];
* ruth recovers the other agents, which takes `manage_root_agent`, and reads
* the swarm's logs and metrics, which are off by default. swarm-controller
* refuses `logs` and `metrics` (409, naming the hive) for a hive that does
* not advertise `tolerant-permissions`; the form shows that error, and
* unticking them creates ruth without. */
export const RUTH_EXTRA_PERMISSIONS = ["manage_root_agent", "logs", "metrics"];

View file

@ -58,17 +58,24 @@ test("anything but a clear answer is not missing", async () => {
);
});
// The assistant's create form sends `manage_root_agent` with the default
// set, so a new ruth holds it from her first start; the default alone does not.
test("the assistant creates ruth with manage_root_agent", () => {
// The assistant's create form sends `manage_root_agent`, `logs` and `metrics` with
// the default set, so a new ruth holds them from her first start; the default
// alone does not.
test("the assistant creates ruth with manage_root_agent, logs and metrics", () => {
const defaults = ["messaging", "meta", "inbox", "execution"];
const all = [...defaults, "web_tools", "manage_root_agent"];
const all = [
...defaults,
"web_tools",
"manage_root_agent",
"logs",
"metrics",
];
assert.deepEqual(
requestPermissions(
initialSelection(all, defaults, RUTH_EXTRA_PERMISSIONS),
defaults,
),
[...defaults, "manage_root_agent"],
[...defaults, "manage_root_agent", "logs", "metrics"],
);
assert.equal(
requestPermissions(initialSelection(all, defaults, []), defaults),