Skip to content

Implement durable capability transitions and stale-work fencing in the hosted runtime #83

Description

@dinpd

Parent: #78
Depends on: task capability-state contract and local enforcement issues under #78

Outcome

Implement tenant-scoped, durable, atomic capability transitions in the Cloudflare runtime and fence parallel work authorized under an obsolete state.

Scope

  • Durable task graph records and versioned capability state.
  • Compare-and-set or single-writer transitions.
  • Transition pending/committed/failed lifecycle.
  • Required enforcement acknowledgements and timeout policy.
  • Stale authorization and execution-result handling.
  • Concurrent requests, retries, cancellation, and idempotent transition replay.
  • Tenant-scoped lifecycle and audit endpoints.
  • State expiry and cleanup behavior.

Non-goals

  • Implementing a network gateway.
  • Releasing protected data through browser-facing management APIs.
  • Distributed consensus beyond the declared AgentPass deployment boundary.

Acceptance criteria

  • Concurrent transitions serialize deterministically.
  • Calls authorized under an obsolete version cannot execute after a narrowing transition commits.
  • A protected result remains held until all required acknowledgements are recorded.
  • Missing acknowledgement, timeout, storage error, or compare-and-set conflict fails closed.
  • Identical transition retries return the committed result; changed retries are rejected.
  • Audit records reconstruct pending, acknowledged, committed, failed, timed-out, and stale-work outcomes.
  • Tenant isolation and authorization tests cover all lifecycle endpoints.
  • Failure-injection tests cover concurrency, partial acknowledgement, Durable Object restart, duplicate delivery, and expired tasks.

Security considerations

A stale allow must never survive a committed restriction. Management, acknowledgement, and read APIs must not expose protected results or permit callers to forge another enforcement component's acknowledgement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions