---
id: FAS-PFM-QRY-01
feature: FEAT-PFM-QRY-01
product_area: platform
module: queries
revision: 1
status: proposed
product_intent: proposed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
  rhythm-v2-docs: 99376625d3e7ac26936413cfc31a88fba6562464
capabilities:
  - CAP-PFM-QRY-001
  - CAP-PFM-QRY-002
  - CAP-PFM-QRY-003
  - CAP-PFM-QRY-004
  - CAP-PFM-QRY-005
  - CAP-PFM-QRY-020
scenarios:
  - id: FAS-PFM-QRY-01-01
    title: 'Discover, draft and validate a usable question'
    kind: behaviour
    exercises:
      - CAP-PFM-QRY-001
      - CAP-PFM-QRY-002
      - CAP-PFM-QRY-003
    relies_on:
      - ATS-PFM-QRY-001-05
      - ATS-PFM-QRY-002-11
      - ATS-PFM-QRY-003-05
    preconditions: A reader can describe Contacts and request a generated draft.
    steps: 'Describe Contacts, request a contact draft, review its outcome and validate the returned definition.'
    expected: >-
      Any returned query uses the reader’s available vocabulary and ordinary validation; clarification
      produces no executable query.
    negative: false
    data_needs: 'Use an isolated workspace, named fixture records and the caller grants described by the prerequisites.'
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-platform:modules/queries/tests/e2e/datasets.e2e.spec.js#tells the console nothing of how a
        field is stored
      - >-
        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
      - >-
        services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#answers the query the worker
        stored, which is the query the execute route would accept
  - id: FAS-PFM-QRY-01-02
    title: Publish a tailored subject and use it through discovery
    kind: interaction
    exercises:
      - CAP-PFM-QRY-001
      - CAP-PFM-QRY-002
      - CAP-PFM-QRY-005
    relies_on:
      - ATS-PFM-QRY-005-07
      - ATS-PFM-QRY-001-02
      - ATS-PFM-QRY-002-01
    preconditions: A safe custom publication is assigned to one workspace but excluded from a second.
    steps: 'Describe the subject and run an ordered question in both workspaces, then disable the publication.'
    expected: >-
      Only the assigned workspace resolves the subject; its execution stops with the explicit disabled refusal
      after the lifecycle change.
    negative: true
    data_needs: 'Use an isolated workspace, named fixture records and the caller grants described by the prerequisites.'
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-platform:modules/queries/tests/e2e/custom-tables.e2e.spec.js#lists the definition as a
        dataset of its own, authorized by the dataset the statement reads
      - >-
        services-platform:modules/queries/tests/e2e/datasets.e2e.spec.js#refuses a dataset the caller holds no
        query permission for as 403
      - >-
        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
  - id: FAS-PFM-QRY-01-03
    title: Retire and restore registered vocabulary
    kind: lifecycle
    exercises:
      - CAP-PFM-QRY-001
      - CAP-PFM-QRY-002
      - CAP-PFM-QRY-005
    relies_on:
      - ATS-PFM-QRY-001-09
      - ATS-PFM-QRY-001-06
      - ATS-PFM-QRY-005-10
    preconditions: A declaration release and a tailored publication each support a current question.
    steps: >-
      Retire and restore the registered declaration, refresh its description, then deprecate and restore the
      tailored publication.
    expected: >-
      Descriptions follow the accepted release; retained custom questions stay usable while deprecated and new
      choices return after restoration.
    negative: false
    data_needs: 'Use an isolated workspace, named fixture records and the caller grants described by the prerequisites.'
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-platform:modules/queries/tests/e2e/datasets.e2e.spec.js#accepts the manifest, naming the
        application it registered
      - >-
        services-platform:modules/queries/tests/integration/services/describe/description-stamp-coverage.integration.spec.js#describes
        a custom field the tenant adds on the very next build
      - >-
        services-platform:modules/queries/tests/e2e/custom-tables.e2e.spec.js#deprecates it, which takes it
        out of every picker and leaves it answering
  - id: FAS-PFM-QRY-01-04
    title: Separate workspace readers from HQ investigators
    kind: permission
    exercises:
      - CAP-PFM-QRY-001
      - CAP-PFM-QRY-002
      - CAP-PFM-QRY-004
      - CAP-PFM-QRY-005
    relies_on:
      - ATS-PFM-QRY-001-04
      - ATS-PFM-QRY-004-01
      - ATS-PFM-QRY-005-01
    preconditions: A workspace reader has contact access; a staff investigator has only one system-dataset grant.
    steps: Use each catalog and attempt a system-to-workspace join and a customer custom-table authoring request.
    expected: >-
      Each caller reaches only the permitted execution scope; mixed-scope joins and customer authoring are
      refused.
    negative: true
    data_needs: 'Use an isolated workspace, named fixture records and the caller grants described by the prerequisites.'
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-platform:modules/queries/tests/e2e/dataset-effective-permissions.e2e.spec.js#refuses a role
        holding the dataset key without the application's access key 403, naming the key
      - >-
        services-platform:modules/queries/tests/e2e/system-queries.e2e.spec.js#answers every dataset as
        unauthorized for a caller holding the surface key alone
      - >-
        services-platform:modules/queries/tests/e2e/custom-tables.e2e.spec.js#refuses a tenant’s own console
        user every one of them, for not being staff
  - id: FAS-PFM-QRY-01-05
    title: Keep dated conditions aligned with ordinary questions
    kind: regression
    exercises:
      - CAP-PFM-QRY-002
      - CAP-PFM-QRY-020
    relies_on:
      - ATS-PFM-QRY-002-10
      - ATS-PFM-QRY-020-03
      - ATS-PFM-QRY-020-05
    preconditions: Two contacts cross an age threshold on adjacent workspace days.
    steps: >-
      Compare system predicate results with equivalent contact questions for each day and include one missing
      birth date.
    expected: 'True identities agree for each chosen day, and the absent fact keeps the selected null interpretation.'
    negative: false
    data_needs: 'Use an isolated workspace, named fixture records and the caller grants described by the prerequisites.'
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/execute/run-query.integration.spec.js#reads
        a day as that day in the tenant's zone, not in UTC
      - >-
        services-platform:modules/queries/tests/integration/services/execute/compile-predicates.integration.spec.js#answers
        NULL for a predicate over a fact the contact does not have, when NULL means unknown
      - >-
        services-platform:modules/queries/tests/integration/services/execute/compile-predicates.integration.spec.js#resolves
        the same shift from the as-of day, so a contact eighteen today was not the day before
evidence:
  - 'rhythm-v2-docs:specs/platform/queries/planning/features/FEAT-PFM-QRY-01-datasets-and-querying.md'
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-001-know-which-data-can-be-queried-and-what-each-dataset-holds.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-002-ask-a-question-of-the-workspace-s-data-and-see-only-what.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-003-have-a-query-written-from-a-plain-english-request.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-004-let-rhythm-staff-query-every-customer-from-rhythm-hq.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-005-give-one-customer-a-staff-authored-custom-query-table.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-020-evaluate-dated-conditions-for-named-records.md
---

# Dataset access and querying: Feature Acceptance Suite

## What the Feature Must Do as a Whole

People move from available vocabulary to a question they can validate and use. The examples cover ordinary workspace work, restricted staff investigation, tailored subjects and dated conditions as one connected feature.

## Interactions Between Capabilities

Publish a tailored subject and use it through discovery. The combined example checks the dependent outcome after another capability changes its source or authority. The lifecycle and regression examples revisit retained state after a later change rather than repeating individual rule rows.

## Regression Record

| Revision | Change | Scenario | Why |
|---|---|---|---|
| 1 | initial | all | Establish the cumulative feature baseline from the pinned specification and executable assertions. |
