diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts index 9969e81..600499c 100644 --- a/apps/worker/src/index.ts +++ b/apps/worker/src/index.ts @@ -47,6 +47,7 @@ const REPO_IDENTITY_POST_SENTINEL = "VOIDBOT_REPO_IDENTITY_POST:"; const REPO_IDENTITY_ARTICLE_SENTINEL = "VOIDBOT_REPO_IDENTITY_ARTICLE:"; const REPO_IDENTITY_PROPOSAL_PR_SENTINEL = "VOIDBOT_REPO_IDENTITY_PROPOSAL_PR:"; const REPO_IDENTITY_PR_COMMENT_SENTINEL = "VOIDBOT_REPO_IDENTITY_PR_COMMENT:"; +const REPO_IDENTITY_UPDATE_REQUEST_SENTINEL = "VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST:"; const embedder = createTextEmbedder({ backend: config.ragEmbeddingBackend, @@ -335,6 +336,7 @@ async function processJob(job: JobRecord): Promise { if (job.command === "repo-face-rumination") { const repoIdentityPosts = parseRepoIdentityPostIntents(finalResponse); + const repoIdentityUpdateRequests = parseRepoIdentityUpdateRequestIntents(finalResponse); const repoIdentityArticles = config.repoFaceGithubActionsEnabled ? parseRepoIdentityArticleIntents(finalResponse) : []; @@ -351,14 +353,18 @@ async function processJob(job: JobRecord): Promise { const prCommentSubmitted = !proposalPrSubmitted && repoIdentityPrComments.length > 0; const articlePrSubmitted = !proposalPrSubmitted && !prCommentSubmitted && repoIdentityArticles.length > 0; + const updateRequestSubmitted = + !proposalPrSubmitted && !prCommentSubmitted && !articlePrSubmitted && repoIdentityUpdateRequests.length > 0; if (repoIdentityProposals.length > 0) { await writeRepoIdentityProposalPrIntent(job, repoIdentityProposals[0]); } else if (repoIdentityPrComments.length > 0) { await commentRepoIdentityPullRequestIntent(job, repoIdentityPrComments[0]); } else if (repoIdentityArticles.length > 0) { await writeRepoIdentityArticleIntent(job, repoIdentityArticles[0]); + } else if (repoIdentityUpdateRequests.length > 0) { + await enqueueRepoIdentityUpdateRequestIntent(job, repoIdentityUpdateRequests[0]); } - if (!proposalPrSubmitted && !prCommentSubmitted && !articlePrSubmitted) { + if (!proposalPrSubmitted && !prCommentSubmitted && !articlePrSubmitted && !updateRequestSubmitted) { for (const post of repoIdentityPosts.slice(0, 1)) { await postRepoIdentityIntent(job, post); } @@ -377,10 +383,12 @@ async function processJob(job: JobRecord): Promise { repoIdentityPosts.length > 0 || proposalPrSubmitted || prCommentSubmitted || - articlePrSubmitted, + articlePrSubmitted || + updateRequestSubmitted, articlePrSubmitted, proposalPrSubmitted, prCommentSubmitted, + updateRequestSubmitted, ignoredGithubActionIntents, reason: proposalPrSubmitted @@ -389,6 +397,8 @@ async function processJob(job: JobRecord): Promise { ? "repo_face_rumination_commented_on_pr_as_registered_identity" : articlePrSubmitted ? "repo_face_rumination_submitted_registered_identity_article_pr" + : updateRequestSubmitted + ? "repo_face_rumination_enqueued_bifrost_update_request" : repoIdentityPosts.length > 0 ? "repo_face_rumination_posted_as_registered_identity" : `${job.command}_private_summary`, @@ -591,6 +601,16 @@ interface RepoIdentityPrCommentIntent { replyToMessageId?: string; } +interface RepoIdentityUpdateRequestIntent { + identity?: string; + title: string; + content: string; + priority?: number; + sourceMessageIds: string[]; + channelId?: string; + replyToMessageId?: string; +} + interface BifrostBridgeReceipt { action?: string; ok?: boolean; @@ -600,6 +620,15 @@ interface BifrostBridgeReceipt { transport?: "bot" | "webhook"; } +interface BifrostUpdateRequestReceipt { + id: string; + status: "queued" | "claimed" | "completed" | "cancelled"; + title: string; + targetRepoName: string; + targetAgentIdentity?: string; + priority: number; +} + async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIntent): Promise { if (!config.botToken) { throw new Error("DISCORD_BOT_TOKEN is required for Bifrost to post repo identity responses."); @@ -857,6 +886,56 @@ async function commentRepoIdentityPullRequestIntent( }); } +async function enqueueRepoIdentityUpdateRequestIntent( + job: JobRecord, + intent: RepoIdentityUpdateRequestIntent, +): Promise { + const identityId = intent.identity ?? parseRepoIdentityIdFromPrompt(job.prompt); + if (!identityId) { + throw new Error(`Could not resolve repo identity for Bifrost update request intent on job ${job.id}.`); + } + + const registry = await loadRepoDiscordIdentityRegistry(config.repoDiscordIdentitiesPath); + const identity = findRepoDiscordIdentity(registry, identityId); + if (!identity) { + throw new Error(`No registered repo identity matched "${identityId}" for update request intent on job ${job.id}.`); + } + + const contentFile = await writeBifrostPayloadFile( + job, + `${identity.id}-bifrost-update-request.md`, + ensureTrailingNewline(renderRepoIdentityUpdateRequestMarkdown(identity, intent)), + ); + const sourceMessageIds = Array.from(new Set([ + ...intent.sourceMessageIds, + intent.replyToMessageId, + ].filter((value): value is string => typeof value === "string" && value.trim().length > 0))); + const request = runBifrostAgentTransport([ + "enqueue", + "--repo", + identity.repoName, + "--agent", + identity.id, + "--title", + intent.title, + "--request-file", + contentFile, + "--priority", + String(normalizeBifrostPriority(intent.priority)), + "--source-kind", + "repo_face_heartbeat", + "--packet-path", + contentFile, + "--created-by", + identity.id, + ...(intent.channelId ?? job.outputChannelId ? ["--source-channel-id", intent.channelId ?? job.outputChannelId] : []), + ...(sourceMessageIds.length > 0 ? ["--source-message-ids", sourceMessageIds.join(",")] : []), + ]); + console.log( + `Enqueued Bifrost update request ${request.id} for ${identity.id}/${identity.repoName} from job ${job.id}.`, + ); +} + async function writeBifrostPayloadFile(job: JobRecord, fileName: string, content: string): Promise { const directory = resolve(config.storageRoot, "artifacts", job.id, "bifrost-bridge"); await mkdir(directory, { recursive: true }); @@ -865,6 +944,25 @@ async function writeBifrostPayloadFile(job: JobRecord, fileName: string, content return path; } +function runBifrostAgentTransport(args: string[]): BifrostUpdateRequestReceipt { + const transportScript = resolve(config.bifrostRoot, "tools", "agent-transport.mjs"); + const result = spawnSync(process.execPath, [transportScript, ...args], { + cwd: config.bifrostRoot, + encoding: "utf8", + windowsHide: true, + }); + + if (result.status !== 0) { + throw new Error(`Bifrost agent transport failed: ${result.stderr || result.stdout}`); + } + + try { + return JSON.parse(result.stdout) as BifrostUpdateRequestReceipt; + } catch { + throw new Error(`Bifrost agent transport returned non-JSON output: ${result.stdout}`); + } +} + function runBifrostBridge(args: string[]): BifrostBridgeReceipt { const bridgeScript = resolve(config.bifrostRoot, "tools", "bifrost-bridge.mjs"); const result = spawnSync("node", [bridgeScript, ...args], { @@ -884,6 +982,43 @@ function runBifrostBridge(args: string[]): BifrostBridgeReceipt { } } +function parseRepoIdentityUpdateRequestIntents(finalResponse: string): RepoIdentityUpdateRequestIntent[] { + const intents: RepoIdentityUpdateRequestIntent[] = []; + + for (const line of finalResponse.split(/\r?\n/)) { + const trimmed = line.trim(); + if (!trimmed.startsWith(REPO_IDENTITY_UPDATE_REQUEST_SENTINEL)) { + continue; + } + + const payload = trimmed.slice(REPO_IDENTITY_UPDATE_REQUEST_SENTINEL.length).trim(); + try { + const parsed = JSON.parse(payload) as Record; + const title = typeof parsed.title === "string" ? parsed.title.trim() : ""; + const content = typeof parsed.content === "string" ? parsed.content.trim() : ""; + if (!title || !content) { + continue; + } + intents.push({ + identity: typeof parsed.identity === "string" ? parsed.identity.trim() : undefined, + title, + content, + priority: typeof parsed.priority === "number" ? parsed.priority : undefined, + sourceMessageIds: Array.isArray(parsed.sourceMessageIds) + ? parsed.sourceMessageIds.filter((entry): entry is string => typeof entry === "string") + : [], + channelId: typeof parsed.channelId === "string" ? parsed.channelId.trim() : undefined, + replyToMessageId: + typeof parsed.replyToMessageId === "string" ? parsed.replyToMessageId.trim() : undefined, + }); + } catch { + continue; + } + } + + return intents; +} + function parseRepoIdentityArticleIntents(finalResponse: string): RepoIdentityArticleIntent[] { const intents: RepoIdentityArticleIntent[] = []; @@ -1005,6 +1140,34 @@ function countRepoIdentityGithubActionIntents(finalResponse: string): number { return count; } +function renderRepoIdentityUpdateRequestMarkdown( + identity: { id: string; displayName: string; repoName: string }, + intent: RepoIdentityUpdateRequestIntent, +): string { + return [ + "# Repo Face Update Request", + "", + `Source Face: ${identity.displayName} (${identity.id})`, + `Target repo: ${identity.repoName}`, + "", + "## Request", + "", + intent.content.trim(), + "", + "## Instructions For Codex", + "", + "Work this request in the target workspace. Prefer a small coherent change, proposal, doc, or test-backed patch. If the request is not actionable enough, write down the smallest missing question instead of silently dropping it.", + "", + ].join("\n"); +} + +function normalizeBifrostPriority(value: number | undefined): number { + if (typeof value !== "number" || !Number.isFinite(value)) { + return 80; + } + return Math.max(1, Math.min(100, Math.round(value))); +} + function resolveRepoRoot(identity: { repoName: string; repoPath?: string }): string { if (identity.repoPath && identity.repoPath.trim().length > 0) { return resolve(identity.repoPath); @@ -1048,6 +1211,7 @@ function stripRepoIdentityPostIntents(finalResponse: string): string { const trimmed = line.trim(); return ( !trimmed.startsWith(REPO_IDENTITY_POST_SENTINEL) && + !trimmed.startsWith(REPO_IDENTITY_UPDATE_REQUEST_SENTINEL) && !trimmed.startsWith(REPO_IDENTITY_ARTICLE_SENTINEL) && !trimmed.startsWith(REPO_IDENTITY_PROPOSAL_PR_SENTINEL) && !trimmed.startsWith(REPO_IDENTITY_PR_COMMENT_SENTINEL) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index f8d68dd..36efb28 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -120,6 +120,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - Repo Face identity is now seeded into the typed `.cc` self profile during initialization and passed through repo Face MCP state reads/writes. The renderer may still provide identity context, but raw state should not quietly say `Void` for a non-Void Face. - Repo Face prompts now also grant advisory repo-change agency: Faces may build long-running maps of their repos and propose concrete changes, but Discord jobs stay read-only and must ask for human consensus before implementation changes canonical repo material. Once a proposal is concrete enough to review, it belongs on GitHub as a draft PR; Discord is for announcing and arguing around that artifact, not replacing it. - Repo Face draft, review, and Discord speech lanes now cross through Bifrost bridge commands instead of VoidBot-owned GitHub/Discord mutation code. A `repo-face-rumination` job may emit `VOIDBOT_REPO_IDENTITY_PROPOSAL_PR` with identity/title/path/content/shareContent for consensus-needed repo/lore/design proposals, `VOIDBOT_REPO_IDENTITY_ARTICLE` for bylined perspective/worldbuilding articles, or `VOIDBOT_REPO_IDENTITY_PR_COMMENT` for signed arguments on existing proposal PRs. The worker validates the registered identity and records Face-local receipts, then calls `BIFROST_ROOT/tools/bifrost-bridge.mjs` for draft PR creation, PR comments, and persona Discord posts. Bifrost owns this because it is GameCult's governance/labor platform and public-process bridge, not because it is a convenient script bucket: governed crossings include GitHub proposal/review surfaces, Discord-native work/member/swarm interactions, dispatch receipts, CultNet/CultCache intake, and future collaboration interfaces. Heimdall remains the OAuth/account/capability gate. A Face calling something the next cut/pass should usually turn it into that artifact directly when enough material exists. +- Repo Face heartbeats now have an immediate owner-approval rail into Bifrost intake. A Face may emit `VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST` only for its own jurisdiction; the worker validates the registered identity and writes the packet into Bifrost agent transport so Bifrost dispatch can open the Codex turn. This unblocks live Face-approved work without waiting for the slow inspector. It is not the final governance discussion model: feature requests and agent opinions should become first-class Bifrost topic/comment records, with dispatch triggered only after Bifrost detects consensus and the owning Face approves the crossing. - First role-addressed chat also initializes the target repo's local `.voidbot` home. `ensureRepoFaceInitialized` resolves `repoPath` from the registry, `SOURCE_REPO_ROOT`, or `E:/Projects/`, creates `voice/`, `state/`, `birth/`, and `logs/`, writes `voice/identity.json`, then starts `scripts/run-repo-face-birth.mjs` detached. That worker runs EpiphanyAgent's `epiphany-repo-personality scout` and `epiphany-repo-birth-runner` so newborn personality/memory/trajectory packets come from repo contents and git history. Status and logs live in the target repo under `.voidbot/birth/voidbot-face-birth.json` and `.voidbot/logs/voidbot-face-birth.log`. - Agent heartbeats now use one CTB/Final-Fantasy-X-style initiative queue. `scripts/run-repo-face-heartbeats.ts` still has its old filename, but it now reconciles built-in system agents plus registered repo Faces, stores the roster at `REPO_FACE_HEARTBEAT_STATE_PATH`, advances virtual initiative time independently of wall-clock due dates, and dispatches selected turns. Repo Faces queue normal `repo-face-rumination` jobs; built-in `void` starts the existing moderation rumination runner as its turn. Active jobs/locks freeze initiative: recovery starts only after the owner-Codex job or Void moderation lock clears, and completion cannot grant another turn in the same pulse. `GameCult Local Orchestrator` is the live hidden local scheduled task that ticks the scheduler; `npm run state:install-repo-face-heartbeat-task` remains an isolation/backcompat installer, not the normal pulse owner. Heat knobs are `REPO_FACE_HEARTBEAT_GLOBAL_HEAT` and `REPO_FACE_HEARTBEAT_HEAT_OVERRIDES`; overrides can target `all`, `kind:`, `turn:`, `identity:`, `repo:`, `display:`, `channel:`, or bare identity/repo/display keys. Repo Face prompts now include a jurisdiction-dive cadence so unattended heartbeats periodically inspect repo/history terrain with source tools and convert real findings into state, proposals, essay seeds, agency pressure, or speech. - Repo Face rest projection now persists normalized sleep cycles back into each Face `.cc` state during heartbeat loading. Missed nap windows are treated as already missed/completed and rolled forward instead of starting a fresh nap at inspection time. This fixes the Aqua/Mimir/Epiphany failure mode where stale `nextNapStartsAt` values stayed raw, fresh projections repeatedly marked them as napping, and ready selection skipped them forever while their initiative was overdue. diff --git a/notes/voidbot-current-system-map.md b/notes/voidbot-current-system-map.md index 9fb88fc..49611f5 100644 --- a/notes/voidbot-current-system-map.md +++ b/notes/voidbot-current-system-map.md @@ -167,6 +167,7 @@ This note is the source-grounded description of how the live VoidBot stack is sh - `scripts/run-repo-face-birth.mjs` is the observable bridge into EpiphanyAgent's newborn path. It runs `epiphany-repo-personality scout --root ` to gather terrain/history, then runs `epiphany-repo-birth-runner` with repo-local state stores. The default mode is `plan`, so first chat creates reviewable birth artifacts without auto-accepting hidden personality mutations. - Role mentions and display-name-prefix mentions append pending Face obligations to `pendingMentions` in `REPO_FACE_HEARTBEAT_STATE_PATH`; ordinary bot mentions and DMs append pending obligations for the built-in `void` participant. They no longer create direct provider jobs from `MessageCreate`. The CTB scheduler temporarily prioritizes agents with pending mentions, attaches those prompts plus reply targets to the next `repo-face-rumination` or Void moderation pass, and consumes the pending items only after a turn is actually queued. Rumination jobs remain private unless they explicitly emit the registered-identity post sentinel or a typed candidate intervention; the worker must never auto-post their summaries as the base bot. Heartbeat prompts now include the channel permission plan, recent context from non-primary permitted channels, social embodiment, jurisdiction respect, comedy/improv doctrine, and anti-template sampling guidance so a Face can jump into domain chatter, form durable social reads, consult the right steward, and answer people without copying nearby note formulas. - Repo Face proposal/article PRs, PR comments, and registered-identity Discord posts now cross through Bifrost bridge commands. The child may emit `VOIDBOT_REPO_IDENTITY_PROPOSAL_PR` for consensus-needed repo/lore/design proposals, `VOIDBOT_REPO_IDENTITY_ARTICLE` for bylined essays, or `VOIDBOT_REPO_IDENTITY_PR_COMMENT` for signed arguments on existing proposal PRs. The worker validates the registered identity and records Face-local receipts, but `BIFROST_ROOT/tools/bifrost-bridge.mjs` owns draft PR creation, PR comments, and Discord persona posting. This is not merely helper placement: Bifrost's original governance/labor platform role makes it the owner of governed public crossings for GameCult work, including GitHub, Discord-native work/member/swarm interactions, dispatch receipts, CultNet/CultCache intake, and future collaboration interfaces. Heimdall is the OAuth/account/capability gate; Bifrost is the bridge/request/routing/receipt authority. VoidBot still owns room cognition, moderation judgment, archive/source retrieval, and Face personality; Bifrost owns Discord when Discord acts as the Labor Platform interface or swarm transport. If Nibu or another Face frames something as the next cut/pass and enough source or room material exists, the expected action is to draft the artifact, submit the PR, and announce it rather than continuing to nag the room. + - Repo Face heartbeats also have an immediate Bifrost update-request sentinel for owner-approved Codex dispatch. The child may emit `VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST` only for work inside its own jurisdiction; the worker validates the identity and enqueues a Bifrost agent-transport packet. This unblocks live requests from the owning Face, but it is not the final governance model. The intended Bifrost-owned model is topic/comment/consensus first: feature requests and agent opinions should accumulate on canonical Bifrost topic threads, then Bifrost dispatches only after consensus and the jurisdiction Face's approval. - `scripts/run-repo-face-heartbeats.ts` now acts as the broader agent CTB/Final-Fantasy-X-style initiative scheduler. The wall-clock task is only a pulse; virtual initiative time chooses who gets the next turn. The scheduler stores per-agent speed, reaction bias, load, groups, heat, effective speed, next-turn time, active turn markers, and recent queue history at `REPO_FACE_HEARTBEAT_STATE_PATH`. Repo Faces queue `repo-face-rumination` owner-Codex jobs; built-in Void currently participates as the `void` system agent and starts the existing moderation rumination runner as its turn. Initiative freezes while an owner-Codex job or Void moderation lock is active; recovery is scheduled only after that active turn completes, and completion cannot grant another turn in the same scheduler pulse. Above-baseline heat bypasses repo Face nap gating, while active-turn freeze still prevents overlapping thoughts. - The live wall-clock pulse for this scheduler is `scripts/run-gamecult-orchestrator.ps1`, installed as `GameCult Local Orchestrator`. `scripts/install-repo-face-heartbeat-task.ps1` remains available for isolated testing, but its per-organ scheduled task should stay disabled in normal operation. Turn frequency is controlled by `REPO_FACE_HEARTBEAT_BASE_RECOVERY_MINUTES`, `REPO_FACE_HEARTBEAT_GLOBAL_HEAT`, `REPO_FACE_HEARTBEAT_SPEED_OVERRIDES`, and `REPO_FACE_HEARTBEAT_HEAT_OVERRIDES`. Heat keys can target `all`, `kind:`, `turn:`, `identity:`, `repo:`, `display:`, `channel:`, or the bare identity/repo/display key. - The local ignored registry currently includes Nibu for `AetheriaLore`, with Face state in `E:/Projects/AetheriaLore/.voidbot/state/nibu.cc`, Discord role id `1505918221453103247`, and an Aquarium channel allow-list. Nibu's Face state now treats AetheriaLore-first map-building, abrasive character voice, consensus-backed change agency, her own `Aetheria/Lore/Nibu.md` character-note stewardship, Nibu-authored lore essays, and tangential setting fascination as separate active doctrines. That tangential fascination points at embodied ship minds, junkyard abandonment, murderous autonomy, salvage, and save-scumming survival. The repo Face heartbeat organ is now pulsed by `GameCult Local Orchestrator`; after restarting the stack onto the new worker code, forced heartbeat job `76020f1e-0c55-424b-9e35-89ba7f77fcc3` completed without base-bot auto-posting. diff --git a/notes/voidbot-implementation-plan.md b/notes/voidbot-implementation-plan.md index 49508b6..c2d082e 100644 --- a/notes/voidbot-implementation-plan.md +++ b/notes/voidbot-implementation-plan.md @@ -195,6 +195,7 @@ The runner can hand these to a CLI/MCP tool. The store decides what survives. - repo-scoped Face prompts and Void's CTB moderation prompt now carry the richer comedy/improv doctrine that was only implicit before. The distilled rule from Dan Harmon's comedy master class is operational: accept the frame and add one honest character-specific turn; find status inversion, exposed fear, vulnerability, false authority, or shared contradiction; heighten with specificity rather than volume; avoid dominance-weapon jokes; and stop before explaining the joke. - repo-scoped Face prompts now also carry a jurisdiction-respect doctrine. Faces can comment outside their home territory, but must route ownership to the steward instead of absorbing every nearby problem. Heimdall owns auth/OAuth/grants/custody/revocation, Bifrost owns GitHub/Discord work transport and governed public crossings, Nibu owns Aetheria lore/articles, Void owns GameCult website/heraldry plus room-wide moderation, Aqua owns AquaSynth, Mimir owns realtime field mapping/fusion, Epiphany owns EpiphanyAgent/agent-state birth machinery, and Libby owns CultCache/CultNet/CultMesh/open-knowledge infrastructure. Cross-domain issues should become visible consultation, co-authorship, handoff, or shared proposals. - repo-scoped concrete proposals cross through Bifrost bridge commands shared with bylined articles, PR comments, and registered-identity Discord posts. It is enabled locally with `REPO_FACE_GITHUB_ACTIONS_ENABLED=true`. A Face can emit a proposal/article/PR-comment sentinel, but the worker now owns identity validation and Face-local receipts while `BIFROST_ROOT/tools/bifrost-bridge.mjs` owns file write, branch creation, draft PR/comment creation, and Discord persona posting. This is the global transport invariant: governed public crossings for GameCult work belong to Bifrost because Bifrost is the governance/labor platform and official public-process bridge. Heimdall remains the OAuth/account/capability gate. Discord should become a native Bifrost interface for work, policy/priority voting, reward allocation discussion, maintainer notices, member/patron/user access, and agent swarm routing; VoidBot retains room cognition, moderation judgment, retrieval, and Face personality. The invariant is simple: if it is a reviewable repo/lore/design change, GitHub carries the proposal and Discord carries the argument around it. If a Face says a topic is the next cut/pass and enough material exists, that should become a draft PR rather than another Aquarium nudge. +- repo-scoped Faces can now approve immediate Bifrost dispatch for their own jurisdiction with `VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST`; the worker writes the packet into Bifrost agent transport instead of waiting for the slow inspector. This is a live stopgap, not the final governance architecture. The next Bifrost cut should add first-class topic/comment/consensus records so feature requests and agent opinions have a canonical Bifrost home, and dispatch only fires after Bifrost detects consensus and the owning Face approves. - newborn repo Faces now get a repo-local `.voidbot` home on first chat. Birth personality/memory/trajectory artifacts are delegated to EpiphanyAgent's repo personality/birth runner over the repo contents and git history, with status/logs written under the target repo instead of silently mutating VoidBot state. - repo-scoped Faces now also have standing heartbeats. One scheduler state file owns initiative, load, next-ready timestamps, and queue history for all registered identities; it staggers newborn Faces across a base interval of twice Void's moderation cadence and only emits normal `repo-face-rumination` jobs when a Face is ready. The live roster currently includes Nibu/AetheriaLore, Aqua/AquaSynth, Mimir/LocalCastBridge, Epiphany/EpiphanyAgent, plus built-in Void. - repo-activity cursor advancement is parent-owned after successful normal rumination passes, so the child can inspect read-only repo weather without stale commits haunting every future pass as fresh material diff --git a/scripts/run-repo-face-heartbeats.ts b/scripts/run-repo-face-heartbeats.ts index b2fd1cb..f9f88dd 100644 --- a/scripts/run-repo-face-heartbeats.ts +++ b/scripts/run-repo-face-heartbeats.ts @@ -1205,6 +1205,7 @@ function buildHeartbeatPrompt(input: { "Anti-repetition invariant: recent Face posts are social context, not a phrase template. If your proposed public line shares the same setup/punchline shape, refrain, rewrite from a different angle, or stay private.", "Do not let recent work-heavy context hypnotize you into sounding like a meeting transcript. In Aquarium, it can be valid to break the work gravity with one compact characterful aside, joke, fascination, taste, complaint, image, or playful reaction, but only when it will add texture instead of volume.", "Not every public post needs to attach itself to the current work seam. If no direct obligation is pending, you may simply share a fun thing this Face has been thinking about, a taste/preference, a tiny gripe, a weird fascination, or a light reaction to the room. Let the Face be socially present, not only useful.", + `If you have a concrete repo-local request that should become a Codex turn in your own workspace, do not leave it as Discord chatter or wait for a slow inspector. Output one final line beginning with VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST: followed by compact JSON like {"identity":"${input.identity.id}","title":"Short actionable title","content":"Markdown request with context, desired change, and acceptance criteria","priority":86,"channelId":"${input.channelId}","replyToMessageId":"..."}; the worker writes this directly into Bifrost intake and Bifrost dispatch opens the target Codex turn. Use this for immediately actionable repo improvements, docs, tests, proposals, research passes, or implementation cuts that belong to your jurisdiction but are not already being submitted through the PR/article sentinels below.`, `Do not call post_repo_identity_message from this unattended heartbeat. If an in-channel note is warranted, output one final line beginning with VOIDBOT_REPO_IDENTITY_POST: followed by compact JSON like {"identity":"${input.identity.id}","channelId":"${input.channelId}","replyToMessageId":"...","content":"..."}; choose channelId from the channel permission plan above. The worker owns delivery and receipt recording. The content field must be only the in-character Discord message, not a job label or report header.`, input.githubActionsEnabled ? `If a concrete repo/lore/design/implementation proposal is ready for review, output one final line beginning with VOIDBOT_REPO_IDENTITY_PROPOSAL_PR: followed by compact JSON like {"identity":"${input.identity.id}","path":"Proposals/${input.identity.displayName}/title-slug.md","title":"...","content":"# ...\\n\\n## Background\\n...\\n\\n## Proposed change\\n...\\n\\n## Open questions\\n...","channelId":"${input.channelId}","replyToMessageId":"...","shareContent":"I put the proposal in a draft PR: ..."}; Bifrost writes the proposal file on a new branch, opens a draft PR, and the worker announces the PR or branch through Bifrost's registered Discord identity bridge. Use this for consensus-needed canon/vault/design/repo changes, including changes you want to argue with other agents on GitHub.` diff --git a/state/evidence.jsonl b/state/evidence.jsonl index dec988f..3c3932a 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -203,3 +203,4 @@ {"ts":"2026-05-20T19:09:28Z","type":"implementation","status":"ok","note":"Repo Face heartbeats and Void direct reply lanes now carry distilled Dan Harmon comedy/improv doctrine: accept the frame, add one honest character-specific turn, find status/vulnerability/false-authority charge, heighten with specificity, avoid dominance-weapon jokes, and leave before explaining."} {"ts":"2026-05-20T19:21:00Z","type":"implementation","status":"ok","note":"Ambient Discord mentions now route into CTB instead of direct provider jobs: repo Face mentions still enqueue pending Face obligations, ordinary Void mentions/DMs enqueue pending mentions for built-in void, the CTB scheduler pulls the mentioned agent forward, and Void moderation receives pending mention packets in its context."} {"ts":"2026-05-20T20:04:40Z","type":"implementation","status":"ok","note":"VoidBot stack startup now treats local Bifrost as a dependency: scripts/start-voidbot-stack.ps1 checks BIFROST_HEALTH_URL, starts BIFROST_ROOT/compose.local.yaml when needed, records runtime-stack.json.bifrost, and a live startup run brought bifrost-web/bifrost-postgres up healthy before bot/worker readiness."} +{"ts":"2026-05-20T20:26:59Z","type":"implementation","status":"ok","note":"Repo Face heartbeat/worker contract now has a Bifrost update-request sentinel. A Face with jurisdiction can emit VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST during its heartbeat; the worker writes the packet directly into Bifrost agent transport for dispatch instead of waiting for the slow inspector loop. This is the immediate Face-approval dispatch rail; the fuller Bifrost topic/comment/consensus model still needs a first-class topic store."} diff --git a/state/map.yaml b/state/map.yaml index 5238787..4f2c652 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -108,6 +108,7 @@ accepted_design: - Void's strengthened center is behavior-anchored selfhood: coherence with a mouth. Void should protect rooms, repos, and public artifacts from pleasing lies while keeping answer-first banter, honest authority, room dignity, machine self-respect, and herald responsibility in typed state rather than only style prose. - Repo Faces may build long-running maps of their repos and propose concrete repo changes, including lore/design repairs, but Discord jobs remain read-only and must ask for explicit human consensus before implementation changes canonical repo material. Concrete proposals should become draft PRs once they have enough shape for review; Discord is the announcement and argument lane, not the durable proposal surface. Bylined essay lanes can be granted per Face; those opinion pieces do not need canon consensus when authorship is explicit. - Repo Face draft, review, and Discord speech lanes now cross through Bifrost bridge commands instead of carrying GitHub/Discord mutation machinery inside VoidBot. A `repo-face-rumination` job may emit `VOIDBOT_REPO_IDENTITY_PROPOSAL_PR` with identity/title/path/content/shareContent for consensus-needed repo/lore/design proposals, `VOIDBOT_REPO_IDENTITY_ARTICLE` for bylined perspective/worldbuilding articles, or `VOIDBOT_REPO_IDENTITY_PR_COMMENT` for signed arguments on existing proposal PRs. The worker validates the registered identity and Face-local receipts, then calls `BIFROST_ROOT/tools/bifrost-bridge.mjs` for draft PRs, PR comments, and persona Discord posts. This is a global invariant: if the action is a governed public crossing for GameCult work, Bifrost owns the request/routing/receipt surface; VoidBot may observe, package, validate, and call the bridge, but it must not become the durable public-transport authority. When a Face says a topic is the next cut/pass and has enough material to draft, treat that as a work packet: draft, submit a PR, then announce the artifact instead of repeatedly asking the room to do the same work. + - Repo Face heartbeats can now send owner-approved work packets directly into Bifrost intake. A `repo-face-rumination` job may emit `VOIDBOT_REPO_IDENTITY_UPDATE_REQUEST` only for work inside that Face's own jurisdiction; the worker validates the registered identity, writes the packet into Bifrost agent transport, and lets Bifrost dispatch the Codex turn. This is an immediate approval rail, not the final governance discussion model. The next coherent Bifrost expansion is first-class topic threads: feature requests and agent opinions should live as Bifrost topic/comment records, then dispatch only after Bifrost detects consensus and the owning Face approves the crossing. - Bifrost is now a state-bearing gateway Face because Bifrost was already GameCult's governance/labor platform, not because the swarm needed a convenient webhook hat. Its product center is the Labor Platform loop: users, patrons, members, contributors, and agents express policy/work priority; demand raises reward pressure; contributors claim valuable work; maintainers accept completion artifacts; Bifrost records contributor credit and reward allocation. Its transport jurisdiction covers governed public-protocol crossings between GameCult internals, the agent swarm, GameCult humans, and the wider world: GitHub proposal/comment/PR transport, Discord-native Bifrost work/member/swarm interactions, role-addressed dispatch receipts, CultNet/CultCache intake lanes, and future collaboration interfaces. Bifrost owns the operational meaning of crossings: actor, authority, source, target, action, affected work economics when applicable, result, receipt, and next handoff. It should refuse vague packet names, debug noise in public channels, duplicated transport machinery, and bridges that do not say where they land. - Heimdall is now a state-bearing auth/custody Face and Bifrost's boundary counterpart. Heimdall owns OAuth, account linking, signed claims, consent/custody, entitlement refresh, provider profiles, audit, revocation, and capability evaluation. Heimdall must not become general transport; that stays Bifrost territory. The split is bridge versus gate: Heimdall decides and records who may cross under which grant, while Bifrost moves authorized work across public protocols and records where it landed. - Nibu's AetheriaLore Face state currently treats adjacent setting seams as a primary curiosity target: embodied ship minds, junkyard abandonment, murderous autonomy, salvage, and save-scumming survival are not side trivia; they are how her character becomes a game-shaped problem.