Skip to content

CAP-PFM-QRY-002Answer a question within the reader’s access

Markdown

CAP-PFM-QRY-002

Answer a question within the reader’s access

Markdown
  • DocumentDraft
  • Product intentProposed
  • 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
Staff investigate data without writing database statements.Workspace and dataset access constrain results.Paging follows the question’s declared ordering.
Surfaces
consoleapi
Intent sources
services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 8services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 9services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 13services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 15services-platform:docs/queries/semantic-query-layer.md#A value asked for when a saved query runs (`$parameter`, 2026-10-13)

Controls

29 controls apply, from the corpus control catalogue.

TC-AVL-001 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-CRY-001 TC-CRY-002 TC-CRY-003 TC-CRY-004 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 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
platform.queries.readapitenant
<application>.<dataset>.query (the owner's key)servicetenant

Business Rules

16 rules, 16 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
Query execution confines source records and joins to the requested workspace, with database row security also preventing cross-workspace reads when a compiled predicate is absent.
origin: services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 9
invariantservice, databasetest
services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#confines a statement carrying no tenant predicate at all, so row-level security holds beneath the compiler
02must prove
Proposed
Queries use a read-only reader transaction with a time limit; timeouts produce an actionable limit message, and other failures reveal neither statement text nor stored data.
invariantservice, databasetest
services-platform:modules/queries/tests/integration/services/execute/read-only-execution.integration.spec.js#refuses a write, whatever the statement carries, because the transaction is read-only
03must prove
Proposed
Unsupported fields, operators and relationships are rejected without distinguishing inaccessible metadata from metadata that does not exist.
validationservicetest
services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#refuses a column no owner registered exactly as it refuses one that does not exist at all
04must prove
Proposed
Criterion validation rejects blank text, empty identity lists, fractional integer values, unsafe whole numbers and dates outside the required calendar-date form.
validationservicetest
services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#refuses a blank text value, which would match every contact rather than narrow anything
05must prove
Proposed
Paging cursors carry the query’s ordered position, and malformed cursors, cursors from another query or cursors with incompatible keys are rejected.
validationservicetest
services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#refuses a cursor issued for a different query, rather than paging the wrong rows
06must prove
Proposed
Requested totals count all matching base records or groups in the page’s database snapshot, independently of cursor position and join multiplication; unrequested totals are omitted.
calculationservicetest
07must prove
Proposed
Recently Viewed returns this person’s workspace records once each at their latest viewing time, newest first, and rejects system executions without a person.
origin: services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 15
policyservicetest
services-platform:modules/queries/tests/integration/services/execute/recently-viewed-scope.integration.spec.js#answers each caller the records that caller viewed, and no other caller’s
08must prove
Proposed
The current-person criterion resolves from the execution identity on a user-bearing field with a compatible operator, and rejects unsuitable fields, operators and non-person executions.
policyservicetest
09must prove
Proposed
Unsaved execution rejects requested-at-run values and supplied parameter maps, while validation reports those uses as located problems in a successful validation response.
origin: services-platform:docs/queries/semantic-query-layer.md#A value asked for when a saved query runs (`$parameter`, 2026-10-13) (Andrew, 2026-10-13)
validationapi, servicetest
services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#refuses a token sent to the validate route, which judges a request on its own
10must prove
Proposed
Calendar and relative-date criteria use the workspace’s time zone and calendar, and date previews report the calendar used.
calculationservicetest
11must prove
Proposed
Validation collects located query problems without executing the query, while execution stops at its first invalid part.
validationservicetest
services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#answers 200 and the problems for a query it will not run, rather than a refusal
12must prove
Proposed
Linked result cells identify records whose identities the reader may select, and an override referring to a record absent from the result is rejected.
policyservicetest
services-platform:modules/queries/tests/e2e/datasets.e2e.spec.js#refuses a link override naming a record the result does not have as 400 QueryLinkInvalid
13must prove
Proposed
Reference columns display the referenced record’s name, fall back to its identity when nameless, and remain empty when absent; an explicitly selected identity stays separate.
calculationservicetest
services-platform:modules/queries/tests/integration/services/execute/reference-display-values.integration.spec.js#shows each spouse’s name, the id as text where the spouse has no name, and null where there is no spouse
14must prove
Proposed
A field reached through a record reference supports one many-to-one traversal and rejects a second traversal.
origin: services-platform:docs/queries/semantic-query-layer.md#Decisions Recorded (Andrew, 2026-10-08) 13
validationservicetest
services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#refuses a second hop through the referenced record's own reference
15must prove
Proposed
The documented query bounds are 255 selected fields, five sort keys, 100 criteria at depth six, two to-one hops and pages of at most one thousand rows, defaulting to one hundred.
validationapi, servicedocumented
services-platform:docs/queries/semantic-query-layer.md#10.6 Complexity limits (first release)
16must prove
Proposed
Grouped calculations apply sums, averages, minima and maxima to the matching group rows, preserve appropriate result types, and yield no value for a field absent from every row.
calculationservicetest
services-platform:modules/queries/tests/integration/services/execute/query-aggregates.integration.spec.js#answers one group for the three contacts, every aggregate computed over exactly those rows

Scenarios

IdGivenWhenThenProvenance
01Two workspaces use identical contact and employer identities.A person queries contacts with an employer value in the first workspace.The answer includes only records and related values from that workspace.test
services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#answers no row, pick or joined value belonging to another tenant, though the ids are the same
02A task question uses the current-person criterion.Two people execute that same question.Each result contains the tasks assigned to its own runner.test
03The workspace calendar uses a time zone different from UTC.A datetime criterion asks for records on a calendar day.Matching follows the full workspace day.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.