Skip to content

Refactor GraphEngine event identity and buffering #244

Open

Description

@laipz8200

Problem

GraphEngine event handling currently has three coupled problems:

  • EventManager retains all emitted events in an append-only list and relies on a custom read/write lock plus polling.
  • graph event id is overloaded as a node execution identifier, leaving no stable identity for an individual event or the overall graph execution.
  • execution identity and event sequence are not preserved consistently across pause and snapshot restore.

There are also unused AgentNode event DTOs and exports that complicate the contract without an in-repository producer.

Proposed change

  • Replace the append-only buffer and polling with standard-library condition/deque primitives so consumed events can be released.
  • Give every graph event a distinct id, graph_id, and execution_id; use node_execution_id for node-run correlation.
  • Preserve execution identity and monotonic event sequence across resume and runtime snapshots.
  • Keep layer observation and consumer ordering deterministic under concurrent producers.
  • Remove unused AgentNode event structures and avoid a custom event serialization helper.

Scope

This issue does not add cancellation, deadlines, persistence, EventStore, cursors, replay, asynchronous task abstractions, or a new event bus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions