Skip to content

job.subscribe ignores history and from_event_seq instead of replaying buffered events (§7.6) #68

@nficano

Description

@nficano

Category: spec-conformance Severity: major
Location: crates/arcp-runtime/src/runtime/server.rs:1255-1316
Spec: ARCP v1.1 §7.6

What

When a subscriber requests history: true with from_event_seq, the runtime must replay buffered events with seq > from_event_seq before live streaming. The handler discards both fields and always acknowledges live-only delivery.

Evidence

let JobSubscribePayload {
    job_id,
    from_event_seq: _,
    history: _,
} = payload;

// ...
let ack = JobSubscribedPayload {
    job_id: job_id.clone(),
    current_status: snap.state.wire_str().to_owned(),
    agent: snap.agent.clone(),
    parent_job_id: snap.parent_job_id.clone(),
    trace_id: None,
    subscribed_from: snap.last_event_seq,
    // History replay is not yet implemented in this SDK; the ack
    // always carries `replayed: false`, matching live-only
    // semantics (§7.6 permits `history: false`).
    replayed: false,
};

Proposed fix

Honor history/from_event_seq by replaying matching event-log entries before attaching to the live bus and report whether replay occurred; return the resume-window error when history is unavailable.

Acceptance criteria

  • A subscription with history: true, from_event_seq: N receives buffered job events with event_seq > N before live events and sets replayed: true.

Metadata

Metadata

Assignees

No one assigned

    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