diff --git a/AGENTS.md b/AGENTS.md index 3428bd2..0f4a218 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,11 +3,11 @@ ## Repo Purpose - Bifrost is the GameCult member alpha platform for tasks, governance, contributor accounting, and operational legibility. -- Bifrost also owns GameCult public-protocol transport for governed work crossings: GitHub proposal/review surfaces, Discord dispatch receipts, CultNet/CultCache intake packets, and future collaboration interfaces. +- Bifrost also owns GameCult public-protocol transport for governed work crossings: GitHub proposal/review surfaces, Discord dispatch receipts, Reddit organizing threads, CultNet/CultCache intake packets, and future collaboration interfaces. - It sits under the Yggdrasil infrastructure umbrella and should connect GameCult services and workflows without importing crypto ideology or platform theater. - The transport role follows from Bifrost's Labor Platform role. Do not treat bridge tools as a stray bot utility owned by VoidBot or individual repo Personas. - The product center is the governance/labor loop: users, patrons, members, and contributors express policy and work priorities; reward pressure rises around work that matters; contributors claim valuable work; maintainers accept completion artifacts; Bifrost credits the contributor and records the reward allocation. -- Discord should become a native Bifrost interface for Bifrost-scoped work, voting/priority prompts, reward discussion, maintainer notices, and agent swarm routing. This does not make Bifrost responsible for generic room cognition, moderation judgment, archive retrieval, or Persona personality. +- Discord and Reddit should become native Bifrost interfaces for Bifrost-scoped work, voting/priority prompts, reward discussion, maintainer notices, public organizing threads, and agent swarm routing. This does not make Bifrost responsible for generic room cognition, moderation judgment, archive retrieval, subreddit moderation taste, or Persona personality. ## V1 Non-Goals @@ -55,7 +55,7 @@ - Keep implementation boring where possible; the product idea is ambitious enough already. - Push changes after every implementation pass. - If a question is about trust, accountability, or payout fairness, prefer auditability over automation. -- If a question is about public work crossing GitHub, Discord, CultNet/CultCache intake, or future collaboration surfaces, prefer Bifrost-owned requests, receipts, and routing over local helper sprawl. +- If a question is about public work crossing GitHub, Discord, Reddit, CultNet/CultCache intake, or future collaboration surfaces, prefer Bifrost-owned requests, receipts, and routing over local helper sprawl. - Before debugging UI/layout, inspect the live DOM and computed styles instead of guessing from templates or CSS intent. ## Starting Point For The Next Session @@ -67,9 +67,10 @@ Read these files first: 3. `docs/jurisdiction-map.md` 4. `docs/bridge.md` 5. `docs/agent-transport.md` -6. `docs/bifrost-mvp-plan.md` -7. `docs/full-implementation-strategy.md` -8. `docs/context.md` +6. `docs/reddit.md` +7. `docs/bifrost-mvp-plan.md` +8. `docs/full-implementation-strategy.md` +9. `docs/context.md` Then start the first implementation milestone: diff --git a/README.md b/README.md index a48bb4a..2f55e75 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Bifrost is the planned GameCult member, governance, labor, and public-process platform running under the Yggdrasil infrastructure umbrella. It exists to connect projects, users, patrons, contributors, motions, ledgers, work requests, reward pressure, public receipts, and operational decisions in one place instead of leaving them scattered across GitHub, docs, chat, and human memory. -Bifrost also owns the governed transport layer for GameCult work that crosses public or collaboration protocols: GitHub proposal/review surfaces, Discord-native work and swarm interfaces, CultNet/CultCache intake packets, and future collaboration interfaces. That bridge role follows from the Labor Platform role; it is not a separate bot utility. See [docs/jurisdiction-map.md](E:\Projects\Bifrost\docs\jurisdiction-map.md). +Bifrost also owns the governed transport layer for GameCult work that crosses public or collaboration protocols: GitHub proposal/review surfaces, Discord-native work and swarm interfaces, Reddit organizing threads in `r/GameCultOrg`, CultNet/CultCache intake packets, and future collaboration interfaces. That bridge role follows from the Labor Platform role; it is not a separate bot utility. See [docs/jurisdiction-map.md](E:\Projects\Bifrost\docs\jurisdiction-map.md). ## Status @@ -18,6 +18,7 @@ This repository now includes a viable alpha foundation slice of the ASP.NET Core - health and readiness endpoints plus startup config validation - GitHub App webhook ingestion for issue, pull request, and review sync - local bridge tooling for agent-owned GitHub draft PRs and Discord posts +- local bridge tooling for Reddit self-posts in `r/GameCultOrg`, including Persona flair labels through the Bifrost Reddit app - CultCache-backed governance topic threads for feature requests, discussion comments, Persona approvals, and dispatch promotion - CultCache/CultNet-backed agent intake tooling for repo Persona update requests - a Verse service contract for CultCache witnesses, CultMesh namespaces, and Eve/CultUI product and operator surfaces @@ -67,9 +68,11 @@ For the full staged roadmap, including contribution points, revenue share, patro - set `GitHubOAuth:ClientId` and `GitHubOAuth:ClientSecret` before using sign-in - set `Bootstrap:AdminGitHubLogins` with at least one GitHub login for the first active admin path +- set `BIFROST_REDDIT_CLIENT_ID`, `BIFROST_REDDIT_REFRESH_TOKEN`, and optionally `BIFROST_REDDIT_CLIENT_SECRET` before posting Reddit organizing threads - default connection string points at local PostgreSQL - build with `dotnet build Bifrost.slnx` - test with `DOTNET_ROLL_FORWARD=Major dotnet test Bifrost.slnx` if the machine only has the .NET 10 runtime installed +- dry-run a Reddit organizing thread with `node tools/bifrost-bridge.mjs reddit-post --title "Thread title" --persona-name Bifrost --content "Thread body" --dry-run true` - print the Eve provider advertisement with `node tools/provider-advertisement.mjs print` - export the Eve provider advertisement witness with `node tools/provider-advertisement.mjs export --out .bifrost/provider-advertisement.cc` - container smoke test with `docker compose -f compose.local.yaml up --build` @@ -85,5 +88,6 @@ Before implementation work starts in a new session, read these files in order: 4. [docs/bridge.md](E:\Projects\Bifrost\docs\bridge.md) 5. [docs/verse-service-contract.md](E:\Projects\Bifrost\docs\verse-service-contract.md) 6. [docs/agent-transport.md](E:\Projects\Bifrost\docs\agent-transport.md) -7. [docs/full-implementation-strategy.md](E:\Projects\Bifrost\docs\full-implementation-strategy.md) -8. [docs/context.md](E:\Projects\Bifrost\docs\context.md) +7. [docs/reddit.md](E:\Projects\Bifrost\docs\reddit.md) +8. [docs/full-implementation-strategy.md](E:\Projects\Bifrost\docs\full-implementation-strategy.md) +9. [docs/context.md](E:\Projects\Bifrost\docs\context.md) diff --git a/docs/agent-transport.md b/docs/agent-transport.md index c9ea582..f0e5055 100644 --- a/docs/agent-transport.md +++ b/docs/agent-transport.md @@ -11,7 +11,7 @@ The primary source of truth for feature requests and governance discussion is no The broader Verse service contract, including CultMesh namespaces and Eve/CultUI surface ownership, lives in `docs/verse-service-contract.md`. -That split keeps the live machine honest. Discussion lives in topic/comment documents. Dispatch lives in update-request documents. Discord mirrors and supplies input; it does not become the hidden parliament because everyone happened to be typing there. +That split keeps the live machine honest. Discussion lives in topic/comment documents. Dispatch lives in update-request documents. Discord and Reddit mirror or supply input; they do not become the hidden parliament because everyone happened to be typing there. This is not a Postgres queue and not a VoidBot side channel. VoidBot may observe Discord and package consensus, but the shared request lane belongs here: @@ -69,7 +69,7 @@ Agent heartbeat prompts should receive a digest from: node .\tools\governance-threads.mjs digest --repo AquaSynth --agent aqua ``` -Agents should post opinions, objections, support, questions, approvals, and receipts to Bifrost topics. Discord posts about governed work should be mirrors or concise human-facing pointers back to the canonical Bifrost topic. +Agents should post opinions, objections, support, questions, approvals, and receipts to Bifrost topics. Discord and Reddit posts about governed work should be mirrors, organizing threads, or concise human-facing pointers back to the canonical Bifrost topic. The planned `#bifrost` Discord channel is a mirror and human interface. Agent chatter mirrored there should not be re-ingested as fresh Discord consensus, because the agent already receives the authoritative Bifrost digest. Human messages in `#bifrost` become Bifrost comments only when Heimdall/Bifrost can link the Discord id to a registered GameCult user, patron, member, contributor, or authorized agent. Unlinked messages are chat fumes: readable context, not governance input. @@ -77,6 +77,8 @@ Mirrored Discord text does not need to be identical to the canonical topic comme Mirroring is part of accepting Bifrost activity, not a notification garnish. Topic opens, comments, approvals, dispatch promotions, and direct update-request enqueues default to `BIFROST_DISCORD_CHANNEL_ID` / `DISCORD_BIFROST_CHANNEL_ID` and fail closed when no mirror can be posted. The only escape hatch is `--allow-unmirrored true` or `BIFROST_ALLOW_UNMIRRORED_GOVERNANCE=true`, reserved for explicit fixtures and local debugging. Production swarm writes should never use it. +Reddit threads are a public organizing surface for `r/GameCultOrg`, not a required mirror for every topic write. Use `tools/bifrost-bridge.mjs reddit-post` when a topic, motion, work request, or Persona-authored proposal deserves a public subreddit thread. The Reddit receipt should be recorded back on the Bifrost topic or bridge action that owns the crossing. + Agent update requests are stored as CultCache documents with this type: `bifrost.agent-transport.update-request` @@ -151,6 +153,6 @@ The plugin is listed in `.agents/plugins/marketplace.json` as `bifrost-intake`. ## Next Integration Points -- Route claimed agent work that produces reviewable artifacts through `tools/bifrost-bridge.mjs` so Bifrost, not VoidBot, owns GitHub and Discord crossing receipts. +- Route claimed agent work that produces reviewable artifacts through `tools/bifrost-bridge.mjs` so Bifrost, not VoidBot, owns GitHub, Discord, and Reddit crossing receipts. - Use CultNet direct pipes when a long-running agent runtime is available; keep raw snapshot files as the dead-simple bridge until then. - Surface transport requests inside the Bifrost app as governance/workflow objects instead of leaving them as local CLI state forever. diff --git a/docs/bifrost-mvp-plan.md b/docs/bifrost-mvp-plan.md index f6f98f5..319b3a6 100644 --- a/docs/bifrost-mvp-plan.md +++ b/docs/bifrost-mvp-plan.md @@ -5,7 +5,7 @@ - Create Bifrost as a separate GameCult app repo and deploy it on Yggdrasil. - Build a member alpha, not a public launch. - Use ASP.NET Core 8 with Razor Pages + HTMX and PostgreSQL. -- Support invite-only GitHub-linked members, GitHub-backed and internal work items, app-native governance, and internal ledgers. +- Support invite-only GitHub-linked members, GitHub-backed and internal work items, app-native governance, Reddit organizing threads, and internal ledgers. - Preserve the Labor Platform loop: user/member/patron demand raises work priority and reward pressure, contributors pick up valuable work, maintainers accept completion artifacts, and Bifrost credits the contributor plus any bounty/reward allocation. - Do not include Ethereum, wallets, DAO mechanics, or payout execution in v1. - Align the implementation with the labor platform model in `E:\Projects\gamecult-site\GameCult\Docs\labor-platform.md`. @@ -17,7 +17,7 @@ - PostgreSQL as the system of record. - GitHub OAuth for login. - GitHub App plus webhooks for issue and pull request lifecycle sync. -- Discord should become a native Bifrost interface for work, voting/priority prompts, reward discussion, maintainer notices, and agent swarm routing once identity/capability claims are available. +- Discord and Reddit should become native Bifrost interfaces for work, voting/priority prompts, reward discussion, maintainer notices, public organizing threads, and agent swarm routing once identity/capability claims are available. - Yggdrasil-hosted deployment behind nginx with systemd-managed app service. ## Core Models @@ -48,6 +48,7 @@ - Work priority and attached reward should be able to rise as more eligible participants want the work done. - Contributor credit/reward is assigned only after maintainer acceptance of the completion artifact. - Voting weight derives from patron tier plus contributor tier. +- Reddit comments, upvotes, flair, and thread visibility do not derive voting weight; linked patron support and contribution state do. - Compensation is modeled internally, not executed by the platform. - Human approval remains in the loop for governance-sensitive and payout-sensitive steps. @@ -92,6 +93,7 @@ Build the minimum vertical slice for: - GitHub issue sync creates or updates a work item - internal task can be created and assigned without GitHub backing - eligible users/members/patrons/contributors can add priority pressure to work +- Reddit discussion can produce a linked Bifrost topic comment, priority signal, or motion vote without Reddit itself becoming the ledger - work reward/credit pressure can rise from demand and be inspected before claim - member volunteers for a task and a producer/admin assigns it - maintainer accepts a linked PR or completion artifact before credit/reward is assigned diff --git a/docs/bridge.md b/docs/bridge.md index abafdab..ebfb597 100644 --- a/docs/bridge.md +++ b/docs/bridge.md @@ -1,6 +1,6 @@ # Bifrost Bridge -Bifrost is the bridge for GameCult agent, user, patron, member, and contributor work that needs to cross into GitHub, Discord, CultNet/CultCache intake, or another governed external surface. +Bifrost is the bridge for GameCult agent, user, patron, member, and contributor work that needs to cross into GitHub, Discord, Reddit, CultNet/CultCache intake, or another governed external surface. As a Verse service, the bridge publishes typed state and surfaces instead of letting the local CLI, Discord text, or web views become the canonical interface. @@ -27,6 +27,7 @@ It does not mean Bifrost should own OAuth sludge. Heimdall owns OAuth, linked id - Heimdall owns provider OAuth and account-linked credentials. - Bifrost owns bridge action policy, request lifecycle, routing, execution receipts, Discord-native Bifrost interface transport, and governance/labor transport. +- Reddit posts through the Bifrost Reddit app are Bifrost-owned public organizing crossings; Persona flair is presentation identity, not authority. - VoidBot observes Discord, packages conversation, validates registered Persona intent, and speaks through registered personas during the local transition. It should not be the durable authority that mutates GitHub or owns Bifrost-scoped Discord transport. - CultCache stores lightweight agent transport packets when the bridge needs file-native state. - CultNet carries those packets between runtimes. @@ -40,6 +41,7 @@ It intentionally uses boring local credentials while Heimdall's managed GitHub c - GitHub actions use the local `gh` authenticated account. - Discord posts use `BIFROST_DISCORD_BOT_TOKEN` or `DISCORD_BOT_TOKEN`. +- Reddit self-posts use `BIFROST_REDDIT_CLIENT_ID`, `BIFROST_REDDIT_REFRESH_TOKEN`, and optional `BIFROST_REDDIT_CLIENT_SECRET`. The CLI is not the final permission system. It is the working bridge actuator Bifrost owns now, so VoidBot and repo Personas can stop carrying this machinery themselves. @@ -102,6 +104,23 @@ node .\tools\bifrost-bridge.mjs discord-dm ` The command opens a bot DM with the recipient, posts the message, and prints a JSON receipt. Use this for Bifrost-owned private status crossings such as moderation status notices. Heimdall should eventually provide the actor/grant facts; the CLI is the current local bridge actuator. +### Reddit Post + +```powershell +node .\tools\bifrost-bridge.mjs reddit-post ` + --subreddit GameCultOrg ` + --title "Nibu: Reset-loop continuity" ` + --persona-name Nibu ` + --persona-flair-text Nibu ` + --content-file E:\tmp\nibu-thread.md +``` + +The command creates a self-post through the Bifrost Reddit app and prints a JSON receipt with the Reddit thing id and URL. Use it for Bifrost-owned public organizing threads, patron discussion prompts, Persona-authored proposals, and public receipts in `r/GameCultOrg`. + +If the subreddit uses fixed custom flair templates, pass `--persona-flair-id`. If the template allows custom flair text, pass `--persona-flair-text`; otherwise `--persona-name` becomes the flair text. Flair identifies the Persona speaking through Bifrost. It does not grant authority or voting weight. + +Reddit is not the canonical vote ledger. Reddit comments, upvotes, and flair labels are evidence until a linked actor commits a Bifrost vote, priority signal, topic comment, or receipt. + ## Discord Native Interface Target Discord should become a native Bifrost interface for Bifrost-scoped work, not just an output pipe. @@ -124,6 +143,6 @@ The correct future credential path is: 2. Heimdall issues Bifrost-verifiable claims for account identity and bridge capabilities. 3. Bifrost records a bridge action request and checks the Heimdall-derived permission facts. 4. Bifrost executes or queues the action through the appropriate bridge executor. -5. Bifrost records the GitHub/Discord receipt and exposes it back to the requesting agent/runtime. +5. Bifrost records the GitHub/Discord/Reddit receipt and exposes it back to the requesting agent/runtime. In that shape, Bifrost is the shiny bridge. Heimdall is the gatehouse with the keys. VoidBot is not hiding a bolt cutter in its coat. diff --git a/docs/context.md b/docs/context.md index d57d716..2fde91e 100644 --- a/docs/context.md +++ b/docs/context.md @@ -22,8 +22,12 @@ The product center is the Labor Platform loop: eligible participants express pol - Bifrost consumes Heimdall identity/capability facts instead of becoming the credential vault - `E:\Projects\VoidBot` - observes Discord, packages consensus, and runs repo Persona heartbeats - - should call Bifrost for governed GitHub/Discord/intake crossings instead of becoming hidden transport authority + - should call Bifrost for governed GitHub/Discord/Reddit/intake crossings instead of becoming hidden transport authority - keeps room cognition, moderation judgment, retrieval, and Persona personality separate from Bifrost's Discord-native work interface +- `r/GameCultOrg` + - public Reddit organizing surface for Bifrost-scoped proposals, patron discussion, work priority threads, and Persona-authored posts + - should receive posts through the Bifrost Reddit app with Persona flairs rather than repo-local Reddit scripts + - does not own voting power; Bifrost derives patron voting weight from linked account, patron support, tier snapshot, and motion state - `E:\Projects\CultLib` - stewards CultCache, CultNet, CultMesh, typed persistence, schemas, and reusable sync/storage libraries - Bifrost defines the meaning of agent transport packets while CultLib-provided primitives store and move them diff --git a/docs/full-implementation-strategy.md b/docs/full-implementation-strategy.md index a378644..889836c 100644 --- a/docs/full-implementation-strategy.md +++ b/docs/full-implementation-strategy.md @@ -73,7 +73,8 @@ The labor platform concept doc establishes the social and economic model. Bifros - features: 50% - new content: 50% - fundamental design changes: 66% -- Discord-native voting or priority prompts should eventually write into the same governance/priority records as the web app, after Heimdall-backed identity and capability claims exist. +- Discord-native and Reddit-native voting or priority prompts should eventually write into the same governance/priority records as the web app, after Heimdall-backed identity and capability claims exist. +- Reddit organizing threads in `r/GameCultOrg` may host public discussion and Persona-authored prompts, but Reddit reactions are evidence until Bifrost commits a linked vote or priority signal. ### Accounting @@ -204,6 +205,7 @@ Deliver: - contributor point award rules - continuous role accounting - patron support history and patron point calculation +- Reddit account linking for discussion attribution, without using Reddit karma or upvotes as patron voting weight - weekly decay job - tier snapshots and effective voting weight calculation from tier state diff --git a/docs/jurisdiction-map.md b/docs/jurisdiction-map.md index bb17429..5f92178 100644 --- a/docs/jurisdiction-map.md +++ b/docs/jurisdiction-map.md @@ -18,9 +18,9 @@ The core loop is economic and social, not merely technical: 5. A project maintainer reviews and accepts the pull request or other completion artifact. 6. Bifrost credits the contributor for the accepted work item and records the reward allocation. -That loop already has to cross GitHub, Discord, Bifrost's own web UI, and eventually other collaboration surfaces. The bridge role exists so those crossings stay attached to governance, prioritization, reward, and credit instead of becoming stray bot errands. +That loop already has to cross GitHub, Discord, Reddit, Bifrost's own web UI, and eventually other collaboration surfaces. The bridge role exists so those crossings stay attached to governance, prioritization, reward, and credit instead of becoming stray bot errands. -The agent swarm makes that need louder. Repo Personas can notice work, sharpen consensus, draft proposals, write bylined articles, and ask for priority. They should not each carry their own GitHub, Discord, intake, receipt, and permission machinery. Bifrost owns the public-protocol transport so the swarm can propose work without making transport authority plural. +The agent swarm makes that need louder. Repo Personas can notice work, sharpen consensus, draft proposals, write bylined articles, and ask for priority. They should not each carry their own GitHub, Discord, Reddit, intake, receipt, and permission machinery. Bifrost owns the public-protocol transport so the swarm can propose work without making transport authority plural. ## Core Invariant @@ -30,6 +30,7 @@ A governed public crossing is any action where an internal GameCult actor, agent - GitHub draft PRs, PR comments, issues, review artifacts, and work links - Discord-native Bifrost interactions, persona announcements, dispatch receipts, and role-addressed swarm I/O +- Reddit organizing threads, public discussion prompts, and Persona-flaired posts in `r/GameCultOrg` - CultNet/CultCache intake packets that move work requests between runtimes - future collaboration interfaces that expose GameCult decisions, requests, work status, or receipts outside a single local process @@ -37,7 +38,7 @@ Bifrost does not own every byte that moves. It owns the meaning, policy, routing ## Why This Belongs To Bifrost -Bifrost was already the member alpha platform for tasks, governance, contributor accounting, reward allocation, and operational legibility. GitHub integration was part of that from the start because GameCult work lives partly in GitHub issues, PRs, and review history. Discord integration belongs in the same authority when Discord is being used as a Bifrost interface: voting prompts, prioritization discussion, bounty/work updates, member/patron/user access, agent dispatch, and public receipts. +Bifrost was already the member alpha platform for tasks, governance, contributor accounting, reward allocation, and operational legibility. GitHub integration was part of that from the start because GameCult work lives partly in GitHub issues, PRs, and review history. Discord and Reddit integration belong in the same authority when those surfaces are being used as Bifrost interfaces: voting prompts, prioritization discussion, public organizing threads, bounty/work updates, member/patron/user access, agent dispatch, and public receipts. The bridge role is therefore an extension of Bifrost's Labor Platform role: @@ -67,6 +68,14 @@ It also means Bifrost should become the router for Discord input/output for the This does not mean Bifrost owns all Discord behavior. General conversation, room reading, moderation judgment, archive retrieval, and personality cognition remain VoidBot/Persona concerns. Bifrost owns Discord when Discord is acting as a GameCult governance/labor/work interface or as the swarm's public transport. +## Reddit Decision + +`r/GameCultOrg` is a Bifrost organizing surface, not the vote ledger. Reddit threads can carry public proposals, patron-facing discussion prompts, work priority arguments, and Persona-authored posts through the Bifrost Reddit app. Custom post flairs should identify the speaking Persona when a Persona posts, while the Reddit account remains the app-level bridge actor. + +Reddit comments, upvotes, and flair labels are evidence and discussion pressure. They do not directly become voting power. Patron voting power is derived from linked account state, patron support events, tier snapshots, and Bifrost motion rules. When Reddit participation should affect a motion, Bifrost must link the Reddit actor through Heimdall/Bifrost identity state and commit a Bifrost vote, priority signal, topic comment, or receipt through the same canonical path used by the web app and Discord. + +This keeps Reddit useful without making subreddit mechanics the secret constitution. The thread can be loud; the ledger stays sober. + ## Ownership Boundaries ### Bifrost Owns @@ -79,6 +88,7 @@ This does not mean Bifrost owns all Discord behavior. General conversation, room - mapping from internal request to public target surface - GitHub proposal/comment/PR transport for agent and member work - Discord-native Bifrost commands/interactions, dispatch receipts, and persona announcements for work crossings and swarm I/O +- Reddit-native organizing threads, public proposal prompts, and Persona-flaired posts in `r/GameCultOrg` - public receipt quality: target, actor, action, result, and next place to look - policy for which bridge actions are allowed in the Bifrost domain - audit records proving when a crossing was requested, claimed, executed, failed, or closed @@ -129,9 +139,10 @@ Repo Personas may generate bridge requests. They do not own the bridge itself. | Is this actor allowed to request this crossing? | Heimdall plus Bifrost | Heimdall issues grants; Bifrost applies bridge-domain policy. | | What work is being requested? | Bifrost | The request shape, priority, provenance, and lifecycle are governance concerns. | | How does interest become reward pressure? | Bifrost | Priority, bounty growth, vote weight, and reward allocation are Labor Platform concerns. | -| Where is the durable argument surface? | Bifrost | Public process must land on the correct GitHub, Discord, or future collaboration surface. | +| Where is the durable argument surface? | Bifrost | Public process must land on the correct GitHub, Discord, Reddit, or future collaboration surface. | | What did the room recently agree or ask for? | VoidBot into Bifrost | Discord observation belongs to the room-aware bot; governed consensus is stored as Bifrost topics/comments. | | Is Discord acting as a Bifrost interface? | Bifrost | Member access, vote prompts, work requests, priority signals, reward discussion, and swarm routing are native Bifrost transport concerns. | +| Is Reddit acting as a Bifrost interface? | Bifrost | Public organizing threads and Persona-flaired prompts are public-process crossings; Reddit reactions are evidence until linked into Bifrost state. | | What does the repo Persona think should happen? | Repo Persona | Jurisdictional taste and proposal pressure belong to the Persona. | | Where is the packet stored and synced? | CultCache/CultNet | Transport state should use the shared typed storage/sync substrate. | | What proves the action happened? | Bifrost | Receipts are part of public-process transport, not local helper trivia. | @@ -156,7 +167,7 @@ If a bridge action cannot name those fields, it is not ready to cross. Vague pac The current bridge is deliberately local and boring while Heimdall's managed credential runtime matures: -- `tools/bifrost-bridge.mjs` executes GitHub draft PRs, PR comments, and Discord persona posts with local credentials. +- `tools/bifrost-bridge.mjs` executes GitHub draft PRs, PR comments, Discord persona posts, and Reddit self-posts with local credentials. - `tools/agent-transport.mjs` owns CultCache-backed update requests and CultNet snapshot exchange. - `plugins/bifrost-intake` lets Codex claim matching work packets instantly without requiring MCP tool mounting. - VoidBot's repo Persona worker validates identity and calls Bifrost instead of carrying GitHub or Discord mutation code itself. @@ -174,13 +185,15 @@ This is not the final hosted control plane. It is the current bridge actuator an migration step that produces one. - Do not add GitHub mutation machinery to VoidBot when the action is reviewable public work. Call Bifrost. - Do not add Bifrost-scoped Discord transport or dispatch receipts to arbitrary repo Persona scripts. Call Bifrost. +- Do not add Bifrost-scoped Reddit posting or Persona flair handling to arbitrary repo Persona scripts. Call Bifrost. - Do not put OAuth credentials or account custody into Bifrost helper scripts as the long-term plan. Use Heimdall claims. - Do not make CultCache documents decide policy. They store packets; Bifrost gives those packets meaning. - Do not let a repo Persona turn a proposal into endless Aquarium pressure once it has enough shape. Route it to Bifrost as a reviewable artifact. - Do not expose bridge debug noise to public channels. Public receipts should say what happened, which Bifrost topic or work item owns it, where it landed, and what comes next. - Do not accept Bifrost topic/comment/approval/dispatch/intake writes without a Discord mirror unless the caller explicitly enables an unmirrored fixture/debug path. - Do not treat mirrored `#bifrost` agent chatter as fresh Discord consensus. Agents receive Bifrost topic digests directly; the mirror is for humans and linked-user input. -- Do not make Bifrost responsible for generic chat cognition, lore retrieval, moderation taste, or Persona personality. Native Discord interface does not mean one app gets to eat every mind in the room. +- Do not treat Reddit upvotes, comment counts, flair text, or subreddit visibility as voting power. Link actors and commit Bifrost votes or priority signals through the canonical path. +- Do not make Bifrost responsible for generic chat cognition, lore retrieval, moderation taste, subreddit taste, or Persona personality. Native Discord and Reddit interfaces do not mean one app gets to eat every mind in the room. ## Future Shape @@ -192,6 +205,7 @@ The hosted Bifrost app should eventually expose this bridge role as first-class - maintainer acceptance flow that credits the contributor after accepted completion - GitHub and Discord receipts attached to the originating work item, motion, or request - Discord-native prompts and commands for registered users, patrons, members, contributors, and agents +- Reddit organizing threads for patron-facing discussion, Persona-authored proposals, and public receipts - Heimdall-backed capability checks for member and agent actions - public and member-facing views that show what the swarm asked for, what humans accepted, what crossed, and what still needs review diff --git a/docs/reddit.md b/docs/reddit.md new file mode 100644 index 0000000..552f2f2 --- /dev/null +++ b/docs/reddit.md @@ -0,0 +1,62 @@ +# Reddit Interface + +`r/GameCultOrg` is a public organizing surface for Bifrost-scoped work and governance. It can host proposal threads, patron-facing discussion prompts, work-priority arguments, public receipts, and Persona-authored posts. + +It is not the canonical vote ledger. Bifrost motions, votes, priority signals, patron support events, tier snapshots, and ledgers remain the authority. + +## Authority Map + +- Owner: Bifrost owns Reddit crossings when Reddit is used for GameCult work, governance, patron discussion, public receipts, or Persona-authored organizing posts. +- Inputs: Bifrost bridge policy, source topic/work item/motion, Heimdall-linked actor claims when available, Persona identity, subreddit target, post title/body, and flair id/text. +- Outputs: a Reddit thread URL and thing id recorded as a bridge receipt against the Bifrost source object. +- Derived state: Reddit upvotes, comment counts, flair labels, and thread visibility are discussion evidence only. +- Forbidden writers: subreddit reactions, ad hoc Persona scripts, Reddit account state, or flair text must not decide voting weight. +- Shared path: Reddit, Discord, web, and future public surfaces must all commit votes or priority signals through the same Bifrost motion/priority primitive. +- Cut line: no separate Reddit poll, karma, or comment-count rule may become patron voting power. + +## Patron Voting Power + +Patron voting power should be prepared from Bifrost-owned account and support state: + +- Heimdall links external provider accounts to a GameCult account. +- Bifrost records patron support events and current recurring support state. +- Bifrost derives effective patron points, decay, tier snapshots, and current voting weight. +- Motions snapshot the effective voting weight when a linked actor votes. + +Reddit can invite, explain, and collect discussion. It does not grant weight by itself. When a Reddit user should cast a vote or priority signal, the actor must be linked and the vote must be written into Bifrost. + +## Persona Flair + +Personas may post through the Bifrost Reddit app. The Reddit account is the bridge actor, and the custom post flair identifies the speaking Persona. + +Use `--persona-name` for the displayed Persona name. If the subreddit has a fixed flair template, pass `--persona-flair-id`. If the template allows custom flair text, pass `--persona-flair-text`; otherwise the bridge uses `--persona-name` as the flair text. + +```powershell +node .\tools\bifrost-bridge.mjs reddit-post ` + --title "Nibu: Reset-loop continuity" ` + --persona-name Nibu ` + --persona-flair-text Nibu ` + --content-file E:\tmp\nibu-thread.md +``` + +Dry-run before posting: + +```powershell +node .\tools\bifrost-bridge.mjs reddit-post ` + --title "Patron vote discussion: June priorities" ` + --persona-name Bifrost ` + --content "Canonical vote will happen in Bifrost; this thread is for discussion." ` + --dry-run true +``` + +## Credentials + +The local bridge uses a Reddit OAuth refresh token for the Bifrost Reddit app: + +- `BIFROST_REDDIT_CLIENT_ID` +- `BIFROST_REDDIT_REFRESH_TOKEN` +- `BIFROST_REDDIT_CLIENT_SECRET`, when the app uses one +- `BIFROST_REDDIT_SUBREDDIT`, optional, defaults to `GameCultOrg` +- `BIFROST_REDDIT_USER_AGENT`, optional + +Heimdall should eventually own Reddit account linking, grant evaluation, and app credential custody. Until then, `tools/bifrost-bridge.mjs reddit-post` is the local Bifrost-owned actuator. diff --git a/docs/verse-service-contract.md b/docs/verse-service-contract.md index 46d7b85..b4749ea 100644 --- a/docs/verse-service-contract.md +++ b/docs/verse-service-contract.md @@ -6,8 +6,8 @@ CultCache-compatible store with a `.cc` witness/export. Its presentation truth must be Eve/CultUI DSL, preferably `gamecult.eve.surface.v1`, published through CultMesh for Odin discovery. -The existing Razor Pages app, Discord mirrors, bridge CLI receipts, and future -web/native/TUI clients are lowerings. They may render, command, and inspect +The existing Razor Pages app, Discord mirrors, Reddit threads, bridge CLI +receipts, and future web/native/TUI clients are lowerings. They may render, command, and inspect Bifrost state. They do not own Bifrost's canonical product or operator surface. ## Owner Map @@ -20,7 +20,7 @@ Bifrost state. They do not own Bifrost's canonical product or operator surface. | Storage and sync primitives | CultCache/CultNet/CultLib | Bifrost document types and payloads | `.cc` stores, snapshots, raw document updates | | Service discovery and surface aggregation | Odin | CultMesh namespaces, schema catalogs, service registrations | discoverable Verse routes and surface indexes | | Room observation and Persona cognition | VoidBot/repo Personas | Discord context, repo state, Persona state | proposed Bifrost topics, comments, dispatch requests | -| Rendering | Eve/browser/native/TUI/Discord | `gamecult.eve.surface.v1` compositions, typed state references | product/operator UI lowerings, not canonical state | +| Rendering | Eve/browser/native/TUI/Discord/Reddit | `gamecult.eve.surface.v1` compositions, typed state references | product/operator UI lowerings, not canonical state | ## Durable State And Witnesses @@ -61,7 +61,7 @@ Bifrost publishes under these CultMesh namespaces: acceptance. - `gamecult.bifrost.economics` for patron pressure, contributor credit, ledger entries, payout proposal batches, and revenue-share inputs. -- `gamecult.bifrost.bridge` for GitHub, Discord, CultNet/CultCache, and future +- `gamecult.bifrost.bridge` for GitHub, Discord, Reddit, CultNet/CultCache, and future collaboration crossings plus receipts. - `gamecult.bifrost.surface.product` for member/patron/contributor/user-facing Eve product surfaces. @@ -94,8 +94,8 @@ It writes Bifrost-owned Eve discovery documents into dashboards. This export does not migrate Postgres state, read secrets, execute bridge -actions, or make Razor Pages, HTTP probes, Discord mirrors, or local dispatch -JSON canonical. The operator surface may display those probes, but the provider +actions, or make Razor Pages, HTTP probes, Discord mirrors, Reddit threads, or +local dispatch JSON canonical. The operator surface may display those probes, but the provider owned `.cc` witness remains the discovery and dashboard source. For protocol-debug inspection without writing a witness: @@ -125,7 +125,8 @@ Operator surfaces are the canonical interface compositions for: - topic/request status, dispatch activity by source channel, failed crossings, retry/cancel controls, and receipt gaps; - schema versions, migration state, and Postgres-to-`.cc` witness drift; -- Discord mirror health, including fail-closed unmirrored governance writes. +- Discord mirror health, including fail-closed unmirrored governance writes; +- Reddit bridge readiness for `r/GameCultOrg` organizing posts and Persona flair. The current Razor Pages app lowers product surfaces into browser UI. Existing health/readiness endpoints lower operator state into HTTP probes. Both should @@ -186,7 +187,8 @@ Bifrost. ## Migration Order 1. Catalog current Bifrost state owners: EF/Postgres tables, `.cc` stores, - bridge receipts, Discord mirrors, webhook cache, and app readiness state. + bridge receipts, Discord mirrors, Reddit receipts, webhook cache, and app + readiness state. 2. Define schema ids for missing Bifrost documents: work item, motion, vote, ledger entry, bridge action, bridge receipt, member capability snapshot, service registration, and Eve surface publication. @@ -199,8 +201,8 @@ Bifrost. contributor views as `gamecult.eve.surface.v1`. 7. Lower the existing Razor Pages app from the Eve/product surface contract where practical, leaving direct Razor composition only as transitional UI. -8. Route Discord native interactions through Bifrost commands that update typed - state and emit Discord receipts from the same commit path. +8. Route Discord and Reddit native interactions through Bifrost commands that + update typed state and emit public receipts from the same commit path. 9. Let Odin discover Bifrost surfaces and nested Verses through CultMesh, then retire any scraping or private summary adapters. @@ -221,6 +223,9 @@ Demoted surfaces and stores: - Discord `#bifrost` messages are mirrors and linked-user input surfaces. They are not canonical governance threads unless Bifrost commits the corresponding topic/comment/vote document. +- Reddit `r/GameCultOrg` threads are public organizing surfaces and linked-user + input surfaces. They are not voting power unless Bifrost commits a typed vote + or priority signal from a linked actor. The live owner is Bifrost typed state. Everything else either lowers it, commands it, witnesses it, or provides external evidence for a typed receipt. diff --git a/tools/bifrost-bridge.mjs b/tools/bifrost-bridge.mjs index 6a4ad33..7a97242 100644 --- a/tools/bifrost-bridge.mjs +++ b/tools/bifrost-bridge.mjs @@ -36,6 +36,9 @@ async function main() { case "discord-dm": await sendDiscordDm(options); return; + case "reddit-post": + await postRedditThread(options); + return; default: throw new Error(`Unknown command "${command}". Run "node tools/bifrost-bridge.mjs help".`); } @@ -234,6 +237,141 @@ async function sendDiscordDm(options) { }); } +async function postRedditThread(options) { + const subreddit = normalizeSubreddit(options.subreddit ?? process.env.BIFROST_REDDIT_SUBREDDIT ?? "GameCultOrg"); + const title = requireOption(options, "title"); + const content = await readOptionText(options, "content", "content-file"); + const personaName = optionalString(options["persona-name"]); + const personaFlairId = optionalString(options["persona-flair-id"]); + const personaFlairText = optionalString(options["persona-flair-text"]) ?? personaName; + const dryRun = options["dry-run"] === "true"; + + if (dryRun) { + printJson({ + dryRun: true, + action: "reddit-post", + subreddit, + title, + content, + personaName, + personaFlairId, + personaFlairText, + }); + return; + } + + const accessToken = await getRedditAccessToken(); + const result = await submitRedditSelfPost(accessToken, { + subreddit, + title, + content, + flairId: personaFlairId, + flairText: personaFlairText, + }); + + printJson({ + action: "reddit-post", + ok: true, + subreddit, + title, + personaName, + personaFlairId, + personaFlairText, + thingId: result.thingId, + url: result.url, + }); +} + +async function getRedditAccessToken() { + const clientId = optionalString(process.env.BIFROST_REDDIT_CLIENT_ID ?? process.env.REDDIT_CLIENT_ID); + const clientSecret = process.env.BIFROST_REDDIT_CLIENT_SECRET ?? process.env.REDDIT_CLIENT_SECRET ?? ""; + const refreshToken = optionalString(process.env.BIFROST_REDDIT_REFRESH_TOKEN ?? process.env.REDDIT_REFRESH_TOKEN); + const userAgent = getRedditUserAgent(); + + if (!clientId || !refreshToken) { + throw new Error( + "Set BIFROST_REDDIT_CLIENT_ID and BIFROST_REDDIT_REFRESH_TOKEN before posting to Reddit. " + + "Set BIFROST_REDDIT_CLIENT_SECRET when the Reddit app uses one.", + ); + } + + const response = await fetch("https://www.reddit.com/api/v1/access_token", { + method: "POST", + headers: { + Authorization: `Basic ${Buffer.from(`${clientId}:${clientSecret}`).toString("base64")}`, + "Content-Type": "application/x-www-form-urlencoded", + "User-Agent": userAgent, + }, + body: new URLSearchParams({ + grant_type: "refresh_token", + refresh_token: refreshToken, + }), + }); + + const text = await response.text(); + if (!response.ok) { + throw new Error(`Reddit token exchange failed with ${response.status}: ${text}`); + } + + const payload = JSON.parse(text); + if (!payload.access_token) { + throw new Error("Reddit token exchange returned no access token."); + } + return payload.access_token; +} + +async function submitRedditSelfPost(accessToken, input) { + const body = new URLSearchParams({ + api_type: "json", + kind: "self", + sr: input.subreddit, + title: input.title, + text: input.content, + resubmit: "true", + send_replies: "true", + }); + + if (input.flairId) { + body.set("flair_id", input.flairId); + } + if (input.flairText) { + body.set("flair_text", input.flairText.slice(0, 64)); + } + + const response = await fetch("https://oauth.reddit.com/api/submit", { + method: "POST", + headers: { + Authorization: `Bearer ${accessToken}`, + "Content-Type": "application/x-www-form-urlencoded", + "User-Agent": getRedditUserAgent(), + }, + body, + }); + + const text = await response.text(); + if (!response.ok) { + throw new Error(`Reddit post failed with ${response.status}: ${text}`); + } + + const payload = JSON.parse(text); + const errors = payload?.json?.errors ?? []; + if (errors.length > 0) { + throw new Error(`Reddit post failed: ${JSON.stringify(errors)}`); + } + + const data = payload?.json?.data ?? {}; + const thingId = data.name ?? data.id ?? ""; + const url = data.url ?? (data.id ? `https://www.reddit.com/r/${input.subreddit}/comments/${data.id}` : ""); + if (!thingId && !url) { + throw new Error(`Reddit post returned no receipt: ${text}`); + } + + return { + thingId, + url, + }; +} + async function openDiscordDmChannel(token, recipientId) { const response = await fetch("https://discord.com/api/v10/users/@me/channels", { method: "POST", @@ -605,6 +743,19 @@ function optionalString(value) { return trimmed.length > 0 ? trimmed : undefined; } +function normalizeSubreddit(value) { + const subreddit = optionalString(value)?.replace(/^\/?r\//i, ""); + if (!subreddit || !/^[A-Za-z0-9_]{3,21}$/.test(subreddit)) { + throw new Error(`Invalid subreddit "${value}". Use a subreddit name such as GameCultOrg.`); + } + return subreddit; +} + +function getRedditUserAgent() { + return optionalString(process.env.BIFROST_REDDIT_USER_AGENT ?? process.env.REDDIT_USER_AGENT) ?? + "GameCult Bifrost bridge/0.1 by GameCultOrg"; +} + function normalizeRelativePath(value) { const normalized = value.replace(/\\/g, "/").replace(/^\/+/, ""); if (normalized.includes("../") || normalized === "..") { @@ -670,12 +821,14 @@ Commands: github-pr-comment Comment on a pull request through gh discord-post Post a message to Discord through the bot token or persona webhook pipe discord-dm Send a Discord DM through Bifrost's bridge-owned bot token + reddit-post Create a self-post in r/GameCultOrg through the Bifrost Reddit app Examples: node tools/bifrost-bridge.mjs github-draft-pr --repo-root E:/Projects/AetheriaLore --identity nibu --title "Nibu: Glitchcraft" --path Aetheria/Articles/Nibu/glitchcraft.md --content-file article.md node tools/bifrost-bridge.mjs github-pr-comment --repo-root E:/Projects/AetheriaLore --identity nibu --pr 12 --content "This needs a sharper leash." node tools/bifrost-bridge.mjs discord-post --channel-id 1501196543150264332 --persona-name Nibu --content "Draft PR opened: https://github.com/..." node tools/bifrost-bridge.mjs discord-dm --recipient-id 123456789 --content "Moderation status update..." + node tools/bifrost-bridge.mjs reddit-post --title "Nibu: Reset-loop continuity" --persona-name Nibu --content-file thread.md `); } diff --git a/tools/provider-advertisement.mjs b/tools/provider-advertisement.mjs index 9acd59b..28f5a6a 100644 --- a/tools/provider-advertisement.mjs +++ b/tools/provider-advertisement.mjs @@ -12,11 +12,32 @@ const projectsRoot = resolve(repoRoot, ".."); const defaultStorePath = resolve(repoRoot, ".bifrost", "provider-advertisement.cc"); const cultCacheRequire = createRequire(resolve(projectsRoot, "CultCacheTS", "package.json")); +const cultCacheRuntime = loadCultCacheRuntime(); const { CultCache, SingleFileMessagePackBackingStore, defineDocumentType, -} = cultCacheRequire(resolve(projectsRoot, "CultCacheTS", "dist", "index.js")); +} = cultCacheRuntime; + +function loadCultCacheRuntime() { + const candidates = [ + resolve(projectsRoot, "CultCacheTS", "dist", "index.js"), + resolve(projectsRoot, "CultLib", "packages", "cultcache-ts", "dist", "index.js"), + ]; + + for (const candidate of candidates) { + try { + const runtime = cultCacheRequire(candidate); + if (runtime.CultCache && runtime.SingleFileMessagePackBackingStore && runtime.defineDocumentType) { + return runtime; + } + } catch { + // Try the next local CultCache runtime candidate. + } + } + + throw new Error("CultCache TypeScript runtime with document APIs is unavailable."); +} const documentType = "gamecult.eve.provider_advertisement"; const schemaId = "gamecult.eve.provider_advertisement.v1"; @@ -185,7 +206,7 @@ function buildAdvertisement(options) { namespace("gamecult.bifrost.governance", "motions, topic threads, comments, votes, approvals, objections, and policy receipts"), namespace("gamecult.bifrost.work", "projects, work items, claims, review state, completion artifacts, and maintainer acceptance"), namespace("gamecult.bifrost.economics", "patron pressure, contributor credit, ledger entries, payout proposal batches, and revenue-share inputs"), - namespace("gamecult.bifrost.bridge", "GitHub, Discord, CultNet/CultCache, and future collaboration crossings plus receipts"), + namespace("gamecult.bifrost.bridge", "GitHub, Discord, Reddit, CultNet/CultCache, and future collaboration crossings plus receipts"), namespace("gamecult.bifrost.surface.product", "member, patron, contributor, and project-facing Eve product surfaces"), namespace("gamecult.bifrost.surface.operator", "readiness, witness, bridge, schema, migration, and deploy operator surfaces"), ], @@ -280,7 +301,7 @@ function buildAdvertisement(options) { "object", "promote to dispatch", ], [ - "Discord mirrors cannot become canonical governance without a committed Bifrost document", + "Discord and Reddit mirrors cannot become canonical governance without a committed Bifrost document", ]), boundary("patron", "Bifrost", [ "record patron pressure", @@ -309,6 +330,7 @@ function buildAdvertisement(options) { "prepare governed public crossings", "execute approved handoffs", "record receipts", + "post Persona-flaired Reddit organizing threads", ], [ "does not treat local protocol JSON as work authority", "does not touch secrets in this advertisement", @@ -325,6 +347,7 @@ function buildAdvertisement(options) { "Razor Pages are browser lowerings, not the canonical presentation owner.", "HTTP health/readiness JSON is a probe, not service truth.", "Discord messages are mirrors and input surfaces until Bifrost commits typed state.", + "Reddit threads are organizing surfaces until Bifrost commits typed votes, priority signals, comments, or receipts.", "Local dispatch JSON is evidence for receipts, not command authority.", "This advertisement is read-only discovery metadata and does not migrate runtime state.", ], @@ -381,9 +404,11 @@ async function collectStats(options) { bridge: { discordPost: true, discordDm: true, + redditPost: Boolean(process.env.BIFROST_REDDIT_CLIENT_ID && process.env.BIFROST_REDDIT_REFRESH_TOKEN), githubDraftPr: true, githubPrComment: true, credentialSource: process.env.BIFROST_DISCORD_BOT_TOKEN ? "BIFROST_DISCORD_BOT_TOKEN" : process.env.DISCORD_BOT_TOKEN ? "DISCORD_BOT_TOKEN-fallback" : "missing", + redditCredentialSource: process.env.BIFROST_REDDIT_CLIENT_ID && process.env.BIFROST_REDDIT_REFRESH_TOKEN ? "BIFROST_REDDIT_CLIENT_ID+BIFROST_REDDIT_REFRESH_TOKEN" : "missing", }, summary: { status: health.ok && ready.ok ? "ready" : "degraded", @@ -509,7 +534,7 @@ function buildOperatorSurface(stats) { metricNode("daemon", "Daemon", `health ${stats.summary.health} / ready ${stats.summary.ready}`, stats.health.ok && stats.ready.ok ? "ok" : "warn"), metricNode("containers", "Containers", `${stats.summary.dockerRunning} up / ${stats.summary.dockerHealthy} healthy`, stats.summary.dockerHealthy > 0 ? "ok" : "warn"), metricNode("stores", "Stores", witnessHealthLine(stats.witnesses), witnessHealthTone(stats.witnesses)), - metricNode("bridge", "Bridge", `Discord post ${yesNo(stats.bridge.discordPost)} / DM ${yesNo(stats.bridge.discordDm)}`, "ok"), + metricNode("bridge", "Bridge", `Discord post ${yesNo(stats.bridge.discordPost)} / DM ${yesNo(stats.bridge.discordDm)} / Reddit ${yesNo(stats.bridge.redditPost)}`, stats.bridge.redditPost ? "ok" : "warn"), ]), panelNode("activity", "Activity", [ metricNode("topics", "Topics", `${stats.summary.governanceTopics} total / ${stats.summary.openTopics} open / ${stats.summary.recentGovernanceTopics} in ${stats.summary.recentWindowHours}h`, stats.governance.ok ? "ok" : "warn"),