Skip to content

ATS-PFM-LLM-009Recover interrupted requests and identify accounting drift: Capability Test Specification

Markdown

ATS-PFM-LLM-009

Recover interrupted requests and identify accounting drift: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-PFM-LLM-009

Design

Executed by
TST-PFM-LLM-045, TST-PFM-LLM-046

KindAcceptance test setProduct areaPlatformModuleAI Requests, Usage and the Jazz AI TeammateRevision2

Read atservices-platform ad3f6a65

Coverage

  • Rule gap: FND-PFM-LLM-068
  • Transition gap: FND-PFM-LLM-068
  • Validation gap: FND-PFM-LLM-068
  • Permission not-applicable
  • Edge gap: FND-PFM-LLM-068
  • Failure gap: FND-PFM-LLM-068
  • Boundary covered
  • Concurrency gap: FND-PFM-LLM-068
  • Invariant gap: FND-PFM-LLM-068
  • Interaction covered

Test Scenarios

6 scenarios proving CAP-PFM-LLM-009; 5 bound to an existing test.

01 Old nonterminal requests receive estimated settlementtransitionapitest
Proves
BR-CAP-PFM-LLM-009-01
Preconditions
An unsettled request is older than one day.
Steps
Run eligible recovery.
Expected
The request records estimated credits and no cents, its recorded hold is released and the period receives the estimate.
Data
Fixtures representing an unsettled request is older than one day.
Bound to
Source
services-platform:modules/llm/tests/integration/services/reconciliation/llm-settlement-sweep.integration.spec.js#settles it at its estimate, because its real cost was never learned
02 Recent work remains untouchedboundaryapitest
Proves
BR-CAP-PFM-LLM-009-02
Preconditions
A request is only a minute old.
Steps
Invoke recovery.
Expected
It examines none of that work and preserves its hold without a past-window alert.
Data
Fixtures representing a request is only a minute old.
Bound to
Source
services-platform:modules/llm/tests/integration/services/reconciliation/llm-settlement-sweep.integration.spec.js#leaves the hold in place, so a live call keeps the credits it reserved
03 Successful recovery is not charged twiceinvariantapitest
Proves
BR-CAP-PFM-LLM-009-03
Preconditions
A request is eligible for recovery.
Steps
Run reconciliation twice.
Expected
The first settles and alerts once; the second finds no unsettled request and adds no charge.
Data
Fixtures representing a request is eligible for recovery.
Bound to
Source
services-platform:modules/llm/tests/integration/services/reconciliation/llm-settlement-sweep.integration.spec.js#finds nothing to examine on the second, because a settled call is not unsettled
04 Stale tasks become abandonedtransitionapitest
Proves
BR-CAP-PFM-LLM-009-05
Preconditions
One execution is older than the window and another remains recent.
Steps
Run task recovery.
Expected
The stale record becomes abandoned at detection with no duration and unchanged counters, while the recent task remains running.
Data
Fixtures representing one execution is older than the window and another remains recent.
Bound to
Source
services-platform:modules/llm/tests/integration/services/reconciliation/llm-execution-sweep.integration.spec.js#abandons the stale running execution
05 Counter drift is reported without repairruleapitest
Proves
BR-CAP-PFM-LLM-009-06
Preconditions
One of two closed tasks disagrees with its settled requests.
Steps
Run the counter check.
Expected
One discrepancy identifies both totals and the execution, leaving its stored counters unchanged.
Data
Fixtures representing one of two closed tasks disagrees with its settled requests.
Bound to
Source
services-platform:modules/llm/tests/integration/services/reconciliation/llm-execution-sweep.integration.spec.js#counts the one execution that differs
06 Recovered requests enter reporting onceinteractionapiproposed
Proves
BR-CAP-PFM-LLM-009-01 BR-CAP-PFM-LLM-010-08
Preconditions
A stale nonterminal request has no prior daily cell.
Steps
Recover it, rebuild reporting, then repeat both passes.
Expected
The request contributes one estimated-credit settlement with unknown cents and repeated rebuilding preserves the same totals.
Data
An isolated workspace with the records, clock instants and caller authority stated in the preconditions.
Source
services-platform:modules/llm/aws/lambda/RECONCILIATION.handler.ts,services-platform:modules/llm/services/reconciliation/rollup-settled-invocations.ts

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.