Skip to content

CAP-PFM-QRY-015Deliver recurring query and report files

Markdown

CAP-PFM-QRY-015

Deliver recurring query and report files

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaPlatformModuleQuestions, record exploration and data deliveryRevision1

Read atservices-platform ad3f6a65react-console baf6dae3

The Formal Contract

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

Outcomes
Recurring files arrive without manual execution.Automatic delivery stops when owner access is lost.Query schedules retain their chosen source copy.
Surfaces
consoleapijob
Intent sources
services-platform:docs/migrations/query-scheduling-exports/README.md#D2. Schedules use the shared scheduling libraryservices-platform:docs/migrations/query-scheduling-exports/README.md#D3. A schedule runs a pinned copy of the saved query (snapshot), and says when the saved query has changedservices-platform:docs/migrations/query-scheduling-exports/README.md#D4. Whose access a run uses: the schedule's owner, checked fresh at every runservices-platform:docs/migrations/query-scheduling-exports/README.md#D5. Permissionsservices-platform:docs/migrations/query-scheduling-exports/README.md#D6. Recipientsservices-platform:docs/migrations/query-scheduling-exports/README.md#D7. Delivery: one e-mail per recipient with a secure link, through the communications moduleservices-platform:docs/migrations/query-scheduling-exports/README.md#D8. Templates: the communications module's templates, chosen per scheduleservices-platform:docs/migrations/query-scheduling-exports/README.md#D12. Execution records and failuresservices-platform:docs/migrations/query-scheduling-exports/README.md#D13. Rhythm 1.0 schedules: converted paused, activated deliberatelyservices-platform:docs/migrations/query-scheduling-exports/README.md#Remaining differences (accepted by Andrew 2026-10-17)services-platform:docs/milestones/plans/RPT-M1-plan.md#D9

Controls

31 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-002 TC-DAT-003 TC-DAT-004 TC-DAT-005 TC-IAM-001 TC-IAM-006 TC-LOG-001 TC-LOG-002 TC-LOG-003 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-TEN-004 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
platform.queries.readapitenant
platform.query-schedules.useservicerecord
platform.query-schedules.manageservicetenant
platform.query-schedules.external-recipientsservicetenant
platform.reports.use (report schedules)servicetenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Schedule access requires the query surface plus schedule use or manage; users reach their own schedules, managers reach all, and other users receive not found.
permissionapi, servicetest
02must prove
Confirmed
Query schedule creation requires a visible compilable source, required values, an active published delivery template, an hourly-or-slower timetable and active organizational user recipients.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D2. Schedules use the shared scheduling library
validationservicetest
03must prove
Confirmed
Query schedules run their stored source copy until explicitly refreshed, show later saved-query changes for comparison, and do not silently adopt those edits.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D3. A schedule runs a pinned copy of the saved query (snapshot), and says when the saved query has changed
policyservicetest
04must prove
Confirmed
Automatic runs rebuild owner access and stop delivery, fail the run and pause the schedule when the owner cannot execute its source.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D4. Whose access a run uses: the schedule's owner, checked fresh at every run
policyservicetest
05must prove
Confirmed
Only schedule managers can take ownership, after which later automatic runs use their access.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D4. Whose access a run uses: the schedule's owner, checked fresh at every run
permissionservicetest
06must prove
Confirmed
Run Now executes as the initiating person for the existing recipients and can run a paused schedule.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D4. Whose access a run uses: the schedule's owner, checked fresh at every run
policyservicetest
07must prove
Confirmed
Schedules accept at most fifty distinct users or addresses, resolve user addresses at send time, skip unavailable users with reasons and require outside-recipient permission for external addresses.
permissionservicetest
services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses an outside address without platform.query-schedules.external-recipients (403), and writes nothing
08must prove
Confirmed
Each recipient gets one communications request per run with a personal seven-day link, and run-recipient deduplication prevents duplicate e-mails on retry.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D7. Delivery: one e-mail per recipient with a secure link, through the communications module
invariantservicetest
09must prove
Confirmed
Query schedules default to skipping empty results, while report schedules reject that option.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D7. Delivery: one e-mail per recipient with a secure link, through the communications module
policyservicetest
10must prove
Confirmed
A scheduled date value stored as today resolves to each run’s workspace day and is recorded on that run’s export.
origin: services-platform:docs/queries/exports-and-schedules.md#Schedule (Andrew, 2026-10-17)
calculationservicetest
11must prove
Confirmed
Transient errors retry, query and access failures do not, five consecutive failed runs pause the schedule with a reason, and success clears the failure count.
policyservicetest
12must prove
Confirmed
Report schedules require report use and visibility, render the current report as PDF by default or eligible Excel, flag report changes without pinning them and cannot change into query schedules.
validationservicetest
services-platform:modules/queries/tests/e2e/query-schedules.e2e.spec.js#refuses Excel for a dashboard (400 at options.format)
13must prove
Confirmed
Report deletion atomically pauses its schedules as report deleted, preserves their history and permits only their deletion rather than resumption or another run.
lifecycleservice, databasetest
14must prove
Confirmed
Imported legacy schedules start paused and require confirmation that the legacy schedule is disabled before resuming.
origin: services-platform:docs/migrations/query-scheduling-exports/README.md#D13. Rhythm 1.0 schedules: converted paused, activated deliberately
lifecycleservicetest
15must prove
Confirmed
Schedule edits use the read version, duplication creates a paused caller-owned copy, and deletion removes runs and deliveries while exported files retain their expiry.
lifecycleservicetest

Scenarios

IdGivenWhenThenProvenance
01A scheduled report’s owner loses access to its source.Automatic delivery runs and a manager later takes ownership.The failed run pauses delivery; the manager can restore responsibility for later runs.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.