Skip to content

session.jobs entries never populate last_event_seq (§6.6) #76

Description

@nficano

Category: spec-conformance Severity: minor
Location: src/Arcp.Runtime/JobManager.Listing.cs:53-63
Spec: ARCP v1.1 §6.6

What

The session.jobs response shape in §6.6 includes "last_event_seq" per job (so a dashboard can decide where to subscribe from). JobListEntry defines the property, but ToListEntry never sets it, so it serializes as null for every listed job. Clients have no way to learn a job's current sequence position from the listing.

Evidence

private static JobListEntry ToListEntry(Job j) => new()
{
    JobId = j.JobId.Value,
    Agent = j.Agent.ToString(),
    Status = MapStatus(j.Status),
    Lease = j.Lease,
    ParentJobId = j.ParentJobId,
    CreatedAt = j.CreatedAt,
    TraceId = j.TraceId?.Value,
    // LastEventSeq is never assigned -> always null
};

The job already tracks a per-job event buffer; the high-water mark is available (Job.SnapshotEventHistory().Last().EventSeq, or a cheap counter).

Proposed fix

Expose the job's highest emitted event_seq (e.g. a counter updated in Job.BufferEvent) and set LastEventSeq = j.LastEmittedSeq in ToListEntry.

Acceptance criteria

  • A running job that has emitted events reports a non-null, monotonic last_event_seq in session.list_jobs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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