Skip to content

CAP-PFM-DJE-019Control capacity protection during database pressure

Markdown

CAP-PFM-DJE-019

Control capacity protection during database pressure

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaPlatformModuleData Job EngineRevision1

Read atservices-platform ad3f6a65macroservice-libraries 54536a44

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Repeated pressure readings guide gradual state changes.Bulk work yields capacity before ordinary traffic is reduced.Staff overrides require a reason, expiry and audit record.
Surfaces
apijob
Intent sources
services-platform:docs/workload-governance.md#Capacity sentinel

Controls

23 controls apply, from the corpus control catalogue.

TC-AVL-001 TC-AVL-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-IAM-003 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-005 TC-MON-001 TC-PI-001 TC-PI-003 TC-PI-005 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
hq.capacity.manageapiglobal

Business Rules

9 rules, 8 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
Minute readings classify pressure using capacity utilization above 80%, load above 1.5 times the derived processor estimate, connection borrowing above one second, API latency above twice baseline or detected scaling; saturation or borrowing above three seconds is critical.
calculationserviceobserved
02must prove
Proposed
Automatic escalation requires three supporting readings, recovery steps down after five calmer readings, and changes are spaced by five minutes; sustained critical readings can then enter emergency, while scaling alone reaches only constrained.
calculationservicetest
03must prove
Proposed
Constrained applies 0.5 bulk and heavy factors; critical applies zero bulk and 0.25 heavy; emergency additionally applies 0.5 write and read factors.
calculationservicetest
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#stops bulk and quarters heavy in critical, keeping writes and reads whole
04must prove
Proposed
Capacity inspection and pin management use staff-only routes and capacity authority; customer-scoped administrators cannot use them.
permissionapitest
services-platform:modules/capacity/tests/e2e/capacity-pins.e2e.spec.js#refuses a customer's administrator, whatever they hold at their customer's scope
05must prove
Proposed
A capacity pin requires a known state, nonblank reason and future expiry within 24 hours; invalid input names its field without changing the stored pin.
validationapi, service, databasetest
06must prove
Proposed
Pin and release operations audit their previous and resulting values; the next sentinel tick applies an active pin without the automatic spacing restriction.
policyservicetest
services-platform:modules/capacity/tests/integration/services/pins/capacity-pins.integration.spec.js#records the pin and its removal, each with what it was and what it became
07must prove
Proposed
When enabled and emergency readings persist for five further minutes, the sentinel applies declared emergency stage throttles and restores their normal values on recovery.
policyservicedocumented
08must prove
Proposed
Without an active pin, a failed signal read holds the previous state for one tick and a second consecutive failure returns it to normal.
policyserviceobserved
09
Proposed
The sentinel publishes its state independently to cache and parameter channels so one failed write does not prevent the other.
policyservicedocumented

Scenarios

IdGivenWhenThenProvenance
01Three consecutive readings show capacity utilization above 80%.The sentinel evaluates the new window.It enters constrained and publishes a bulk factor of one half.test
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#enters constrained on three constrained readings in a row

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.