Skip to content

Enforce lease_constraints max_budget when issuing leases #31

Description

@nficano

Arcp::Lease::LeaseConstraints carries max_budget, and the README shows it as part of submit_job, but the runtime never applies it. lib/arcp/lease.rb:11 defines the field and lib/arcp/lease.rb:21 through lib/arcp/lease.rb:23 serializes it, yet lib/arcp/runtime/job_manager.rb:221 through lib/arcp/runtime/job_manager.rb:227 builds the accepted lease directly from submit.lease_request.budget and only considers lease_constraints.expires_at. A client can therefore request a lease budget above the declared maximum and receive it unchanged.

Fix prompt: Define the expected max_budget wire shape and enforce it in lease construction before the job is accepted. The runtime should reject or clamp a lease request whose per-currency budget exceeds the constraint, and rejection should surface as Arcp::Errors::InvalidRequest or Arcp::Errors::LeaseSubsetViolation consistently with the protocol. Add request/response round-trip tests for LeaseConstraints#max_budget and an integration spec proving an over-budget submit_job does not start an agent task.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:mediumMedium severity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions