Skip to content

CAP-PFM-DJE-014Process file jobs within shared workload limits

Markdown

CAP-PFM-DJE-014

Process file jobs within shared workload limits

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaPlatformModuleData Job EngineRevision1

Read atmacroservice-libraries 54536a44services-crm a8d1364f

The Formal Contract

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

Outcomes
Malformed input is traceable to file lines.Admission observes job, workspace and shared ceilings.Stalled admission produces a visible failure reason.
Surfaces
jobapi
Intent sources
services-platform:docs/milestones/plans/PLAT-M19-plan.md#A1services-platform:docs/milestones/plans/PLAT-M19-plan.md#S16services-platform:docs/milestones/plans/PLAT-M19-plan.md#S21

Controls

29 controls apply, from the corpus control catalogue.

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

Permissions

KeyChecked atScope
crm.contacts.bulkapitenant
crm.organizations.bulkapitenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Confirmed
A file job reads the exact version of a completed upload in its workspace; absent or foreign uploads receive the same refusal, and unfinished uploads report their state.
validationapi, servicetest
services-crm:modules/data-jobs/tests/e2e/bulk-data-jobs.e2e.spec.js#refuses an upload id of no upload at all in the same words, so neither answer tells a caller whose it is
02must prove
Confirmed
File jobs accept JSON Lines and header-based CSV, including gzip variants identified by filename; single JSON documents and zip archives are refused.
validationservicedocumented
03must prove
Confirmed
Chunks target 100 records or two million bytes, allowing oversized records and existing groups to exceed those targets; a repeated group from the most recently closed chunk is rejected.
calculationserviceobserved
04must prove
Confirmed
Unreadable lines receive line-numbered refusals, while exceeding the configured malformed-input rate fails the job.
policyservicetest
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#fails the job when most of the file cannot be read, rather than reading nine million lines of it
05must prove
Confirmed
Admission is bounded by the remaining job, workspace and service capacity; a workspace ceiling is below a divisible service share and the service ceiling is reduced by its capacity factor.
calculationserviceobserved
06must prove
Confirmed
A job waiting longer than ten minutes receives priority; other grants rotate across workspaces with fewer batches in flight, selecting older jobs within each workspace.
policyservicetest
07must prove
Confirmed
Admission fails after 15 minutes without room when the job has no work in flight and its blocking admissions are also stalled; a zero capacity factor holds work without that failure.
policyservicetest
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#fails a job whose ceiling has been held by work that is not moving, rather than waiting for room for ever
08must prove
Confirmed
Batches belonging to paused, cancelled, failed or completed jobs do not consume admission room.
policyservicetest
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#admits the next job when the one holding the tenant’s ceiling has been paused, because a paused batch is not in flight
09
Confirmed
Default cluster bulk limits are twelve batches in production and four in development, divided between CRM and Accounting; workload profiles request workspace limits, with four as the fallback before share capping.
calculationservicedocumented
10
Confirmed
File-job progress distinguishes source reading, batch planning, application and completion, without persisting one input row per record.
policyservice, consoledocumented
11must prove
Confirmed
Within one source-reading invocation, repeated-group detection remembers only the most recently closed chunk; distant or resumed repetitions can escape it.
invariantserviceobserved

Scenarios

IdGivenWhenThenProvenance
01Three lines in a thousand-line file cannot be parsed.The engine processes the file.The job records 997 applications and refusals at lines 100, 500 and 900.test
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#reads a thousand-line file into chunks, applies 997 records and rejects three lines by their line number
02Two workspaces have imports competing for a four-batch budget.Admission distributes available batches.The cited fixture grants two batches to each workspace.test

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.