---
id: STATE-PFM-QRY-010
title: Workspace export package
object: DOM-PFM-QRY-004
product_area: platform
module: queries
revision: 1
status: draft
design_intent: confirmed
implementation_evidence: not-implemented
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
states:
  - name: available
    meaning: >-
      The package row identifies an available artifact and retention deadline; the deployed
      foundation does not produce packages.
  - name: expired
    meaning: >-
      The helper recorded expiry. Object removal and delivery expiry require separate orchestration
      that is not deployed.
  - name: deleted
    meaning: >-
      The helper marked the available package deleted and audited the change; the customer route is
      unimplemented.
transitions:
  - from: available
    to: expired
    trigger: The expiry helper is called after a due-artifact read.
    guard: The locked artifact is available; the setter does not check its deadline itself.
    side_effects:
      - only package status and settlement metadata change; byte and delivery cleanup are separate
    who: 'system (sweep, not yet built)'
    provenance: observed
    source: 'services-platform:modules/data-exports/services/persistence/artifacts.ts (listDueArtifacts)'
  - from: available
    to: deleted
    trigger: The early-deletion helper is called.
    guard: The locked artifact is available; the customer route remains unavailable.
    side_effects:
      - the deletion status and access-narrowing audit event commit together
    who: workspace administrator or Rhythm staff (future)
    provenance: observed
    source: 'services-platform:modules/data-exports/services/persistence/artifacts.ts'
invalid:
  - from: expired
    to: available
    why: A settled artifact cannot be returned to available through its persistence helper.
  - from: deleted
    to: available
    why: A deleted artifact is terminal in persistence; another execution must create a replacement.
concurrency: >-
  Settlement locks the package row and accepts only available status. Cross-workspace due-artifact
  inspection uses a transaction-local dispatch scope; there is no deployed cleanup sweep.
evidence:
  - >-
    services-platform at ad3f6a6: modules/data-exports/db/data-export-artifacts.table.ts;
    services/persistence/artifacts.ts, volumes.ts; aws/api/executions.routes.ts
---

# Workspace export package

## The Lifecycle

```mermaid
stateDiagram-v2
  state "available" as s0
  state "expired" as s1
  state "deleted" as s2
  s0 --> s1
  s0 --> s2
```

Package availability is a foundation persistence lifecycle. It must not be read as proof that package production or storage cleanup runs.

## Transitions Explained

Available artifacts can be marked expired or deleted. The helper updates status and time, with an audit event for early deletion.

## What Cannot Happen

Terminal package rows cannot be restored by another status call. These checks do not establish removal of stored bytes.

## Concurrency and Timing

The due-artifact read supports later cleanup orchestration, which remains absent from deployment.
