Skip to content

CAP-MKT-MKT-009Obtain a complete audience count in the background

Markdown

CAP-MKT-MKT-009

Obtain a complete audience count in the background

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaMarketingModuleMarketing campaigns, communications and resolutionRevision2

Read atservices-marketing d071a159react-console baf6dae3

The Formal Contract

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

Outcomes
Large audiences can be counted beyond the interactive people limit.Jobs settle evaluations with complete counts or an explained failure.
Surfaces
consoleapijob
Preconditions
A saved audience is available and the caller has audience-view permission.
Postconditions
The count evaluation eventually stores completed counts or a failure reason.
Intent sources
services-marketing:docs/milestones/MKT-M2.md#6. **Preview**: "Matching records 241 → People 233 → Deliverable 216" with a table of who is left out and why (bounced orservices-marketing:docs/milestones/MKT-M2.md#Scope

Controls

32 controls apply, from the corpus control catalogue.

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

Permissions

KeyChecked atScope
marketing.audiences.viewapitenant

Business Rules

13 rules, 13 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
Count everyone returns an accepted evaluation while a background job performs the calculation rather than counting within the start request.
lifecycleapi, servicetest
02must prove
Proposed
Full counts remove the people cap but reject more than one million source records or more than 100,000 records in an excluded audience.
calculationserviceobserved
03must prove
Proposed
Successful counting stores the complete count chain and completion time and marks the job successful.
lifecycleservicetest
services-marketing:modules/marketing/tests/integration/services/count-everyone-job.integration.spec.ts#settles the job succeeded, with its record in the audience’s tenant
04must prove
Proposed
A final refusal immediately fails the evaluation and job with its reason, without recording a successful or empty count.
lifecycleservicetest
services-marketing:modules/marketing/tests/integration/services/count-everyone-job.integration.spec.ts#settles the evaluation failed with Platform’s code, never counted and never empty
05must prove
Proposed
Temporary faults leave evaluations running during retries, and exhausted job attempts eventually fail the evaluation.
lifecycleservicetest
services-marketing:modules/marketing/tests/integration/services/count-everyone-job.integration.spec.ts#settles the evaluation failed through the job’s failure consequence, so none waits running
06must prove
Proposed
The five-minute reconciler resolves submitted jobs that never run and applies their evaluation failure only once.
lifecycleunknown
07must prove
Proposed
Submission failure marks the newly recorded evaluation failed before returning the start error.
lifecycleserviceobserved
08must prove
Proposed
Submission identity makes retries for one evaluation refer to one job; requesting another attempt creates a new evaluation.
invariantservicetest
services-marketing:modules/marketing/tests/unit/count-everyone-job.spec.ts#submits the same job again for the same evaluation: one intention per evaluation
09must prove
Proposed
A task redelivered after evaluation settlement returns the stored result without settling it again.
invariantservicetest
10must prove
Proposed
Evaluation reads must name its owning audience and workspace; mismatches return not found.
validationapi, servicetest
services-marketing:modules/marketing/tests/e2e/audience-evaluation.e2e.spec.ts#answers 404 for an evaluation the audience does not have
11must prove
Proposed
The audience-view permission authorizes both a count request and its job submission.
permissionapi, servicetest
services-marketing:modules/marketing/tests/unit/count-everyone-job.spec.ts#is submitted under the key that lets a person count: audiences.view
12must prove
Proposed
The console offers Count Everyone after a capped preview, polls until settlement and explains a failed count.
policyconsoleobserved
13must prove
Proposed
The count task loads the audience definition current at execution and applies parameter values retained at submission.
lifecycleserviceobserved

Scenarios

IdGivenWhenThenProvenance
01An interactive result has reached its people limit.The coordinator requests a complete count and watches settlement.The console progresses from running work to the completed count chain.test
react-console:e2e/mock/marketing-audiences.mock.spec.ts#counts the whole audience when the preview stopped early, and polls until the job settles

Edge Cases

IdGivenWhenThenProvenance
02The query service stays unavailable throughout the job's attempts.The retry budget is exhausted.The stored evaluation ends in failure rather than remaining running.test
services-marketing:modules/marketing/tests/e2e/audience-evaluation.e2e.spec.ts#answers a count 202 and reads it back failed once the job gave up, never left running

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.