/wbBroadcast — Exhaustive Simulation ()
/wbBroadcast is the event dispatcher. It fires notifications across external systems (Slack, Discord, webhooks) and internal micro-frontends (PubSub events). The central constraint: asynchronous, non-blocking. Broadcasting never halts the CI/CD pipeline or the active development loop. It fires and reports, but a failed broadcast doesn't cascade into a build failure.
Read this if you want to know how channel targeting works, what the -d (data) flag carries versus the -m (message) flag, and why /wbBroadcast is the only command that makes external HTTP requests.
1. Role & target
| Aspect | Behavior |
|---|---|
| Role | The Event Dispatcher. Sends messages to external and internal systems. |
| Target | Webhook URLs, Slack/Discord channels, or internal PubSub event bus. |
| Cell scope | None. /wbBroadcast doesn't interact with plans or code. |
| Side effects allowed | HTTP POST requests to external services. Internal event dispatch. |
| Side effects forbidden | Modifying code, editing plans, altering local state. |
The "fire-and-forget" principle is deliberate. A Slack notification failing shouldn't break a release pipeline. /wbBroadcast reports the HTTP status (200, 401, 429) but never blocks on failure. The caller decides whether to retry.
2. Argument resolution
| Form | Example | What /wbBroadcast does |
|---|---|---|
| Natural language string | Command: /wbBroadcast "Deployment Successful" | Sends text to the default notification channel. |
| Channel target | Command: /wbBroadcast "#engineering" | Routes the message to a specific Slack/Discord channel. |
| Comma-separated | Command: /wbBroadcast #ops,#dev | Multicasts to multiple destinations simultaneously. |
| Event type | Command: /wbBroadcast event:cache_invalidation | Fires an internal architectural event across the micro-frontend bus. |
The event: prefix is the mode switch. Without it, /wbBroadcast sends a human-readable message to a chat channel. With it, it dispatches a machine-readable event to the internal PubSub system — consumed by window.addEventListener('wb:cache_invalidation', ...) in the micro-frontends.
3. Flag matrix
| Flag | Shortcut | Purpose |
|---|---|---|
--dry-run | -D | Formats the payload and lists targets without firing the request. |
4. Pipelines (the agent-native scenarios)
/wbBroadcast #dev,#ops,#product -m="Release v4.6.0 is Live" -d='{"version": "4.6.0", "packages": ["wb-core", "wb-dataviewer"], "status": "success"}'> /wbBroadcast #dev,#ops,#product -m="Release v4.6.0 is Live" -d='{"version": "4.6.0", "packages": ["wb-core", "wb-dataviewer"], "status": "success"}'💠 Pipeline Post-release notification to all teams
After a successful /wbRelease, notify engineering, ops, and product:
💠 Pipeline Internal cache purge event (dry-run first)
The core library updated. All micro-frontends need to drop their local caches. Test the event payload first:
💠 Pipeline Silent CI notification
In a CI pipeline, broadcast the build status without cluttering logs:
5. Edge cases & refusals
| Trigger | What /wbBroadcast does |
|---|---|
No message and no data (/wbBroadcast #dev) | ❌ Empty payload. Use -m for text or -d for structured data. |
| Dead webhook (HTTP 404) | ⚠️ Broadcast to #dev failed (HTTP 404). Check webhook URL. Pipeline continues. |
Malformed JSON in -d | ❌ Cannot parse JSON payload. Check escaping at position N. |
| Network timeout (5s) | ⚠️ Broadcast timed out. Fire-and-forget — pipeline continues. |
Event type without event: prefix | Treated as a channel name. /wbBroadcast cache_invalidation → sends to #cache_invalidation channel, not the PubSub bus. |
The unifying principle: /wbBroadcast is the only command that reaches outside the workspace. Every other /wb* command operates on local files and local state. Broadcasting is the exit point — it tells the world what happened. That external scope is why it defaults to fire-and-forget: the workspace shouldn't depend on Slack being up.
