---
id: TST-PFM-DJE-001
title: Admission budget
kind: unit
product_area: platform
module: data-job-engine
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: macroservice-libraries
files:
  - packages/data-jobs/src/admission-budget.spec.ts
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: In-memory fixtures and restored dependency doubles.
evidence:
  - 'macroservice-libraries:packages/data-jobs/src/admission-budget.spec.ts'
assertion_inventory:
  - '@rhythmsoftware/macroservice-data-jobs: how many batches admission hands over'
  - hands over the room the tightest ceiling leaves
  - 'hands over no more than are waiting, however much room there is'
  - hands over nothing when a ceiling is full
  - 'hands over nothing, rather than asking for batches back, when a ceiling is already exceeded'
  - hands over nothing when nothing is waiting
  - 'answers the room each ceiling left on its own, which is what a job that admitted nothing logs'
  - names the per-job ceiling as the binding one when it leaves the least room
  - names the per-tenant ceiling as the binding one when it leaves the least room
  - names the global ceiling as the binding one when it leaves the least room
  - >-
    @rhythmsoftware/macroservice-data-jobs: whether a job that could admit nothing can ever admit
    anything
  - calls a job stalled when it has been blocked for the limit and nothing blocking it has moved
  - >-
    calls a job stalled when the ceiling leaves no room and there is nothing in flight to give any
    back
  - leaves a job that has room alone
  - 'leaves a job with nothing waiting alone, because it is finishing and not stuck'
  - 'leaves a job waiting for its own batches alone, however long they take'
  - leaves a job blocked for less than the limit alone
  - 'leaves a job waiting behind a neighbour whose batches are moving alone, however long it waits'
  - '@rhythmsoftware/macroservice-data-jobs: the ceilings the ports resolve'
  - 'caps a tenant''s ceiling at the service''s share less one, so one tenant never holds a whole share'
  - 'leaves a share of one whole, and a share of none at none'
  - takes the default for a profile that is absent or not a whole number of batches
  - 'bounds the capacity factor to between 0 and 1, and reads nothing trustworthy as 1'
  - 'defaults the factor to 1: the seam the capacity sentinel fills'
  - 'asks the profile of each tenant once, and answers a failing port with its default and a report'
registration_note: Registration describes existing source; the suite is not executed by this documentation job.
---

# Admission budget

## Verification Boundary

The suite checks an isolated production calculation, declaration or adapter. The structured assertion inventory records the checks present at the pinned revision.

## What This Suite Proves

The existing checks exercise admission budget. The specification bindings identify the narrower outcomes supported by those assertions.

## What It Does Not Prove

An isolated check does not establish a deployed workflow, database enforcement or complete feature acceptance.

## Real Dependencies and Test Doubles

The production function or declaration is exercised with in-memory inputs and dependency doubles. This boundary does not require a live database.

## Must Not Be Doubled

The production function under examination and its returned decisions remain real; replacing their answers defeats the check.
