Skip to content

CAP-PFM-OPS-004Recover or deliberately stop background work

Markdown

CAP-PFM-OPS-004

Recover or deliberately stop background work

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

KindCapabilityProduct areaPlatformModuleOperational RecordsRevision1

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

The Formal Contract

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

Outcomes
Retry can retain completed work while creating a separate attempt.Requested abort is distinguished from ordinary failure.
Surfaces
consolejob
Preconditions
The kind declares support for the requested retry or cancellation.
Postconditions
Retry produces a linked new job, while cancellation records the request before stopping execution.
Intent sources
services-platform:docs/hq/rhythm-hq-plan.md#D12 (retry where the kind offers one; cancel hidden)

Controls

29 controls apply, from the corpus control catalogue.

TC-AVL-001 TC-AVL-004 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-DAT-001 TC-DAT-003 TC-DAT-004 TC-IAM-001 TC-IAM-003 TC-IAM-006 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-MON-001 TC-PI-001 TC-PI-002 TC-PI-004 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.jobs.retryconsoleglobal
hq.tenants.provisionapiglobal

Business Rules

8 rules, 6 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
Retry creation requires a settled job of a retryable kind and creates a new job linked to the prior execution.
origin: services-platform:docs/hq/rhythm-hq-plan.md#L. Verification plan (retry lineage)
validationservicetest
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses to create a retry of a kind that is not retryable
02must prove
Proposed
A retry carries forward completed step keys so its workflow can bypass work already completed.
calculationservicetest
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
03
Proposed
Workspace provisioning and workspace purge are the retryable Platform kinds; the other registered kinds do not permit retry.
policyserviceobserved
04must prove
Proposed
Cancellation requires a reason, an unsettled job and a kind that declares cancellation support.
validationservicetest
05must prove
Proposed
The cancellation request commits to the job and its history before execution is stopped; an unstarted job settles cancelled immediately, and repeat requests add no second request event.
lifecycleservicetest
macroservice-libraries:packages/jobs/src/engine/job-cancellation.spec.ts#records the request on the root and in its history, then stops the execution with the cause
06must prove
Proposed
Reconciliation treats an execution aborted after a cancellation request as cancelled without applying failure consequences; an unrequested abort fails normally.
lifecycleservicetest
macroservice-libraries:packages/jobs/src/engine/job-cancellation.spec.ts#settles an execution aborted on request as cancelled, applying no failure consequence
07
Proposed
Platform exposes no job-cancellation route or screen despite cancellation support in the eligibility population kind.
policyapiobserved
08must prove
Proposed
The HQ job page offers confirmed retry for failed workspace provisioning under the jobs retry permission, while the called workspace operation requires provisioning authority.
permissionconsole, apitest
react-console:e2e/mock/hq-ops.mock.spec.ts#shows a failed job's reason and retries its provisioning

Scenarios

IdGivenWhenThenProvenance
01A retryable job has completed earlier steps before failing.Its owner creates a retry.The new job identifies its predecessor and carries the completed step keys.inferred
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#creates the retry with lineage to the prior job
02A cancellable job is executing.An authorized engine caller records a stop reason and requests cancellation.An aborted execution settles cancelled without invoking the business failure consequence.inferred
macroservice-libraries:packages/jobs/src/engine/job-cancellation.spec.ts#settles an execution aborted on request as cancelled, applying no failure consequence

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.