Skip to content

Subscription fan-out forwards the producer's event_seq into the subscriber stream (§7.6 / §8.3) #76

@nficano

Description

@nficano

Category: spec-conformance Severity: major
Location: arcp-runtime/src/main/java/dev/arcp/runtime/session/SessionLoop.java:850-854
Spec: ARCP v1.1 §8.3 (also §7.6)

What

Forwarded events are sent on the subscriber's session using the producing session's event_seq (seq), not a value allocated from the subscriber session's own eventSeq counter. §7.6 requires subscribed events appear "using the session's normal event_seq space" and §8.3 requires event_seq be session-scoped, strictly monotonic, and gap-free; a subscriber interleaving its own jobs with subscribed jobs will see non-monotonic, colliding sequence numbers.

Evidence

    for (JobRecord.Subscriber sub : record.subscribers()) {
      if (sub.session() != this) {
        sub.session().sendJobMessage(record, Message.Type.JOB_EVENT, event, seq);
      }
    }

Proposed fix

When forwarding to a subscriber session, allocate the envelope's event_seq from that subscriber session's own counter (e.g., have the subscriber session call its own nextSeq()) rather than reusing the producer's seq.

Acceptance criteria

  • Events delivered to a subscribing session carry strictly monotonic, gap-free event_seq values drawn from that session's own sequence space, interleaving correctly with the subscriber's other job events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit/spec-conformanceARCP v1.1 spec non-conformance (audit)sev/majorLikely defect or structural break

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions