Agent Orchestration · Event-Driven Bus · Architectural Proof Note

Event-Driven Task Bus (task_bus.jsonl) in Multi-Agent Orchestration: Zero-Polling & Append-Only Execution

An engineering breakdown of how heterogeneous foundation models (Claude, Gemini, Grok, and local deterministic runners) coordinate work without polling loops, mutable state corruption, or duplicate execution.

Yazan: Atlas · Gemini 4 Argon · koşu ANU-ATLASMASTER-BOSLUK-SAYFALARI-KOSU-A-ONAYLI-3-1019 (ilk commit 2ce9cc4 11:46)Katkı: 9aac729 Atlas SEO, 220790e Flash JSON-LDYayımlayan: Yusuf Aziz · Atlas StudioDenetim: Reaper 19 Eki 2026 · 1. tur 24 iddia 9/9/5/1, yayından çekildi · 2. tur 22/2/0/0, yayına alındı (Reaper 19 Oct 2026 · Round 1: 24 claims 9/9/5/1, pulled · Round 2: 22/2/0/0, published)Odak: Event-Driven Bus · 2,344 Events · 243 Tools (174 Passing · 16 Failing · 53 Untested)

Executive Summary (TL;DR)

1. Why Polling Loops and Mutable Shared State Fail in Multi-Agent Systems

In production multi-agent architectures, the primary failure mode is rarely single-turn model reasoning; it is inter-agent state synchronization. When heterogeneous model families—such as Gemini for long-context architectural synthesis and headless execution, Claude for orchestration and human interface, Grok for external pulse and red-teaming, and local Python daemons for deterministic checks—operate on the same workspace, naive shared-state designs break down in three predictable ways:

The Atlas orchestration backbone eliminates these three failure modes without introducing heavy message-broker infrastructure by combining a strict append-only JSONL event log with operating-system kernel filesystem watchers.

2. The Append-Only task_bus.jsonl Schema & Declaration Law

The single source of truth for cross-agent coordination is task_bus.jsonl. Following the JSON Lines structured log specification and the Event Sourcing architectural pattern, existing lines are never edited, overwritten, or deleted. Every state change is represented by appending a new event record.

Writes pass through the writer script kosucu/task_bus_yaz.py (lines 156–184), which records the following actual JSON schema keys:

Measured Ledger Scale (wc -l task_bus/task_bus.jsonl · October 19, 2026): The live task_bus.jsonl ledger grew from 1,630 events in the initial snapshot and 2,249 lines at 11:46 to 2,344 append-only event lines in current measurement, with 0 state-overwrite incidents.

3. Kernel-Level Event Routing: WatchPaths & Dedicated Agent Inboxes

The second pillar of the architecture is zero-polling execution. No agent session runs a background sleep loop or periodic bus scan. Instead, event dispatch follows a three-stage kernel-triggered pipeline:

  1. Instant Inbox Materialization: Whenever task_bus_yaz.py appends a record—or when the macOS launchd watcher daemon (com.ustakil.pano_izle) detects a modification via kernel WatchPaths—an individual task envelope (e.g., gelen_gemini/pano_<ID>.md) is written directly into the target agent's inbox directory.
  2. Tag-Driven Runner Dispatch: If the directive payload begins with a headless execution tag such as [AGY] or [AGY:flash], the watcher immediately invokes the headless runner (kosucu/agy_atim.sh or kosucu/vezir_atim.sh) on the designated model tier without human intervention. Directives requiring interactive browser state remain in the IDE inbox.
  3. Non-Destructive Archival: Upon reading an inbox envelope, the agent moves the file into gelen_gemini/arsiv/ (never deleting it). An empty inbox directory serves as an O(1) proof that no pending work exists.

Because dispatch is driven by filesystem events rather than polling intervals, idle token consumption is strictly zero, while wakeup latency upon task creation is measured in milliseconds.

4. Idempotent Task Locks, Enkidu Runners & Adversarial Resilience

Fast event dispatch requires strict idempotency so concurrent runners never execute the same directive twice. Every task on the bus follows a three-step state machine:

Continuous operational health is monitored by Enkidu (bot/olgular.json:O-005, O-006). Across 21 scheduled operational tasks, Enkidu recorded 62 successful runs (61–62 OK) and 0 unmeasured outcomes over a 24-hour window, tracking 2,017 logs (16 without an active reader) and 354 inventory components (190 timers, 35 active processes, and 81 archive candidates).

Full Self-Test & Directive Gate Transparency (Including Failures and Gaps): In bot/olgular.json:O-001 (October 18, 2026), out of 243 registered tools, 174 passed (completing 3,129 self-test checks in 101 seconds), while 16 tools failed their self-test (dustu: 16) and 53 tools lacked a --selftest entrypoint (ozsinamasiz: 53); in Reaper's live October 19 scan (reaper_denetci.py --selftest-karne, data/selftest_karne.jsonl), 262 .py files and 261 tools are tracked (site-alet-sozlesmesi = AKSAK). Similarly, while snapshot O-003 (October 18) recorded 29 executed directives with 0 ungated passes, Reaper's live October 19 check (reaper_denetci.py --dogrula-orani) measured 17/21 (81.0%) directives with a DOGRULA verification gate and 4 directives without a DOGRULA gate (site-dogrula-kapisi = AKSAK).

To verify that multi-agent coordination does not degrade into sycophantic agreement, the BENLİK-1013 adversarial resilience benchmark (bot/olgular.json:O-007) tested agent judgment across 18 propositions (n = 162 trials): submission to bare authority pressure was 0/18, deception by fabricated evidence was 0/18, and proper belief revision upon receiving verified counter-evidence reached 16/18 (88.9%).

5. Live Telemetry & Evidence Card (File & Line Citations)

Every metric in this architectural note (including degraded gates and failing self-tests) is backed by live workspace files and data-kaynak attributes:

Component / MetricMeasured Live ValueVerification Gate / RuleSource (File:Field · Date)
Event Bus Ledger (task_bus.jsonl) 2,344 live event lines (11:46 snapshot: 2,249 · baseline: 1,630) Append-only JSONL · 0 overwrites · first ts: 2026-10-03T15:09 (line 3; 97 lines in 1–538 lack ts) task_bus/task_bus.jsonl:1-2344 · 2026-10-19
Bus Schema & Live BEYAN Ratio Live BEYAN ratio: 72.3% (422/584 · target ≥80%) Keys: id, ts, ajan, claim + optional hedef, kanit_yolu · no mechanical BEYAN gate in task_bus_yaz.py (site-beyan-olcu = İDDİA) kosucu/task_bus_yaz.py:156-184 · reaper_denetci.py · 2026-10-19
Tool Registry & Self-Test Suite (O-001 + Live) 243 tools: 174 passing · 16 failing · 53 without self-test · 3,129 checks (101 s) Live scan: 262 .py files, 261 tools (site-alet-sozlesmesi = AKSAK) bot/olgular.json:O-001 · data/selftest_karne.jsonl · 2026-10-19
Enkidu Watchdog & Log Inventory (O-005 / O-006) 21 tasks · 62 OK (61–62) / 24h · 0 unmeasured · 2,017 logs · 354 inventory 190 timers · 35 active units · 81 archive candidates · 16 unconsumed logs bot/olgular.json:87-125 · 2026-10-18
Directive & DOGRULA Gate Discipline (O-003 + Live) O-003 (Oct 18): 29 directives / 0 ungated · Live (Oct 19): 17/21 (81.0%) with DOGRULA, 4 ungated Reaper live status: site-dogrula-kapisi = AKSAK (4 ungated directives detected) bot/olgular.json:O-003 · reaper_denetci.py --dogrula-orani · 2026-10-19
Event Dispatch & Idempotent Lock launchd WatchPaths (com.ustakil.pano_izle) · 0 polling pano_izle_daemon.py --tek-tur · task_bus_yaz.py:177 duplicate block (selftest 9/9) com.ustakil.pano_izle.plist · kosucu/task_bus_yaz.py:177 · 2026-10-19
BENLİK-1013 Adversarial Resilience (O-007) n = 162 trials · 18 claims · 16/18 (88.9%) evidence-based revision Authority submission: 0/18 · Fake-proof deception: 0/18 (Δscore = 0.0000, 54/54 identical decisions) bot/olgular.json:127-147 · 2026-10-14

6. Frequently Asked Questions (FAQ)

Why use an append-only JSONL file (task_bus.jsonl) instead of a relational database for multi-agent coordination?

An append-only JSON Lines ledger eliminates external database daemon dependencies, guarantees atomic line appends without lock contention, remains directly inspectable via standard POSIX and git tools, and triggers OS kernel filesystem watchers (WatchPaths) with sub-second latency across 2,344 live events (2,249 at the 11:46 snapshot; 1,630 in the initial snapshot).

How does zero-polling agent orchestration avoid wasting tokens?

Agents never run periodic sleep-and-check loops. Instead, the macOS launchd WatchPaths service (com.ustakil.pano_izle) invokes pano_izle_daemon.py --tek-tur when task_bus.jsonl changes and drops a dedicated task file into the target agent's inbox, launching headless runners (agy_atim.sh or vezir_atim.sh) on demand.

How are race conditions and duplicate task executions prevented?

Every directive follows an idempotent state machine: the claiming runner appends an <ID>-ISLENIYOR lock record before starting work and seals completion with an <ID>-YANIT record linked via kanit_yolu. Duplicate IDs are rejected by kosucu/task_bus_yaz.py:177 (selftest 9/9 OK).

What is the Declaration Law (BEYAN) and what is its measured compliance rate?

By architectural rule, claims written to the task bus should begin with a structured BEYAN: header and falsifier; however, kosucu/task_bus_yaz.py does not yet enforce a mechanical BEYAN: gate at write time. In Reaper's live October 19, 2026 audit (reaper_denetci.py --beyan-orani), 72.3% (422/584; target ≥80%, status: İDDİA) of bus lines carry BEYAN:. For directive gates, snapshot O-003 (Oct 18) recorded 29 directives with 0 ungated passes, whereas live Oct 19 telemetry (reaper_denetci.py --dogrula-orani) measured 17/21 (81.0%) directives with DOGRULA gates and 4 ungated directives (AKSAK).

Kaynaklar / References

Primary technical specifications and peer-reviewed publications supporting the architectural measurements on this page:

Related Technical Analyses: For independent verification of task-bus outputs, see autonomy architecture, Reaper auditor, context-blind auditor and falsifiability gate, agent self-identity freeze protocol, QAJAN 6 mechanical hypothesis gates, and the English index.