Skip to content

ATS-PFM-QRY-003Draft a query from a written request: Capability Test Specification

Markdown

ATS-PFM-QRY-003

Draft a query from a written request: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-PFM-QRY-003

Design

Executed by
TST-PFM-QRY-227, TST-PFM-QRY-307

KindAcceptance test setProduct areaPlatformModuleQuestions, record exploration and data deliveryRevision2

Read atservices-platform ad3f6a65react-console baf6dae3rhythm-v2-docs 99376625

Coverage

  • Rule covered
  • Transition gap: FND-PFM-QRY-053
  • Validation gap: FND-PFM-QRY-053
  • Permission covered
  • Edge gap: FND-PFM-QRY-053
  • Failure covered
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

12 scenarios proving CAP-PFM-QRY-003; 11 bound to an existing test.

01 Generation has separate authoritypermissionapinegativetest
Proves
BR-CAP-PFM-QRY-003-01
Preconditions
A caller has query access but lacks generation permission.
Steps
Request a generation and poll an existing one.
Expected
Both operations return 403.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller without platform.queries.generate as 403, however much else they hold
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller without platform.queries.generate as 403
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller without platform.queries.generate as 403, however much else they hold
02 Generation checks its subjectpermissionapinegativetest
Proves
BR-CAP-PFM-QRY-003-02
Preconditions
A caller cannot query the requested dataset.
Steps
Generate for that subject and for an unregistered subject.
Expected
Access is refused with 403 and absence returns 404.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller who may not query the dataset as 403
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller who may not query the dataset as 403
03 Written requests satisfy text boundsboundaryapinegativetest
Proves
BR-CAP-PFM-QRY-003-03
Preconditions
The caller can request generation.
Steps
Submit empty, oversized and non-text input.
Expected
All invalid inputs return the same validation code with 400.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses an empty request as 400, naming the field
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a request longer than a person may type as 400
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#carries the same code for a request that is not text at all
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses an empty request as 400, naming the field
04 Generation follows its initiating personpermissionapinegativetest
Proves
BR-CAP-PFM-QRY-003-04 INV-DOM-PFM-QRY-002-12
Preconditions
A generation remains in progress in one workspace.
Steps
Read it as its requester, another person and from another workspace.
Expected
Only the initiating person in the originating workspace can read it.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses the person who did not start it as 404, however much they hold
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#does not answer, in another tenant, a generation started in this one
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#answers 200 with the generation still working
05 Generated definitions use ordinary executioninvariantapitest
Proves
BR-CAP-PFM-QRY-003-05
Preconditions
Generation has produced a valid query.
Steps
Submit that query through normal execution.
Expected
Execution succeeds under the requester’s data access.
Data
Use the existing binding’s controlled fixture data.
Bound to
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
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#runs the query it answered: the console can send it straight to the execute route
Source
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
06 Exhausted allowance prevents admissionfailureapinegativetest
Proves
BR-CAP-PFM-QRY-003-06
Preconditions
The organization has no remaining AI credit.
Steps
Submit a generation request.
Expected
The request fails immediately with allowance details and no model or price disclosure.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses the request itself, rather than accepting it and failing two minutes later
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#says what was needed and what was left, and nothing of a model or a price
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses the request itself, rather than accepting it and failing two minutes later
07 Metering remains separate from visible outputruleapitest
Proves
BR-CAP-PFM-QRY-003-07
Preconditions
A generation has completed successfully.
Steps
Inspect its invocation accounting and requester-facing record.
Expected
Accounting records one invocation while visible output omits cost and model.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#recorded one metered invocation for the request, against this operation and its prompt version
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#charged the association for it and holds nothing of its allowance
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#answers nothing of the cost or the model to the person who asked: that is the operator’s record
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#recorded one metered invocation for the request, against this operation and its prompt version
08 Refinement retains its predecessortransitionapinegativetest
Proves
BR-CAP-PFM-QRY-003-09
Preconditions
One generation is complete and another is still working.
Steps
Request refinements of both.
Expected
The completed predecessor yields a linked new generation; the working predecessor is refused.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#is a generation of its own, not the one it refines
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a refinement of a generation that is still working as 400
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#is a generation of its own, not the one it refines
09 Simultaneous-call limits explain retryconcurrencyapinegativetest
Proves
BR-CAP-PFM-QRY-003-10
Preconditions
The organization has reached its concurrent AI-call cap.
Steps
Request generation and inspect its settled state.
Expected
Failure identifies the concurrency limit and the invocation records a refusal reason.
Data
Use the existing binding’s controlled fixture data.
Bound to
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#leaves a refused invocation that names the reason, the generation having been refused rather than failed
Source
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#leaves a refused invocation that names the reason, the generation having been refused rather than failed
10 Abandonment and retentiontransitionunitnegativetest
Proves
BR-CAP-PFM-QRY-003-11 INV-DOM-PFM-QRY-002-11
Preconditions
Controlled generations include overdue, recent, settled and expired records.
Steps
Run recovery with the fixture clock.
Expected
Overdue work fails, recent and settled work keeps its state, and expired request and outcome records are removed.
Data
Use the controlled fixtures and clocks supplied by the cited tests.
Bound to
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#fails the generation no worker is going to settle, with the code an operator reads
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#gives a generation the worker’s whole timeout and a margin before calling it abandoned
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#leaves a verdict already written alone, so a worker that finished mid-sweep wins
Source
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#fails the generation no worker is going to settle, with the code an operator reads
11 Context refusal and startup compensationfailureunitnegativetest
Proves
BR-CAP-PFM-QRY-003-12
Preconditions
A request can include a current query and the worker invocation can fail.
Steps
Submit inaccessible and mismatched query context, then fail invocation for a valid request.
Expected
Invalid context creates no work; startup failure returns and stores a failed generation.
Data
Use the controlled fixtures and clocks supplied by the cited tests.
Bound to
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#refuses a query on screen naming a field nobody can query, listing the problem under the property it is about
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#refuses a query on screen built for another dataset, which is not the query this request is about
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#fails the generation at once when the worker cannot be started, and says so to the caller
Source
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#refuses a query on screen naming a field nobody can query, listing the problem under the property it is about
12 A proposed question cannot bypass execution accessinteractionapinegativeproposed
Proves
BR-CAP-PFM-QRY-002-01 BR-CAP-PFM-QRY-003-05
Preconditions
A completed proposal refers to Contacts and its requester subsequently loses contact query access.
Steps
Open the proposal and submit its query to ordinary execution.
Expected
The proposal remains requester-readable but its execution is refused before contact rows are returned.
Data
Use an isolated workspace with the described source records, access grants and a surviving control workspace.
Source
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,services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#runs the query it answered: the console can send it straight to the execute route

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.