Skip to content

ATS-PFM-OPS-001Complete background work with a durable record: Capability Test Specification

Markdown

ATS-PFM-OPS-001

Complete background work with a durable record: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleOperational RecordsRevision2

Read atservices-platform ad3f6a65macroservice-libraries 54536a44react-console baf6dae3

Coverage

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

Test Scenarios

17 scenarios proving CAP-PFM-OPS-001; 8 bound to an existing test.

01 Reuse an existing submissionconcurrencyunittest
Proves
BR-CAP-PFM-OPS-001-01 INV-DOM-PFM-OPS-001-01
Preconditions
A registered kind has a stable intention key; one competing submission runs in a caller transaction.
Steps
Repeat the intention, simulate a uniqueness collision outside a caller transaction, and repeat the collision inside one.
Expected
Ordinary repeats and a lost race outside the caller transaction resolve to the existing job; the same collision inside the caller transaction surfaces its uniqueness failure to the caller.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#answers the job the identity already names when the submission is repeated
02 Keep execution outside the transactionvalidationunitnegativeproposed
Proves
BR-CAP-PFM-OPS-001-02
Preconditions
The submitting operation has an open transaction.
Steps
Attempt combined submission and start, then create inside and start after commit.
Expected
The combined attempt is refused and the committed job has queued steps and submission history.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses submitJob inside a transaction: the execution starts after the commit
03 Retain the committed request after start failurefailureunitnegativeproposed
Proves
BR-CAP-PFM-OPS-001-03
Preconditions
Execution startup is unavailable.
Steps
Call the API-facing start helper for a committed job.
Expected
Submission remains successful and the pending job is logged for reconciliation.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.ts:startJobOrLeaveToReconciler
04 Reject movement after settlementinvariantunitnegativetest
Proves
BR-CAP-PFM-OPS-001-04 INV-DOM-PFM-OPS-001-03
Preconditions
A job has reached success.
Steps
Attempt another settlement and deliver a delayed step report.
Expected
Settlement is refused and the report adds no transition history.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses settling an already terminal job
05 Reject decreasing progressboundaryunitnegativetest
Proves
BR-CAP-PFM-OPS-001-05 INV-DOM-PFM-OPS-001-04
Preconditions
A run already reports sixty percent progress.
Steps
Report forty percent progress.
Expected
The transition is refused.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses progress that would move backwards
06 Keep transient errors out of persisted historyfailureunitnegativetest
Proves
BR-CAP-PFM-OPS-001-06
Preconditions
One task refuses permanently and another raises an unexpected fault.
Steps
Execute both failure paths through the workflow.
Expected
The refusal ends immediately with safe wording and the retried fault reveals no technical payload in persisted history.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/workflow/job-workflow.spec.ts#lets no detail of the transient error reach the job or the execution state
07 Require a declared business consequenceruleunitnegativetest
Proves
BR-CAP-PFM-OPS-001-09 INV-DOM-PFM-OPS-001-08
Preconditions
All Platform job kinds are registered.
Steps
Inspect their failure declarations.
Expected
Every kind names a consequence or an explicit no-change declaration.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
services-platform:modules/jobs/tests/unit/job-failure-consequences.spec.js#declares a failure consequence, or states there is none, for every registered kind
08 Retain deletion evidence during purgetransitionapiproposed
Proves
BR-CAP-PFM-OPS-001-10
Preconditions
A deleting workspace has ordinary jobs and requester notices.
Steps
Purge its job resources while naming the deletion’s own jobs to retain.
Expected
Ordinary roots, steps, history and notices disappear while the two retained jobs remain.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Source
services-platform:modules/jobs/services/persistence/tenant-purges.ts:JOB_PURGE_RESOURCES
09 Recover a committed run whose start failsinteractionapiproposed
Proves
BR-CAP-PFM-OPS-001-03 BR-CAP-PFM-OPS-002-03
Preconditions
Execution startup fails after a workspace change commits.
Steps
Submit the change, let the reconciliation threshold pass, and inspect the run.
Expected
The change and pending run remain inspectable before reconciliation supplies the final failure.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.ts:startJobOrLeaveToReconciler; services-platform:modules/jobs/tests/integration/lifecycle/job-reconciliation/job-reconciliation.integration.spec.js#settles it failed, saying the job never started; CAP-PFM-OPS-002; WF-PFM-OPS-001; WF-PFM-OPS-002; WF-PFM-OPS-009
10 Retry without reopening the predecessorinteractionapiproposed
Proves
BR-CAP-PFM-OPS-001-04 BR-CAP-PFM-OPS-004-01 BR-CAP-PFM-OPS-004-02
Preconditions
A retryable run fails after completing its first step.
Steps
Create a retry and compare both runs after later reports arrive for the predecessor.
Expected
The retry has separate history while the predecessor retains its final outcome.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses settling an already terminal job; macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses to create a retry of a kind that is not retryable; macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#answers the steps the prior job completed, which the start carries into the new execution; CAP-PFM-OPS-004; WF-PFM-OPS-001; WF-PFM-OPS-002; WF-PFM-OPS-009
11 Retain lifecycle failure evidenceinteractionapiproposed
Proves
BR-CAP-PFM-OPS-001-10
Preconditions
A workspace lifecycle run reaches an interrupted execution outcome.
Steps
Reconcile it and inspect the lifecycle record alongside the job record.
Expected
Both records identify the failed work without silently reopening its final history.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
services-platform:modules/jobs/services/persistence/tenant-purges.ts:JOB_PURGE_RESOURCES; CAP-PFM-SEC-003; WF-PFM-OPS-001; WF-PFM-OPS-002; WF-PFM-OPS-009
12 Preserve retirement scopeinteractionapiproposed
Proves
BR-CAP-PFM-OPS-001-10
Preconditions
A workspace is deleting and its deletion jobs must remain inspectable.
Steps
Purge operational resources and inspect the retained deletion runs.
Expected
Retirement removes owned resources while its retained work still explains the deletion.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
services-platform:modules/jobs/services/persistence/tenant-purges.ts:JOB_PURGE_RESOURCES; CAP-PFM-SEC-004; WF-PFM-OPS-001; WF-PFM-OPS-002; WF-PFM-OPS-009
13 Follow a first report into successful settlementtransitionunittest
Proves
BR-CAP-PFM-OPS-001-04 INV-DOM-PFM-OPS-001-02
Preconditions
A pending run and a running run have an unsettled declared step.
Steps
Report the pending run’s first step; separately settle the running run successfully.
Expected
The first run starts its recorded activity; the second has a final successful outcome with full progress and settlement time.
Data
Run-owned records and controlled clocks or dependency responses named in the preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-root-status-model.spec.ts#settles a running job succeeded, at full progress
14 Exercise the declared step moves and retained attemptstransitionunittest
Proves
BR-CAP-PFM-OPS-001-04 INV-DOM-PFM-OPS-001-03
Preconditions
Separate runs contain steps in each starting state of the declared step lifecycle.
Steps
Apply each declared step move, replay final states, and attempt changed final outcomes.
Expected
Each permitted move has the expected event and attempt history; final-state replays add no event and changed final outcomes are refused.
Data
Run-owned records and controlled clocks or dependency responses named in the preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-step-status-model.spec.ts#the job step status model
15 Retain the continuation successor through replayinvariantunittest
Proves
BR-CAP-PFM-OPS-001-12
Preconditions
A run has a current execution handle and a named continuation.
Steps
Record the successor, replay the same continuation, and submit a continuation for a different source handle.
Expected
Replay preserves the successor and its single continuation event; the different source is refused.
Data
Run-owned records and controlled clocks or dependency responses named in the preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-continuation.spec.ts#recording the continuation
16 Keep success final when requester delivery failsinteractionapinegativeproposed
Proves
BR-CAP-PFM-OPS-001-04 BR-CAP-PFM-OPS-003-05
Preconditions
A notifying run settles successfully before its message sender fails.
Steps
Complete the run, inject the send failure, and inspect both the run and notice outcome.
Expected
The run retains success while notice evidence records the delivery failure.
Data
Isolated workspace and run-owned lifecycle records, with a second linked workspace where shared company evidence is checked.
Source
services-platform:modules/jobs/tests/integration/services/job-snapshot/job-snapshot.integration.spec.js#takes that catalog from the published event rather than the declaration, which the event itself carries; macroservice-libraries:packages/jobs/src/workflow/job-workflow.spec.ts#lets no detail of the transient error reach the job or the execution state; macroservice-libraries:packages/jobs/src/engine/job-engine.ts:settleJob; macroservice-libraries:packages/jobs/src/reconciler/job-reconciler.spec.ts#applies it before the settlement, so a consequence that fails leaves the job for the next pass; services-platform:modules/jobs/services/notices/notify-job-requester.ts:notifyJobRequester
17 Keep the deletion run readable after operational purgeinteractionapiproposed
Proves
BR-CAP-PFM-OPS-001-10 BR-CAP-PFM-OPS-015-09
Preconditions
A deleting workspace has ordinary runs and notices, activity entries, staff exceptions and operational application rows.
Steps
Run the operational lifecycle participants through bounded batches, retaining the deletion’s own run identities.
Expected
The retained deletion runs still explain the purge after the other workspace-owned operational records disappear.
Data
Isolated workspace and run-owned lifecycle records, with a second linked workspace where shared company evidence is checked.
Source
services-platform:modules/jobs/services/persistence/tenant-purges.ts:JOB_PURGE_RESOURCES; services-platform:modules/audit/tests/integration/services/persistence/audit-events.integration.spec.js#is refused by the database, so the purger is never a delete-by-tenant tool; services-platform:modules/licensing/services/maintenance/tenant-participant.ts:licensingParticipant

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.