---
id: TST-PFM-SEC-059
title: HQ workspace roles request checks
kind: api-lifecycle
product_area: platform
module: security
revision: 2
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: Use the prepared test database and suite-owned fixture rows; retain shared seed records.
assertion_evidence:
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#the roles grantable
      in a tenant, for HQ (end to end)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#serves a staff member
      holding hq.tenants.read and nothing else
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#answers records of
      id, name, productKey, kind, description and grants_nothing, a built-in as built-in and a
      custom role as custom
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#leaves out another
      customer's custom role and the HQ staff roles
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#leaves out a built-in
      that is staff-only by its keys alone, and keeps one that also grants a customer key
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#answers 404 for a
      tenant that does not exist
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#refuses a staff
      member who holds another HQ key but not hq.tenants.read as 403
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#refuses an
      administrator of the tenant's own customer, holding every key at that customer, as 403
  - provenance: test
    source: >-
      services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js#refuses an anonymous
      call as 401
dependency_evidence: >-
  The local request harness exercises the route dispatcher and the prepared database. The suite
  controls the signing key at the declared seams; those collaborators remain outside its live proof.
evidence:
  - 'services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js'
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
binding_note: >-
  The file has no scenario binding established by this examination. Its executable checks remain
  registered without assigning them broader acceptance coverage.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: 'services-platform:modules/security/tests/e2e/hq-tenant-roles.e2e.spec.js'
  explicit_no_doubles: false
  identified_double_boundaries:
    - the signing key
---
# HQ workspace roles request checks

## Verification Boundary

The file exercises public request handling through the local service harness. The assertion references identify the source checks for HQ workspace roles.

## What This Suite Proves

The file supplies executable engineering checks for the named subject. No complete acceptance scenario is inferred from the file’s existence.

## 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 local request harness exercises the route dispatcher and the prepared database. The suite controls the signing key at the declared seams; those collaborators remain outside its live proof.

## Must Not Be Doubled

Keep route dispatch, signed-context verification and the exercised service decisions real. A test key can supply signatures, but replacing the authorization decision cannot prove request enforcement.
