---
id: TST-PFM-SEC-266
title: Workspace availability unit checks
kind: unit
product_area: platform
module: security
revision: 2
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/tenants/tests/unit/services/access/tenant-availability.spec.js
implements:
  - ATS-PFM-SEC-002-09
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: The suite owns its input fixtures and installed doubles.
assertion_evidence:
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#tenants:
      the word the access gate enforces about a tenant
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#the
      rule, by what the tenant is and who is asking
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#walks
      every combination of lifecycle state and status (premise)
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#answers
      the rule for every combination of lifecycle state, status and caller
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#is
      unavailable to everybody when there is no such tenant
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#is
      unavailable to staff too when there is no such tenant
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#is
      available to the tenant’s own user when the tenant is active and its customer is not cut off
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#is
      unavailable to the tenant’s own user when the customer has been cut off
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#is
      reads only for staff once destruction has begun, so support can still inspect it
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#is
      unavailable to the tenant’s own user once destruction has begun
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#a
      tenant taking its initial data import
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#refuses
      the tenant’s own user, naming the load as the reason
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#serves
      the upload protocol, which is what the load is made of
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#serves
      the data jobs of a record type, whose path carries the same segment
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#serves
      the data jobs of a macroservice whose paths are still kebab-case, until it moves to snake_case
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#serves
      staff, who reach every tenant on a system route
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#refuses
      a route that merely mentions the words in a parameter’s value, the template being what is read
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#refuses
      a request asked without a route at all, the exception being the route’s
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#names
      the state rather than the load when the tenant is merely provisioning
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#names
      the cut-off customer when the tenant is active and disabled
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#names
      no such tenant when there is none
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#the
      cache
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#reads
      the tenant the first time it is asked (the premise)
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#answers
      the same tenant again without reading it
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#answers
      the same thing the second time
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#answers
      a staff caller from the same read, so the two kinds of caller cost one query
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#still
      answers from the cache one millisecond before the window closes
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#reads
      again once the window has closed
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#sees
      a tenant that has become unavailable once the window has closed
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#caches
      a tenant that does not exist, so a flood naming a made-up id costs one read
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#keeps
      one answer per tenant
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#reads
      a forgotten tenant again at once, which is how the process that changed it stays right
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#forgets
      only the tenant it is told to forget
  - provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js#measures
      the window by the execution context clock, not the machine (the fixed clock never expires it)
dependency_evidence: >-
  The production decision runs in-process. The suite substitutes the clock where its dependency
  setup supplies them; those boundaries have no live-service proof here.
evidence:
  - 'services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js'
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
binding_note: >-
  Each binding names the scenario to which this file contributes assertions. A binding is not a
  recorded pass and does not extend the file’s dependency boundary.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: 'services-platform:modules/tenants/tests/unit/services/access/tenant-availability.spec.js'
  explicit_no_doubles: false
  identified_double_boundaries:
    - the clock
---
# Workspace availability unit checks

## Verification Boundary

The file evaluates production helpers with controlled inputs in-process. The assertion references identify the source checks for workspace availability.

## What This Suite Proves

The source assertions support the observations named in the bound scenarios. A scenario spanning multiple files must retain the other files’ contributions.

## What It Does Not Prove

This examination does not run the suite. Passing behavior, deployed conformance and the behavior of substituted dependencies require separate execution evidence.

## Real Dependencies and Test Doubles

The production decision runs in-process. The suite substitutes the clock where its dependency setup supplies them; those boundaries have no live-service proof here.

## Must Not Be Doubled

Keep the production helper, schema, matcher or declaration under examination real. Substituting the decision itself would remove the behavior the assertions exercise.
