Category: bug Severity: minor
Location: lib/arcp/runtime/job_manager.rb:256-269
Spec: ARCP v1.1 §7.1, §9.5
What
build_lease returns nil unless submit.lease_request is present. A client that supplies lease_constraints (e.g. expires_at) but no lease_request gets no lease at all, so the requested expiration is silently dropped and LeaseManager never registers an expiry to enforce. Spec §7.1 documents lease_constraints as an independent submit field, and §9.5 ties enforcement to it; the SDK only honors it as a side effect of also requesting capabilities. The expiry the caller asked for vanishes with no error.
Evidence
# lib/arcp/runtime/job_manager.rb:256-269
def build_lease(submit, job_id)
return nil unless submit.lease_request # constraints-only submit yields no lease, no expiry
submit.lease_constraints&.enforce_max_budget!(submit.lease_request.budget)
Arcp::Lease::Lease.new(
id: "lse_#{job_id}",
capabilities: submit.lease_request.capabilities,
# ...
expires_at: submit.lease_constraints&.expires_at || submit.lease_request.expires_at,
issued_at: @clock.now.iso8601
)
end
Proposed fix
Build a lease whenever lease_request or lease_constraints is present (a constraints-only lease carries empty capabilities plus the expires_at), so the expiration is registered and enforceable. Add a test submitting lease_constraints with a future expires_at and no lease_request, asserting the accepted lease carries expires_at and that LeaseManager would expire it.
Acceptance criteria
Category: bug Severity: minor
Location:
lib/arcp/runtime/job_manager.rb:256-269Spec: ARCP v1.1 §7.1, §9.5
What
build_leasereturnsnilunlesssubmit.lease_requestis present. A client that supplieslease_constraints(e.g.expires_at) but nolease_requestgets no lease at all, so the requested expiration is silently dropped andLeaseManagernever registers an expiry to enforce. Spec §7.1 documentslease_constraintsas an independent submit field, and §9.5 ties enforcement to it; the SDK only honors it as a side effect of also requesting capabilities. The expiry the caller asked for vanishes with no error.Evidence
Proposed fix
Build a lease whenever
lease_requestorlease_constraintsis present (a constraints-only lease carries emptycapabilitiesplus theexpires_at), so the expiration is registered and enforceable. Add a test submittinglease_constraintswith a futureexpires_atand nolease_request, asserting the accepted lease carriesexpires_atand thatLeaseManagerwould expire it.Acceptance criteria
expires_atmatches the request.job.acceptedechoes theexpires_at.