diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 81242ea..b60565f 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -173,6 +173,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - The `voidbot.swarm` CultMesh provider store is generated state, not authority. If `.voidbot/status/cultmesh/voidbot-swarm-state.cc` develops duplicate global documents, `scripts/render-voidbot-swarm-dashboard.mjs` archives the bad store and regenerates a clean one; Odin should then rediscover `voidbot.swarm`. - Swarm heat now has a real typed operator path. The Eve/CultUI dashboard places one heat slider beside the eight-entry CTB horizon; Hermodr publishes `gamecult.eve.command.v1` to `cultmesh://voidbot.local/commands/swarm`, the provider route resolves to RUDP `127.0.0.1:17873` with connection id `0x43554c54`, and the VoidBot swarm server validates `swarm.set_heat` in the range `0.05..2.00`. Accepted heat lives in `.voidbot/private/swarm-controls.cc`; `scripts/run-repo-face-heartbeats.ts` reads it before falling back to `REPO_FACE_HEARTBEAT_GLOBAL_HEAT`. `node scripts/smoke-swarm-heat-command.mjs ` verifies the provider consumer directly. A 2026-07-13 Hermodr browser live-fire set heat to `1.25` and the following CTB pass projected that exact global and per-Face heat. - The receipt-driven slider repair is gone. CultLib dev provides typed live-publication handles, authenticated provider sessions, reliable reconnect evidence, and RUDP receipts (`ebd8c78c`, `d4934233`, `8965f3c0`). Eve resolves component bindings and removes receipt-to-DOM authority (`85b0139`, `522df00`). Hermodr ingests retained provider sessions and lowers ordered state over SSE without polling (`5cb819e`, `561e320`). VoidBot publishes accepted heat as typed state (`060da23`, `3d86b93`). Live-fire proved initial `0.65`, provider-driven `0.75`, and browser-command `0.85` all reached the visible slider through the same state subscription. +- The rest of the live swarm dashboard now follows that same authority. `voidbot.swarm_operator_view.v1` projects summary, queue, selected Face/state/channels, operations, pressure, mentions/events, and route data; Eve nodes bind those fields instead of baking them from the composition snapshot. The renderer registers the operator-view schema when reopening the shared `.cc` store, so retained provider documents no longer make snapshot regeneration fail with an unknown-schema error. - Production browser lowering now lives on Yggdrasil: Starfire Chrome reaches Hermodr at `http://10.77.0.1:8798` over WireGuard; Hermodr consumes Odin at `10.77.0.1:17871`, accepts VoidBot's authenticated retained publications on loopback `127.0.0.1:17874`, and sends typed commands to VoidBot's advertised loopback RUDP route at `127.0.0.1:17873`. The 2026-07-15 repair proved Starfire HTTP/catalog/surface access, an SSE snapshot containing global heat `0.05`, and a reconciled `swarm.set_heat` receipt owned by VoidBot. Do not recreate Hermodr or VoidBot on Starfire. - The new state/notes surfaces are now the continuity spine for future nontrivial work. - `npm run agents:feed-consensus -- --agent --cwd --task ""` writes a recent Aquarium consensus packet and target Codex prompt under `.voidbot/artifacts/chat-consensus/`. Add `--execute` only when the packet should be sent directly to `codex exec` in that workspace. diff --git a/scripts/render-voidbot-swarm-dashboard.mjs b/scripts/render-voidbot-swarm-dashboard.mjs index 491de21..3c812d1 100644 --- a/scripts/render-voidbot-swarm-dashboard.mjs +++ b/scripts/render-voidbot-swarm-dashboard.mjs @@ -29,6 +29,8 @@ const commandBoundaryDocumentType = "idunn.command_boundary"; const commandBoundarySchemaId = "idunn.command_boundary.v1"; const swarmControlDocumentType = "voidbot.swarm_control_state"; const swarmControlSchemaId = "voidbot.swarm_control_state.v1"; +const swarmOperatorViewDocumentType = "voidbot.swarm_operator_view"; +const swarmOperatorViewSchemaId = "voidbot.swarm_operator_view.v1"; const args = parseArgs(process.argv.slice(2)); @@ -908,6 +910,16 @@ async function writeCultMeshPublication(snapshot, eveState, storePath, allowStor name: () => "voidbot-swarm", schema: { parse: parseObjectDocument("VoidBot swarm control state") }, }); + const swarmOperatorViewDefinition = defineDocumentType({ + type: swarmOperatorViewDocumentType, + schemaName: swarmOperatorViewDocumentType, + schemaId: swarmOperatorViewSchemaId, + schemaVersion: swarmOperatorViewSchemaId, + contentHash: swarmOperatorViewSchemaId, + global: false, + name: () => "voidbot-swarm", + schema: { parse: parseObjectDocument("VoidBot swarm operator view") }, + }); const node = await CultMesh.createNode(storePath, { documents: [ snapshotDefinition, @@ -918,6 +930,7 @@ async function writeCultMeshPublication(snapshot, eveState, storePath, allowStor transportProfileDefinition, commandBoundaryDefinition, swarmControlDefinition, + swarmOperatorViewDefinition, ], }); const providerCatalog = loadProviderAdvertisementCatalog(snapshot); @@ -1495,65 +1508,34 @@ function buildEveProviderState(snapshot) { layout: { gap: 8 }, }, [ eveNode("voidbot-state", "pane", { title: "State Detail", density: "compact" }, selectedLeaf ? [ - eveNode("state-path", "text", { role: "mono", text: selectedLeaf.path ?? "state path" }), - eveNode("state-preview", "text", { role: "mono", text: compactText(selectedLeaf.detail ?? selectedLeaf.preview ?? "", 520) }), + eveNode("state-path", "text", { role: "mono", text: selectedLeaf.path ?? "state path", stateBindings: [operatorBinding("text", "selectedFace.statePath")] }), + eveNode("state-preview", "text", { role: "mono", text: compactText(selectedLeaf.detail ?? selectedLeaf.preview ?? "", 520), stateBindings: [operatorBinding("text", "selectedFace.statePreview")] }), ] : [ - eveNode("state-empty", "text", { text: selected?.faceState?.error ?? "No readable Face state leaf." }), + eveNode("state-empty", "text", { text: selected?.faceState?.error ?? "No readable Face state leaf.", stateBindings: [operatorBinding("text", "selectedFace.statePreview")] }), ]), eveNode("voidbot-watchdog-pane", "pane", { title: "Operations", density: "compact" }, [ eveNode("watchdog-summary", "text", { role: "mono", text: `orchestrator ${orchestrator.state ?? "unknown"} organs ${organs.length}\nmesh ${snapshot.cultMesh?.writeStatus ?? "pending"} ${shortIso(snapshot.cultMesh?.writtenAt ?? snapshot.generatedAt)}`, + stateBindings: [operatorBinding("text", "operations.summary")], }), - eveBar("watchdog", "Watchdog", watchdog?.lastStatus ?? "missing", statusFill(watchdog?.lastStatus)), - eveBar("repo-face-organ", "Faces", repoFaceOrgan?.lastStatus ?? "missing", statusFill(repoFaceOrgan?.lastStatus)), - eveBar("swarm-surface-organ", "Eve surface", swarmSurfaceOrgan?.lastStatus ?? "missing", statusFill(swarmSurfaceOrgan?.lastStatus)), - ...organs - .slice() - .sort((left, right) => String(left.id ?? "").localeCompare(String(right.id ?? ""))) - .slice(0, 5) - .map((organ) => eveNode(`watchdog-organ-${stableId(organ.id)}`, "text", { - role: "caption", - text: `${organ.label ?? organ.id ?? "organ"}: ${organ.lastStatus ?? "unknown"} / exit ${organ.lastExitCode ?? "?"}`, - })), + eveNode("operations-items", "list", { items: [], stateBindings: [operatorBinding("items", "operations.items")] }), + ]), + eveNode("voidbot-pressure-pane", "pane", { title: "Pressure", density: "compact" }, [ + eveNode("pressure-items", "list", { items: [], stateBindings: [operatorBinding("items", "pressure")] }), ]), - eveNode("voidbot-pressure-pane", "pane", { title: "Pressure", density: "compact" }, highPressureFaces.map((face, index) => - eveNode(`pressure-face-${index}-${stableId(face.identityId)}`, "text", { - role: "mono", - text: `${String(index + 1).padStart(2, " ")} ${String(face.displayName ?? face.identityId ?? "face").padEnd(14, " ")} mem ${String(faceMemoryCount(face)).padStart(2, " ")} prs ${String(facePressureCount(face)).padStart(2, " ")} heat ${formatNumber(face.heat, 2)} q ${face.queuedCount ?? 0}`, - }), - )), eveNode("pending-mentions-pane", "pane", { title: "Mentions + Events", density: "compact" }, [ - ...(pendingMentions.length - ? pendingMentions.slice(0, 4).map((mention, index) => eveNode(`pending-mention-${index}`, "text", { - role: "mono", - text: `${mention.identityId ?? "face"} / ${shortIso(mention.createdAt)}\n${compactText(mention.prompt ?? "", 150)}`, - })) - : [eveNode("pending-mentions-empty", "text", { text: mentionEmptyText(summary, recentMentionActivity) })]), - ...recentMentionActivity.slice(0, 5).map((activity, index) => - eveNode(`recent-mention-activity-${index}`, "text", { - role: "mono", - text: mentionActivityText(activity), - }), - ), - ...recentEvents.slice(0, 4).map((event, index) => - eveNode(`recent-event-${index}`, "text", { - role: "mono", - text: `${event.type ?? "event"} ${event.identityId ?? ""} ${shortIso(event.observedAt)}\n${compactText(event.reason ?? event.statusPath ?? "", 120)}`, - }), - ), + eveNode("pending-mention-items", "list", { items: [], stateBindings: [operatorBinding("items", "mentions")] }), + eveNode("recent-event-items", "list", { items: [], stateBindings: [operatorBinding("items", "recentEvents")] }), ]), ]), eveNode("voidbot-context", "grid", { columns: "minmax(0, 1fr)", layout: { gap: 8, overflowX: "hidden" }, }, [ - eveNode("selected-channels", "pane", { title: "Channels", density: "compact" }, (selected?.channelPermissions ?? []).slice(0, 8).map((channel, index) => - eveNode(`selected-channel-${index}`, "text", { - role: "mono", - text: `${channel.label ?? "channel"} x${formatNumber(channel.speedMultiplier ?? 1, 2)} ${channel.speechThreshold ?? "threshold"}\n${channel.topic ?? "no topic"}`, - }), - )), + eveNode("selected-channels", "pane", { title: "Channels", density: "compact" }, [ + eveNode("selected-channel-items", "list", { items: [], stateBindings: [operatorBinding("items", "selectedFace.channels")] }), + ]), ]), ]), assets: participants diff --git a/scripts/voidbot-swarm-operator-view.cjs b/scripts/voidbot-swarm-operator-view.cjs index efed4c1..9b934b1 100644 --- a/scripts/voidbot-swarm-operator-view.cjs +++ b/scripts/voidbot-swarm-operator-view.cjs @@ -25,7 +25,13 @@ function projectSwarmOperatorView({ heartbeat, orchestrator, pause, control, obs pressureCount: array(participant?.responsePressureEvidence).length, description: text(participant?.description), statePath: text(participant?.statePath) || text(participant?.faceStatePath), - statePreview: participant?.statePreview ?? null, + statePreview: preview(participant?.statePreview), + channels: array(participant?.channelPermissions).slice(0, 8).map((channel) => ({ + label: text(channel?.label) || text(channel?.channelName) || "channel", + speedMultiplier: number(channel?.speedMultiplier) ?? 1, + speechThreshold: text(channel?.speechThreshold) || "threshold", + topic: text(channel?.topic) || "no topic", + })), pendingMentionCount, }; }); @@ -102,7 +108,46 @@ function projectSwarmOperatorView({ heartbeat, orchestrator, pause, control, obs description: selected.description, statePath: selected.statePath, statePreview: selected.statePreview, + channels: selected.channels.map((channel) => ({ + label: channel.label, + status: `${channel.speechThreshold} / x${channel.speedMultiplier}`, + detail: channel.topic, + })), } : null, + operations: { + summary: `organs ${organs.length} / ${deriveOrchestratorState(organs, orchestratorReadable)}`, + items: organs + .sort((left, right) => left.id.localeCompare(right.id)) + .map((organ) => ({ + label: organ.label, + status: organ.status, + detail: compact([ + organ.lastFinishedAt ? `finished ${organ.lastFinishedAt}` : null, + organ.durationSeconds === null ? null : `${organ.durationSeconds}s`, + ]).join(" / "), + })), + }, + pressure: [...participants] + .sort((left, right) => right.pressureCount - left.pressureCount || right.memoryCount - left.memoryCount || left.displayName.localeCompare(right.displayName)) + .slice(0, 6) + .map((participant) => ({ + label: participant.displayName, + status: `pressure ${participant.pressureCount}`, + detail: `memory ${participant.memoryCount} / heat ${participant.heat ?? "?"}`, + })), + mentions: array(heartbeat?.pendingMentions).slice(0, 6).map((mention) => ({ + label: text(mention?.identityId) || "face", + status: "pending", + detail: compact([text(mention?.createdAt) || text(mention?.queuedAt), text(mention?.prompt)]).join(" / "), + })), + recentEvents: array(heartbeat?.history).slice(-8).reverse().map((event) => ({ + label: text(event?.type) || "event", + status: text(event?.identityId) || "swarm", + detail: compact([ + text(event?.observedAt) || text(event?.queuedAt) || text(event?.consumedAt) || text(event?.appliedAt), + text(event?.reason) || text(event?.statusPath), + ]).join(" / "), + })), }; } @@ -205,11 +250,20 @@ function buildAlerts({ sources, organs }) { function array(value) { return Array.isArray(value) ? value : []; } function object(value) { return value && typeof value === "object" && !Array.isArray(value) ? value : {}; } function text(value) { return typeof value === "string" && value.trim() ? value : null; } -function number(value) { const parsed = Number(value); return Number.isFinite(parsed) ? parsed : null; } +function number(value) { + if (value === null || value === undefined || value === "") return null; + const parsed = Number(value); + return Number.isFinite(parsed) ? parsed : null; +} function subtract(left, right) { return left === null || right === null ? null : Math.round((left - right) * 1000) / 1000; } function nullableOrder(left, right) { return left === null ? 1 : right === null ? -1 : left - right; } function compact(values) { return values.filter((value) => value !== null); } function formatTurnDistance(value) { return value === null ? "unscheduled" : value <= 0 ? "ready now" : `turn in ${value}m`; } +function preview(value) { + if (value === null || value === undefined) return null; + if (typeof value === "string") return value; + try { return JSON.stringify(value); } catch { return String(value); } +} module.exports = { RECORD_KEY, diff --git a/scripts/voidbot-swarm-operator-view.test.cjs b/scripts/voidbot-swarm-operator-view.test.cjs index 9fa927a..2c2ebbc 100644 --- a/scripts/voidbot-swarm-operator-view.test.cjs +++ b/scripts/voidbot-swarm-operator-view.test.cjs @@ -13,9 +13,10 @@ test("projects bounded operator state and lets control own heat", () => { globalHeat: 0.5, initiativeClock: 12, lastTickAt: "2026-07-15T10:00:00.000Z", - pendingMentions: [{ identityId: "eve" }], + pendingMentions: [{ identityId: "eve", prompt: "status?", createdAt: "2026-07-15T09:59:00.000Z" }], + history: [{ type: "queued", identityId: "odin", queuedAt: "2026-07-15T09:58:00.000Z" }], participants: [ - { identityId: "eve", displayName: "Eve", status: "active", nextTurnInMinutes: 3, heat: 1.2 }, + { identityId: "eve", displayName: "Eve", status: "active", nextTurnInMinutes: 3, heat: 1.2, memories: ["one"], responsePressureEvidence: ["signal"], statePath: "face.eve", statePreview: { claim: "awake" }, channelPermissions: [{ label: "general", speedMultiplier: 1.5, speechThreshold: "low", topic: "room" }] }, { identityId: "odin", displayName: "Odin", status: "active", activeJobId: "job-1", nextTurnInMinutes: 8 }, ], }, @@ -32,7 +33,12 @@ test("projects bounded operator state and lets control own heat", () => { assert.equal(view.summary.nextIdentityId, "eve"); assert.equal(view.queue[0].heat, 0.85); assert.equal(view.selectedFace.identityId, "eve"); - assert.equal(view.recentEvents, undefined); + assert.equal(view.selectedFace.statePreview, '{"claim":"awake"}'); + assert.deepEqual(view.selectedFace.channels, [{ label: "general", status: "low / x1.5", detail: "room" }]); + assert.equal(view.operations.items[0].label, "Heartbeat"); + assert.equal(view.pressure[0].label, "Eve"); + assert.equal(view.mentions[0].status, "pending"); + assert.equal(view.recentEvents[0].label, "queued"); }); test("publication exposes the typed record without dashboard-shaped authority", () => { diff --git a/scripts/voidbot-swarm-structured-surface.test.mjs b/scripts/voidbot-swarm-structured-surface.test.mjs index 368f34f..af4cf5e 100644 --- a/scripts/voidbot-swarm-structured-surface.test.mjs +++ b/scripts/voidbot-swarm-structured-surface.test.mjs @@ -11,6 +11,11 @@ test("the operator surface is composed from metrics and typed lists", () => { "metric-route-provider", "route-alerts", "metric-swarm-brake", + "operations-items", + "pressure-items", + "pending-mention-items", + "recent-event-items", + "selected-channel-items", ]) assert.match(source, new RegExp(`\\b${componentId}\\b`)); assert.match(source, /sourceId: "voidbot\.swarm_operator_view:voidbot-swarm"/); @@ -23,5 +28,9 @@ test("the migrated prose authorities cannot reappear in the surface", () => { "route-summary", "swarm-pause-status", "live-queue-empty", + "watchdog-organ-", + "pressure-face-", + "pending-mention-0", + "recent-event-0", ]) assert.doesNotMatch(source, new RegExp(`\\b${removedId}\\b`)); }); diff --git a/state/evidence.jsonl b/state/evidence.jsonl index b2d172a..d3df7be 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -406,3 +406,4 @@ {"ts":"2026-07-15T22:51:46Z","type":"verification","status":"ok","note":"Idunn live-path audit found /srv/odin/deploy-manifests/voidbot was the invoked actuator while /usr/local/sbin was only an unused copy. gamecult-ops now installs both from one source and runs all build-repository Git operations as idunn; live manifest hashes match and Git ownership was repaired."} {"ts":"2026-07-15T23:12:25Z","type":"repair","status":"ok","note":"Repaired the production Starfire Chrome -> Yggdrasil Hermodr -> VoidBot path. Hermodr now serves 10.77.0.1:8798 over WireGuard, accepts authenticated retained provider publications on Ygg loopback 17874, discovers through Odin 17871, and routes commands to VoidBot 17873. Starfire observed health/catalog/surface, live SSE projected globalHeat 0.05, and a browser-shaped swarm.set_heat command returned a reconciled VoidBot-owned receipt."} {"ts":"2026-07-15T23:03:20Z","type":"operations","status":"ok","note":"Reduced live swarm global heat to the minimum accepted 0.05 after one-minute Persona traffic burned tokens. Two following resident scheduler ticks selected and queued nobody. The daemon may pulse every minute; speech must remain initiative/rest gated rather than equated with the pulse."} +{"ts":"2026-07-15T23:17:32Z","type":"implementation","status":"ok","note":"Completed the swarm Eve live-state authority migration: voidbot.swarm_operator_view.v1 now owns summary, queue, selected Face/state/channels, operations, pressure, mentions/events, and route projections; Eve binds them as typed props instead of recomputing browser-visible facts from a generation snapshot. The renderer also registers the retained operator-view schema when reopening the shared CultCache store. Focused tests, TypeScript build, and isolated render/store smoke passed."} diff --git a/state/map.yaml b/state/map.yaml index d46c537..0e8e504 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -209,6 +209,7 @@ accepted_design: - VoidBot's Verse contract is documented in `docs/architecture/voidbot-verse-service-contract.md`: durable agent/service state should be typed CultCache `.cc` or have a `.cc` witness/export; `voidbot.swarm` currently publishes through `cultmesh://voidbot.local/eve/providers/voidbot.swarm`; target Eve surfaces are `voidbot.discord`, `voidbot.reddit`, `voidbot.archive`, `voidbot.source`, `voidbot.repo_face`, and `voidbot.swarm`; static/browser dashboard output is only a lowering, not authority. - The `voidbot.swarm` CultMesh store at `.voidbot/status/cultmesh/voidbot-swarm-state.cc` is derived provider state. If duplicate global documents corrupt it, archive the bad store and regenerate from `scripts/render-voidbot-swarm-dashboard.mjs`; do not treat the broken generated store as canonical truth. - Eve v2 live state has one owner path. CultLib dev supplies typed live-publication handles, authenticated retained provider sessions, reconnect evidence, and application receipts (`ebd8c78c`, `d4934233`, `8965f3c0`). Eve resolves component `stateBindings` and owns subscription teardown/rebind without receipt DOM writes (`85b0139`, `522df00`). Hermodr ingests provider sessions and emits ordered snapshot/update/stale/reconnected events without polling (`5cb819e`, `561e320`). VoidBot publishes accepted heat as typed control state and binds both visible heat components to it (`060da23`, `3d86b93`). Live-fire proved initial, provider-driven, and browser-command updates converge through that one path. + - `voidbot.swarm_operator_view.v1` is the live authority for swarm summary, queue, selected Face detail/channels, operations, pressure, pending mentions, recent events, and route state. Eve binds those values as text/list props; the composition renderer no longer computes those browser-visible facts from its generation snapshot. The static HTML artifact may still lower a snapshot for debugging, but it cannot own live browser state. - The production Eve browser nerve is Starfire Chrome -> `http://10.77.0.1:8798` -> Hermodr on Yggdrasil -> Odin discovery and provider-owned VoidBot RUDP on Yggdrasil. Hermodr's browser listener is WireGuard-only, its authenticated retained-publication ingress is host-loopback `127.0.0.1:17874`, and VoidBot remains the state/command owner at `127.0.0.1:17873`. Starfire owns no Hermodr, Odin, or VoidBot deployment body. - Long-running work should expose durable logs or status files instead of relying on one attached session and hope. - Persistent project memory must stay ruthlessly distilled; git history and artifacts carry routine proof. @@ -277,4 +278,4 @@ rejected_paths: current_status: summary: VoidBot's bot/worker/provider/RAG/Postgres/Qdrant/CultCache structure is live. Repo Face/persona heartbeat jobs run through the direct `openai_api` provider configured for MiMo `mimo-v2.5-pro`, with the expensive state-projector pass still disabled. The 2026-07-04 transport repair replaced the old Bifrost HTTP/token bridge shortcut with typed Bifrost CultMesh Discord command and receipt documents advertised in the Bifrost provider store at `cultmesh://asgard.starfire.bifrost/commands/discord-post`. VoidBot stores the Bifrost target as a CultMesh URI, writes command docs to `E:/Projects/Bifrost/.bifrost/provider-store.cc`, optionally pumps Bifrost's command processor, and waits for typed receipts before completing repo Face Discord delivery. Bifrost's provider advertisement exposes `discord.post` command metadata for Odin/Eve agents, and a bounded Weksa live-fire completed visibly. Eve live state now runs end to end through CultLib dev retained publications, Hermodr ordered SSE, Eve component bindings, and VoidBot typed control state. Receipts acknowledge intent only. Heat initial load, provider-driven change, and browser-command change were visibly verified without reload through the same subscription. - next_action: Migrate the remaining swarm status, queue, Face, and operations components from baked surface props to provider-owned typed documents and Eve stateBindings. Reuse the proven retained-publication path; do not restore receipt-driven DOM mutation or whole-surface polling. + next_action: Move the Persona scheduler state-store port from the tolerated whole-file JSON persistence shape to one typed CultCache `.cc` document without reopening initiative ownership. Preserve explicit missing/malformed/migration witnesses and atomic durable commits; the engine remains the only state writer.