ari-eventbus-patterns
EventBus communication patterns for ARI's six-layer architecture
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
EventBus communication patterns for ARI's six-layer architecture
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Discord slash commands, approval routing, channel policy, button interaction patterns for OpenClaw/ARI Discord integration
Obsidian vault integration patterns — vault-analyzer.ts, /ari-vault-* commands, morning briefing snippet, PARA structure, read-only enforcement
OpenClaw plugin development patterns — hooks, manifest structure, plugin SDK, APEX/CODEX enforcement
NOVA's P1 PayThePryce pipeline — market signal ingest, card detection, price monitoring, script generation, thumbnail generation, video assembly, approval gate
CHASE's P2 Pryceless Solutions pipeline — lead discovery, 5-criteria audit, LLM qualification, Prompt Forge 4-pass lock, demo generation, outreach approval gate
NOVA's thumbnail generation pipeline — Ideogram V3 via Fal.ai (primary) + DALL-E 3 fallback, 4-variant strategy, Pokemon TCG copyright rules,
استنادا إلى تصنيف SOC المهني
| name | ari-eventbus-patterns |
| description | EventBus communication patterns for ARI's six-layer architecture |
| triggers | ["eventbus pattern","emit event","subscribe event","cross-layer communication"] |
Guide proper EventBus usage for inter-layer communication in ARI's six-layer architecture (ADR-003).
All inter-layer communication via typed EventBus - no direct cross-layer function calls.
{domain}:{action}
Examples:
- message:accepted
- security:threat_detected
- governance:vote_required
- audit:log
- task:completed
this.eventBus.emit('audit:log', {
action: 'operation_name',
agent: 'AGENT_ID',
details: { key: 'value' },
timestamp: new Date().toISOString(),
});
this.eventBus.emit('security:threat_detected', {
risk: riskScore,
source: 'sanitizer',
pattern: 'sql_injection',
content: sanitizedContent,
});
this.eventBus.emit('governance:vote_required', {
proposal: {
type: 'tool_execution',
tool: 'file_delete',
requiredThreshold: 'supermajority'
}
});
// Planner → Executor
this.eventBus.emit('task:execute', {
taskId: 'uuid',
tool: 'read_file',
params: { path: '/path/to/file' }
});
// Executor → Planner
this.eventBus.emit('task:completed', {
taskId: 'uuid',
result: { success: true, data: '...' }
});
gateway:request_receivedsanitizer:input_cleanedaudit:logconfig:updatedrouter:message_routedstorage:context_savedcore:processing_startedguardian:threat_assessedplanner:task_decomposedexecutor:tool_invokedmemory:fact_storedcouncil:vote_castarbiter:rule_checkedoverseer:gate_evaluateddaemon:starteddaemon:stoppedcli:command_receivedcli:output_sentthis.eventBus.on('security:threat_detected', (event) => {
this.handleThreat(event);
});
const events = ['task:completed', 'task:failed', 'task:timeout'];
events.forEach(e => this.eventBus.on(e, this.handleTaskResult));
this.eventBus.once('governance:decision', (result) => {
// Called only once, then removed
});
// ❌ WRONG: Direct cross-layer import
import { Council } from '../governance/council.js';
const result = council.vote(proposal);
// ✅ CORRECT: EventBus communication
this.eventBus.emit('governance:vote_required', proposal);
this.eventBus.on('governance:decision', (result) => { ... });
try {
await operation();
this.eventBus.emit('operation:completed', { success: true });
} catch (error) {
this.eventBus.emit('audit:log', {
action: 'operation_failed',
error: error instanceof Error ? error.message : String(error),
});
this.eventBus.emit('operation:failed', { error });
throw error;
}