## MODIFIED Requirements ### Requirement: Active execution renews its lease The Host Agent SHALL renew the active assignment lease before expiry while execution continues, and SHALL treat loss or rejection of the lease, or an observed cancellation request, as a stop condition for further planned actions where interruption is possible. #### Scenario: Lease renewal succeeds - **WHEN** the owning Host Agent renews an unexpired active lease - **THEN** the control plane extends its expiry without changing the task attempt or device assignment #### Scenario: Lease is stale or foreign - **WHEN** a Host Agent attempts to renew an expired, replaced, or differently owned lease - **THEN** the control plane returns a conflict and does not revive or alter the current attempt #### Scenario: Renewal response signals a pending cancellation - **WHEN** the control plane's renewal response for an active lease indicates a pending cancellation request - **THEN** the Host Agent stops further planned actions at the next available step boundary, the same way it stops on lease loss ### Requirement: Terminal result reporting is idempotent The Host Agent SHALL report a terminal result using the task, attempt, and lease identifiers, and repeating the same report SHALL return the already recorded outcome without duplicating state transitions. The terminal result SHALL be `done`, `failed`, or `cancelled`. #### Scenario: Report a successful result - **WHEN** the active lease owner reports successful completion - **THEN** the control plane marks the scheduled task done, releases the device reservation, and records the result metadata #### Scenario: Report a cancelled result - **WHEN** the active lease owner reports that its execution stopped because of an observed cancellation request - **THEN** the control plane marks the scheduled task cancelled, releases the device reservation, and records the result metadata #### Scenario: Retry a result after response loss - **WHEN** the Host Agent repeats the identical terminal report for an already completed active lease - **THEN** the control plane returns the recorded terminal result without creating a new attempt or error #### Scenario: Stale attempt reports after requeue - **WHEN** an expired earlier attempt reports after a newer attempt has been created - **THEN** the control plane rejects the stale report and preserves the newer attempt's state ## ADDED Requirements ### Requirement: Host distinguishes cancellation stop from lease-loss stop when reporting outcome The Host Agent SHALL track whether its active execution stopped because of an observed cancellation request or for another stop reason (lost or rejected lease), and SHALL report `cancelled` only in the cancellation case, reporting `failed` for other stop reasons. #### Scenario: Stop triggered by cancellation - **WHEN** the Host Agent's collaborative-stop mechanism is triggered by a renewal response signaling a pending cancellation - **THEN** the terminal result it reports for that attempt is `cancelled` #### Scenario: Stop triggered by lease loss - **WHEN** the Host Agent's collaborative-stop mechanism is triggered by a rejected or lost lease unrelated to any cancellation signal - **THEN** the terminal result it reports for that attempt is `failed`, not `cancelled`