---
id: TST-PFM-SEC-040
title: Session unit checks
kind: unit
product_area: platform
module: security
revision: 2
status: draft
source_sha:
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: react-console
files:
  - lib/auth/__tests__/session.test.ts
implements:
  - ATS-PFM-SEC-006-03
  - ATS-PFM-SEC-006-04
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: 'react-console:lib/auth/__tests__/session.test.ts#reading tokens'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#takes the expiry, the subject and the
      verified address off the tokens themselves
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#does not throw on a token it cannot read'
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#starting a session'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#hands the three tokens to the session route
      with the header that makes it same-origin only
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#keeps the access token in memory and the
      refresh token nowhere
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#refuses to call a session started when the
      route would not have it
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#refreshing'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#replaces the tokens from the refresh cookie
      without sending one
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#gives every concurrent caller the same
      exchange, so a refresh token is never replayed
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#ends the session when the route refuses, and
      tells whoever is listening why
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#ends the session when the answer carries no
      tokens
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#ends the session when the network fails,
      rather than running without knowing who is signed in
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#keeps a session whose token still works when
      the refresh cannot reach the network (D-17)
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#keeps a session whose token still works when
      the pool is busy and the route answers 503
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#asks again once when a reload meets a busy
      pool, and restores the session if the second answer is good
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#starts a new exchange after the last one
      finished
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#refreshing after a 401'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#does not exchange the cookie again once a
      refusal has ended the session
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#reuses the refresh another request's 401
      already made instead of exchanging again
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#exchanges again when the token in memory is
      the one that was refused
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#exchanges again after a new sign-in follows a
      refusal
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#refreshing a tab that wakes up (D-17)'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#refreshes a token at the end of its life,
      before the next click meets a 401
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#leaves a token with plenty of life alone, and
      does nothing without a session
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#resolving an access token'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#answers the one in memory while it is good
      for anything
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#refreshes when the token in memory has aged
      out
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#refreshes when there is nothing in memory at
      all, which is what a reload looks like
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#answers null when the refresh is refused, so
      the caller sends the person to sign in
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#ending a session'
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#revokes, forgets and announces'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#still forgets the tokens when the revocation
      call fails
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#can skip the revocation when the session is
      already gone
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#the remembered tenant'
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#remembers a tenant against the pool subject,
      and only the subject
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#keeps each person's choice apart, so the next
      person does not inherit it
  - provenance: test
    source: >-
      react-console:lib/auth/__tests__/session.test.ts#forgets one person's choice without touching
      anybody else's
  - provenance: test
    source: 'react-console:lib/auth/__tests__/session.test.ts#does nothing at all without a subject'
dependency_evidence: >-
  The test imports the authentication helper and supplies its inputs in-process. Browser storage,
  environment values or fetch responses are fixtures where the file replaces them; these checks do
  not call a live identity provider.
evidence:
  - 'react-console:lib/auth/__tests__/session.test.ts'
  - >-
    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
---
# Session unit checks

## Verification Boundary

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

## 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 test imports the authentication helper and supplies its inputs in-process. Browser storage, environment values or fetch responses are fixtures where the file replaces them; these checks do not call a live identity provider.

## 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.
