Skip to content

Lease-expiry termination emits final_status "timed_out" instead of "error" with LEASE_EXPIRED (§9.5 / §7.3) #74

@nficano

Description

@nficano

Category: spec-conformance Severity: blocker
Location: arcp-runtime/src/main/java/dev/arcp/runtime/session/SessionLoop.java:561-574
Spec: ARCP v1.1 §9.5 (also §7.3)

What

The lease-expiry watchdog transitions the job to TIMED_OUT and emits job.error with final_status: "timed_out" carrying code LEASE_EXPIRED. §9.5 requires the runtime emit job.error with code LEASE_EXPIRED and final_status: "error", and §7.3 explicitly states LEASE_EXPIRED results in final_status: "error".

Evidence

  private void terminateExpiredJob(JobRecord record) {
    if (record.transitionTo(JobRecord.Status.TIMED_OUT)) {
      var w = record.worker();
      if (w != null) {
        w.cancel(true);
      }
      emitJobError(
          record,
          JobError.TIMED_OUT,
          ErrorCode.LEASE_EXPIRED,
          "lease expired at " + record.constraints().expiresAt());

Proposed fix

Transition the record to Status.ERROR (not TIMED_OUT) and pass JobError.ERROR as the final_status when the cause is lease expiry, keeping ErrorCode.LEASE_EXPIRED.

Acceptance criteria

  • When a lease's expires_at is reached for an active job, the emitted job.error carries final_status: "error" and code LEASE_EXPIRED, and the job's terminal status is ERROR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit/spec-conformanceARCP v1.1 spec non-conformance (audit)sev/blockerCorrectness/security/data-loss or spec MUST violation

    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