Skip to content

Gate: debounced wakes go to every agent with one shared provenance, ignoring who each event was for #243

Open

Description

@antra-tess

Problem

A debounced gate wake goes to every agent, and every agent gets the same provenance. Nobody checks which agent each event in the batch was for.

EventGate.deliverEvents computes one wakeProvenance(events) for the whole batch. It then calls requestInference for every name getAgentNames() returns. The framework wires that to all agents except the subconscious, conversation forks included. PendingEvent keeps no record of which agents an event was for, so the gate couldn't target even if it tried.

The direct (non-debounced) paths do filter:

Path Who it wakes
Module events Agents in response.requestInference, or every agent except forks and the subconscious; each must pass canBeTriggeredBy(source)
mcpl:push-event event.targetAgents, else every agent except forks and the subconscious
mcpl:channel-incoming event.targetAgents, else every agent except the subconscious; conversation routing and deliverTo send it to one fork
Gate debounce Every agent except the subconscious

Consequences

  1. Conversation forks (deprecated in chore(deprecate): per-channel conversation routing (FrameworkConfig.conversations) #239). Traffic in a fork's channel also wakes the trunk and every other fork. fix(gate): batched wakes route to their addressed message's channel #200 added mayTakeGateRoute, so those agents no longer take the addressed channel as their speech locus. The trunk is still woken, though, and with no locus it publishes to the most-recent-inbound fallback channel. This case goes away when conversation routing is removed.
  2. Targeted events lose their targeting when debounced. An event that names its agents (targetAgents) wakes exactly those agents on the direct path. Through the gate it wakes every agent. Since fix(gate): batched wakes route to their addressed message's channel #200, the non-target agents also inherit the batch's addressed route as their speech locus.
  3. triggerSources is bypassed. A module event from a source an agent doesn't accept still wakes that agent if a debounce policy matched it.
  4. One shared provenance. Each agent's wake gets the channel, author and route of the batch's newest addressed event, even when that event wasn't for that agent.

In a single-agent host (one resident plus its subconscious) none of this applies, since the broadcast reaches one agent. It matters once a framework hosts several agents.

Possible direction

  • Resolve each event's audience when it's queued, the same way fix(gate): batched wakes route to their addressed message's channel #200 resolves routeChannelId: a host resolver (resolveAudience(info)) records which agents the event is for, or "all".
  • In deliverEvents, give each agent its own provenance from its own events, and skip agents with none.
  • Decide whether the [Gate: N events matched] line should also be per agent. Today it's written once, without forAgent.

Refs #200, #239

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions