---
id: FAS-PFM-QRY-02
feature: FEAT-PFM-QRY-02
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-006
  - CAP-PFM-QRY-007
  - CAP-PFM-QRY-008
scenarios:
  - id: FAS-PFM-QRY-02-01
    title: Keep a recipe as a reusable parameterized question
    kind: behaviour
    exercises:
      - CAP-PFM-QRY-006
      - CAP-PFM-QRY-007
      - CAP-PFM-QRY-008
    relies_on:
      - ATS-PFM-QRY-008-04
      - ATS-PFM-QRY-006-11
      - ATS-PFM-QRY-007-04
    preconditions: A recipe can produce a contact draft and the author can save it.
    steps: 'Draft it, retain a requested date input, save the question and run it with two valid dates.'
    expected: >-
      Each run uses its supplied date and the retained definition preserves the author’s exact values and
      recipe origin.
    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/query-recipes.e2e.spec.js#records which recipe and which
        version the draft came from
      - >-
        services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#leaves a criterion’s value
        exactly as the person typed it, spaces and all
      - >-
        services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#runs with the value given,
        answering only the contacts it keeps
  - id: FAS-PFM-QRY-02-02
    title: Sharing changes discovery without granting source records
    kind: interaction
    exercises:
      - CAP-PFM-QRY-006
      - CAP-PFM-QRY-007
    relies_on:
      - ATS-PFM-QRY-006-02
      - ATS-PFM-QRY-007-01
    preconditions: A colleague holds the selected role but lacks dataset query access.
    steps: >-
      Share a private question with that role, open it as the colleague, try running it, grant dataset access
      and retry.
    expected: >-
      The definition becomes discoverable before the source becomes executable; after the grant the colleague
      runs under their own authority.
    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/saved-queries.e2e.spec.js#lets a holder of the selected
        role read the record [E2E-SQ-08]
      - >-
        services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#runs the organization’s query
        for a colleague who may query the dataset
  - id: FAS-PFM-QRY-02-03
    title: A recipe release leaves earlier questions independent
    kind: lifecycle
    exercises:
      - CAP-PFM-QRY-006
      - CAP-PFM-QRY-007
      - CAP-PFM-QRY-008
    relies_on:
      - ATS-PFM-QRY-008-04
      - ATS-PFM-QRY-008-09
      - ATS-PFM-QRY-006-14
    preconditions: An earlier recipe derivative is retained and a report uses it.
    steps: >-
      Retire the recipe, run the retained question, create a draft from a restored release and attempt to
      delete the retained source.
    expected: >-
      The retained derivative stays independent, the restored recipe supplies a new draft and the report
      dependency still blocks source deletion.
    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/query-recipes.e2e.spec.js#records which recipe and which
        version the draft came from
      - >-
        services-platform:modules/queries/tests/integration/services/recipe-registration/register-query-recipes.integration.spec.js#writes
        nothing for a manifest that declares exactly what is stored, and answers them as unchanged
      - >-
        services-platform:modules/queries/tests/e2e/reports.e2e.spec.js#refuses to delete a saved query a
        report presents as 409 saved_query_reported
  - id: FAS-PFM-QRY-02-04
    title: Read access supports consumption while sharing stays controlled
    kind: permission
    exercises:
      - CAP-PFM-QRY-006
      - CAP-PFM-QRY-007
      - CAP-PFM-QRY-008
    relies_on:
      - ATS-PFM-QRY-006-03
      - ATS-PFM-QRY-006-04
      - ATS-PFM-QRY-007-01
    preconditions: A shared question and an active recipe exist; one reader has library read but no write or share power.
    steps: >-
      Open and run the shared question, attempt replacement and sharing, then request a recipe using a denied
      joined dataset.
    expected: >-
      Permitted consumption succeeds; writes and sharing fail, and the recipe does not bypass the
      joined-dataset refusal.
    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/read-tier.e2e.spec.js#lists the organization’s saved query'
      - >-
        services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#refuses making the query the
        organization’s without the power to share it as 403
      - >-
        services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#runs the organization’s query
        for a colleague who may query the dataset
  - id: FAS-PFM-QRY-02-05
    title: Refinement cannot answer a required input or widen results
    kind: regression
    exercises:
      - CAP-PFM-QRY-006
      - CAP-PFM-QRY-007
    relies_on:
      - ATS-PFM-QRY-007-05
      - ATS-PFM-QRY-007-07
      - ATS-PFM-QRY-006-11
    preconditions: 'A retained question has a required input, intentional text whitespace and a bounded population.'
    steps: >-
      Run with the required value and additional criteria, then omit the input and try supplying it through
      refinement.
    expected: >-
      The valid result narrows the original population; the missing value is still refused and the stored text
      is unchanged.
    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/integration/services/saved-queries/run-with-refinement.integration.spec.js#narrows
        to the rows that also meet the refinement’s criteria
      - >-
        services-platform:modules/queries/tests/integration/services/saved-queries/run-with-refinement.integration.spec.js#refuses
        criteria that ask for a value when run, which only a stored definition may
      - >-
        services-platform:modules/queries/tests/e2e/saved-queries.e2e.spec.js#leaves a criterion’s value
        exactly as the person typed it, spaces and all
evidence:
  - 'rhythm-v2-docs:specs/platform/queries/planning/features/FEAT-PFM-QRY-02-saved-queries-and-recipes.md'
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-006-keep-and-share-saved-queries-without-widening-anyone-s.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-007-run-a-saved-query-with-the-values-it-asks-for-as-the-person.md
  - >-
    rhythm-v2-docs:specs/platform/queries/planning/capabilities/CAP-PFM-QRY-008-start-a-query-from-a-recipe-rhythm-ships.md
---

# Reusable questions: Feature Acceptance Suite

## What the Feature Must Do as a Whole

People retain useful questions and run them again with current values and authority. The examples connect recipe origins, library audiences and execution without treating shared definitions as permission grants.

## Interactions Between Capabilities

Sharing changes discovery without granting source records. 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. |
